Source Code Cross Referenced for LdapASN1Constant.java in  » Apache-Harmony-Java-SE » org-package » org » apache » harmony » jndi » provider » ldap » asn1 » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » org package » org.apache.harmony.jndi.provider.ldap.asn1 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* 
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more 
003:         *  contributor license agreements.  See the NOTICE file distributed with 
004:         *  this work for additional information regarding copyright ownership. 
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0 
006:         *  (the "License"); you may not use this file except in compliance with 
007:         *  the License.  You may obtain a copy of the License at 
008:         * 
009:         *     http://www.apache.org/licenses/LICENSE-2.0 
010:         * 
011:         *  Unless required by applicable law or agreed to in writing, software 
012:         *  distributed under the License is distributed on an "AS IS" BASIS, 
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
014:         *  See the License for the specific language governing permissions and 
015:         *  limitations under the License. 
016:         */
017:
018:        package org.apache.harmony.jndi.provider.ldap.asn1;
019:
020:        import org.apache.harmony.security.asn1.ASN1Boolean;
021:        import org.apache.harmony.security.asn1.ASN1Constants;
022:        import org.apache.harmony.security.asn1.ASN1Enumerated;
023:        import org.apache.harmony.security.asn1.ASN1Implicit;
024:        import org.apache.harmony.security.asn1.ASN1Integer;
025:        import org.apache.harmony.security.asn1.ASN1OctetString;
026:        import org.apache.harmony.security.asn1.ASN1Sequence;
027:        import org.apache.harmony.security.asn1.ASN1SequenceOf;
028:        import org.apache.harmony.security.asn1.ASN1SetOf;
029:        import org.apache.harmony.security.asn1.ASN1Type;
030:
031:        /**
032:         * This class contains all ASN.1 type defined in RFC 2251.
033:         */
034:        public class LdapASN1Constant {
035:
036:            public static final int OP_BIND_REQUEST = 0;
037:
038:            public static final int OP_BIND_RESPONSE = 1;
039:
040:            public static final int OP_UNBIND_REQUEST = 2;
041:
042:            public static final int OP_SEARCH_REQUEST = 3;
043:
044:            public static final int OP_SEARCH_RESULT_ENTRY = 4;
045:
046:            public static final int OP_SEARCH_RESULT_DONE = 5;
047:
048:            public static final int OP_SEARCH_RESULT_REF = 6;
049:
050:            public static final int OP_MODIFY_REQUEST = 7;
051:
052:            public static final int OP_MODIFY_RESPONSE = 8;
053:
054:            public static final int OP_ADD_REQUEST = 9;
055:
056:            public static final int OP_ADD_RESPONSE = 10;
057:
058:            public static final int OP_DEL_REQUEST = 11;
059:
060:            public static final int OP_DEL_RESPONSE = 12;
061:
062:            public static final int OP_MODIFY_DN_REQUEST = 13;
063:
064:            public static final int OP_MODIFY_DN_RESPONSE = 14;
065:
066:            public static final int OP_COMPARE_REQUEST = 15;
067:
068:            public static final int OP_COMPARE_RESPONSE = 16;
069:
070:            public static final int OP_ABANDON_REQUEST = 17;
071:
072:            public static final int OP_EXTENDED_REQUEST = 18;
073:
074:            public static final int OP_EXTENDED_RESPONSE = 19;
075:
076:            public static final ASN1Type Attribute = new ASN1SequenceWrap(
077:                    new ASN1Type[] { ASN1OctetString.getInstance(), // type
078:                            new ASN1SetOf(ASN1OctetString.getInstance()) }); // vals
079:
080:            public static final ASN1Type AttributeList = new ASN1SequenceOf(
081:                    new ASN1SequenceWrap(new ASN1Type[] {
082:                            ASN1OctetString.getInstance(), // type
083:                            new ASN1SetOf(ASN1OctetString.getInstance()) })); // values
084:
085:            public static final ASN1Type AddRequest = new ASN1Implicit(
086:                    ASN1Constants.CLASS_APPLICATION, 8, new ASN1SequenceWrap(
087:                            new ASN1Type[] { ASN1OctetString.getInstance(), // entry
088:                                    AttributeList })); // attributes
089:
090:            public static final ASN1Type SaslCredentials = new ASN1SequenceWrap(
091:                    new ASN1Type[] { ASN1OctetString.getInstance(), // mechanism
092:                            ASN1OctetString.getInstance() }) { // credentials
093:                {
094:                    setOptional(1); // credentials is optional
095:                }
096:            };
097:
098:            public static final ASN1Type AuthenticationChoice = new ASN1ChoiceWrap(
099:                    new ASN1Type[] {
100:                            new ASN1Implicit(
101:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 0, // simple
102:                                    ASN1OctetString.getInstance()),
103:                            new ASN1Implicit(
104:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 3, // sasl
105:                                    SaslCredentials) });
106:
107:            public static final ASN1Type LDAPResult = new ASN1SequenceWrap(
108:                    new ASN1Type[] {
109:                            ASN1Enumerated.getInstance(), // resultCode
110:                            ASN1OctetString.getInstance(), // matchedDN
111:                            ASN1OctetString.getInstance(), // errorMessage
112:                            new ASN1Implicit(
113:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 3, // referral
114:                                    new ASN1SequenceOf(ASN1OctetString
115:                                            .getInstance())) }) {
116:                {
117:                    setOptional(3); // referral is optional
118:                }
119:            };
120:
121:            public static final ASN1Type AddResponse = new ASN1Implicit(
122:                    ASN1Constants.CLASS_APPLICATION, 9, LDAPResult);
123:
124:            public static final ASN1Type Control = new ASN1SequenceWrap(
125:                    new ASN1Type[] { ASN1OctetString.getInstance(), // controlType
126:                            ASN1Boolean.getInstance(), // criticality
127:                            ASN1OctetString.getInstance() }) { // controlValue
128:                {
129:                    setDefault(Boolean.FALSE, 1); // criticality default false
130:                    setOptional(2); // controlValue is optional
131:                }
132:            };
133:
134:            public static final ASN1Type BindRequest = new ASN1Implicit(
135:                    ASN1Constants.CLASS_APPLICATION, 0, new ASN1SequenceWrap(
136:                            new ASN1Type[] { ASN1Integer.getInstance(), // version
137:                                    ASN1OctetString.getInstance(), // name
138:                                    AuthenticationChoice })); // authentication
139:
140:            public static final ASN1Type BindResponse = new ASN1Implicit(
141:                    ASN1Constants.CLASS_APPLICATION,
142:                    1,
143:                    Utils
144:                            .conjoinSequence(
145:                                    (ASN1Sequence) LDAPResult, // result
146:                                    new ASN1SequenceWrap(
147:                                            new ASN1Type[] { new ASN1Implicit(
148:                                                    ASN1Constants.CLASS_CONTEXTSPECIFIC,
149:                                                    7, // serverSaslCreds
150:                                                    ASN1OctetString
151:                                                            .getInstance()) }) {
152:                                        {
153:                                            setOptional(0); // serverSaslCreds is optional
154:                                        }
155:                                    }));
156:
157:            public static final ASN1Type UnbindRequest = new ASN1Implicit(
158:                    ASN1Constants.CLASS_APPLICATION, 2, ASN1Null.getInstance());
159:
160:            public static final ASN1Type AttributeValueAssertion = new ASN1SequenceWrap(
161:                    new ASN1Type[] { ASN1OctetString.getInstance(), // attributeDesc
162:                            ASN1OctetString.getInstance() }); // assertionValue
163:
164:            public static final ASN1Type AbandonRequest = new ASN1Implicit(
165:                    ASN1Constants.CLASS_APPLICATION, 16, ASN1Integer
166:                            .getInstance());
167:
168:            public static final ASN1Type CompareRequest = new ASN1Implicit(
169:                    ASN1Constants.CLASS_APPLICATION, 14, new ASN1SequenceWrap(
170:                            new ASN1Type[] { ASN1OctetString.getInstance(), // entry
171:                                    AttributeValueAssertion })); // ava
172:
173:            public static final ASN1Type CompareResponse = new ASN1Implicit(
174:                    ASN1Constants.CLASS_APPLICATION, 15, LDAPResult);
175:
176:            public static final ASN1Type DelRequest = new ASN1Implicit(
177:                    ASN1Constants.CLASS_APPLICATION, 10, ASN1OctetString
178:                            .getInstance());
179:
180:            public static final ASN1Type DelResponse = new ASN1Implicit(
181:                    ASN1Constants.CLASS_APPLICATION, 11, LDAPResult);
182:
183:            public static final ASN1Type ExtendedRequest = new ASN1Implicit(
184:                    ASN1Constants.CLASS_APPLICATION, 23,
185:                    new ASN1SequenceWrap(new ASN1Type[] {
186:                            new ASN1Implicit(
187:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 0, // requestName
188:                                    ASN1OctetString.getInstance()),
189:                            new ASN1Implicit(
190:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 1, // requestValue
191:                                    ASN1OctetString.getInstance()) }) {
192:                        {
193:                            setOptional(1); // requestValue is optional
194:                        }
195:                    });
196:
197:            public static final ASN1Type ExtendedResponse = new ASN1Implicit(
198:                    ASN1Constants.CLASS_APPLICATION,
199:                    24,
200:                    Utils
201:                            .conjoinSequence(
202:                                    (ASN1Sequence) LDAPResult, // LDAPResult
203:                                    new ASN1SequenceWrap(
204:                                            new ASN1Type[] {
205:                                                    new ASN1Implicit(
206:                                                            ASN1Constants.CLASS_CONTEXTSPECIFIC,
207:                                                            10, // responseName
208:                                                            ASN1OctetString
209:                                                                    .getInstance()),
210:                                                    new ASN1Implicit(
211:                                                            ASN1Constants.CLASS_CONTEXTSPECIFIC,
212:                                                            11, // response
213:                                                            ASN1OctetString
214:                                                                    .getInstance()) }) {
215:                                        {
216:                                            setOptional(0);
217:                                            setOptional(1);
218:                                        }
219:                                    }));
220:
221:            public static final ASN1Type ModifyDNRequest = new ASN1Implicit(
222:                    ASN1Constants.CLASS_APPLICATION, 12,
223:                    new ASN1SequenceWrap(new ASN1Type[] {
224:                            ASN1OctetString.getInstance(), // entry
225:                            ASN1OctetString.getInstance(), // newrdn
226:                            ASN1Boolean.getInstance(), // deleteoldrdn
227:                            new ASN1Implicit(
228:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 0,
229:                                    ASN1OctetString.getInstance()) }) { // newSuperior
230:                        {
231:                            setOptional(3);
232:                        }
233:                    });
234:
235:            public static final ASN1Type ModifyDNResponse = new ASN1Implicit(
236:                    ASN1Constants.CLASS_APPLICATION, 13, LDAPResult);
237:
238:            public static final ASN1Type AttributeTypeAndValues = new ASN1SequenceWrap(
239:                    new ASN1Type[] { ASN1OctetString.getInstance(), // type
240:                            new ASN1SetOf(ASN1OctetString.getInstance()) }); // vals
241:
242:            public static final ASN1Type ModifyRequest = new ASN1Implicit(
243:                    ASN1Constants.CLASS_APPLICATION, 6,
244:                    new ASN1SequenceWrap(new ASN1Type[] {
245:                            ASN1OctetString.getInstance(), // object
246:                            new ASN1SequenceOf(new ASN1SequenceWrap( // modification
247:                                    new ASN1Type[] {
248:                                            ASN1Enumerated.getInstance(), // operation
249:                                            AttributeTypeAndValues })) })); // modification
250:
251:            public static final ASN1Type ModifyResponse = new ASN1Implicit(
252:                    ASN1Constants.CLASS_APPLICATION, 7, LDAPResult);
253:
254:            public static final ASN1Type SubstringFilter = new ASN1SequenceWrap(
255:                    new ASN1Type[] {
256:                            ASN1OctetString.getInstance(), // type
257:                            new ASN1SequenceOf(
258:                                    new ASN1ChoiceWrap(new ASN1Type[] { // substrings
259:                                                    new ASN1Implicit(
260:                                                            // initial
261:                                                            ASN1Constants.CLASS_CONTEXTSPECIFIC,
262:                                                            0,
263:                                                            ASN1OctetString
264:                                                                    .getInstance()),
265:                                                    new ASN1Implicit(
266:                                                            // any
267:                                                            ASN1Constants.CLASS_CONTEXTSPECIFIC,
268:                                                            1,
269:                                                            ASN1OctetString
270:                                                                    .getInstance()),
271:                                                    new ASN1Implicit(
272:                                                            // final
273:                                                            ASN1Constants.CLASS_CONTEXTSPECIFIC,
274:                                                            2,
275:                                                            ASN1OctetString
276:                                                                    .getInstance()) })) });
277:
278:            public static final ASN1Type MatchingRuleAssertion = new ASN1SequenceWrap(
279:                    new ASN1Type[] {
280:                            new ASN1Implicit(
281:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 1, // matchingRule
282:                                    ASN1OctetString.getInstance()),
283:                            new ASN1Implicit(
284:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 2, // type
285:                                    ASN1OctetString.getInstance()),
286:                            new ASN1Implicit(
287:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 3, // matchValue
288:                                    ASN1OctetString.getInstance()),
289:                            new ASN1Implicit(
290:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 4, // dnAttributes
291:                                    ASN1Boolean.getInstance()) }) {
292:                {
293:                    setOptional(0);
294:                    setOptional(1);
295:                    setDefault(Boolean.FALSE, 3);
296:                }
297:            };
298:
299:            public static final ASN1Type Filter = new ASN1ChoiceWrap(
300:                    new ASN1Type[] {
301:                            new ASN1Implicit(
302:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 0,
303:                                    new ASN1SetOf(new ASN1LdapFilter())),
304:                            new ASN1Implicit(
305:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 1,
306:                                    new ASN1SetOf(new ASN1LdapFilter())),
307:                            new ASN1Implicit(
308:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 2,
309:                                    new ASN1LdapFilter()),
310:                            new ASN1Implicit(
311:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 3,
312:                                    AttributeValueAssertion),
313:                            new ASN1Implicit(
314:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 4,
315:                                    SubstringFilter),
316:                            new ASN1Implicit(
317:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 5,
318:                                    AttributeValueAssertion),
319:                            new ASN1Implicit(
320:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 6,
321:                                    AttributeValueAssertion),
322:                            new ASN1Implicit(
323:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 7,
324:                                    ASN1OctetString.getInstance()),
325:                            new ASN1Implicit(
326:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 8,
327:                                    AttributeValueAssertion),
328:                            new ASN1Implicit(
329:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 9,
330:                                    MatchingRuleAssertion) });
331:
332:            public static final ASN1Type SearchRequest = new ASN1Implicit(
333:                    ASN1Constants.CLASS_APPLICATION, 3, new ASN1SequenceWrap(
334:                            new ASN1Type[] {
335:                                    ASN1OctetString.getInstance(), // baseObject
336:                                    ASN1Enumerated.getInstance(), // scope
337:                                    ASN1Enumerated.getInstance(), // derefAliases
338:                                    ASN1Integer.getInstance(), // sizeLimit
339:                                    ASN1Integer.getInstance(), // timeLimit
340:                                    ASN1Boolean.getInstance(), // typesonly
341:                                    Filter, // Filter
342:                                    new ASN1SequenceOf(ASN1OctetString
343:                                            .getInstance()) })); // attributes
344:
345:            public static final ASN1Type PartialAttributeList = new ASN1SequenceOf(
346:                    new ASN1SequenceWrap(new ASN1Type[] {
347:                            ASN1OctetString.getInstance(), // type
348:                            new ASN1SetOf(ASN1OctetString.getInstance()) })); // vals
349:
350:            public static final ASN1Type SearchResultEntry = new ASN1Implicit(
351:                    ASN1Constants.CLASS_APPLICATION, 4, new ASN1SequenceWrap(
352:                            new ASN1Type[] { ASN1OctetString.getInstance(), // objectName
353:                                    PartialAttributeList })); // attributes
354:
355:            public static final ASN1Type SearchResultReference = new ASN1Implicit(
356:                    ASN1Constants.CLASS_APPLICATION, 19, new ASN1SequenceOf(
357:                            ASN1OctetString.getInstance()));
358:
359:            public static final ASN1Type SearchResultDone = new ASN1Implicit(
360:                    ASN1Constants.CLASS_APPLICATION, 5, LDAPResult);
361:
362:            public static final ASN1Type LDAPMessage = new ASN1SequenceWrap(
363:                    new ASN1Type[] {
364:                            ASN1Integer.getInstance(),
365:                            new ASN1ChoiceWrap(new ASN1Type[] { BindRequest,
366:                                    BindResponse, UnbindRequest, SearchRequest,
367:                                    SearchResultEntry, SearchResultDone,
368:                                    SearchResultReference, ModifyRequest,
369:                                    ModifyResponse, AddRequest, AddResponse,
370:                                    DelRequest, DelResponse, ModifyDNRequest,
371:                                    ModifyDNResponse, CompareRequest,
372:                                    CompareResponse, AbandonRequest,
373:                                    ExtendedRequest, ExtendedResponse }),
374:                            new ASN1Implicit(
375:                                    ASN1Constants.CLASS_CONTEXTSPECIFIC, 0,
376:                                    new ASN1SequenceOf(Control)) }) {
377:                {
378:                    setOptional(2);
379:                }
380:            };
381:
382:            public static final ASN1Type PersistentSearchControl = new ASN1SequenceWrap(
383:                    new ASN1Type[] { new ASN1Integer(), // changeTypes
384:                            new ASN1Boolean(), // changesOnly
385:                            new ASN1Boolean() }); // returnECs
386:
387:            public static final ASN1Type EntryChangeNotificationControl = new ASN1SequenceWrap(
388:                    new ASN1Type[] { new ASN1Enumerated(), // changeType
389:                            new ASN1OctetString(), // previousDN
390:                            new ASN1Integer() }) { // changeNumber
391:                {
392:                    setOptional(1);
393:                    setOptional(2);
394:                }
395:            };
396:        }
ww_w_.__j__a___v__a__2s__.__c__o__m | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.