1 23 24 29 package com.sun.enterprise.management.config; 30 31 import java.util.Map ; 32 33 import com.sun.appserv.management.base.Container; 34 import com.sun.appserv.management.base.XTypes; 35 36 import com.sun.appserv.management.config.AMXConfig; 37 import com.sun.appserv.management.config.AuditModuleConfig; 38 import com.sun.appserv.management.config.SecurityServiceConfig; 39 40 41 43 public final class AuditModuleConfigTest extends ConfigMgrTestBase 44 { 45 static final String CLASSNAME = "com.sun.enterprise.security.Audit"; 46 47 public 48 AuditModuleConfigTest() 49 { 50 if ( checkNotOffline( "ensureDefaultInstance" ) ) 51 { 52 ensureDefaultInstance( getConfigConfig().getSecurityServiceConfig() ); 53 } 54 } 55 56 57 public static String 58 getDefaultInstanceName() 59 { 60 return getDefaultInstanceName( "AuditModuleConfig" ); 61 } 62 63 64 public static AuditModuleConfig 65 ensureDefaultInstance( final SecurityServiceConfig securityServiceConfig ) 66 { 67 AuditModuleConfig result = 68 securityServiceConfig.getAuditModuleConfigMap().get( getDefaultInstanceName() ); 69 70 if ( result == null ) 71 { 72 result = createInstance( securityServiceConfig, 73 getDefaultInstanceName(), CLASSNAME, false, null ); 74 } 75 76 return result; 77 } 78 79 public static AuditModuleConfig 80 createInstance( 81 final SecurityServiceConfig securityServiceConfig, 82 final String name, 83 final String classname, 84 final boolean enabled, 85 final Map <String ,String > optional ) 86 { 87 return securityServiceConfig.createAuditModuleConfig( 88 name, CLASSNAME, enabled, null ); 89 } 90 91 92 93 protected Container 94 getProgenyContainer() 95 { 96 return getConfigConfig().getSecurityServiceConfig(); 97 } 98 99 protected String 100 getProgenyJ2EEType() 101 { 102 return XTypes.AUDIT_MODULE_CONFIG; 103 } 104 105 106 protected void 107 removeProgeny( final String name ) 108 { 109 getConfigConfig().getSecurityServiceConfig().removeAuditModuleConfig( name ); 110 } 111 112 protected final AMXConfig 113 createProgeny( final String name, final Map <String ,String > options ) 114 { 115 return getConfigConfig().getSecurityServiceConfig().createAuditModuleConfig(name, CLASSNAME, false, options); 116 } 117 } 118 119 120 | Popular Tags |