1 23 24 29 package com.sun.enterprise.management.config; 30 31 import java.util.Map ; 32 import java.util.Properties ; 33 34 import javax.management.ObjectName ; 35 36 import javax.management.Attribute ; 37 import javax.management.AttributeList ; 38 39 import com.sun.appserv.management.base.XTypes; 40 import com.sun.appserv.management.base.Util; 41 import com.sun.appserv.management.util.jmx.JMXUtil; 42 import com.sun.appserv.management.config.PropertiesAccess; 43 44 import com.sun.enterprise.management.support.oldconfig.OldSecurityServiceMBean; 45 46 48 public final class AuditModuleConfigFactory extends ConfigFactory 49 { 50 private static final String AUDIT_ON_PROPERTY_KEY = 51 PropertiesAccess.PROPERTY_PREFIX + "auditOn"; 52 53 private static final String CLASSNAME_KEY = "Classname"; 54 55 private final OldSecurityServiceMBean mOldSecurityServiceMBean; 56 57 58 public 59 AuditModuleConfigFactory( final ConfigFactoryCallback callbacks ) 60 { 61 super( callbacks ); 62 63 mOldSecurityServiceMBean = 64 getOldConfigProxies().getOldSecurityServiceMBean( getConfigName() ); 65 } 66 67 public ObjectName 68 create( String name, String className, boolean auditOn, 69 Map <String ,String > reservedForFutureUse ) 70 { 71 final String [] requiredParams = { 72 CLASSNAME_KEY, className, 73 AUDIT_ON_PROPERTY_KEY, Boolean.toString(auditOn), 74 }; 75 76 final Map <String ,String > params = initParams( name, requiredParams, reservedForFutureUse ); 77 78 final ObjectName amxName = createNamedChild( name, params ); 79 80 return amxName; 81 } 82 83 84 protected void 85 internalRemove( final ObjectName objectName ) 86 { 87 final String name = Util.getName( objectName ); 88 89 mOldSecurityServiceMBean.removeAuditModuleByName(name); 90 } 91 92 protected ObjectName 93 createOldChildConfig( final AttributeList translatedAttrs ) 94 { 95 return mOldSecurityServiceMBean.createAuditModule( translatedAttrs ); 96 } 97 } 98 99 100 101 102 | Popular Tags |