1 23 24 29 package com.sun.enterprise.management.config; 30 31 import java.util.Set ; 32 import java.util.HashSet ; 33 import java.util.Iterator ; 34 import java.util.Map ; 35 import java.util.HashMap ; 36 import java.util.Properties ; 37 import java.util.Collections ; 38 39 import javax.management.AttributeList ; 40 import javax.management.ObjectName ; 41 42 import com.sun.appserv.management.util.misc.GSetUtil; 43 import com.sun.appserv.management.config.LoadBalancerConfigKeys; 44 45 final class LoadBalancerConfigFactory extends ConfigFactory { 46 47 public LoadBalancerConfigFactory(final ConfigFactoryCallback callbacks) { 48 super(callbacks); 49 } 50 51 private final Set <String > LEGAL_OPTIONAL_KEYS = 52 GSetUtil.newUnmodifiableStringSet( 53 LoadBalancerConfigKeys.NAME, 54 LoadBalancerConfigKeys.LB_CONFIG_NAME, 55 LoadBalancerConfigKeys.AUTO_APPLY_ENABLED ); 56 57 protected Set <String > getLegalOptionalCreateKeys() { 58 return LEGAL_OPTIONAL_KEYS; 59 } 60 61 public ObjectName create(String name, String lbConfigName, 62 boolean autoApplyEnabled, Map <String ,String > optional) { 63 final String [] required = 64 new String [] {"lb-config-name", lbConfigName, "auto-apply-enabled", "" + autoApplyEnabled }; 65 final Map <String ,String > params = initParams(name, required, optional); 66 final ObjectName amxName = createNamedChild(name, params); 67 return amxName; 68 } 69 70 protected ObjectName createOldChildConfig(final AttributeList translatedAttrs) { 71 return getOldConfigProxies().getOldLoadBalancers().createLoadBalancer(translatedAttrs); 72 } 73 74 public void removeByName(String name) { 75 getOldConfigProxies().getOldLoadBalancers().removeLoadBalancerByName(name); 76 } 77 } 78 79 80 81 82 83 | Popular Tags |