You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LdapConfiguration.java 8.0KB

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