You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2005/08/02 00:07:41 UTC
svn commit: r226894 - in
/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec:
LdapConstants.java grammars/FilterGrammar.java
grammars/LdapMessageGrammar.java grammars/ModifyRequestGrammar.java
grammars/SearchRequestGrammar.java
Author: elecharny
Date: Mon Aug 1 15:07:35 2005
New Revision: 226894
URL: http://svn.apache.org/viewcvs?rev=226894&view=rev
Log:
Added the last constant tags, and update the grammars using
those constants instead of numeric values
Modified:
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/LdapConstants.java
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java
directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/LdapConstants.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/LdapConstants.java?rev=226894&r1=226893&r2=226894&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/LdapConstants.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/LdapConstants.java Mon Aug 1 15:07:35 2005
@@ -48,6 +48,7 @@
public static final byte ABANDON_REQUEST_TAG = 0x50;
public static final byte BIND_REQUEST_TAG = 0x60;
public static final byte BIND_RESPONSE_TAG = 0x61;
+ public static final byte SEARCH_REQUEST_TAG = 0x63;
public static final byte SEARCH_RESULT_ENTRY_TAG = 0x64;
public static final byte SEARCH_RESULT_DONE_TAG = 0x65;
public static final byte MODIFY_REQUEST_TAG = 0x66;
@@ -67,12 +68,29 @@
public static final int BIND_REQUEST_SIMPLE_TAG = 0x80;
public static final int EXTENDED_REQUEST_NAME_TAG = 0x80;
public static final int MODIFY_DN_REQUEST_NEW_SUPERIOR_TAG = 0x80;
+ public static final int SEARCH_SUBSTRINGS_INITIAL_TAG = 0x80;
public static final int EXTENDED_REQUEST_VALUE_TAG = 0x81;
+ public static final int SEARCH_MATCHING_RULE_TAG = 0x81;
+ public static final int SEARCH_SUBSTRINGS_ANY_TAG = 0x81;
+ public static final int SEARCH_TYPE_TAG = 0x82;
+ public static final int SEARCH_SUBSTRINGS_FINAL_TAG = 0x82;
+ public static final int SEARCH_MATCH_VALUE_TAG = 0x83;
public static final int BIND_REQUEST_SASL_TAG = 0x83;
public static final int LDAP_RESULT_REFERRAL_SEQUENCE_TAG = 0x83;
+ public static final int DN_ATTRIBUTES_FILTER_TAG = 0x84;
public static final int SERVER_SASL_CREDENTIAL_TAG = 0x87;
+ public static final int PRESENT_FILTER_TAG = 0x87;
public static final int EXTENDED_RESPONSE_RESPONSE_NAME_TAG = 0x8A;
public static final int EXTENDED_RESPONSE_RESPONSE_TAG = 0x8B;
public static final int CONTROLS_SEQUENCE_TAG = 0x90;
+ public static final int AND_FILTER_TAG = 0xA0;
+ public static final int OR_FILTER_TAG = 0xA1;
+ public static final int NOT_FILTER_TAG = 0xA2;
+ public static final int EQUALITY_MATCH_FILTER_TAG = 0xA3;
+ public static final int SUBSTRINGS_FILTER_TAG = 0xA4;
+ public static final int GREATER_OR_EQUAL_FILTER_TAG = 0xA5;
+ public static final int LESS_OR_EQUAL_FILTER_TAG = 0xA6;
+ public static final int APPROX_MATCH_FILTER_TAG = 0xA8;
+ public static final int EXTENSIBLE_MATCH_FILTER_TAG = 0xA9;
}
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java?rev=226894&r1=226893&r2=226894&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/FilterGrammar.java Mon Aug 1 15:07:35 2005
@@ -23,6 +23,7 @@
import org.apache.asn1.ber.grammar.GrammarTransition;
import org.apache.asn1.ber.grammar.IGrammar;
import org.apache.asn1.ber.tlv.TLV;
+import org.apache.asn1.ber.tlv.UniversalTag;
import org.apache.asn1.ber.tlv.Value;
import org.apache.asn1.ldap.codec.LdapConstants;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
@@ -147,7 +148,7 @@
// and [0] SET OF Filter, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA0] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.AND_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_AND_VALUE, null );
// Filter ::= CHOICE {
@@ -155,7 +156,7 @@
// or [1] SET OF Filter, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA1] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.OR_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_OR_VALUE, null );
// Filter ::= CHOICE {
@@ -163,7 +164,7 @@
// not [2] Filter, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA2] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.NOT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_NOT_VALUE, null );
// Filter ::= CHOICE {
@@ -171,7 +172,7 @@
// equalityMatch [3] AttributeValueAssertion, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA3] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.EQUALITY_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_EQUALITY_MATCH_VALUE, null );
// Filter ::= CHOICE {
@@ -179,7 +180,7 @@
// substrings [4] SubstringFilter, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA4] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.SUBSTRINGS_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_VALUE, null );
// Filter ::= CHOICE {
@@ -187,7 +188,7 @@
// greaterOrEqual [5] AttributeValueAssertion, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA5] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.GREATER_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_GREATER_OR_EQUAL_VALUE, null );
// Filter ::= CHOICE {
@@ -195,7 +196,7 @@
// lessOrEqual [6] AttributeValueAssertion, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA6] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.LESS_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_LESS_OR_EQUAL_VALUE, null );
// Filter ::= CHOICE {
@@ -203,7 +204,7 @@
// present [7] AttributeDescription, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0x87] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.PRESENT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_PRESENT_VALUE, null );
// Filter ::= CHOICE {
@@ -211,14 +212,14 @@
// approxMatch [8] AttributeValueAssertion, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA8] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.APPROX_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_APPROX_MATCH_VALUE, null );
// Filter ::= CHOICE {
// ...
// extensibleMatch [9] ExtensibleMatchFilter } (Tag)
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_TAG][0xA9] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_TAG][LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_TAG, LdapStatesEnum.FILTER_EXTENSIBLE_MATCH_VALUE, null );
// Filter ::= CHOICE {
@@ -226,7 +227,7 @@
// ...
// We just have to switch to the initial state of Filter, because this is what
// we will get !
- super.transitions[LdapStatesEnum.FILTER_AND_VALUE][0xA0] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_AND_VALUE][LdapConstants.AND_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_AND_VALUE, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Init And Filter" )
{
@@ -270,7 +271,7 @@
// ...
// We just have to switch to the initial state of Filter, because this is what
// we will get !
- super.transitions[LdapStatesEnum.FILTER_OR_VALUE][0xA1] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_OR_VALUE][LdapConstants.OR_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_OR_VALUE, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Init Or Filter" )
{
@@ -314,7 +315,7 @@
// ...
// We just have to switch to the initial state of Filter, because this is what
// we will get !
- super.transitions[LdapStatesEnum.FILTER_NOT_VALUE][0xA2] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_NOT_VALUE][LdapConstants.NOT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_NOT_VALUE, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Init Not Filter" )
{
@@ -358,7 +359,7 @@
// ...
// We will create the filter container (as this is an equalityMatch filter,
// we will create an AttributeValueAssertionFilter).
- super.transitions[LdapStatesEnum.FILTER_EQUALITY_MATCH_VALUE][0xA3] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_EQUALITY_MATCH_VALUE][LdapConstants.EQUALITY_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_EQUALITY_MATCH_VALUE, LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG,
new GrammarAction( "Init Equality Match Filter" )
{
@@ -374,7 +375,7 @@
// ...
// We will create the filter container (as this is an GreaterOrEqual filter,
// we will create an AttributeValueAssertionFilter).
- super.transitions[LdapStatesEnum.FILTER_GREATER_OR_EQUAL_VALUE][0xA5] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_GREATER_OR_EQUAL_VALUE][LdapConstants.GREATER_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_GREATER_OR_EQUAL_VALUE, LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG,
new GrammarAction( "Init Greater Or Equal Filter" )
{
@@ -390,7 +391,7 @@
// ...
// We will create the filter container (as this is an lessOrEqual filter,
// we will create an AttributeValueAssertionFilter).
- super.transitions[LdapStatesEnum.FILTER_LESS_OR_EQUAL_VALUE][0xA6] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_LESS_OR_EQUAL_VALUE][LdapConstants.LESS_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_LESS_OR_EQUAL_VALUE, LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG,
new GrammarAction( "Init Less Or Equal Filter" )
{
@@ -406,7 +407,7 @@
// ...
// We will create the filter container (as this is an approxMatch filter,
// we will create an AttributeValueAssertionFilter).
- super.transitions[LdapStatesEnum.FILTER_APPROX_MATCH_VALUE][0xA8] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_APPROX_MATCH_VALUE][LdapConstants.APPROX_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_APPROX_MATCH_VALUE, LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG,
new GrammarAction( "Init ApproxMatch Filter" )
{
@@ -420,7 +421,7 @@
// attributeDesc AttributeDescription, (TAG)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_ATTRIBUTE_DESC_TAG, LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE, null);
// AttributeValueAssertion ::= SEQUENCE {
@@ -429,7 +430,7 @@
// We have to set the attribute description in the current filter.
// It could be an equalityMatch, greaterOrEqual, lessOrEqual or an
// approxMatch filter.
- super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE, LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG,
new GrammarAction( "Init attributeDesc Value" )
{
@@ -456,7 +457,7 @@
// ...
// assertionValue AssertionValue } (TAG)
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG, LdapStatesEnum.FILTER_ASSERTION_VALUE_VALUE, null);
// AttributeValueAssertion ::= SEQUENCE {
@@ -466,7 +467,7 @@
// It could be an equalityMatch, greaterOrEqual, lessOrEqual or an
// approxMatch filter.
// Whgen finished, we will transit to the first state.
- super.transitions[LdapStatesEnum.FILTER_ASSERTION_VALUE_VALUE][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_ASSERTION_VALUE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_ASSERTION_VALUE_VALUE, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Init AssertionValue Value" )
{
@@ -497,7 +498,7 @@
// We have to set the attribute description in the current filter.
// It could be an equalityMatch, greaterOrEqual, lessOrEqual or an
// approxMatch filter.
- super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_ATTRIBUTE_DESC_VALUE, LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG,
new GrammarAction( "Init attributeDesc Value" )
{
@@ -524,14 +525,14 @@
// ...
// assertionValue AssertionValue } (TAG)
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_ASSERTION_VALUE_TAG, LdapStatesEnum.FILTER_ASSERTION_VALUE_VALUE, null);
// Filter ::= CHOICE {
// ...
// present [7] AttributeDescription, (Value)
// ...
- super.transitions[LdapStatesEnum.FILTER_PRESENT_VALUE][0x87] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_PRESENT_VALUE][LdapConstants.PRESENT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_PRESENT_VALUE, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Init present filter Value" )
{
@@ -587,7 +588,7 @@
// substrings [4] SubstringFilter, (Value)
// ...
// Store the substring
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_VALUE][0xA4] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_VALUE][LdapConstants.SUBSTRINGS_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_VALUE, LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_TAG,
new GrammarAction( "Init Substring Filter" )
{
@@ -635,14 +636,14 @@
// type AttributeDescription, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_VALUE, null );
// SubstringFilter ::= SEQUENCE {
// type AttributeDescription, (Value)
// ...
//
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_VALUE][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_TYPE_VALUE, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_TAG,
new GrammarAction( "Store substring filter Value" )
{
@@ -671,7 +672,7 @@
// substrings SEQUENCE OF CHOICE { (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_TAG][0x30] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_TAG][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_VALUE, null );
// SubstringFilter ::= SEQUENCE {
@@ -681,7 +682,7 @@
// ...
// Nothing to do. Here, we may have three possibilities. We may have an "initial" value,
// or an "any" value, or a "final" value. Any other option is an error.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_VALUE][0x30] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_VALUE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_VALUE, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, null );
// SubstringFilter ::= SEQUENCE {
@@ -691,7 +692,7 @@
// initial [0] LDAPString, (Tag)
// ...
// We have an "initial" value. Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0x80] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.SEARCH_SUBSTRINGS_INITIAL_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_INITIAL_VALUE, null );
// SubstringFilter ::= SEQUENCE {
@@ -701,7 +702,7 @@
// initial [0] LDAPString, (Value)
// ...
// Store the initial value.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_INITIAL_VALUE][0x80] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_INITIAL_VALUE][LdapConstants.SEARCH_SUBSTRINGS_INITIAL_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_INITIAL_VALUE, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG,
new GrammarAction( "Store substring filter initial Value" )
{
@@ -732,7 +733,7 @@
// any [1] LDAPString, (Tag)
// ...
// We have an 'any' value without an 'initial' value. Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0x81] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.SEARCH_SUBSTRINGS_ANY_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_VALUE, null);
// SubstringFilter ::= SEQUENCE {
@@ -743,7 +744,7 @@
// any [1] LDAPString, (Tag)
// ...
// We had an 'initial' substring, and now we have an 'any' substring. Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG][0x81] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG][LdapConstants.SEARCH_SUBSTRINGS_ANY_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_VALUE, null );
// SubstringFilter ::= SEQUENCE {
@@ -754,7 +755,7 @@
// any [1] LDAPString, (Value)
// ...
// Store the 'any' value.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_VALUE][0x81] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_VALUE][LdapConstants.SEARCH_SUBSTRINGS_ANY_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_VALUE, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG,
new GrammarAction( "Store substring filter any Value" )
{
@@ -787,7 +788,7 @@
// }
//
// We have an 'final' value after an 'any' value. Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG][LdapConstants.SEARCH_SUBSTRINGS_FINAL_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_FINAL_VALUE, null);
// SubstringFilter ::= SEQUENCE {
@@ -799,7 +800,7 @@
// }
//
// We have an 'final' value only. Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.SEARCH_SUBSTRINGS_FINAL_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_FINAL_VALUE, null);
// SubstringFilter ::= SEQUENCE {
@@ -810,7 +811,7 @@
// final [2] LDAPString, (Tag)
// }
// We had an 'initial' substring, and now we have an 'final' substring. Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG][LdapConstants.SEARCH_SUBSTRINGS_FINAL_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_ANY_OR_FINAL_TAG, LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_FINAL_VALUE, null );
// SubstringFilter ::= SEQUENCE {
@@ -820,7 +821,7 @@
// ...
// final [2] LDAPString, (Value)
// Store the initial value.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_FINAL_VALUE][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_FINAL_VALUE][LdapConstants.SEARCH_SUBSTRINGS_FINAL_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_FINAL_VALUE, LdapStatesEnum.END_STATE,
new GrammarAction( "Store substring filter final Value" )
{
@@ -849,7 +850,7 @@
// }
//
// Has we must have at least an initial, any or final value, every other value is an error.
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA0] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.AND_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -859,7 +860,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA1] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.OR_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -869,7 +870,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA2] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.NOT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -879,7 +880,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA3] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.EQUALITY_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -889,7 +890,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA4] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.SUBSTRINGS_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -899,7 +900,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA5] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.GREATER_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -909,7 +910,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA6] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.LESS_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -919,7 +920,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0x87] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.PRESENT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -929,7 +930,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA8] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.APPROX_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -939,7 +940,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0xA9] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -949,7 +950,7 @@
}
});
- super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][0x30] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_SUBSTRINGS_SUBSTRINGS_CHOICE_TAG, LdapStatesEnum.FILTER_TAG,
new GrammarAction( "Bad tag exception" )
{
@@ -966,7 +967,7 @@
// extensibleMatch [9] MatchingRuleAssertion} (Value)
//
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_EXTENSIBLE_MATCH_VALUE][0xA9] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_EXTENSIBLE_MATCH_VALUE][LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_EXTENSIBLE_MATCH_VALUE, LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_TAG,
new GrammarAction( "Init extensible match Filter" )
{
@@ -1010,14 +1011,14 @@
// MatchingRuleAssertion ::= SEQUENCE { (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_TAG][0x30] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_TAG][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_TAG, LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_VALUE, null );
// MatchingRuleAssertion ::= SEQUENCE { (Value)
// ...
// Nothing to do. Two cases next : we may have a matching rule or a type.
// At least one of those two elements must be present.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_VALUE][0x30] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_VALUE][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_RULE_ASSERTION_VALUE, LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG, null);
@@ -1025,14 +1026,14 @@
// matchingRule [1] MatchingRuleId OPTIONAL, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG][0x81] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG][LdapConstants.SEARCH_MATCHING_RULE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG, LdapStatesEnum.FILTER_MATCHING_RULE_VALUE, null );
// MatchingRuleAssertion ::= SEQUENCE {
// matchingRule [1] MatchingRuleId OPTIONAL, (Value)
// ...
// Store the matching rule value.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_VALUE][0x81] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_VALUE][LdapConstants.SEARCH_MATCHING_RULE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_RULE_VALUE, LdapStatesEnum.FILTER_MATCHING_TYPE_OR_MATCH_VALUE_TAG,
new GrammarAction( "Store matching rule Value" )
{
@@ -1057,7 +1058,7 @@
// type [2] AttributeDescription OPTIONAL, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG][LdapConstants.SEARCH_TYPE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG, LdapStatesEnum.FILTER_MATCHING_TYPE_VALUE, null );
// MatchingRuleAssertion ::= SEQUENCE {
@@ -1065,7 +1066,7 @@
// type [2] AttributeDescription OPTIONAL, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_TYPE_OR_MATCH_VALUE_TAG][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_TYPE_OR_MATCH_VALUE_TAG][LdapConstants.SEARCH_TYPE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_RULE_OR_TYPE_TAG, LdapStatesEnum.FILTER_MATCHING_TYPE_VALUE, null );
// MatchingRuleAssertion ::= SEQUENCE {
@@ -1073,7 +1074,7 @@
// type [2] AttributeDescription OPTIONAL, (Length)
// ...
// Store the matching type value.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_TYPE_VALUE][0x82] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_TYPE_VALUE][LdapConstants.SEARCH_TYPE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_TYPE_VALUE, LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_TAG,
new GrammarAction( "Store matching type Value" )
{
@@ -1098,7 +1099,7 @@
// matchValue [3] AssertionValue, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_TAG][0x83] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_TAG][LdapConstants.SEARCH_MATCH_VALUE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_TAG, LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_VALUE, null );
// MatchingRuleAssertion ::= SEQUENCE {
@@ -1106,7 +1107,7 @@
// matchValue [3] AssertionValue, (Value)
// ...
// Store the matching type value.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_VALUE][0x83] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_VALUE][LdapConstants.SEARCH_MATCH_VALUE_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_MATCH_VALUE_VALUE, LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_OR_END_TAG,
new GrammarAction( "Store matching match value Value" )
{
@@ -1130,14 +1131,14 @@
// ...
// dnAttributes [4] BOOLEAN DEFAULT FALSE } (Tag)
// Nothing to do.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_OR_END_TAG][0x84] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_OR_END_TAG][LdapConstants.DN_ATTRIBUTES_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_OR_END_TAG, LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_VALUE, null );
// MatchingRuleAssertion ::= SEQUENCE {
// ...
// dnAttributes [4] BOOLEAN DEFAULT FALSE } (Length)
// Store the matching type value.
- super.transitions[LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_VALUE][0x84] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_VALUE][LdapConstants.DN_ATTRIBUTES_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.FILTER_MATCHING_DN_ATTRIBUTES_VALUE, LdapStatesEnum.END_STATE,
new GrammarAction( "Store matching dnAttributes Value" )
{
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java?rev=226894&r1=226893&r2=226894&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapMessageGrammar.java Mon Aug 1 15:07:35 2005
@@ -25,6 +25,7 @@
import org.apache.asn1.ber.tlv.TLV;
import org.apache.asn1.ber.tlv.UniversalTag;
import org.apache.asn1.ber.tlv.Value;
+import org.apache.asn1.ldap.codec.LdapConstants;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
import org.apache.asn1.ldap.pojo.LdapMessage;
@@ -163,7 +164,7 @@
// LdapMessage ::= ... UnBindRequest ...
// unbindRequest ::= [APPLICATION 2] NULL (Tag)
// We have to switch to the UnBindRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x42] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.UNBIND_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.UNBIND_REQUEST_GRAMMAR_SWITCH,
null );
@@ -173,7 +174,7 @@
// LdapMessage ::= ... DelRequest ...
// delRequest ::= [APPLICATION 10] LDAPDN (Tag)
// We have to switch to the DelRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x4A] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.DEL_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.DEL_REQUEST_GRAMMAR_SWITCH,
null );
@@ -183,7 +184,7 @@
// LdapMessage ::= ... AbandonRequest ...
// AbandonRequest ::= [APPLICATION 16] MessageID (Tag)
// We have to switch to the AbandonRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x50] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.ABANDON_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.ABANDON_REQUEST_GRAMMAR_SWITCH,
null );
@@ -193,7 +194,7 @@
// LdapMessage ::= ... BindRequest ...
// BindRequest ::= [APPLICATION 0] SEQUENCE { ... (Tag)
// Nothing to do while the length is not checked.
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x60] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.BIND_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.BIND_REQUEST_GRAMMAR_SWITCH, null );
//--------------------------------------------------------------------------------------------
@@ -202,7 +203,7 @@
// LdapMessage ::= ... BindResponse ...
// BindResponse ::= [APPLICATION 1] SEQUENCE { ... (Tag)
// We have to switch to the BindResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x61] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.BIND_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.BIND_RESPONSE_GRAMMAR_SWITCH, null );
//--------------------------------------------------------------------------------------------
@@ -211,7 +212,7 @@
// LdapMessage ::= ... SearchRequest ...
// SearchRequest ::= [APPLICATION 3] SEQUENCE { ... (Tag)
// Nothing to do while the length is not checked.
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x63] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.SEARCH_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.SEARCH_REQUEST_GRAMMAR_SWITCH, null );
//--------------------------------------------------------------------------------------------
@@ -220,7 +221,7 @@
// LdapMessage ::= ... SearchResultEntry ...
// SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ... (Tag)
// Nothing to do while the length is not checked.
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x64] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.SEARCH_RESULT_ENTRY_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.SEARCH_RESULT_ENTRY_GRAMMAR_SWITCH, null );
//--------------------------------------------------------------------------------------------
@@ -229,7 +230,7 @@
// LdapMessage ::= ... SearchResultDone ...
// SearchResultDone ::= [APPLICATION 5] SEQUENCE { ... (Tag)
// We have to switch to the SearchResultDone grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x65] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.SEARCH_RESULT_DONE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.SEARCH_RESULT_DONE_GRAMMAR_SWITCH,
null );
@@ -239,7 +240,7 @@
// LdapMessage ::= ... ModifyRequest ...
// ModifyRequest ::= [APPLICATION 6] SEQUENCE { ... (Tag)
// We have to switch to the ModifyRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x66] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.MODIFY_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.MODIFY_REQUEST_GRAMMAR_SWITCH,
null );
@@ -249,7 +250,7 @@
// LdapMessage ::= ... ModifyResponse ...
// ModifyResponse ::= [APPLICATION 7] SEQUENCE { ... (Tag)
// We have to switch to the ModifyResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x67] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.MODIFY_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.MODIFY_RESPONSE_GRAMMAR_SWITCH,
null );
@@ -259,7 +260,7 @@
// LdapMessage ::= ... AddRequest ...
// AddRequest ::= [APPLICATION 8] SEQUENCE { ... (Tag)
// We have to switch to the AddRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x68] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.ADD_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.ADD_REQUEST_GRAMMAR_SWITCH,
null );
@@ -269,7 +270,7 @@
// LdapMessage ::= ... AddResponse ...
// AddResponse ::= [APPLICATION 9] LDAPResult (Tag)
// We have to switch to the AddResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x69] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.ADD_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.ADD_RESPONSE_GRAMMAR_SWITCH, null );
//--------------------------------------------------------------------------------------------
@@ -278,7 +279,7 @@
// LdapMessage ::= ... DelResponse ...
// DelResponse ::= [APPLICATION 11] LDAPResult (Tag)
// We have to switch to the DelResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x6B] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.DEL_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.DEL_RESPONSE_GRAMMAR_SWITCH, null );
//--------------------------------------------------------------------------------------------
@@ -287,7 +288,7 @@
// LdapMessage ::= ... ModifyDNRequest ...
// ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ... (Tag)
// We have to switch to the ModifyDNRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x6C] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.MODIFY_DN_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.MODIFY_DN_REQUEST_GRAMMAR_SWITCH,
null );
@@ -297,7 +298,7 @@
// LdapMessage ::= ... ModifyDNResponse ...
// ModifyDNResponse ::= [APPLICATION 13] SEQUENCE { ... (Tag)
// We have to switch to the ModifyDNResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x6D] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.MODIFY_DN_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.MODIFY_DN_RESPONSE_GRAMMAR_SWITCH,
null );
@@ -307,7 +308,7 @@
// LdapMessage ::= ... CompareRequest ...
// CompareRequest ::= [APPLICATION 14] SEQUENCE {
// We have to switch to the CompareRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x6E] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.COMPARE_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.COMPARE_REQUEST_GRAMMAR_SWITCH,
null );
@@ -317,7 +318,7 @@
// LdapMessage ::= ... CompareResponse ...
// CompareResponse ::= [APPLICATION 15] LDAPResult (Tag)
// We have to switch to the CompareResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x6F] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.COMPARE_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.COMPARE_RESPONSE_GRAMMAR_SWITCH,
null );
@@ -327,7 +328,7 @@
// LdapMessage ::= ... SearchResultReference ...
// SearchResultReference ::= [APPLICATION 19] SEQUENCE OF LDAPURL (Tag)
// We have to switch to the SearchResultReference grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x73] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.SEARCH_RESULT_REFERENCE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.SEARCH_RESULT_REFERENCE_GRAMMAR_SWITCH,
null );
@@ -337,7 +338,7 @@
// LdapMessage ::= ... ExtendedRequest ...
// ExtendedRequest ::= [APPLICATION 23] SEQUENCE {
// We have to switch to the ExtendedRequest grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x77] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.EXTENDED_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.EXTENDED_REQUEST_GRAMMAR_SWITCH,
null );
@@ -347,7 +348,7 @@
// LdapMessage ::= ... ExtendedResponse ...
// ExtendedResponse ::= [APPLICATION 24] SEQUENCE {
// We have to switch to the ExtendedResponse grammar
- super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][0x78] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.PROTOCOL_OP_TAG][LdapConstants.EXTENDED_RESPONSE_TAG] = new GrammarTransition(
LdapStatesEnum.PROTOCOL_OP_TAG, LdapStatesEnum.EXTENDED_RESPONSE_GRAMMAR_SWITCH,
null );
}
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java?rev=226894&r1=226893&r2=226894&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/ModifyRequestGrammar.java Mon Aug 1 15:07:35 2005
@@ -23,6 +23,8 @@
import org.apache.asn1.ber.grammar.GrammarTransition;
import org.apache.asn1.ber.grammar.IGrammar;
import org.apache.asn1.ber.tlv.TLV;
+import org.apache.asn1.ber.tlv.UniversalTag;
+import org.apache.asn1.ldap.codec.LdapConstants;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
import org.apache.asn1.ldap.codec.primitives.LdapDN;
import org.apache.asn1.ldap.codec.primitives.LdapString;
@@ -72,13 +74,13 @@
// LdapMessage ::= ... ModifyRequest ...
// ModifyRequest ::= [APPLICATION 6] SEQUENCE { (Tag)
// Nothing to do.
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_TAG][0x66] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_TAG][LdapConstants.MODIFY_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_TAG, LdapStatesEnum.MODIFY_REQUEST_VALUE, null );
// LdapMessage ::= ... ModifyRequest ...
// ModifyRequest ::= [APPLICATION 6] SEQUENCE { (Value)
// Create the structure
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_VALUE][0x66] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_VALUE][LdapConstants.MODIFY_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_VALUE, LdapStatesEnum.MODIFY_REQUEST_OBJECT_TAG,
new GrammarAction( "Init ModifyRequest" )
{
@@ -101,7 +103,7 @@
// object LDAPDN, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_OBJECT_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_OBJECT_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_OBJECT_TAG,
LdapStatesEnum.MODIFY_REQUEST_OBJECT_VALUE, null );
@@ -110,7 +112,7 @@
// object LDAPDN, (Value)
// ...
// Store the object name.
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_OBJECT_VALUE][0x04] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_OBJECT_VALUE][UniversalTag.OCTET_STRING_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_OBJECT_VALUE,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_TAG,
@@ -146,7 +148,7 @@
// ...
// modification *SEQUENCE* OF SEQUENCE { (Tag)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_TAG][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_TAG][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_TAG,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_VALUE, null );
@@ -156,7 +158,7 @@
// ...
// modification *SEQUENCE* OF SEQUENCE { (Value)
// Allocates the array list
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_VALUE][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_VALUE][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_MODIFICATIONS_VALUE,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_TAG,
@@ -180,7 +182,7 @@
// ...
// modification SEQUENCE OF *SEQUENCE* { (Tag)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_TAG][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_TAG][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_TAG,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_VALUE, null );
@@ -191,7 +193,7 @@
// modification SEQUENCE OF *SEQUENCE* { (Tag)
// Nothing to do
// This is a loop, when dealing with more than one modification
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_VALUE, null );
@@ -201,7 +203,7 @@
// ...
// modification SEQUENCE OF *SEQUENCE* { (Value)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_VALUE][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_VALUE][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_SEQUENCE_VALUE,
LdapStatesEnum.MODIFY_REQUEST_OPERATION_TAG, null );
@@ -214,7 +216,7 @@
// replace (2) },
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_OPERATION_TAG][0x0A] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_OPERATION_TAG][UniversalTag.ENUMERATED_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_OPERATION_TAG,
LdapStatesEnum.MODIFY_REQUEST_OPERATION_VALUE, null );
@@ -229,7 +231,7 @@
// Store the operation type. We put it in a temporary storage,
// because we can't allocate a ModificationItem before knowing
// the attributes'name.
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_OPERATION_VALUE][0x0A] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_OPERATION_VALUE][UniversalTag.ENUMERATED_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_OPERATION_VALUE,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_TAG,
@@ -260,7 +262,7 @@
// modification AttributeTypeAndValues } }
// AttributeTypeAndValues ::= SEQUENCE { (Tag)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_TAG][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_TAG][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_TAG,
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_VALUE, null );
@@ -270,7 +272,7 @@
// modification AttributeTypeAndValues } }
// AttributeTypeAndValues ::= SEQUENCE { (Value)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_VALUE][0x30] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_VALUE][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_MODIFICATION_VALUE,
LdapStatesEnum.MODIFY_REQUEST_TYPE_TAG, null );
@@ -279,7 +281,7 @@
// type AttributeDescription, (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_TYPE_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_TYPE_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_TYPE_TAG, LdapStatesEnum.MODIFY_REQUEST_TYPE_VALUE,
null );
@@ -287,7 +289,7 @@
// type AttributeDescription, (Value)
// ...
// Store a new attribute type and values.
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_TYPE_VALUE][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_TYPE_VALUE][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_TYPE_VALUE, LdapStatesEnum.MODIFY_REQUEST_VALS_TAG,
new GrammarAction( "Store type" )
{
@@ -320,7 +322,7 @@
// ...
// vals SET OF AttributeValue } (Tag)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_VALS_TAG][0x31] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_VALS_TAG][UniversalTag.SET_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_VALS_TAG, LdapStatesEnum.MODIFY_REQUEST_VALS_VALUE,
null );
@@ -328,7 +330,7 @@
// ...
// vals SET OF AttributeValue } (Value)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_VALS_VALUE][0x31] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_VALS_VALUE][UniversalTag.SET_TAG] = new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_VALS_VALUE,
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_TAG, null );
@@ -337,7 +339,7 @@
// vals SET OF AttributeValue }
// AttributeValue ::= OCTET STRING (Tag)
// Nothing to do
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_TAG][0x04] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_TAG][UniversalTag.OCTET_STRING_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_TAG,
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_VALUE, null );
@@ -347,7 +349,7 @@
// vals SET OF AttributeValue }
// AttributeValue ::= OCTET STRING (Tag)
// This is a loop, when dealing with multi-valued attributes
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG][0x04] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG][UniversalTag.OCTET_STRING_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG,
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_VALUE, null );
@@ -357,7 +359,7 @@
// vals SET OF AttributeValue }
// AttributeValue ::= OCTET STRING (Value)
// Store a new attribute value.
- super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_VALUE][0x04] =
+ super.transitions[LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_VALUE][UniversalTag.OCTET_STRING_TAG] =
new GrammarTransition(
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_VALUE,
LdapStatesEnum.MODIFY_REQUEST_ATTRIBUTE_VALUE_OR_MODIFICATION_TAG,
Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java?rev=226894&r1=226893&r2=226894&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java (original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/SearchRequestGrammar.java Mon Aug 1 15:07:35 2005
@@ -23,6 +23,7 @@
import org.apache.asn1.ber.grammar.GrammarTransition;
import org.apache.asn1.ber.grammar.IGrammar;
import org.apache.asn1.ber.tlv.TLV;
+import org.apache.asn1.ber.tlv.UniversalTag;
import org.apache.asn1.ber.tlv.Value;
import org.apache.asn1.ldap.codec.LdapConstants;
import org.apache.asn1.ldap.codec.LdapMessageContainer;
@@ -76,13 +77,13 @@
// SearchRequest ::= [APPLICATION 3] SEQUENCE { (Tag)
// ...
// Nothing to do
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_TAG][0x63] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_TAG][LdapConstants.SEARCH_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_TAG, LdapStatesEnum.SEARCH_REQUEST_VALUE, null );
// LdapMessage ::= ... SearchRequest ...
// SearchRequest ::= [APPLICATION 3] SEQUENCE { ... (Value)
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_VALUE][0x63] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_VALUE][LdapConstants.SEARCH_REQUEST_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_VALUE, LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_TAG,
new GrammarAction( "Init SearchRequest" )
{
@@ -104,7 +105,7 @@
// baseObject LDAPDN, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_TAG, LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_VALUE,
null);
@@ -112,7 +113,7 @@
// baseObject LDAPDN, (Value)
// ...
// We have a value for the base object, we will store it in the message
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_VALUE][0x04] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_VALUE][UniversalTag.OCTET_STRING_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_BASE_OBJECT_VALUE,
LdapStatesEnum.SEARCH_REQUEST_SCOPE_TAG,
new GrammarAction( "store base object value" )
@@ -162,7 +163,7 @@
// wholeSubtree (2) }, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_SCOPE_TAG][0x0A] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_SCOPE_TAG][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_SCOPE_TAG, LdapStatesEnum.SEARCH_REQUEST_SCOPE_VALUE,
null);
@@ -174,7 +175,7 @@
// wholeSubtree (2) }, (Value)
// ...
// We have a value for the scope, we will store it in the message
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_SCOPE_VALUE][0x0A] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_SCOPE_VALUE][UniversalTag.ENUMERATED_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_SCOPE_VALUE,
LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_TAG,
new GrammarAction( "store scope value" )
@@ -210,7 +211,7 @@
// derefAlways (3) }, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_TAG][0x0A] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_TAG][UniversalTag.ENUMERATED_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_TAG, LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_VALUE,
null);
@@ -223,7 +224,7 @@
// derefAlways (3) }, (Value)
// ...
// We have a value for the derefAliases, we will store it in the message
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_VALUE][0x0A] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_VALUE][UniversalTag.ENUMERATED_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_DEREF_ALIASES_VALUE,
LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_TAG,
new GrammarAction( "store derefAliases value" )
@@ -255,7 +256,7 @@
// sizeLimit INTEGER (0 .. maxInt), (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_TAG][0x02] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_TAG][UniversalTag.INTEGER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_TAG, LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_VALUE,
null);
@@ -264,7 +265,7 @@
// sizeLimit INTEGER (0 .. maxInt), (Value)
// ...
// We have a value for the sizeLimit, we will store it in the message
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_VALUE][0x02] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_VALUE][UniversalTag.INTEGER_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_SIZE_LIMIT_VALUE,
LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_TAG,
new GrammarAction( "store sizeLimit value" )
@@ -297,7 +298,7 @@
// timeLimit INTEGER (0 .. maxInt), (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_TAG][0x02] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_TAG][UniversalTag.INTEGER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_TAG, LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_VALUE,
null);
@@ -306,7 +307,7 @@
// timeLimit INTEGER (0 .. maxInt), (Value)
// ...
// We have a value for the timeLimit, we will store it in the message
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_VALUE][0x02] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_VALUE][UniversalTag.INTEGER_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_TIME_LIMIT_VALUE,
LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_TAG,
new GrammarAction( "store timeLimit value" )
@@ -339,7 +340,7 @@
// typesOnly BOOLEAN, (Tag)
// ...
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_TAG][0x01] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_TAG][UniversalTag.BOOLEAN_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_TAG, LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_VALUE,
null);
@@ -350,7 +351,7 @@
// We have a value for the typesOnly, we will store it in the message.
// The next transition will deal with the Filter. As a filter could contains
// sub-filter, we will initialize the filter Object right here.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_VALUE][0x01] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_VALUE][UniversalTag.BOOLEAN_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_TYPES_ONLY_VALUE,
LdapStatesEnum.SEARCH_REQUEST_FILTER,
new GrammarAction( "store typesOnly value" )
@@ -407,7 +408,7 @@
// and [0] SET OF Filter,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA0] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.AND_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -419,7 +420,7 @@
// or [0] SET OF Filter,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA1] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.OR_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -431,7 +432,7 @@
// not [2] Filter,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA2] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.NOT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -443,7 +444,7 @@
// equalityMatch [3] AttributeValueAssertion,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA3] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.EQUALITY_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -455,7 +456,7 @@
// substrings [4] SubstringFilter,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA4] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.SUBSTRINGS_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -467,7 +468,7 @@
// greaterOrEqual [5] AttributeValueAssertion,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA5] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.GREATER_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -479,7 +480,7 @@
// lessOrEqual [6] AttributeValueAssertion,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA6] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.LESS_OR_EQUAL_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -491,7 +492,7 @@
// present [7] AttributeDescription,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0x87] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.PRESENT_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -503,7 +504,7 @@
// approxMatch [8] AttributeValueAssertion,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA8] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.APPROX_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -515,7 +516,7 @@
// extensibleMatch [9] MatchingRuleAssertion,
// ...
// We have to switch to the Filter grammar
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0xA9] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][LdapConstants.EXTENSIBLE_MATCH_FILTER_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.FILTER_GRAMMAR_SWITCH,
null );
@@ -525,7 +526,7 @@
// AttributeDescriptionList ::= SEQUENCE OF AttributeDescription (Tag)
// ...
// We have to check that the filter has been created.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][0x30] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_FILTER][UniversalTag.SEQUENCE_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_FILTER, LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_LIST_VALUE,
null);
@@ -536,7 +537,7 @@
// We have to create an array of elements to store the list of attributes
// to retrieve. We don't know yet how many attributes we will read so we
// will allocate an ArrayList.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_LIST_VALUE][0x30] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_LIST_VALUE][UniversalTag.SEQUENCE_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_LIST_VALUE,
LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_TAG,
new GrammarAction( "store Attribute Description List value" )
@@ -558,7 +559,7 @@
// AttributeDescription ::= LDAPString
// Nothing to do.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_TAG][0x04] = new GrammarTransition(
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_TAG][UniversalTag.OCTET_STRING_TAG] = new GrammarTransition(
LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_TAG, LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_VALUE,
null);
@@ -568,7 +569,7 @@
// ...
// We have to create an array of elements to store the list of attributes
// to retrieve. We don't know yet how many attributes we will read.
- super.transitions[LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_VALUE][0x04] =
+ super.transitions[LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_VALUE][UniversalTag.OCTET_STRING_TAG] =
new GrammarTransition( LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_VALUE,
LdapStatesEnum.SEARCH_REQUEST_ATTRIBUTE_DESCRIPTION_TAG,
new GrammarAction( "store Attribute Description value" )