directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r226619 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars: AddResponseGrammar.java LdapResultGrammar.java
Date Sun, 31 Jul 2005 08:09:36 GMT
Author: elecharny
Date: Sun Jul 31 01:09:33 2005
New Revision: 226619

URL: http://svn.apache.org/viewcvs?rev=226619&view=rev
Log:
Substituted constant values by literral constants

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/AddResponseGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/AddResponseGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/AddResponseGrammar.java?rev=226619&r1=226618&r2=226619&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/AddResponseGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/AddResponseGrammar.java
Sun Jul 31 01:09:33 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.ldap.codec.LdapConstants;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.pojo.AddResponse;
 import org.apache.asn1.ldap.pojo.LdapMessage;
@@ -68,14 +69,14 @@
         // LdapMessage ::= ... AddResponse ...
         // AddResponse ::= [APPLICATION 9] LDAPResult (Tag)
         // Nothing to do.
-        super.transitions[LdapStatesEnum.ADD_RESPONSE_TAG][0x69] = new GrammarTransition(
+        super.transitions[LdapStatesEnum.ADD_RESPONSE_TAG][LdapConstants.ADD_RESPONSE_TAG]
= new GrammarTransition(
                 LdapStatesEnum.ADD_RESPONSE_TAG, LdapStatesEnum.ADD_RESPONSE_VALUE, null
);
 
         // LdapMessage ::= ... AddResponse ...
         // AddResponse ::= [APPLICATION 9] LDAPResult (Value)
         // The next Tag will be the LDAPResult Tag (0x0A).
         // We will switch the grammar then.
-        super.transitions[LdapStatesEnum.ADD_RESPONSE_VALUE][0x69] = new GrammarTransition(
+        super.transitions[LdapStatesEnum.ADD_RESPONSE_VALUE][LdapConstants.ADD_RESPONSE_TAG]
= new GrammarTransition(
                 LdapStatesEnum.ADD_RESPONSE_VALUE, LdapStatesEnum.ADD_RESPONSE_LDAP_RESULT,

                 new GrammarAction( "Init AddResponse" )
                 {
@@ -105,7 +106,7 @@
         // LdapMessage ::= ... AddResponse ...
         // AddResponse ::= [APPLICATION 9] LDAPResult (Value)
         // Ok, we have a LDAPResult Tag (0x0A). So we have to switch the grammar.
-        super.transitions[LdapStatesEnum.ADD_RESPONSE_LDAP_RESULT][0x0A] = new GrammarTransition(
+        super.transitions[LdapStatesEnum.ADD_RESPONSE_LDAP_RESULT][LdapConstants.ENUMERATED_TAG]
= new GrammarTransition(
                 LdapStatesEnum.ADD_RESPONSE_LDAP_RESULT, LdapStatesEnum.LDAP_RESULT_GRAMMAR_SWITCH,
null );
     }
 

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java?rev=226619&r1=226618&r2=226619&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapResultGrammar.java
Sun Jul 31 01:09:33 2005
@@ -24,6 +24,7 @@
 import org.apache.asn1.ber.grammar.IGrammar;
 import org.apache.asn1.ber.tlv.TLV;
 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.primitives.LdapDN;
 import org.apache.asn1.ldap.codec.primitives.LdapString;
@@ -77,7 +78,7 @@
         //    resultCode    ENUMERATED { ... (Tag)
         // We have a LDAPResult, and the tag may be 0x0A
         // Nothing to do
-        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_TAG][0x0A] = new GrammarTransition(
+        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_TAG][LdapConstants.ENUMERATED_TAG]
= new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_CODE_TAG, LdapStatesEnum.LDAP_RESULT_CODE_VALUE,
null );
 
         // LDAPResult --> SEQUENCE {
@@ -131,7 +132,7 @@
         //  other                        (80) },
         //  -- 81-90 reserved for APIs --
         //
-        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_VALUE][0x0A] = new GrammarTransition(
+        super.transitions[LdapStatesEnum.LDAP_RESULT_CODE_VALUE][LdapConstants.ENUMERATED_TAG]
= new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_CODE_VALUE, LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG,
                 new GrammarAction( "Store resultCode" )
                 {
@@ -212,7 +213,7 @@
         //    ...
         //    matchedDN   LDAPDN, (Tag)
         // The tag is 0x04. Nothing to do
-        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG][0x04] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG][LdapConstants.OCTET_STRING_TAG]
=
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_MATCHED_DN_TAG,
                 LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE, null );
@@ -221,7 +222,7 @@
         //    ...
         //    matchedDN   LDAPDN, (Value)
         // We store the LDAPDN after having checked that it is valid.
-        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE][0x04] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE][LdapConstants.OCTET_STRING_TAG]
=
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_MATCHED_DN_VALUE,
                 LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
@@ -258,7 +259,7 @@
         //    ...
         //    errorMessage   LDAPString, (Tag)
         // The tag is 0x04. Nothing to do
-        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG][0x04] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG][LdapConstants.OCTET_STRING_TAG]
=
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_TAG,
                 LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE, null );
@@ -267,7 +268,7 @@
         //    ...
         //    errorMessage   LDAPString, (Value)
         // Stores the value.
-        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][0x04] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][LdapConstants.OCTET_STRING_TAG]
=
             new GrammarTransition( LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
                 new GrammarAction( "Store Ldap Result error message" )
@@ -315,19 +316,19 @@
         // As referral is optionnal, we may transoit from a error message state
 
         // This is a referral.
-        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][0x83] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG]
=
             new GrammarTransition( LdapStatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_TAG,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG, null );
 
         // In case we are coming from a error message state
-        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][0x83] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE][LdapConstants.LDAP_RESULT_REFERRAL_SEQUENCE_TAG]
=
             new GrammarTransition( LdapStatesEnum.LDAP_RESULT_ERROR_MESSAGE_VALUE,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG, null );
 
         // Referral ::= SEQUENCE OF LDAPURL (Tag)
         // This is a SEQUENCE, we will have at least one referral, but may be many.
         // As this is the tag, we don't have anything to do.
-        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG][0x04] = new GrammarTransition(
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG][LdapConstants.OCTET_STRING_TAG]
= new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_TAG,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE, null );
 
@@ -336,7 +337,7 @@
         // To handle those different cases, we have to transit to a special state, which
         // will do this brancing.
         // Here, we store the referral in the ldapResult.
-        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE][0x04] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE][LdapConstants.OCTET_STRING_TAG]
=
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
@@ -373,7 +374,7 @@
         // Those different cases are handled here.
 
         // This is a referral. We have to transit to its Length state
-        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x04] =
+        super.transitions[LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][LdapConstants.OCTET_STRING_TAG]
=
             new GrammarTransition(
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
                 LdapStatesEnum.LDAP_RESULT_REFERRAL_VALUE, null );



Mime
View raw message