directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r164347 - in /directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars: BindRequestGrammar.java BindResponseGrammar.java LdapControlGrammar.java LdapMessageGrammar.java LdapResultGrammar.java
Date Sat, 23 Apr 2005 06:44:23 GMT
Author: elecharny
Date: Fri Apr 22 23:44:22 2005
New Revision: 164347

URL: http://svn.apache.org/viewcvs?rev=164347&view=rev
Log:
Added the reference to the LdapStatesEnum class. 

Modified:
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
    directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.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/LdapResultGrammar.java

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java?rev=164347&r1=164346&r2=164347&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindRequestGrammar.java
Fri Apr 22 23:44:22 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.asn1.ldap.codec.grammars;
 
+import org.apache.asn1.DecoderException;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ber.grammar.AbstractGrammar;
 import org.apache.asn1.ber.grammar.GrammarAction;
@@ -24,7 +25,6 @@
 import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
-import org.apache.asn1.ldap.codec.DecoderException;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.codec.primitives.LdapDN;
 import org.apache.asn1.ldap.codec.primitives.LdapString;
@@ -82,6 +82,8 @@
     {
 
         name = BindRequestGrammar.class.getName();
+        
+        statesEnum = LdapStatesEnum.getInstance();
 
         // We have 17 differents states, so 16 transitions between states.
         super.transitions = new GrammarTransition[StatesEnum.LAST_BIND_REQUEST_STATE][256];
@@ -178,8 +180,8 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        BindRequestPOJO      bindRequestMessage   = ( BindRequestPOJO )
-                            ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO      bindRequestMessage   = 
+                            ldapMessageContainer.getLdapMessage().getBindRequest();
 
                         // The current TLV should be a integer between 1 and 127
                         // We get it and store it in Version
@@ -211,8 +213,8 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        BindRequestPOJO bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
                         
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
@@ -242,8 +244,8 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        BindRequestPOJO bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
 
                         // Get the Value and store it in the BindRequest
                         TLV             tlv                = ldapMessageContainer.getCurrentTLV();
@@ -279,8 +281,8 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        BindRequestPOJO bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
                         
                         TLV             tlv                = ldapMessageContainer.getCurrentTLV();
 
@@ -331,10 +333,10 @@
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
                         
-                        BindRequestPOJO bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
                         
-                        SimpleAuthenticationPOJO simpleAuthentication = (SimpleAuthenticationPOJO)bindRequestMessage.getAuthentication();
+                        SimpleAuthenticationPOJO simpleAuthentication = bindRequestMessage.getSimpleAuthentication();
 
                         TLV           tlv    = ldapMessageContainer.getCurrentTLV();
 
@@ -378,8 +380,8 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        BindRequestPOJO bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
 
                         TLV           tlv    = ldapMessageContainer.getCurrentTLV();
                         
@@ -432,10 +434,10 @@
                         LdapMessageContainer   ldapMessageContainer = ( LdapMessageContainer
)
                             container;
 
-                        BindRequestPOJO        bindRequestMessage = ( BindRequestPOJO )
-                            ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO        bindRequestMessage = 
+                            ldapMessageContainer.getLdapMessage().getBindRequest();
                         
-                        SaslAuthenticationPOJO saslAuthentication = (SaslAuthenticationPOJO)bindRequestMessage.getAuthentication();
+                        SaslAuthenticationPOJO saslAuthentication = bindRequestMessage.getSaslAuthentication();
 
                         MutableString mechanism = LdapString.parse(
                                 ldapMessageContainer.getPoolManager(),
@@ -483,8 +485,8 @@
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
                         
-                        BindRequestPOJO        bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO        bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
 
                         TLV           tlv    = ldapMessageContainer.getCurrentTLV();
                         
@@ -493,8 +495,8 @@
                         // We have to handle the special case of a 0 length credentials
                         if (tlv.getLength().getLength() == 0)
                         {
-                            SaslAuthenticationPOJO saslAuthentication = ( SaslAuthenticationPOJO
) ( bindRequestMessage
-                                .getAuthentication() );
+                            SaslAuthenticationPOJO saslAuthentication = bindRequestMessage
+                                .getSaslAuthentication();
 
                             saslAuthentication.setCredentials( new byte[]{} );
                         }
@@ -524,11 +526,11 @@
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
 
-                        BindRequestPOJO        bindRequestMessage = ( BindRequestPOJO )
-                        ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindRequestPOJO        bindRequestMessage = 
+                        ldapMessageContainer.getLdapMessage().getBindRequest();
                         
-                        SaslAuthenticationPOJO saslAuthentication = ( SaslAuthenticationPOJO
) ( bindRequestMessage
-                                .getAuthentication() );
+                        SaslAuthenticationPOJO saslAuthentication = bindRequestMessage
+                                .getSaslAuthentication();
 
                         // Get the Value and store it in the BindRequest
                         TLV           tlv         = ldapMessageContainer.getCurrentTLV();

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java?rev=164347&r1=164346&r2=164347&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/BindResponseGrammar.java
Fri Apr 22 23:44:22 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.asn1.ldap.codec.grammars;
 
+import org.apache.asn1.DecoderException;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ber.grammar.AbstractGrammar;
 import org.apache.asn1.ber.grammar.GrammarAction;
@@ -23,7 +24,6 @@
 import org.apache.asn1.ber.grammar.IGrammar;
 import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
-import org.apache.asn1.ldap.codec.DecoderException;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.pojo.BindResponsePOJO;
 import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
@@ -62,6 +62,7 @@
     private BindResponseGrammar()
     {
         name = BindResponseGrammar.class.getName();
+        statesEnum = LdapStatesEnum.getInstance();
 
         // We have 17 differents states, so 16 transitions between states.
         super.transitions = new GrammarTransition[StatesEnum.LAST_LDAP_STATE][256];
@@ -162,8 +163,8 @@
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
 
-                        BindResponsePOJO     bindResponseMessage = ( BindResponsePOJO )
-                            ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindResponsePOJO     bindResponseMessage = 
+                            ldapMessageContainer.getLdapMessage().getBindResponse();
 
                         TLV                  tlv = ldapMessageContainer.getCurrentTLV();
 
@@ -200,8 +201,8 @@
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
 
-                        BindResponsePOJO     bindResponseMessage = ( BindResponsePOJO )
-                            ldapMessageContainer.getLdapMessage().getProtocolOp();
+                        BindResponsePOJO     bindResponseMessage = 
+                            ldapMessageContainer.getLdapMessage().getBindResponse();
 
                         // Get the Value and store it in the BindRequest
                         TLV tlv = ldapMessageContainer.getCurrentTLV();

Modified: directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java
URL: http://svn.apache.org/viewcvs/directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java?rev=164347&r1=164346&r2=164347&view=diff
==============================================================================
--- directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java
(original)
+++ directory/sandbox/trunk/asn1-new-codec/src/java/org/apache/asn1/ldap/codec/grammars/LdapControlGrammar.java
Fri Apr 22 23:44:22 2005
@@ -62,6 +62,7 @@
     private LdapControlGrammar()
     {
         name = LdapControlGrammar.class.getName();
+        statesEnum = LdapStatesEnum.getInstance();
 
         super.transitions = new GrammarTransition[StatesEnum.CONTROL_LAST_STATE][256];
 

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=164347&r1=164346&r2=164347&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
Fri Apr 22 23:44:22 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.asn1.ldap.codec.grammars;
 
+import org.apache.asn1.DecoderException;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ber.grammar.AbstractGrammar;
 import org.apache.asn1.ber.grammar.GrammarAction;
@@ -24,7 +25,6 @@
 import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
-import org.apache.asn1.ldap.codec.DecoderException;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.codec.utils.IntegerDecoder;
 import org.apache.asn1.ldap.pojo.LdapMessagePOJO;
@@ -73,6 +73,7 @@
     {
 
         name = LdapMessageGrammar.class.getName();
+        statesEnum = LdapStatesEnum.getInstance();
 
         // We have 9 differents states, so 8 transitions between states.
         super.transitions = new GrammarTransition[StatesEnum.LAST_LDAP_MESSAGE_STATE][256];

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=164347&r1=164346&r2=164347&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
Fri Apr 22 23:44:22 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.asn1.ldap.codec.grammars;
 
+import org.apache.asn1.DecoderException;
 import org.apache.asn1.ber.containers.IAsn1Container;
 import org.apache.asn1.ber.grammar.AbstractGrammar;
 import org.apache.asn1.ber.grammar.GrammarAction;
@@ -24,7 +25,6 @@
 import org.apache.asn1.ber.grammar.StatesEnum;
 import org.apache.asn1.ber.tlv.TLV;
 import org.apache.asn1.ber.tlv.Value;
-import org.apache.asn1.ldap.codec.DecoderException;
 import org.apache.asn1.ldap.codec.LdapMessageContainer;
 import org.apache.asn1.ldap.codec.primitives.LdapDN;
 import org.apache.asn1.ldap.codec.primitives.LdapString;
@@ -69,6 +69,7 @@
     private LdapResultGrammar()
     {
         name              = LdapResultGrammar.class.getName();
+        statesEnum = LdapStatesEnum.getInstance();
 
         super.transitions = new GrammarTransition[StatesEnum.LDAP_RESULT_LAST_STATE][256];
 
@@ -95,10 +96,9 @@
                         // We have to store the expected Length of the PDU
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
 
                         // We have to allocate a LdapResultPOJO now
                         LdapResultPOJO ldapResult = null;
@@ -189,10 +189,8 @@
                             container;
                         LdapMessagePOJO      ldapMessage          =
                             ldapMessageContainer.getLdapMessage();
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         // We don't have to allocate a LdapResultPOJO first.
 
@@ -277,20 +275,18 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
 
                         checkLength( bindResponse, tlv );
-                        
+
                         // We have to handle the special case of a 0 length matched DN
-                        if (tlv.getLength().getLength() == 0)
+                        if ( tlv.getLength().getLength() == 0 )
                         {
                             ldapResult.setMatchedDN( MutableString.EMPTY_STRING );
                         }
@@ -310,12 +306,10 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         // Get the Value and store it in the BindResponse
                         TLV           tlv       = ldapMessageContainer.getCurrentTLV();
@@ -349,20 +343,18 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
 
                         checkLength( bindResponse, tlv );
-                        
+
                         // We have to handle the special case of a 0 length error message
-                        if (tlv.getLength().getLength() == 0)
+                        if ( tlv.getLength().getLength() == 0 )
                         {
                             ldapResult.setErrorMessage( MutableString.EMPTY_STRING );
                         }
@@ -383,12 +375,10 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         // Get the Value and store it in the BindResponse
                         TLV           tlv          = ldapMessageContainer.getCurrentTLV();
@@ -450,12 +440,10 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
@@ -475,7 +463,7 @@
         // 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[StatesEnum.LDAP_RESULT_REFERRAL_TAG][0x04]    = new GrammarTransition(
+        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_TAG][0x04] = new GrammarTransition(
                 StatesEnum.LDAP_RESULT_REFERRAL_TAG, StatesEnum.LDAP_RESULT_REFERRAL_LENGTH,
null );
 
         // Referral ::= SEQUENCE OF LDAPURL (Length)
@@ -490,12 +478,10 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
@@ -503,13 +489,13 @@
                         checkLength( ldapResult, tlv );
 
                         // We have to handle the special case of a 0 length referral
-                        if (tlv.getLength().getLength() == 0)
+                        if ( tlv.getLength().getLength() == 0 )
                         {
                             ldapResult.addReferral( MutableString.EMPTY_STRING );
                         }
                     }
                 } );
-        
+
         // Referral ::= SEQUENCE OF LDAPURL (Length)
         // We may have other referrals, but wa may also have finished to read the LdapResult.
         // To handle those different cases, we have to transit to a special state, which
@@ -524,50 +510,45 @@
 
                         LdapMessageContainer ldapMessageContainer = ( LdapMessageContainer
)
                             container;
-                        LdapMessagePOJO      ldapMessage          = ( LdapMessagePOJO )
-                            ( ldapMessageContainer.getLdapMessage() );
-                        BindResponsePOJO     bindResponse         = ( BindResponsePOJO )
-                            ( ldapMessage.getProtocolOp() );
-                        LdapResultPOJO       ldapResult           = ( LdapResultPOJO )
-                            ( bindResponse.getLdapResult() );
+                        LdapMessagePOJO      ldapMessage          =
+                            ldapMessageContainer.getLdapMessage();
+                        BindResponsePOJO     bindResponse         = ldapMessage.getBindResponse();
+                        LdapResultPOJO       ldapResult           = bindResponse.getLdapResult();
 
                         TLV                  tlv                  =
                             ldapMessageContainer.getCurrentTLV();
 
-                        MutableString referral = LdapString.parse(
+                        MutableString        referral = LdapString.parse(
                                 ldapMessageContainer.getPoolManager(), tlv.getValue().getData()
);
                         ldapResult.addReferral( referral );
                     }
                 } );
 
         // Referral ::= SEQUENCE OF LDAPURL (Tag)
