PageRenderTime 39ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

/vt-ldap/branches/vt-ldap-3/src/main/java/edu/vt/middleware/ldap/LdapConstants.java

http://vt-middleware.googlecode.com/
Java | 352 lines | 72 code | 60 blank | 220 comment | 0 complexity | ed9d84289a3c2f46c911c38dae73180d MD5 | raw file
Possible License(s): GPL-3.0, Apache-2.0, LGPL-3.0, LGPL-2.1
  1. /*
  2. $Id: LdapConstants.java 1330 2010-05-23 22:10:53Z dfisher $
  3. Copyright (C) 2003-2010 Virginia Tech.
  4. All rights reserved.
  5. SEE LICENSE FOR MORE INFORMATION
  6. Author: Middleware Services
  7. Email: middleware@vt.edu
  8. Version: $Revision: 1330 $
  9. Updated: $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
  10. */
  11. package edu.vt.middleware.ldap;
  12. /**
  13. * <code>LdapConstants</code> contains all the constants needed for creating a
  14. * <code>Ldap</code>. See
  15. * http://java.sun.com/j2se/1.4.2/docs/guide/jndi/jndi-ldap.html or
  16. * http://java.sun.com/j2se/1.4.2/docs/guide/jndi/spec/jndi/properties.html for
  17. * more information on JNDI properties.
  18. *
  19. * @author Middleware Services
  20. * @version $Revision: 1330 $ $Date: 2010-05-24 00:10:53 +0200 (Mon, 24 May 2010) $
  21. */
  22. public final class LdapConstants
  23. {
  24. /**
  25. * The value of this property is a fully qualified class name of the factory
  26. * class which creates the initial context for the LDAP service provider. The
  27. * value of this constant is {@value}.
  28. */
  29. public static final String CONTEXT_FACTORY = "java.naming.factory.initial";
  30. /**
  31. * The value of this property is a string identifying the class name of a
  32. * socket factory. The value of this constant is {@value}.
  33. */
  34. public static final String SOCKET_FACTORY = "java.naming.ldap.factory.socket";
  35. /**
  36. * The value of this property is a string specifying the authoritativeness of
  37. * the service requested. The value of this constant is {@value}.
  38. */
  39. public static final String AUTHORITATIVE = "java.naming.authoritative";
  40. /**
  41. * The value of this property is a java.io.OutputStream object into which a
  42. * hexadecimal dump of the incoming and outgoing LDAP ASN.1 BER packets is
  43. * written. The value of this constant is {@value}.
  44. */
  45. public static final String TRACE = "com.sun.jndi.ldap.trace.ber";
  46. /**
  47. * The value of this property is a string that specifies the authentication
  48. * mechanism(s) for the provider to use. The value of this constant is {@value
  49. * }.
  50. */
  51. public static final String AUTHENTICATION =
  52. "java.naming.security.authentication";
  53. /**
  54. * The value of this property is a string that specifies the identity of the
  55. * principal to be authenticated. The value of this constant is {@value}.
  56. */
  57. public static final String PRINCIPAL = "java.naming.security.principal";
  58. /**
  59. * The value of this property is an object that specifies the credentials of
  60. * the principal to be authenticated. The value of this constant is {@value}.
  61. */
  62. public static final String CREDENTIALS = "java.naming.security.credentials";
  63. /**
  64. * The value of this property is a string of decimal digits that specifies the
  65. * batch size of search results returned by the server. The value of this
  66. * constant is {@value}.
  67. */
  68. public static final String BATCH_SIZE = "java.naming.batchsize";
  69. /**
  70. * The value of this property is a string that specifies the DNS host and
  71. * domain names. The value of this constant is {@value}.
  72. */
  73. public static final String DNS_URL = "java.naming.dns.url";
  74. /**
  75. * The value of this property is a string language tag according to RFC 1766.
  76. * The value of this constant is {@value}.
  77. */
  78. public static final String LANGUAGE = "java.naming.language";
  79. /**
  80. * The value of this property is a string that specifies how referrals shall
  81. * be handled by the provider. The value of this constant is {@value}.
  82. */
  83. public static final String REFERRAL = "java.naming.referral";
  84. /**
  85. * The value of this property is a string that specifies how aliases shall be
  86. * handled by the provider. The value of this constant is {@value}.
  87. */
  88. public static final String DEREF_ALIASES = "java.naming.ldap.derefAliases";
  89. /**
  90. * The value of this property is a string that specifies additional binary
  91. * attributes. The value of this constant is {@value}.
  92. */
  93. public static final String BINARY_ATTRIBUTES =
  94. "java.naming.ldap.attributes.binary";
  95. /**
  96. * The value of this property is a string that specifies a SASL authorization
  97. * id. The value of this constant is {@value}.
  98. */
  99. public static final String SASL_AUTHORIZATION_ID =
  100. "java.naming.security.sasl.authorizationId";
  101. /**
  102. * The value of this property is a string that specifies a SASL realm. The
  103. * value of this constant is {@value}.
  104. */
  105. public static final String SASL_REALM = "java.naming.security.sasl.realm";
  106. /**
  107. * The value of this property is a string that specifies to only return
  108. * attribute type names, no values. The value of this constant is {@value}.
  109. */
  110. public static final String TYPES_ONLY = "java.naming.ldap.typesOnly";
  111. /**
  112. * The value of this property is a string that specifies the security protocol
  113. * for the provider to use. The value of this constant is {@value}.
  114. */
  115. public static final String PROTOCOL = "java.naming.security.protocol";
  116. /**
  117. * The value of this property is a string that specifies the protocol version
  118. * for the provider. The value of this constant is {@value}.
  119. */
  120. public static final String VERSION = "java.naming.ldap.version";
  121. /**
  122. * The value of this property is a URL string that specifies the hostname and
  123. * port number of the LDAP server, and the root distinguished name of the
  124. * naming context to use. The value of this constant is {@value}.
  125. */
  126. public static final String PROVIDER_URL = "java.naming.provider.url";
  127. /**
  128. * The value of this property is a string that specifies the time in
  129. * milliseconds that a connection attempt will abort if the connection cannot
  130. * be made. The value of this constant is {@value}.
  131. */
  132. public static final String TIMEOUT = "com.sun.jndi.ldap.connect.timeout";
  133. /**
  134. * Value passed to PROTOCOL to use SSL.
  135. * The value of this constant is {@value}.
  136. */
  137. public static final String SSL_PROTOCOL = "ssl";
  138. /**
  139. * Value passed to AUTHENTICATION to use simple authentication. The value of
  140. * this constant is {@value}.
  141. */
  142. public static final String SIMPLE_AUTHTYPE = "simple";
  143. /**
  144. * Value passed to AUTHENTICATION to use simple authentication. The value of
  145. * this constant is {@value}.
  146. */
  147. public static final String STRONG_AUTHTYPE = "strong";
  148. /**
  149. * Value passed to AUTHENTICATION to use none authentication The value of this
  150. * constant is {@value}.
  151. */
  152. public static final String NONE_AUTHTYPE = "none";
  153. /**
  154. * Value passed to VERSION to use ldap version 3 controls The value of this
  155. * constant is {@value}.
  156. */
  157. public static final String VERSION_THREE = "3";
  158. /** Ldap scheme, the value of this constant is {@value}. */
  159. public static final String PROVIDER_URL_SCHEME = "ldap";
  160. /** Secure ldap scheme, the value of this constant is {@value}. */
  161. public static final String PROVIDER_URL_SSL_SCHEME = "ldaps";
  162. /**
  163. * URL prefix used for constructing URLs. The value of this constant is
  164. * {@value}.
  165. */
  166. public static final String PROVIDER_URL_PREFIX = "://";
  167. /**
  168. * URL separator used for constructing URLs. The value of this constant is
  169. * {@value}.
  170. */
  171. public static final String PROVIDER_URL_SEPARATOR = ":";
  172. /**
  173. * Ldap command which returns a list of supported SASL mechanisms. The value
  174. * of this constant is {@value}.
  175. */
  176. public static final String SUPPORTED_SASL_MECHANISMS =
  177. "supportedSASLMechanisms";
  178. /**
  179. * Ldap command which returns a list of supported controls. The value of this
  180. * constant is {@value}.
  181. */
  182. public static final String SUPPORTED_CONTROL = "supportedcontrol";
  183. /**
  184. * Value passed to AUTHENTICATION to use SASL authentication. The value of
  185. * this constant is {@value}.
  186. */
  187. public static final String SASL_MECHANISM_EXTERNAL = "EXTERNAL";
  188. /**
  189. * Value passed to AUTHENTICATION to use DIGEST-MD5 authentication. The value
  190. * of this constant is {@value}.
  191. */
  192. public static final String SASL_MECHANISM_DIGEST_MD5 = "DIGEST-MD5";
  193. /**
  194. * Value passed to AUTHENTICATION to use CRAM-MD5 authentication. The value of
  195. * this constant is {@value}.
  196. */
  197. public static final String SASL_MECHANISM_CRAM_MD5 = "CRAM-MD5";
  198. /**
  199. * Value passed to AUTHENTICATION to use GSS-API authentication. The value of
  200. * this constant is {@value}.
  201. */
  202. public static final String SASL_MECHANISM_GSS_API = "GSSAPI";
  203. /** List of supported SASL Mechanisms. */
  204. public static final String[] SASL_MECHANISMS = new String[] {
  205. SASL_MECHANISM_EXTERNAL,
  206. SASL_MECHANISM_DIGEST_MD5,
  207. SASL_MECHANISM_CRAM_MD5,
  208. SASL_MECHANISM_GSS_API,
  209. };
  210. /** Default context factory, value of this constant is {@value}. */
  211. public static final String DEFAULT_CONTEXT_FACTORY =
  212. "com.sun.jndi.ldap.LdapCtxFactory";
  213. /** Default base DN, value of this constant is {@value}. */
  214. public static final String DEFAULT_BASE_DN = "";
  215. /**
  216. * Default timeout, -1 means use provider setting. The value of this constant
  217. * is {@value}.
  218. */
  219. public static final int DEFAULT_TIMEOUT = -1;
  220. /** Default authentication type, the value of this constant is {@value}. */
  221. public static final String DEFAULT_AUTHTYPE = SIMPLE_AUTHTYPE;
  222. /**
  223. * Default time limit, 0 means wait indefinitely. The value of this constant
  224. * is {@value}.
  225. */
  226. public static final int DEFAULT_TIME_LIMIT = 0;
  227. /**
  228. * Default count limit, 0 means return all results. The value of this constant
  229. * is {@value}.
  230. */
  231. public static final long DEFAULT_COUNT_LIMIT = 0;
  232. /** Default paged results size. The value of this constant is {@value}. */
  233. public static final int DEFAULT_PAGED_RESULTS_SIZE = 0;
  234. /**
  235. * Default batch size, -1 means use provider setting. The value of this
  236. * constant is {@value}.
  237. */
  238. public static final int DEFAULT_BATCH_SIZE = -1;
  239. /** Default authoritative value, the value of this constant is {@value}. */
  240. public static final boolean DEFAULT_AUTHORITATIVE = false;
  241. /** Default type only value, the value of this constant is {@value}. */
  242. public static final boolean DEFAULT_TYPES_ONLY = false;
  243. /** Default ignore case value, value of this constant is {@value}. */
  244. public static final boolean DEFAULT_IGNORE_CASE = true;
  245. /** Default ldap port, the value of this constant is {@value}. */
  246. public static final String DEFAULT_PORT = "389";
  247. /** Default ldaps port, the value of this constant is {@value}. */
  248. public static final String DEFAULT_SSL_PORT = "636";
  249. /** Whether to use SSL by default, the value of this constant is {@value}. */
  250. public static final boolean DEFAULT_USE_SSL = false;
  251. /**
  252. * Whether to log authentication credentials. The value of this constant is
  253. * {@value}.
  254. */
  255. public static final boolean DEFAULT_LOG_CREDENTIALS = false;
  256. /**
  257. * Default userfield field used by Authenticator. The value of this constant
  258. * is {@value}.
  259. */
  260. public static final String DEFAULT_USER_FIELD = "uid";
  261. /**
  262. * Whether Authenticator should throw an exception if multiple DNs are found
  263. * by {@link edu.vt.middleware.ldap.auth.Authenticator#getDn(String)}. The
  264. * value of this constant is {@value}.
  265. */
  266. public static final boolean DEFAULT_ALLOW_MULTIPLE_DNS = false;
  267. /**
  268. * Default character set for creating strings. The value of this constant is
  269. * {@value}.
  270. */
  271. public static final String DEFAULT_CHARSET = "UTF-8";
  272. /**
  273. * Default number of times to retry an operation on failure. The value of this
  274. * constant is {@value}.
  275. */
  276. public static final int DEFAULT_OPERATION_RETRY = 1;
  277. /**
  278. * Default amount of time to wait between operation retries. The value of this
  279. * constant is {@value}.
  280. */
  281. public static final long DEFAULT_OPERATION_RETRY_WAIT = 0;
  282. /**
  283. * Default factor to multiply the operation retry wait by. The value of this
  284. * constant is {@value}.
  285. */
  286. public static final int DEFAULT_OPERATION_RETRY_BACKOFF = 0;
  287. /** Default constructor. */
  288. private LdapConstants() {}
  289. }