1 23 package com.sun.enterprise.management.config; 24 25 import java.util.Map ; 26 import java.util.Set ; 27 import java.util.Collections ; 28 29 import javax.management.ObjectName ; 30 import javax.management.AttributeList ; 31 32 import com.sun.appserv.management.base.Util; 33 import com.sun.appserv.management.config.AMXConfig; 34 import com.sun.appserv.management.config.ProviderConfig; 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.OldConfigsMBean; 38 39 import com.sun.appserv.management.util.misc.GSetUtil; 40 import com.sun.appserv.management.util.jmx.JMXUtil; 41 42 43 import com.sun.appserv.management.config.MessageSecurityConfigKeys; 44 45 47 public final class MessageSecurityConfigFactory extends ConfigFactory 48 { 49 private final OldSecurityServiceMBean mOldSecurityServiceMBean; 50 private final OldConfigsMBean mOldConfigs; 51 52 public 53 MessageSecurityConfigFactory( final ConfigFactoryCallback callbacks ) 54 { 55 super( callbacks ); 56 57 mOldSecurityServiceMBean = 58 getOldConfigProxies().getOldSecurityServiceMBean( getConfigName() ); 59 60 mOldConfigs = getOldConfigProxies().getOldConfigsMBean(); 61 } 62 63 public ObjectName 64 create( 65 final String authLayer, 66 final String providerID, 67 final String providerType, 68 final String providerClassname, 69 Map <String ,String > optional ) 70 { 71 final String requestAuthSource = null; 72 final String requestAuthRecipient = null; 73 final String responseAuthSource = null; 74 final String responseAuthRecipient = null; 75 final boolean isDefaultProvider = false; 76 final java.util.Properties props = null; 77 final String targetName = getConfigName(); 78 79 final ObjectName provider = mOldConfigs.createMessageSecurityProvider( 80 authLayer, 81 providerID, 82 providerType, 83 providerClassname, 84 requestAuthSource, 85 requestAuthRecipient, 86 responseAuthSource, 87 responseAuthRecipient, 88 isDefaultProvider, 89 props, 90 targetName 91 ); 92 getLogger().info( "OBJECTNAME: " + JMXUtil.toString( provider ) ); 94 95 final ObjectName providerObjectName = finish( provider, null ); 96 final ProviderConfig providerConfig = (ProviderConfig) 97 Util.getExtra(getFactoryContainer()).getProxyFactory().getProxy( providerObjectName ); 98 99 final ObjectName amxName = Util.getExtra(providerConfig.getContainer()).getObjectName(); 100 101 return amxName; 102 } 103 104 105 protected final void 106 removeByName( final String authLayer ) 107 { 108 mOldSecurityServiceMBean.removeMessageSecurityConfigByAuthLayer( authLayer ); 109 } 110 } 111 112 113 114 115 116 117 | Popular Tags |