-        // We may have another referral, but we could also have something else : 
+        // We may have another referral, but we could also have something else :
         //  - 0x04 : a referral, in a LdapResult.
         //  - 0x80 : a control, like in SearchResultDone, ModifyResponse, AddResponse, DelResponse,
ModifyDNResponse, CompareResponse
         //  - 0x87 : a serverSaslCreds, in a BindResponse
         //  - 0x8A : an extended response
         //  - GRAMMAR_END : this is implicitly deducted by the fact that we don't have anymore
byte...
         // Those different cases are handled here.
-        
+
         // This is a referral. We have to transit to its Length state
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x04] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
+        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x04] = new GrammarTransition(
+                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
                 StatesEnum.LDAP_RESULT_REFERRAL_SEQUENCE_LENGTH, null );
 
         // This is a control. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x80] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x80] = new GrammarTransition(
+                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, StatesEnum.GRAMMAR_END, null );
 
         // This is a serverSaslCreds. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x87] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x87] = new GrammarTransition(
+                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, StatesEnum.GRAMMAR_END, null );
 
         // This is a extended response. We have to quit the LdapResult grammar
-        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x8A] =
-            new GrammarTransition( StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG,
-                StatesEnum.GRAMMAR_END, null );
+        super.transitions[StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG][0x8A] = new GrammarTransition(
+                StatesEnum.LDAP_RESULT_REFERRAL_LOOP_TAG, StatesEnum.GRAMMAR_END, null );
 
     }
 



Mime
View raw message