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.util.misc.MapUtil; 33 import com.sun.appserv.management.config.SSLConfigKeys; 34 35 import com.sun.appserv.management.util.misc.GSetUtil; 36 37 39 class SSLConfigFactory extends ConfigFactory 40 { 41 private static final String CREATE_SSL = "createSsl"; 42 private static final String [] CREATE_SSL_SIG = new String [] { AttributeList .class.getName() }; 43 44 private static final String REMOVE_SSL = "removeSsl"; 45 private static final String [] REMOVE_SSL_SIG = null; 46 47 public 48 SSLConfigFactory(final ConfigFactoryCallback callbacks) 49 { 50 super( callbacks ); 51 } 52 53 55 private static final String CERT_NICKNAME_KEY = "cert-nickname"; 56 57 private final Set <String > LEGAL_OPTIONAL_KEYS = 58 GSetUtil.newUnmodifiableStringSet( 59 SSLConfigKeys.CLIENT_AUTH_ENABLED_KEY, 60 SSLConfigKeys.SSL_2_CIPHERS_KEY, 61 SSLConfigKeys.SSL_3_TLS_CIPHERS_KEY, 62 SSLConfigKeys.SSL_3_ENABLED_KEY, 63 SSLConfigKeys.SSL_2_ENABLED_KEY, 64 SSLConfigKeys.TLS_ENABLED_KEY, 65 SSLConfigKeys.TLS_ROLLBACK_ENABLED_KEY, 66 SSLConfigKeys.SSL3_TLS_CIPHERS_KEY 67 ); 68 69 protected Set <String > 70 getLegalOptionalCreateKeys() 71 { 72 return( LEGAL_OPTIONAL_KEYS ); 73 } 74 75 76 private final static Map <String ,String > OVERRIDES = 77 Collections.unmodifiableMap( MapUtil.newMap( 78 new String [] 79 { 80 CONFIG_NAME_KEY, CERT_NICKNAME_KEY, 81 } 82 )); 83 84 protected Map <String ,String > 85 getParamNameOverrides() 86 { 87 return( OVERRIDES ); 88 } 89 90 91 public ObjectName 92 create( 93 final String certNickname, 94 final Map <String ,String > optional ) 95 { 96 final Map <String ,String > params = initParams( certNickname, null, optional ); 97 98 final ObjectName amxName = createChild( params ); 99 100 return( amxName ); 101 } 102 103 protected ObjectName 104 createOldChildConfig( final AttributeList attrs ) 105 { 106 final ObjectName oldObjectName = (ObjectName ) 107 getCallbacks().getDelegate().invoke( 108 CREATE_SSL, new Object [] { attrs }, CREATE_SSL_SIG ); 109 110 return oldObjectName; 111 } 112 113 public void 114 internalRemove( final ObjectName sslConfigObjectName ) 115 { 116 getCallbacks().getDelegate().invoke( REMOVE_SSL, null, REMOVE_SSL_SIG ); 117 getCallbacks().sendConfigRemovedNotification( sslConfigObjectName ); 118 } 119 } 120 121 122 123 124 125 126 | Popular Tags |