KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > activemq > jaas > ldap > ServerStartupConfiguration


1 /**
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one or more
4  * contributor license agreements. See the NOTICE file distributed with
5  * this work for additional information regarding copyright ownership.
6  * The ASF licenses this file to You under the Apache License, Version 2.0
7  * (the "License"); you may not use this file except in compliance with
8  * the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */

18 package org.apache.activemq.jaas.ldap;
19
20 import java.net.InetAddress JavaDoc;
21
22 import org.apache.ldap.server.configuration.ConfigurationException;
23 import org.apache.ldap.server.configuration.StartupConfiguration;
24 import org.apache.mina.registry.ServiceRegistry;
25 import org.apache.mina.registry.SimpleServiceRegistry;
26
27 /**
28  * A {@link StartupConfiguration} that starts up ApacheDS with network layer support.
29  *
30  * @version $Rev: 233391 $ $Date: 2005-08-18 16:38:47 -0600 (Thu, 18 Aug 2005) $
31  */

32 public class ServerStartupConfiguration extends StartupConfiguration {
33     private static final long serialVersionUID = -7138616822614155454L;
34
35     private boolean enableNetworking = true;
36     private ServiceRegistry minaServiceRegistry = new SimpleServiceRegistry();
37     private int ldapPort = 389;
38     private int ldapsPort = 636;
39     private InetAddress JavaDoc host = null;
40     private boolean enableKerberos;
41
42     protected ServerStartupConfiguration() {
43     }
44
45     protected InetAddress JavaDoc getHost() {
46         return host;
47     }
48
49     protected void setHost(InetAddress JavaDoc host) {
50         this.host = host;
51     }
52
53     /**
54      * Returns <tt>true</tt> if networking (LDAP, LDAPS, and Kerberos) is enabled.
55      */

56     public boolean isEnableNetworking() {
57         return enableNetworking;
58     }
59
60     /**
61      * Sets whether to enable networking (LDAP, LDAPS, and Kerberos) or not.
62      */

63     public void setEnableNetworking(boolean enableNetworking) {
64         this.enableNetworking = enableNetworking;
65     }
66
67     /**
68      * Returns <tt>true</tt> if Kerberos support is enabled.
69      */

70     public boolean isEnableKerberos() {
71         return enableKerberos;
72     }
73
74     /**
75      * Sets whether to enable Kerberos support or not.
76      */

77     protected void setEnableKerberos(boolean enableKerberos) {
78         this.enableKerberos = enableKerberos;
79     }
80
81     /**
82      * Returns LDAP TCP/IP port number to listen to.
83      */

84     public int getLdapPort() {
85         return ldapPort;
86     }
87
88     /**
89      * Sets LDAP TCP/IP port number to listen to.
90      */

91     protected void setLdapPort(int ldapPort) {
92         this.ldapPort = ldapPort;
93     }
94
95     /**
96      * Returns LDAPS TCP/IP port number to listen to.
97      */

98     public int getLdapsPort() {
99         return ldapsPort;
100     }
101
102     /**
103      * Sets LDAPS TCP/IP port number to listen to.
104      */

105     protected void setLdapsPort(int ldapsPort) {
106         this.ldapsPort = ldapsPort;
107     }
108
109     /**
110      * Returns <a HREF="http://directory.apache.org/subprojects/network/">MINA</a>
111      * {@link ServiceRegistry} that will be used by ApacheDS.
112      */

113     public ServiceRegistry getMinaServiceRegistry() {
114         return minaServiceRegistry;
115     }
116
117     /**
118      * Sets <a HREF="http://directory.apache.org/subprojects/network/">MINA</a>
119      * {@link ServiceRegistry} that will be used by ApacheDS.
120      */

121     protected void setMinaServiceRegistry(ServiceRegistry minaServiceRegistry) {
122         if (minaServiceRegistry == null) {
123             throw new ConfigurationException("MinaServiceRegistry cannot be null");
124         }
125         this.minaServiceRegistry = minaServiceRegistry;
126     }
127 }
128
Popular Tags