1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.ldap.server.configuration;
20
21 import org.apache.mina.registry.ServiceRegistry;
22 import org.apache.mina.registry.SimpleServiceRegistry;
23
24 /***
25 * A {@link StartupConfiguration} that starts up ApacheDS with network layer support.
26 *
27 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
28 * @version $Rev: 264732 $, $Date: 2005-08-30 04:04:51 -0400 (Tue, 30 Aug 2005) $
29 */
30 public class ServerStartupConfiguration extends StartupConfiguration
31 {
32 private static final long serialVersionUID = -7138616822614155454L;
33
34 private boolean enableNetworking = true;
35 private ServiceRegistry minaServiceRegistry = new SimpleServiceRegistry();
36 private int ldapPort = 389;
37 private int ldapsPort = 636;
38 private boolean enableKerberos;
39
40 protected ServerStartupConfiguration()
41 {
42 }
43
44 /***
45 * Returns <tt>true</tt> if networking (LDAP, LDAPS, and Kerberos) is enabled.
46 */
47 public boolean isEnableNetworking()
48 {
49 return enableNetworking;
50 }
51
52 /***
53 * Sets whether to enable networking (LDAP, LDAPS, and Kerberos) or not.
54 */
55 public void setEnableNetworking( boolean enableNetworking )
56 {
57 this.enableNetworking = enableNetworking;
58 }
59
60 /***
61 * Returns <tt>true</tt> if Kerberos support is enabled.
62 */
63 public boolean isEnableKerberos()
64 {
65 return enableKerberos;
66 }
67
68 /***
69 * Sets whether to enable Kerberos support or not.
70 */
71 protected void setEnableKerberos( boolean enableKerberos )
72 {
73 this.enableKerberos = enableKerberos;
74 }
75
76 /***
77 * Returns LDAP TCP/IP port number to listen to.
78 */
79 public int getLdapPort()
80 {
81 return ldapPort;
82 }
83
84 /***
85 * Sets LDAP TCP/IP port number to listen to.
86 */
87 protected void setLdapPort( int ldapPort )
88 {
89 ConfigurationUtil.validatePortNumber( ldapPort );
90 this.ldapPort = ldapPort;
91 }
92
93 /***
94 * Returns LDAPS TCP/IP port number to listen to.
95 */
96 public int getLdapsPort()
97 {
98 return ldapsPort;
99 }
100
101 /***
102 * Sets LDAPS TCP/IP port number to listen to.
103 */
104 protected void setLdapsPort( int ldapsPort )
105 {
106 ConfigurationUtil.validatePortNumber( ldapsPort );
107 this.ldapsPort = ldapsPort;
108 }
109
110 /***
111 * Returns <a href="http://directory.apache.org/subprojects/network/">MINA</a>
112 * {@link ServiceRegistry} that will be used by ApacheDS.
113 */
114 public ServiceRegistry getMinaServiceRegistry()
115 {
116 return minaServiceRegistry;
117 }
118
119 /***
120 * Sets <a href="http://directory.apache.org/subprojects/network/">MINA</a>
121 * {@link ServiceRegistry} that will be used by ApacheDS.
122 */
123 protected void setMinaServiceRegistry( ServiceRegistry minaServiceRegistry )
124 {
125 if( minaServiceRegistry == null )
126 {
127 throw new ConfigurationException( "MinaServiceRegistry cannot be null" );
128 }
129 this.minaServiceRegistry = minaServiceRegistry;
130 }
131 }