001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2006-2008 Sun Microsystems, Inc.
025 */
026package org.opends.server.protocols.ldap;
027
028
029
030/**
031 * This class defines a number of constants used in the LDAP protocol.
032 */
033public class LDAPConstants
034{
035  /**
036   * The protocol op type for bind requests.
037   */
038  public static final byte OP_TYPE_BIND_REQUEST = 0x60;
039
040
041
042  /**
043   * The protocol op type for bind responses.
044   */
045  public static final byte OP_TYPE_BIND_RESPONSE = 0x61;
046
047
048
049  /**
050   * The protocol op type for unbind requests.
051   */
052  public static final byte OP_TYPE_UNBIND_REQUEST = 0x42;
053
054
055
056  /**
057   * The protocol op type for search requests.
058   */
059  public static final byte OP_TYPE_SEARCH_REQUEST = 0x63;
060
061
062
063  /**
064   * The protocol op type for search result entries.
065   */
066  public static final byte OP_TYPE_SEARCH_RESULT_ENTRY = 0x64;
067
068
069
070  /**
071   * The protocol op type for search result references.
072   */
073  public static final byte OP_TYPE_SEARCH_RESULT_REFERENCE = 0x73;
074
075
076
077  /**
078   * The protocol op type for search result done elements.
079   */
080  public static final byte OP_TYPE_SEARCH_RESULT_DONE = 0x65;
081
082
083
084  /**
085   * The protocol op type for modify requests.
086   */
087  public static final byte OP_TYPE_MODIFY_REQUEST = 0x66;
088
089
090
091  /**
092   * The protocol op type for modify responses.
093   */
094  public static final byte OP_TYPE_MODIFY_RESPONSE = 0x67;
095
096
097
098  /**
099   * The protocol op type for add requests.
100   */
101  public static final byte OP_TYPE_ADD_REQUEST = 0x68;
102
103
104
105  /**
106   * The protocol op type for add responses.
107   */
108  public static final byte OP_TYPE_ADD_RESPONSE = 0x69;
109
110
111
112  /**
113   * The protocol op type for delete requests.
114   */
115  public static final byte OP_TYPE_DELETE_REQUEST = 0x4A;
116
117
118
119  /**
120   * The protocol op type for delete responses.
121   */
122  public static final byte OP_TYPE_DELETE_RESPONSE = 0x6B;
123
124
125
126  /**
127   * The protocol op type for modify DN requests.
128   */
129  public static final byte OP_TYPE_MODIFY_DN_REQUEST = 0x6C;
130
131
132
133  /**
134   * The protocol op type for modify DN responses.
135   */
136  public static final byte OP_TYPE_MODIFY_DN_RESPONSE = 0x6D;
137
138
139
140  /**
141   * The protocol op type for compare requests.
142   */
143  public static final byte OP_TYPE_COMPARE_REQUEST = 0x6E;
144
145
146
147  /**
148   * The protocol op type for compare responses.
149   */
150  public static final byte OP_TYPE_COMPARE_RESPONSE = 0x6F;
151
152
153
154  /**
155   * The protocol op type for abandon requests.
156   */
157  public static final byte OP_TYPE_ABANDON_REQUEST = 0x50;
158
159
160
161  /**
162   * The protocol op type for extended requests.
163   */
164  public static final byte OP_TYPE_EXTENDED_REQUEST = 0x77;
165
166
167
168  /**
169   * The protocol op type for extended responses.
170   */
171  public static final byte OP_TYPE_EXTENDED_RESPONSE = 0x78;
172
173
174
175  /**
176   * The protocol op type for intermediate responses.
177   */
178  public static final byte OP_TYPE_INTERMEDIATE_RESPONSE = 0x79;
179
180
181
182  /**
183   * The BER type to use for encoding the sequence of controls in an LDAP
184   * message.
185   */
186  public static final byte TYPE_CONTROL_SEQUENCE = (byte) 0xA0;
187
188
189
190  /**
191   * The BER type to use for encoding the sequence of referral URLs in an
192   * LDAPResult element.
193   */
194  public static final byte TYPE_REFERRAL_SEQUENCE = (byte) 0xA3;
195
196
197
198  /**
199   * The BER type to use for the AuthenticationChoice element in a bind request
200   * when simple authentication is to be used.
201   */
202  public static final byte TYPE_AUTHENTICATION_SIMPLE = (byte) 0x80;
203
204
205
206  /**
207   * The BER type to use for the AuthenticationChoice element in a bind request
208   * when SASL authentication is to be used.
209   */
210  public static final byte TYPE_AUTHENTICATION_SASL = (byte) 0xA3;
211
212
213
214  /**
215   * The BER type to use for the server SASL credentials in a bind response.
216   */
217  public static final byte TYPE_SERVER_SASL_CREDENTIALS = (byte) 0x87;
218
219
220
221  /**
222   * The BER type to use for AND filter components.
223   */
224  public static final byte TYPE_FILTER_AND = (byte) 0xA0;
225
226
227
228  /**
229   * The BER type to use for OR filter components.
230   */
231  public static final byte TYPE_FILTER_OR = (byte) 0xA1;
232
233
234
235  /**
236   * The BER type to use for NOT filter components.
237   */
238  public static final byte TYPE_FILTER_NOT = (byte) 0xA2;
239
240
241
242  /**
243   * The BER type to use for equality filter components.
244   */
245  public static final byte TYPE_FILTER_EQUALITY = (byte) 0xA3;
246
247
248
249  /**
250   * The BER type to use for substring filter components.
251   */
252  public static final byte TYPE_FILTER_SUBSTRING = (byte) 0xA4;
253
254
255
256  /**
257   * The BER type to use for greater than or equal to filter components.
258   */
259  public static final byte TYPE_FILTER_GREATER_OR_EQUAL = (byte) 0xA5;
260
261
262
263  /**
264   * The BER type to use for less than or equal to filter components.
265   */
266  public static final byte TYPE_FILTER_LESS_OR_EQUAL = (byte) 0xA6;
267
268
269
270  /**
271   * The BER type to use for presence filter components.
272   */
273  public static final byte TYPE_FILTER_PRESENCE = (byte) 0x87;
274
275
276
277  /**
278   * The BER type to use for approximate filter components.
279   */
280  public static final byte TYPE_FILTER_APPROXIMATE = (byte) 0xA8;
281
282
283
284  /**
285   * The BER type to use for extensible matching filter components.
286   */
287  public static final byte TYPE_FILTER_EXTENSIBLE_MATCH = (byte) 0xA9;
288
289
290
291  /**
292   * The BER type to use for the subInitial component of a substring filter.
293   */
294  public static final byte TYPE_SUBINITIAL = (byte) 0x80;
295
296
297
298  /**
299   * The BER type to use for the subAny component(s) of a substring filter.
300   */
301  public static final byte TYPE_SUBANY = (byte) 0x81;
302
303
304
305  /**
306   * The BER type to use for the subFinal components of a substring filter.
307   */
308  public static final byte TYPE_SUBFINAL = (byte) 0x82;
309
310
311
312  /**
313   * The BER type to use for the matching rule OID in a matching rule assertion.
314   */
315  public static final byte TYPE_MATCHING_RULE_ID = (byte) 0x81;
316
317
318
319  /**
320   * The BER type to use for the attribute type in a matching rule assertion.
321   */
322  public static final byte TYPE_MATCHING_RULE_TYPE = (byte) 0x82;
323
324
325
326  /**
327   * The BER type to use for the assertion value in a matching rule assertion.
328   */
329  public static final byte TYPE_MATCHING_RULE_VALUE = (byte) 0x83;
330
331
332
333  /**
334   * The BER type to use for the DN attributes flag in a matching rule
335   * assertion.
336   */
337  public static final byte TYPE_MATCHING_RULE_DN_ATTRIBUTES = (byte) 0x84;
338
339
340
341  /**
342   * The BER type to use for the newSuperior component of a modify DN request.
343   */
344  public static final byte TYPE_MODIFY_DN_NEW_SUPERIOR = (byte) 0x80;
345
346
347
348  /**
349   * The BER type to use for the OID of an extended request.
350   */
351  public static final byte TYPE_EXTENDED_REQUEST_OID = (byte) 0x80;
352
353
354
355  /**
356   * The BER type to use for the value of an extended request.
357   */
358  public static final byte TYPE_EXTENDED_REQUEST_VALUE = (byte) 0x81;
359
360
361
362  /**
363   * The BER type to use for the OID of an extended response.
364   */
365  public static final byte TYPE_EXTENDED_RESPONSE_OID = (byte) 0x8A;
366
367
368
369  /**
370   * The BER type to use for the value of an extended response.
371   */
372  public static final byte TYPE_EXTENDED_RESPONSE_VALUE = (byte) 0x8B;
373
374
375
376  /**
377   * The BER type to use for the OID of an intermediate response message.
378   */
379  public static final byte TYPE_INTERMEDIATE_RESPONSE_OID = (byte) 0x80;
380
381
382
383  /**
384   * The BER type to use for the value of an intermediate response message.
385   */
386  public static final byte TYPE_INTERMEDIATE_RESPONSE_VALUE = (byte) 0x81;
387
388
389
390  /**
391   * The enumerated type for modify operations that add one or more values for
392   * an attribute.
393   */
394  public static final int MOD_TYPE_ADD = 0;
395
396
397
398  /**
399   * The enumerated type for modify operations that remove one or more values
400   * from an attribute.
401   */
402  public static final int MOD_TYPE_DELETE = 1;
403
404
405
406  /**
407   * The enumerated type for modify operations that replace the set of values
408   * for an attribute.
409   */
410  public static final int MOD_TYPE_REPLACE = 2;
411
412
413
414  /**
415   * The enumerated type for modify operations that increment the value for an
416   * attribute.
417   */
418  public static final int MOD_TYPE_INCREMENT = 3;
419
420
421
422  /**
423   * The search scope value that will be used for base-level searches.
424   */
425  public static final int SCOPE_BASE_OBJECT = 0;
426
427
428
429  /**
430   * The search scope value that will be used for single-level searches.
431   */
432  public static final int SCOPE_SINGLE_LEVEL = 1;
433
434
435
436  /**
437   * The search scope value that will be used for whole subtree searches.
438   */
439  public static final int SCOPE_WHOLE_SUBTREE = 2;
440
441
442
443  /**
444   * The search scope value that will be used for subordinate subtree searches.
445   */
446  public static final int SCOPE_SUBORDINATE_SUBTREE = 3;
447
448
449
450  /**
451   * The alias dereferencing policy value that will be used for cases in which
452   * aliases are never to be dereferenced.
453   */
454  public static final int DEREF_NEVER = 0;
455
456
457
458  /**
459   * The alias dereferencing policy value that will be used for cases in which
460   * any aliases encountered while finding matching entries should be
461   * dereferenced.
462   */
463  public static final int DEREF_IN_SEARCHING = 1;
464
465
466
467  /**
468   * The alias dereferencing policy value that will be used for cases in which
469   * the search base should be dereferenced if it is an alias.
470   */
471  public static final int DEREF_FINDING_BASE = 2;
472
473
474
475  /**
476   * The alias dereferencing policy value that will be used for cases in which
477   * all aliases encountered should be dereferenced.
478   */
479  public static final int DEREF_ALWAYS = 3;
480
481
482
483  /**
484   * The OID for the Kerberos V GSSAPI mechanism.
485   */
486  public static final String OID_GSSAPI_KERBEROS_V = "1.2.840.113554.1.2.2";
487
488
489
490  /**
491   * The OID for the LDAP notice of disconnection extended operation.
492   */
493  public static final String OID_NOTICE_OF_DISCONNECTION =
494       "1.3.6.1.4.1.1466.20036";
495
496
497
498  /**
499   * The ASN.1 element decoding state that indicates that the next byte read
500   * should be the BER type for a new element.
501   */
502  public static final int ELEMENT_READ_STATE_NEED_TYPE = 0;
503
504
505
506  /**
507   * The ASN.1 element decoding state that indicates that the next byte read
508   * should be the first byte for the element length.
509   */
510  public static final int ELEMENT_READ_STATE_NEED_FIRST_LENGTH_BYTE = 1;
511
512
513
514  /**
515   * The ASN.1 element decoding state that indicates that the next byte read
516   * should be additional bytes of a multi-byte length.
517   */
518  public static final int ELEMENT_READ_STATE_NEED_ADDITIONAL_LENGTH_BYTES = 2;
519
520
521
522  /**
523   * The ASN.1 element decoding state that indicates that the next byte read
524   * should be applied to the value of the element.
525   */
526  public static final int ELEMENT_READ_STATE_NEED_VALUE_BYTES = 3;
527}
528