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