Methods Summary |
---|
final com.sun.appserv.management.config.AuthRealmConfig | createAuthRealmConfig(java.lang.String name)
removeAuthRealmConfig( name );
return getSecurityServiceConfig().createAuthRealmConfig(
name, TEST_REALM_CLASS, null );
|
private java.lang.String | createAuthRealmName(java.lang.String progenyName)
return progenyName + ".TestRealm";
|
public static com.sun.appserv.management.config.JMXConnectorConfig | createInstance(java.lang.String name, java.lang.String address, java.lang.String port, com.sun.appserv.management.config.AuthRealmConfig authRealm, java.util.Map optional)
final AdminServiceConfig adminServiceConfig =
getConfigConfig( authRealm ).getAdminServiceConfig();
return adminServiceConfig.createJMXConnectorConfig( name,
address, port, authRealm.getName(), optional );
|
protected final com.sun.appserv.management.config.AMXConfig | createProgeny(java.lang.String name, java.util.Map options)
final Map<String,String> allOptions = MapUtil.newMap( options, OPTIONAL );
final int port = (name.hashCode() % 16000) + 33111;
final String authRealmName = createAuthRealmName( name );
final AuthRealmConfig authRealmConfig = createAuthRealmConfig( authRealmName );
try
{
return getAdminServiceConfig().createJMXConnectorConfig(name,
ADDRESS, "" + port, authRealmName, allOptions);
}
catch( Exception e )
{
removeAuthRealmConfig( authRealmName );
throw new RuntimeException( e );
}
|
public static com.sun.appserv.management.config.JMXConnectorConfig | ensureDefaultInstance(com.sun.appserv.management.config.AdminServiceConfig adminServiceConfig)
JMXConnectorConfig result =
adminServiceConfig.getJMXConnectorConfigMap().get( getDefaultInstanceName() );
if ( result == null )
{
final SecurityServiceConfig securityServiceConfig =
getConfigConfig( adminServiceConfig ).getSecurityServiceConfig();
final AuthRealmConfig defaultAuthRealm =
AuthRealmConfigTest.ensureDefaultInstance( securityServiceConfig );
result = createInstance( getDefaultInstanceName(),
ADDRESS, DEFAULT_PORT, defaultAuthRealm, OPTIONAL );
}
return result;
|
final com.sun.appserv.management.config.AdminServiceConfig | getAdminServiceConfig()
return( getConfigConfig(). getAdminServiceConfig());
|
public static java.lang.String | getDefaultInstanceName()
return getDefaultInstanceName( "JMXConnectorConfig" );
|
protected com.sun.appserv.management.base.Container | getProgenyContainer()
return getAdminServiceConfig();
|
protected java.lang.String | getProgenyJ2EEType()
return XTypes.JMX_CONNECTOR_CONFIG;
|
final com.sun.appserv.management.config.SecurityServiceConfig | getSecurityServiceConfig()
return getConfigConfig().getSecurityServiceConfig();
|
final void | removeAuthRealmConfig(java.lang.String name)
try
{
getSecurityServiceConfig().removeAuthRealmConfig( name );
}
catch( Exception e )
{
}
|
protected void | removeProgeny(java.lang.String name)
try
{
getAdminServiceConfig().removeJMXConnectorConfig( name );
}
finally
{
try
{
removeAuthRealmConfig( createAuthRealmName( name ) );
}
catch( Exception e )
{
}
}
|
public void | testCreateSSL()
if ( ! checkNotOffline( "testCreateSSL" ) )
{
return;
}
final String NAME = "JMXConnectorConfigTest-testCreateSSL";
try
{
removeEx(NAME);
final JMXConnectorConfig newConfig =
(JMXConnectorConfig)createProgeny( NAME, null);
final Map<String,JMXConnectorConfig> jmxConnectors =
getAdminServiceConfig().getJMXConnectorConfigMap();
final JMXConnectorConfig jmxConnector = (JMXConnectorConfig)
jmxConnectors.get(NAME);
assert jmxConnector != null;
assert jmxConnector == newConfig;
final String CERT_NICKNAME = NAME + "Cert";
final SSLConfig ssl = jmxConnector.createSSLConfig( CERT_NICKNAME, null);
assert ssl != null;
assert ssl.getCertNickname().equals( CERT_NICKNAME );
jmxConnector.removeSSLConfig();
}
finally
{
remove(NAME);
}
|