1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Map ; 26 import java.util.Collections ; 27 28 import javax.management.ObjectName ; 29 import javax.management.AttributeList ; 30 31 32 import com.sun.appserv.management.base.XTypes; 33 import com.sun.enterprise.management.config.AMXConfigImplBase; 34 import com.sun.enterprise.management.support.Delegate; 35 import com.sun.enterprise.management.support.oldconfig.OldVirtualServerMBean; 36 import com.sun.appserv.management.config.VirtualServerConfig; 37 38 import com.sun.appserv.management.util.misc.MapUtil; 39 40 43 44 45 public final class HTTPAccessLogConfigFactory extends ConfigFactory 46 { 47 private final OldVirtualServerMBean mOldVirtualServerMBean; 48 49 public 50 HTTPAccessLogConfigFactory( 51 final ConfigFactoryCallback callbacks ) 52 { 53 super( callbacks ); 54 55 mOldVirtualServerMBean = 56 getOldConfigProxies().getOldVirtualServerMBean( 57 getConfigName(), getContainerName() ); 58 } 59 60 61 public static final String LOG_DIRECTORY_KEY = "LogDirectory"; 62 63 public static final String IP_ONLY_KEY = "IPOnly"; 64 65 static private final Map <String ,String > PARAM_NAME_OVERRIDES = 66 Collections.unmodifiableMap( MapUtil.newMap( IP_ONLY_KEY, "iponly" ) ); 67 68 protected Map <String ,String > 69 getParamNameOverrides() 70 { 71 return( PARAM_NAME_OVERRIDES ); 72 } 73 74 76 public ObjectName 77 create( 78 final boolean ipOnly, 79 final String logDirectory, 80 final Map <String ,String > reserved ) 81 { 82 final String [] requiredParams = new String [] 83 { 84 IP_ONLY_KEY, "" + ipOnly, 85 LOG_DIRECTORY_KEY, logDirectory, 86 }; 87 88 final Map <String ,String > params = initParams( requiredParams, reserved ); 89 90 final ObjectName amxName = createChild( params ); 91 92 return( amxName ); 93 } 94 95 96 protected void 97 internalRemove( final ObjectName objectName) 98 { 99 mOldVirtualServerMBean.removeHttpAccessLog(); 100 } 101 102 protected ObjectName 103 createOldChildConfig( final AttributeList attrs ) 104 { 105 return( mOldVirtualServerMBean.createHttpAccessLog( attrs ) ); 106 } 107 } 108 109 110 111 112 | Popular Tags |