KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > management > config > SSLConfigFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23 package com.sun.enterprise.management.config;
24
25 import java.util.Map JavaDoc;
26 import java.util.Set JavaDoc;
27 import java.util.Collections JavaDoc;
28
29 import javax.management.ObjectName JavaDoc;
30 import javax.management.AttributeList JavaDoc;
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 /**
38  */

39 class SSLConfigFactory extends ConfigFactory
40 {
41     private static final String JavaDoc CREATE_SSL = "createSsl";
42     private static final String JavaDoc[] CREATE_SSL_SIG = new String JavaDoc[] { AttributeList JavaDoc.class.getName() };
43     
44     private static final String JavaDoc REMOVE_SSL = "removeSsl";
45     private static final String JavaDoc[] REMOVE_SSL_SIG = null;
46     
47         public
48     SSLConfigFactory(final ConfigFactoryCallback callbacks)
49     {
50         super( callbacks );
51     }
52     
53     /**
54      */

55     private static final String JavaDoc CERT_NICKNAME_KEY = "cert-nickname";
56     
57     private final Set JavaDoc<String JavaDoc> 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 JavaDoc<String JavaDoc>
70     getLegalOptionalCreateKeys()
71     {
72         return( LEGAL_OPTIONAL_KEYS );
73     }
74     
75     
76     private final static Map JavaDoc<String JavaDoc,String JavaDoc> OVERRIDES =
77         Collections.unmodifiableMap( MapUtil.newMap(
78         new String JavaDoc[]
79         {
80             CONFIG_NAME_KEY, CERT_NICKNAME_KEY,
81         }
82         ));
83         
84         protected Map JavaDoc<String JavaDoc,String JavaDoc>
85     getParamNameOverrides()
86     {
87         return( OVERRIDES );
88     }
89
90     
91         public ObjectName JavaDoc
92     create(
93         final String JavaDoc certNickname,
94         final Map JavaDoc<String JavaDoc,String JavaDoc> optional )
95     {
96         final Map JavaDoc<String JavaDoc,String JavaDoc> params = initParams( certNickname, null, optional );
97
98         final ObjectName JavaDoc amxName = createChild( params );
99         
100         return( amxName );
101     }
102     
103         protected ObjectName JavaDoc
104     createOldChildConfig( final AttributeList JavaDoc attrs )
105     {
106         final ObjectName JavaDoc oldObjectName = (ObjectName JavaDoc)
107             getCallbacks().getDelegate().invoke(
108                 CREATE_SSL, new Object JavaDoc[] { attrs }, CREATE_SSL_SIG );
109         
110         return oldObjectName;
111     }
112     
113         public void
114     internalRemove( final ObjectName JavaDoc 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