1 package org.apache.archiva.configuration;
2
3 /*
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
19 * under the License.
20 */
21
22 /**
23 *
24 * The LDAP configuration.
25 *
26 *
27 * @version $Revision$ $Date$
28 */
29 @SuppressWarnings( "all" )
30 public class LdapConfiguration
31 implements java.io.Serializable
32 {
33
34 //--------------------------/
35 //- Class/Member Variables -/
36 //--------------------------/
37
38 /**
39 * The LDAP host.
40 */
41 private String hostName;
42
43 /**
44 * The LDAP port.
45 */
46 private int port = 0;
47
48 /**
49 * ssl LDAP connection.
50 */
51 private boolean ssl = false;
52
53 /**
54 * The LDAP base dn.
55 */
56 private String baseDn;
57
58 /**
59 * The LDAP base dn for groups (if empty baseDn is used).
60 */
61 private String baseGroupsDn;
62
63 /**
64 * contextFactory to use.
65 */
66 private String contextFactory;
67
68 /**
69 * The LDAP bind dn.
70 */
71 private String bindDn;
72
73 /**
74 * The LDAP password.
75 */
76 private String password;
77
78 /**
79 * The LDAP authenticationMethod.
80 */
81 private String authenticationMethod;
82
83 /**
84 * The LDAP authenticator enabled.
85 */
86 private boolean bindAuthenticatorEnabled = false;
87
88 /**
89 * LDAP writable.
90 */
91 private boolean writable = false;
92
93 /**
94 * Will use role name as LDAP group.
95 */
96 private boolean useRoleNameAsGroup = false;
97
98 /**
99 * Field extraProperties.
100 */
101 private java.util.Map extraProperties;
102
103
104 //-----------/
105 //- Methods -/
106 //-----------/
107
108 /**
109 * Method addExtraProperty.
110 *
111 * @param key
112 * @param value
113 */
114 public void addExtraProperty( Object key, String value )
115 {
116 getExtraProperties().put( key, value );
117 } //-- void addExtraProperty( Object, String )
118
119 /**
120 * Get the LDAP authenticationMethod.
121 *
122 * @return String
123 */
124 public String getAuthenticationMethod()
125 {
126 return this.authenticationMethod;
127 } //-- String getAuthenticationMethod()
128
129 /**
130 * Get the LDAP base dn.
131 *
132 * @return String
133 */
134 public String getBaseDn()
135 {
136 return this.baseDn;
137 } //-- String getBaseDn()
138
139 /**
140 * Get the LDAP base dn for groups (if empty baseDn is used).
141 *
142 * @return String
143 */
144 public String getBaseGroupsDn()
145 {
146 return this.baseGroupsDn;
147 } //-- String getBaseGroupsDn()
148
149 /**
150 * Get the LDAP bind dn.
151 *
152 * @return String
153 */
154 public String getBindDn()
155 {
156 return this.bindDn;
157 } //-- String getBindDn()
158
159 /**
160 * Get contextFactory to use.
161 *
162 * @return String
163 */
164 public String getContextFactory()
165 {
166 return this.contextFactory;
167 } //-- String getContextFactory()
168
169 /**
170 * Method getExtraProperties.
171 *
172 * @return Map
173 */
174 public java.util.Map getExtraProperties()
175 {
176 if ( this.extraProperties == null )
177 {
178 this.extraProperties = new java.util.HashMap();
179 }
180
181 return this.extraProperties;
182 } //-- java.util.Map getExtraProperties()
183
184 /**
185 * Get the LDAP host.
186 *
187 * @return String
188 */
189 public String getHostName()
190 {
191 return this.hostName;
192 } //-- String getHostName()
193
194 /**
195 * Get the LDAP password.
196 *
197 * @return String
198 */
199 public String getPassword()
200 {
201 return this.password;
202 } //-- String getPassword()
203
204 /**
205 * Get the LDAP port.
206 *
207 * @return int
208 */
209 public int getPort()
210 {
211 return this.port;
212 } //-- int getPort()
213
214 /**
215 * Get the LDAP authenticator enabled.
216 *
217 * @return boolean
218 */
219 public boolean isBindAuthenticatorEnabled()
220 {
221 return this.bindAuthenticatorEnabled;
222 } //-- boolean isBindAuthenticatorEnabled()
223
224 /**
225 * Get ssl LDAP connection.
226 *
227 * @return boolean
228 */
229 public boolean isSsl()
230 {
231 return this.ssl;
232 } //-- boolean isSsl()
233
234 /**
235 * Get will use role name as LDAP group.
236 *
237 * @return boolean
238 */
239 public boolean isUseRoleNameAsGroup()
240 {
241 return this.useRoleNameAsGroup;
242 } //-- boolean isUseRoleNameAsGroup()
243
244 /**
245 * Get lDAP writable.
246 *
247 * @return boolean
248 */
249 public boolean isWritable()
250 {
251 return this.writable;
252 } //-- boolean isWritable()
253
254 /**
255 * Set the LDAP authenticationMethod.
256 *
257 * @param authenticationMethod
258 */
259 public void setAuthenticationMethod( String authenticationMethod )
260 {
261 this.authenticationMethod = authenticationMethod;
262 } //-- void setAuthenticationMethod( String )
263
264 /**
265 * Set the LDAP base dn.
266 *
267 * @param baseDn
268 */
269 public void setBaseDn( String baseDn )
270 {
271 this.baseDn = baseDn;
272 } //-- void setBaseDn( String )
273
274 /**
275 * Set the LDAP base dn for groups (if empty baseDn is used).
276 *
277 * @param baseGroupsDn
278 */
279 public void setBaseGroupsDn( String baseGroupsDn )
280 {
281 this.baseGroupsDn = baseGroupsDn;
282 } //-- void setBaseGroupsDn( String )
283
284 /**
285 * Set the LDAP authenticator enabled.
286 *
287 * @param bindAuthenticatorEnabled
288 */
289 public void setBindAuthenticatorEnabled( boolean bindAuthenticatorEnabled )
290 {
291 this.bindAuthenticatorEnabled = bindAuthenticatorEnabled;
292 } //-- void setBindAuthenticatorEnabled( boolean )
293
294 /**
295 * Set the LDAP bind dn.
296 *
297 * @param bindDn
298 */
299 public void setBindDn( String bindDn )
300 {
301 this.bindDn = bindDn;
302 } //-- void setBindDn( String )
303
304 /**
305 * Set contextFactory to use.
306 *
307 * @param contextFactory
308 */
309 public void setContextFactory( String contextFactory )
310 {
311 this.contextFactory = contextFactory;
312 } //-- void setContextFactory( String )
313
314 /**
315 * Set additional properties to use for ldap connection.
316 *
317 * @param extraProperties
318 */
319 public void setExtraProperties( java.util.Map extraProperties )
320 {
321 this.extraProperties = extraProperties;
322 } //-- void setExtraProperties( java.util.Map )
323
324 /**
325 * Set the LDAP host.
326 *
327 * @param hostName
328 */
329 public void setHostName( String hostName )
330 {
331 this.hostName = hostName;
332 } //-- void setHostName( String )
333
334 /**
335 * Set the LDAP password.
336 *
337 * @param password
338 */
339 public void setPassword( String password )
340 {
341 this.password = password;
342 } //-- void setPassword( String )
343
344 /**
345 * Set the LDAP port.
346 *
347 * @param port
348 */
349 public void setPort( int port )
350 {
351 this.port = port;
352 } //-- void setPort( int )
353
354 /**
355 * Set ssl LDAP connection.
356 *
357 * @param ssl
358 */
359 public void setSsl( boolean ssl )
360 {
361 this.ssl = ssl;
362 } //-- void setSsl( boolean )
363
364 /**
365 * Set will use role name as LDAP group.
366 *
367 * @param useRoleNameAsGroup
368 */
369 public void setUseRoleNameAsGroup( boolean useRoleNameAsGroup )
370 {
371 this.useRoleNameAsGroup = useRoleNameAsGroup;
372 } //-- void setUseRoleNameAsGroup( boolean )
373
374 /**
375 * Set lDAP writable.
376 *
377 * @param writable
378 */
379 public void setWritable( boolean writable )
380 {
381 this.writable = writable;
382 } //-- void setWritable( boolean )
383
384 }