1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Map ; 26 27 import javax.management.ObjectName ; 28 29 import com.sun.appserv.management.base.Util; 30 31 import com.sun.appserv.management.config.MessageSecurityConfig; 32 import com.sun.appserv.management.config.SecurityServiceConfig; 33 import com.sun.appserv.management.config.ProviderConfig; 34 35 import com.sun.appserv.management.util.misc.MapUtil; 36 import com.sun.enterprise.management.support.oldconfig.OldSecurityServiceMBean; 37 import com.sun.enterprise.management.support.oldconfig.OldMessageSecurityConfigMBean; 38 39 41 public final class ProviderConfigFactory extends ConfigFactory 42 { 44 private final OldSecurityServiceMBean mOldSecurityServiceMBean; 45 private final OldMessageSecurityConfigMBean mOldMessageSecurityConfigMBean; 46 47 public ProviderConfigFactory(final ConfigFactoryCallback callbacks) 48 { 49 super( callbacks ); 50 51 mOldSecurityServiceMBean = 54 getOldConfigProxies().getOldSecurityServiceMBean( getConfigName() ); 55 56 mOldMessageSecurityConfigMBean = getOldMessageSecurityConfigMBean(); 57 } 58 59 private final OldMessageSecurityConfigMBean 60 getOldMessageSecurityConfigMBean() 61 { 62 final String name = getFactoryContainer().getName(); 63 return getOldConfigProxies().getOldMessageSecurityConfigMBean( name ); 64 } 65 66 67 72 public ObjectName 73 create( 74 final String name, 75 final String providerType, 76 final String providerClassname, 77 Map <String ,String > optional ) 78 { 79 final MessageSecurityConfig msc = (MessageSecurityConfig)getFactoryContainer(); 80 final SecurityServiceConfig ss = (SecurityServiceConfig)(msc.getContainer()); 81 82 final MessageSecurityConfig newMSC = 83 ss.createMessageSecurityConfig( msc.getAuthLayer(), name, providerType, providerClassname, optional ); 84 86 final ProviderConfig providerConfig = newMSC.getProviderConfigMap().get( name ); 87 88 return Util.getObjectName( providerConfig ); 89 } 90 91 92 protected final void 93 removeByName(final String name) 94 { 95 getOldMessageSecurityConfigMBean().removeProviderConfigByProviderId( name ); 96 } 97 } 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 | Popular Tags |