001package org.apache.archiva.configuration; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022/** 023 * 024 * The LDAP configuration. 025 * 026 * 027 * @version $Revision$ $Date$ 028 */ 029@SuppressWarnings( "all" ) 030public class LdapConfiguration 031 implements java.io.Serializable 032{ 033 034 //--------------------------/ 035 //- Class/Member Variables -/ 036 //--------------------------/ 037 038 /** 039 * The LDAP host. 040 */ 041 private String hostName; 042 043 /** 044 * The LDAP port. 045 */ 046 private int port = 0; 047 048 /** 049 * ssl LDAP connection. 050 */ 051 private boolean ssl = false; 052 053 /** 054 * The LDAP base dn. 055 */ 056 private String baseDn; 057 058 /** 059 * The LDAP base dn for groups (if empty baseDn is used). 060 */ 061 private String baseGroupsDn; 062 063 /** 064 * contextFactory to use. 065 */ 066 private String contextFactory; 067 068 /** 069 * The LDAP bind dn. 070 */ 071 private String bindDn; 072 073 /** 074 * The LDAP password. 075 */ 076 private String password; 077 078 /** 079 * The LDAP authenticationMethod. 080 */ 081 private String authenticationMethod; 082 083 /** 084 * The LDAP authenticator enabled. 085 */ 086 private boolean bindAuthenticatorEnabled = false; 087 088 /** 089 * LDAP writable. 090 */ 091 private boolean writable = false; 092 093 /** 094 * Will use role name as LDAP group. 095 */ 096 private boolean useRoleNameAsGroup = false; 097 098 /** 099 * 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}