KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > directory > ServerStartupConfiguration


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

17 package org.apache.geronimo.directory;
18
19 import java.net.InetAddress JavaDoc;
20
21 import org.apache.ldap.server.configuration.ConfigurationException;
22 import org.apache.ldap.server.configuration.StartupConfiguration;
23 import org.apache.mina.registry.ServiceRegistry;
24 import org.apache.mina.registry.SimpleServiceRegistry;
25
26 /**
27  * A {@link StartupConfiguration} that starts up ApacheDS with network layer support.
28  *
29  * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
30  */

31 public class ServerStartupConfiguration extends StartupConfiguration
32 {
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
46     protected InetAddress JavaDoc getHost() {
47         return host;
48     }
49
50     protected void setHost(InetAddress JavaDoc host) {
51         this.host = host;
52     }
53
54     /**
55      * Returns <tt>true</tt> if networking (LDAP, LDAPS, and Kerberos) is enabled.
56      */

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

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

73     public boolean isEnableKerberos()
74     {
75         return enableKerberos;
76     }
77
78     /**
79      * Sets whether to enable Kerberos support or not.
80      */

81     protected void setEnableKerberos( boolean enableKerberos )
82     {
83         this.enableKerberos = enableKerberos;
84     }
85
86     /**
87      * Returns LDAP TCP/IP port number to listen to.
88      */

89     public int getLdapPort()
90     {
91         return ldapPort;
92     }
93
94     /**
95      * Sets LDAP TCP/IP port number to listen to.
96      */

97     protected void setLdapPort( int ldapPort )
98     {
99         this.ldapPort = ldapPort;
100     }
101
102     /**
103      * Returns LDAPS TCP/IP port number to listen to.
104      */

105     public int getLdapsPort()
106     {
107         return ldapsPort;
108     }
109
110     /**
111      * Sets LDAPS TCP/IP port number to listen to.
112      */

113     protected void setLdapsPort( int ldapsPort )
114     {
115         this.ldapsPort = ldapsPort;
116     }
117
118     /**
119      * Returns <a HREF="http://directory.apache.org/subprojects/network/">MINA</a>
120      * {@link ServiceRegistry} that will be used by ApacheDS.
121      */

122     public ServiceRegistry getMinaServiceRegistry()
123     {
124         return minaServiceRegistry;
125     }
126
127     /**
128      * Sets <a HREF="http://directory.apache.org/subprojects/network/">MINA</a>
129      * {@link ServiceRegistry} that will be used by ApacheDS.
130      */

131     protected void setMinaServiceRegistry( ServiceRegistry minaServiceRegistry )
132     {
133         if( minaServiceRegistry == null )
134         {
135             throw new ConfigurationException( "MinaServiceRegistry cannot be null" );
136         }
137         this.minaServiceRegistry = minaServiceRegistry;
138     }
139 }
Popular Tags