directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1069014 - in /directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec: ./ actions/addRequest/ actions/addResponse/ actions/bindRequest/ actions/compareRequest/ actions/compareResponse/ actions/delRespon...
Date Wed, 09 Feb 2011 18:23:00 GMT
Author: elecharny
Date: Wed Feb  9 18:22:59 2011
New Revision: 1069014

URL: http://svn.apache.org/viewvc?rev=1069014&view=rev
Log:
o Moved some more actions
o Fixed some Javadoc

Added:
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/InitCompareRequest.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAssertionValue.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAttributeDesc.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestEntryName.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareResponse/
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareResponse/InitCompareResponse.java
Modified:
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/AddAddRequestAttributeType.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/InitAddRequest.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/StoreAddRequestEntryName.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addResponse/InitAddResponse.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreName.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslCredentials.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslMechanism.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSimpleAuth.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreVersion.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/delResponse/InitDelResponse.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/InitModifyDnRequest.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestDeleteOldRdn.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestEntryName.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewRdn.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewSuperior.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnResponse/InitModifyDnResponse.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/AddModifyRequestAttribute.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitAttributeVals.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitModifyRequest.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreModifyRequestObjectName.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreOperationType.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyResponse/InitModifyResponse.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/AddAttributeType.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/StoreSearchResultEntryObjectName.java
    directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/unbindRequest/InitUnbindRequest.java

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageGrammar.java Wed Feb  9 18:22:59 2011
@@ -83,6 +83,11 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.actions.bindRequest.StoreVersion;
 import org.apache.directory.shared.ldap.codec.actions.bindResponse.InitBindResponse;
 import org.apache.directory.shared.ldap.codec.actions.bindResponse.StoreServerSASLCreds;
+import org.apache.directory.shared.ldap.codec.actions.compareRequest.InitCompareRequest;
+import org.apache.directory.shared.ldap.codec.actions.compareRequest.StoreCompareRequestAssertionValue;
+import org.apache.directory.shared.ldap.codec.actions.compareRequest.StoreCompareRequestAttributeDesc;
+import org.apache.directory.shared.ldap.codec.actions.compareRequest.StoreCompareRequestEntryName;
+import org.apache.directory.shared.ldap.codec.actions.compareResponse.InitCompareResponse;
 import org.apache.directory.shared.ldap.codec.actions.controls.InitControls;
 import org.apache.directory.shared.ldap.codec.actions.delRequest.InitDelRequest;
 import org.apache.directory.shared.ldap.codec.actions.delResponse.InitDelResponse;
@@ -112,8 +117,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.codec.actions.unbindRequest.InitUnbindRequest;
 import org.apache.directory.shared.ldap.codec.api.LdapConstants;
 import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
-import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
-import org.apache.directory.shared.ldap.codec.decorators.CompareResponseDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedRequestDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.ExtendedResponseDecorator;
 import org.apache.directory.shared.ldap.codec.decorators.IntermediateResponseDecorator;
@@ -125,9 +128,6 @@ import org.apache.directory.shared.ldap.
 import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
 import org.apache.directory.shared.ldap.model.filter.SearchScope;
 import org.apache.directory.shared.ldap.model.message.AliasDerefMode;
-import org.apache.directory.shared.ldap.model.message.CompareRequest;
-import org.apache.directory.shared.ldap.model.message.CompareRequestImpl;
-import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
 import org.apache.directory.shared.ldap.model.message.Control;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequest;
 import org.apache.directory.shared.ldap.model.message.ExtendedRequestImpl;
@@ -1654,20 +1654,12 @@ public final class LdapMessageGrammar<E>
         // ...
         //
         // Initialize the Compare Request object
-        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapConstants.COMPARE_REQUEST_TAG] = new GrammarTransition(
-            LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.COMPARE_REQUEST_STATE, LdapConstants.COMPARE_REQUEST_TAG,
-            new GrammarAction<LdapMessageContainer<CompareRequestDecorator>>( "Init Compare Request" )
-            {
-                public void action( LdapMessageContainer<CompareRequestDecorator> container )
-                {
-                    // Now, we can allocate the CompareRequest Object
-                    CompareRequestDecorator compareRequest = new CompareRequestDecorator(
-                        container.getLdapCodecService(), new CompareRequestImpl( container.getMessageId() ) );
-                    container.setMessage( compareRequest );
-
-                    LOG.debug( "Compare Request" );
-                }
-            } );
+        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapConstants.COMPARE_REQUEST_TAG] =
+            new GrammarTransition(
+                LdapStatesEnum.MESSAGE_ID_STATE,
+                LdapStatesEnum.COMPARE_REQUEST_STATE,
+                LdapConstants.COMPARE_REQUEST_TAG,
+                new InitCompareRequest() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from CompareResquest to entryComp
@@ -1677,54 +1669,12 @@ public final class LdapMessageGrammar<E>
         //     ...
         //
         // Stores the compared Dn
-        super.transitions[LdapStatesEnum.COMPARE_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] = new GrammarTransition(
-            LdapStatesEnum.COMPARE_REQUEST_STATE, LdapStatesEnum.ENTRY_COMP_STATE, OCTET_STRING,
-            new GrammarAction<LdapMessageContainer<CompareRequestDecorator>>( "Store entry" )
-            {
-                public void action( LdapMessageContainer<CompareRequestDecorator> container ) throws DecoderException
-                {
-                    CompareRequest compareRequest = container.getMessage();
-
-                    // Get the Value and store it in the CompareRequest
-                    TLV tlv = container.getCurrentTLV();
-                    Dn entry = null;
-
-                    // We have to handle the special case of a 0 length matched
-                    // Dn
-                    if ( tlv.getLength() == 0 )
-                    {
-                        // This will generate a PROTOCOL_ERROR
-                        throw new DecoderException( I18n.err( I18n.ERR_04089 ) );
-                    }
-                    else
-                    {
-                        byte[] dnBytes = tlv.getValue().getData();
-                        String dnStr = Strings.utf8ToString(dnBytes);
-
-                        try
-                        {
-                            entry = new Dn( dnStr );
-                        }
-                        catch ( LdapInvalidDnException ine )
-                        {
-                            String msg = "Invalid Dn given : " + dnStr + " (" + Strings.dumpBytes(dnBytes)
-                                + ") is invalid";
-                            LOG.error( "{} : {}", msg, ine.getMessage() );
-
-                            CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() );
-                            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
-                                Dn.EMPTY_DN, ine );
-                        }
-
-                        compareRequest.setName( entry );
-                    }
-
-                    if ( IS_DEBUG )
-                    {
-                        LOG.debug( "Comparing Dn {}", entry );
-                    }
-                }
-            } );
+        super.transitions[LdapStatesEnum.COMPARE_REQUEST_STATE.ordinal()][OCTET_STRING.getValue()] =
+            new GrammarTransition(
+                LdapStatesEnum.COMPARE_REQUEST_STATE,
+                LdapStatesEnum.ENTRY_COMP_STATE,
+                OCTET_STRING,
+                new StoreCompareRequestEntryName() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from entryComp to ava
@@ -1752,39 +1702,12 @@ public final class LdapMessageGrammar<E>
         // AttributeDescription LDAPString
         //
         // Stores the attribute description
-        super.transitions[LdapStatesEnum.AVA_STATE.ordinal()][OCTET_STRING.getValue()] = new GrammarTransition(
-            LdapStatesEnum.AVA_STATE, LdapStatesEnum.ATTRIBUTE_DESC_STATE, OCTET_STRING,
-            new GrammarAction<LdapMessageContainer<CompareRequestDecorator>>( "Store attribute desc" )
-            {
-                public void action( LdapMessageContainer<CompareRequestDecorator> container ) throws DecoderException
-                {
-                    // Get the CompareRequest Object
-                    CompareRequest compareRequest = container.getMessage();
-
-                    // Get the Value and store it in the CompareRequest
-                    TLV tlv = container.getCurrentTLV();
-
-                    // We have to handle the special case of a 0 length matched
-                    // Dn
-                    if ( tlv.getLength() == 0 )
-                    {
-                        String msg = I18n.err( I18n.ERR_04093 );
-                        LOG.error( msg );
-                        CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() );
-
-                        throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
-                            compareRequest.getName(), null );
-                    }
-
-                    String type = Strings.utf8ToString( tlv.getValue().getData() );
-                    compareRequest.setAttributeId( type );
-
-                    if ( IS_DEBUG )
-                    {
-                        LOG.debug( "Comparing attribute description {}", compareRequest.getAttributeId() );
-                    }
-                }
-            } );
+        super.transitions[LdapStatesEnum.AVA_STATE.ordinal()][OCTET_STRING.getValue()] =
+            new GrammarTransition(
+                LdapStatesEnum.AVA_STATE,
+                LdapStatesEnum.ATTRIBUTE_DESC_STATE,
+                OCTET_STRING,
+                new StoreCompareRequestAttributeDesc() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from AttributeDesc to Assertion Value
@@ -1796,50 +1719,12 @@ public final class LdapMessageGrammar<E>
         // AssertionValue OCTET STRING
         //
         // Stores the attribute value
-        super.transitions[LdapStatesEnum.ATTRIBUTE_DESC_STATE.ordinal()][OCTET_STRING.getValue()] = new GrammarTransition(
-            LdapStatesEnum.ATTRIBUTE_DESC_STATE, LdapStatesEnum.ASSERTION_VALUE_STATE, OCTET_STRING,
-            new GrammarAction<LdapMessageContainer<CompareRequestDecorator>>( "Store assertion value" )
-            {
-                public void action( LdapMessageContainer<CompareRequestDecorator> container )
-                {
-                    // Get the CompareRequest Object
-                    CompareRequest compareRequest = container.getMessage();
-
-                    // Get the Value and store it in the CompareRequest
-                    TLV tlv = container.getCurrentTLV();
-
-                    // We have to handle the special case of a 0 length value
-                    if ( tlv.getLength() == 0 )
-                    {
-                        compareRequest.setAssertionValue( "" );
-                    }
-                    else
-                    {
-                        if ( container.isBinary( compareRequest.getAttributeId() ) )
-                        {
-                            compareRequest.setAssertionValue( tlv.getValue().getData() );
-
-                            if ( IS_DEBUG )
-                            {
-                                LOG.debug( "Comparing attribute value {}", Strings.dumpBytes(compareRequest
-                                        .getAssertionValue().getBytes()) );
-                            }
-                        }
-                        else
-                        {
-                            compareRequest.setAssertionValue( Strings.utf8ToString(tlv.getValue().getData()) );
-
-                            if ( LOG.isDebugEnabled() )
-                            {
-                                LOG.debug( "Comparing attribute value {}", compareRequest.getAssertionValue() );
-                            }
-                        }
-                    }
-
-                    // We can have an END transition
-                    container.setGrammarEndAllowed( true );
-                }
-            } );
+        super.transitions[LdapStatesEnum.ATTRIBUTE_DESC_STATE.ordinal()][OCTET_STRING.getValue()] =
+            new GrammarTransition(
+                LdapStatesEnum.ATTRIBUTE_DESC_STATE,
+                LdapStatesEnum.ASSERTION_VALUE_STATE,
+                OCTET_STRING,
+                new StoreCompareRequestAssertionValue() );
 
         // --------------------------------------------------------------------------------------------
         // Transition from Assertion Value to Controls
@@ -1864,30 +1749,12 @@ public final class LdapMessageGrammar<E>
         // LdapMessage ::= ... CompareResponse ...
         // CompareResponse ::= [APPLICATION 15] LDAPResult
         // We have to switch to the CompareResponse grammar
-        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapConstants.COMPARE_RESPONSE_TAG] = new GrammarTransition(
-            LdapStatesEnum.MESSAGE_ID_STATE, LdapStatesEnum.COMPARE_RESPONSE_STATE, LdapConstants.COMPARE_RESPONSE_TAG,
-            new GrammarAction<LdapMessageContainer<CompareResponseDecorator>>( "Init CompareResponse" )
-            {
-                public void action( LdapMessageContainer<CompareResponseDecorator> container ) throws DecoderException
-                {
-                    // Now, we can allocate the CompareResponse Object
-                    CompareResponseDecorator compareResponse = new CompareResponseDecorator(
-                        container.getLdapCodecService(), new CompareResponseImpl( container.getMessageId() ) );
-                    container.setMessage( compareResponse );
-
-                    // We will check that the request is not null
-                    TLV tlv = container.getCurrentTLV();
-
-                    if ( tlv.getLength() == 0 )
-                    {
-                        String msg = I18n.err( I18n.ERR_04094 );
-                        LOG.error( msg );
-                        throw new DecoderException( msg );
-                    }
-
-                    LOG.debug( "Compare response " );
-                }
-            } );
+        super.transitions[LdapStatesEnum.MESSAGE_ID_STATE.ordinal()][LdapConstants.COMPARE_RESPONSE_TAG] =
+            new GrammarTransition(
+                LdapStatesEnum.MESSAGE_ID_STATE,
+                LdapStatesEnum.COMPARE_RESPONSE_STATE,
+                LdapConstants.COMPARE_RESPONSE_TAG,
+                new InitCompareResponse() );
 
         // --------------------------------------------------------------------------------------------
         // CompareResponse Message.

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/AddAddRequestAttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/AddAddRequestAttributeType.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/AddAddRequestAttributeType.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/AddAddRequestAttributeType.java Wed Feb  9 18:22:59 2011
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the AddRequest AttributeDescription
  * <pre>
  * AttributeList ::= SEQUENCE OF SEQUENCE {
  *     type    AttributeDescription,

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/InitAddRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/InitAddRequest.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/InitAddRequest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/InitAddRequest.java Wed Feb  9 18:22:59 2011
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the AddRequest response
  * <pre>
  * LdapMessage ::= ... AddRequest ...
  * AddRequest ::= [APPLICATION 8] SEQUENCE { ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/StoreAddRequestEntryName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/StoreAddRequestEntryName.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/StoreAddRequestEntryName.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addRequest/StoreAddRequestEntryName.java Wed Feb  9 18:22:59 2011
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the AddReqyuest entry name
  * <pre>
  * AddRequest ::= [APPLICATION 8] SEQUENCE {
  *     entry           LDAPDN,

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addResponse/InitAddResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addResponse/InitAddResponse.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addResponse/InitAddResponse.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/addResponse/InitAddResponse.java Wed Feb  9 18:22:59 2011
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the AddResponse response
  * <pre>
  * LdapMessage ::= ... AddResponse ...
  * AddResponse ::= [APPLICATION 9] SEQUENCE { ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreName.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreName.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreName.java Wed Feb  9 18:22:59 2011
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to store the BindRequest version MessageID.
+ * The action used to store the BindRequest name.
  * <pre>
  * BindRequest ::= [APPLICATION 0] SEQUENCE {
  *     ....

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslCredentials.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslCredentials.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslCredentials.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslCredentials.java Wed Feb  9 18:22:59 2011
@@ -33,11 +33,11 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to store the BindRequest version MessageID.
+ * The action used to store the BindRequest credentials.
  * <pre>
  * SaslCredentials ::= SEQUENCE {
- *     mechanism   LDAPSTRING,
  *     ...
+ *     credentials OCTET STRING OPTIONAL }
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -55,7 +55,7 @@ public class StoreSaslCredentials extend
      */
     public StoreSaslCredentials()
     {
-        super( "Store SASL mechanism" );
+        super( "Store SASL credentials" );
     }
 
 

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslMechanism.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslMechanism.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslMechanism.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSaslMechanism.java Wed Feb  9 18:22:59 2011
@@ -34,8 +34,8 @@ import org.slf4j.LoggerFactory;
  * The action used to store the BindRequest version MessageID.
  * <pre>
  * SaslCredentials ::= SEQUENCE {
+ *     mechanism   LDAPSTRING,
  *     ...
- *     credentials OCTET STRING OPTIONAL }
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -53,7 +53,7 @@ public class StoreSaslMechanism extends 
      */
     public StoreSaslMechanism()
     {
-        super( "Store SASL credentials" );
+        super( "Store SASL mechanism" );
     }
 
 

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSimpleAuth.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSimpleAuth.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSimpleAuth.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreSimpleAuth.java Wed Feb  9 18:22:59 2011
@@ -33,7 +33,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to store the BindRequest version MessageID.
+ * The action used to store the BindRequest simple authentication
  * <pre>
  * BindRequest ::= [APPLICATION 0] SEQUENCE {
  *     ....

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreVersion.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreVersion.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreVersion.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/bindRequest/StoreVersion.java Wed Feb  9 18:22:59 2011
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to store the BindRequest version MessageID.
+ * The action used to store the BindRequest version.
  * <pre>
  * BindRequest ::= [APPLICATION 0] SEQUENCE {
  *     version                 INTEGER (1 ..  127),

Added: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/InitCompareRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/InitCompareRequest.java?rev=1069014&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/InitCompareRequest.java (added)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/InitCompareRequest.java Wed Feb  9 18:22:59 2011
@@ -0,0 +1,67 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.codec.actions.compareRequest;
+
+
+import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
+import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
+import org.apache.directory.shared.ldap.model.message.CompareRequestImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to initialize the CompareRequest.
+ * <pre>
+ * LdapMessage ::= ... CompareRequest ...
+ *
+ * CompareRequest ::= [APPLICATION 14] SEQUENCE {
+ * ...
+ * </pre>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class InitCompareRequest extends GrammarAction<LdapMessageContainer<CompareRequestDecorator>>
+{
+    /** The logger */
+    private static final Logger LOG = LoggerFactory.getLogger( InitCompareRequest.class );
+
+    /**
+     * Instantiates a new action.
+     */
+    public InitCompareRequest()
+    {
+        super( "Compare Request initialization" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void action( LdapMessageContainer<CompareRequestDecorator> container )
+    {
+        // Now, we can allocate the CompareRequest Object
+        CompareRequestDecorator compareRequest = new CompareRequestDecorator(
+            container.getLdapCodecService(), new CompareRequestImpl( container.getMessageId() ) );
+        container.setMessage( compareRequest );
+
+        LOG.debug( "Compare Request" );
+    }
+}

Added: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAssertionValue.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAssertionValue.java?rev=1069014&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAssertionValue.java (added)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAssertionValue.java Wed Feb  9 18:22:59 2011
@@ -0,0 +1,107 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.codec.actions.compareRequest;
+
+
+import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
+import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
+import org.apache.directory.shared.ldap.model.message.CompareRequest;
+import org.apache.directory.shared.util.Strings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to store the AssertionValue in a Compare Request
+ * <pre>
+ * CompareRequest ::= [APPLICATION 14] SEQUENCE {
+ *     ...
+ *     ava AttributeValueAssertion }
+ *
+ * AttributeValueAssertion ::= SEQUENCE {
+ *     ...
+ *     assertionValue AssertionValue }
+ *
+ * AssertionValue OCTET STRING
+ * </pre>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCompareRequestAssertionValue extends GrammarAction<LdapMessageContainer<CompareRequestDecorator>>
+{
+    /** The logger */
+    private static final Logger LOG = LoggerFactory.getLogger( StoreCompareRequestAssertionValue.class );
+
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+    /**
+     * Instantiates a new action.
+     */
+    public StoreCompareRequestAssertionValue()
+    {
+        super( "Store CompareRequest assertion value" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void action( LdapMessageContainer<CompareRequestDecorator> container )
+    {
+        // Get the CompareRequest Object
+        CompareRequest compareRequest = container.getMessage();
+
+        // Get the Value and store it in the CompareRequest
+        TLV tlv = container.getCurrentTLV();
+
+        // We have to handle the special case of a 0 length value
+        if ( tlv.getLength() == 0 )
+        {
+            compareRequest.setAssertionValue( "" );
+        }
+        else
+        {
+            if ( container.isBinary( compareRequest.getAttributeId() ) )
+            {
+                compareRequest.setAssertionValue( tlv.getValue().getData() );
+
+                if ( IS_DEBUG )
+                {
+                    LOG.debug( "Comparing attribute value {}", Strings.dumpBytes(compareRequest
+                            .getAssertionValue().getBytes()) );
+                }
+            }
+            else
+            {
+                compareRequest.setAssertionValue( Strings.utf8ToString(tlv.getValue().getData()) );
+
+                if ( LOG.isDebugEnabled() )
+                {
+                    LOG.debug( "Comparing attribute value {}", compareRequest.getAssertionValue() );
+                }
+            }
+        }
+
+        // We can have an END transition
+        container.setGrammarEndAllowed( true );
+    }
+}

Added: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAttributeDesc.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAttributeDesc.java?rev=1069014&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAttributeDesc.java (added)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestAttributeDesc.java Wed Feb  9 18:22:59 2011
@@ -0,0 +1,99 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.codec.actions.compareRequest;
+
+
+import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
+import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
+import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
+import org.apache.directory.shared.ldap.model.message.CompareRequest;
+import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.shared.util.Strings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to store the AssertionValue attributeDescription in a Compare Request
+ * <pre>
+ * CompareRequest ::= [APPLICATION 14] SEQUENCE {
+ *     ...
+ *     ava AttributeValueAssertion }
+ *
+ * AttributeValueAssertion ::= SEQUENCE {
+ *     attributeDesc   AttributeDescription,
+ *     ...
+ * </pre>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCompareRequestAttributeDesc extends GrammarAction<LdapMessageContainer<CompareRequestDecorator>>
+{
+    /** The logger */
+    private static final Logger LOG = LoggerFactory.getLogger( StoreCompareRequestAttributeDesc.class );
+
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+    /**
+     * Instantiates a new action.
+     */
+    public StoreCompareRequestAttributeDesc()
+    {
+        super( "Store CompareRequest assertion description" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void action( LdapMessageContainer<CompareRequestDecorator> container ) throws DecoderException
+    {
+        // Get the CompareRequest Object
+        CompareRequest compareRequest = container.getMessage();
+
+        // Get the Value and store it in the CompareRequest
+        TLV tlv = container.getCurrentTLV();
+
+        // We have to handle the special case of a 0 length matched
+        // Dn
+        if ( tlv.getLength() == 0 )
+        {
+            String msg = I18n.err( I18n.ERR_04093 );
+            LOG.error( msg );
+            CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() );
+
+            throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
+                compareRequest.getName(), null );
+        }
+
+        String type = Strings.utf8ToString( tlv.getValue().getData() );
+        compareRequest.setAttributeId( type );
+
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Comparing attribute description {}", compareRequest.getAttributeId() );
+        }
+    }
+}

Added: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestEntryName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestEntryName.java?rev=1069014&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestEntryName.java (added)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareRequest/StoreCompareRequestEntryName.java Wed Feb  9 18:22:59 2011
@@ -0,0 +1,112 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.codec.actions.compareRequest;
+
+
+import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
+import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.api.ResponseCarryingException;
+import org.apache.directory.shared.ldap.codec.decorators.CompareRequestDecorator;
+import org.apache.directory.shared.ldap.model.exception.LdapInvalidDnException;
+import org.apache.directory.shared.ldap.model.message.CompareRequest;
+import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
+import org.apache.directory.shared.ldap.model.message.ResultCodeEnum;
+import org.apache.directory.shared.ldap.model.name.Dn;
+import org.apache.directory.shared.util.Strings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to store the Compare Request name
+ * <pre>
+ * CompareRequest ::= [APPLICATION 14] SEQUENCE {
+ *     entry    LDAPDN,
+ *     ...
+ * </pre>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StoreCompareRequestEntryName extends GrammarAction<LdapMessageContainer<CompareRequestDecorator>>
+{
+    /** The logger */
+    private static final Logger LOG = LoggerFactory.getLogger( StoreCompareRequestEntryName.class );
+
+    /** Speedup for logs */
+    private static final boolean IS_DEBUG = LOG.isDebugEnabled();
+
+    /**
+     * Instantiates a new action.
+     */
+    public StoreCompareRequestEntryName()
+    {
+        super( "Store CompareRequest entry Name" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void action( LdapMessageContainer<CompareRequestDecorator> container ) throws DecoderException
+    {
+        CompareRequest compareRequest = container.getMessage();
+
+        // Get the Value and store it in the CompareRequest
+        TLV tlv = container.getCurrentTLV();
+        Dn entry = null;
+
+        // We have to handle the special case of a 0 length matched
+        // Dn
+        if ( tlv.getLength() == 0 )
+        {
+            // This will generate a PROTOCOL_ERROR
+            throw new DecoderException( I18n.err( I18n.ERR_04089 ) );
+        }
+        else
+        {
+            byte[] dnBytes = tlv.getValue().getData();
+            String dnStr = Strings.utf8ToString(dnBytes);
+
+            try
+            {
+                entry = new Dn( dnStr );
+            }
+            catch ( LdapInvalidDnException ine )
+            {
+                String msg = "Invalid Dn given : " + dnStr + " (" + Strings.dumpBytes(dnBytes)
+                    + ") is invalid";
+                LOG.error( "{} : {}", msg, ine.getMessage() );
+
+                CompareResponseImpl response = new CompareResponseImpl( compareRequest.getMessageId() );
+                throw new ResponseCarryingException( msg, response, ResultCodeEnum.INVALID_DN_SYNTAX,
+                    Dn.EMPTY_DN, ine );
+            }
+
+            compareRequest.setName( entry );
+        }
+
+        if ( IS_DEBUG )
+        {
+            LOG.debug( "Comparing Dn {}", entry );
+        }
+    }
+}

Added: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareResponse/InitCompareResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareResponse/InitCompareResponse.java?rev=1069014&view=auto
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareResponse/InitCompareResponse.java (added)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/compareResponse/InitCompareResponse.java Wed Feb  9 18:22:59 2011
@@ -0,0 +1,78 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.directory.shared.ldap.codec.actions.compareResponse;
+
+
+import org.apache.directory.shared.asn1.DecoderException;
+import org.apache.directory.shared.asn1.ber.grammar.GrammarAction;
+import org.apache.directory.shared.asn1.ber.tlv.TLV;
+import org.apache.directory.shared.i18n.I18n;
+import org.apache.directory.shared.ldap.codec.LdapMessageContainer;
+import org.apache.directory.shared.ldap.codec.decorators.CompareResponseDecorator;
+import org.apache.directory.shared.ldap.model.message.CompareResponseImpl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * The action used to initialize the CompareResponse
+ * <pre>
+ * LdapMessage ::= ... CompareResponse ...
+ * CompareResponse ::= [APPLICATION 15] LDAPResult
+ * </pre>
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class InitCompareResponse extends GrammarAction<LdapMessageContainer<CompareResponseDecorator>>
+{
+    /** The logger */
+    private static final Logger LOG = LoggerFactory.getLogger( InitCompareResponse.class );
+
+    /**
+     * Instantiates a new action.
+     */
+    public InitCompareResponse()
+    {
+        super( "Compare Response initialization" );
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void action( LdapMessageContainer<CompareResponseDecorator> container ) throws DecoderException
+    {
+        // Now, we can allocate the CompareResponse Object
+        CompareResponseDecorator compareResponse = new CompareResponseDecorator(
+            container.getLdapCodecService(), new CompareResponseImpl( container.getMessageId() ) );
+        container.setMessage( compareResponse );
+
+        // We will check that the request is not null
+        TLV tlv = container.getCurrentTLV();
+
+        if ( tlv.getLength() == 0 )
+        {
+            String msg = I18n.err( I18n.ERR_04094 );
+            LOG.error( msg );
+            throw new DecoderException( msg );
+        }
+
+        LOG.debug( "Compare response " );
+    }
+}

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/delResponse/InitDelResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/delResponse/InitDelResponse.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/delResponse/InitDelResponse.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/delResponse/InitDelResponse.java Wed Feb  9 18:22:59 2011
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the DelResponse response
  * <pre>
  * LdapMessage ::= ... DelResponse ...
  * DelResponse ::= [APPLICATION 11] SEQUENCE { ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/InitModifyDnRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/InitModifyDnRequest.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/InitModifyDnRequest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/InitModifyDnRequest.java Wed Feb  9 18:22:59 2011
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the ModifyDnRequest message
  * <pre>
  * LdapMessage ::= ... ModifyDNRequest ...
  * ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestDeleteOldRdn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestDeleteOldRdn.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestDeleteOldRdn.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestDeleteOldRdn.java Wed Feb  9 18:22:59 2011
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModifyDnRequest deleteOldRdn flag
  * <pre>
  * ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
  *     ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestEntryName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestEntryName.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestEntryName.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestEntryName.java Wed Feb  9 18:22:59 2011
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModifyDnRequest entry name
  * <pre>
  * ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
  *     entry LDAPDN,

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewRdn.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewRdn.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewRdn.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewRdn.java Wed Feb  9 18:22:59 2011
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModifyDnRequest new RDN
  * <pre>
  * ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
  *     ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewSuperior.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewSuperior.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewSuperior.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnRequest/StoreModifyDnRequestNewSuperior.java Wed Feb  9 18:22:59 2011
@@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModifyDnRequest new Superior
  * <pre>
  * ModifyDNRequest ::= [APPLICATION 12] SEQUENCE { ...
  *     ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnResponse/InitModifyDnResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnResponse/InitModifyDnResponse.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnResponse/InitModifyDnResponse.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyDnResponse/InitModifyDnResponse.java Wed Feb  9 18:22:59 2011
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the ModifyDnResponse message
  * <pre>
  * ModifyDNResponse ::= [APPLICATION 13] SEQUENCE {
  * </pre>

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/AddModifyRequestAttribute.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/AddModifyRequestAttribute.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/AddModifyRequestAttribute.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/AddModifyRequestAttribute.java Wed Feb  9 18:22:59 2011
@@ -36,7 +36,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModificationRequest's attribute type
  * <pre>
  * ModifyRequest ::= [APPLICATION 6] SEQUENCE {
  *     ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitAttributeVals.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitAttributeVals.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitAttributeVals.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitAttributeVals.java Wed Feb  9 18:22:59 2011
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to initialize the set of ModificationRequest AVAs
  * <pre>
  * ModifyRequest ::= [APPLICATION 6] SEQUENCE {
  *     ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitModifyRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitModifyRequest.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitModifyRequest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/InitModifyRequest.java Wed Feb  9 18:22:59 2011
@@ -28,7 +28,7 @@ import org.apache.directory.shared.ldap.
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the ModifyRequest message
  * <pre>
  * LdapMessage ::= ... ModifyRequest ...
  * ModifyRequest ::= [APPLICATION 6] SEQUENCE { ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreModifyRequestObjectName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreModifyRequestObjectName.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreModifyRequestObjectName.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreModifyRequestObjectName.java Wed Feb  9 18:22:59 2011
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModificationRequest object name
  * <pre>
  * ModifyRequest ::= [APPLICATION 6] SEQUENCE {
  *     object    LDAPDN,

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreOperationType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreOperationType.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreOperationType.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyRequest/StoreOperationType.java Wed Feb  9 18:22:59 2011
@@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the ModificationRequest operation type
  * <pre>
  * ModifyRequest ::= [APPLICATION 6] SEQUENCE {
  *     ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyResponse/InitModifyResponse.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyResponse/InitModifyResponse.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyResponse/InitModifyResponse.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/modifyResponse/InitModifyResponse.java Wed Feb  9 18:22:59 2011
@@ -29,7 +29,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultDone response
+ * The action used to initialize the ModifyResponse message
  * <pre>
  * LdapMessage ::= ... ModifyResponse ...
  * ModifyResponse ::= [APPLICATION 7] SEQUENCE { ...

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/AddAttributeType.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/AddAttributeType.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/AddAttributeType.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/AddAttributeType.java Wed Feb  9 18:22:59 2011
@@ -33,11 +33,11 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the SearchResultEntry attributes
  * <pre>
  * SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
- * ...
- * attributes PartialAttributeList }
+ *     ...
+ *     attributes PartialAttributeList }
  *
  * PartialAttributeList ::= SEQUENCE OF SEQUENCE {
  *     type  AttributeDescription,

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/StoreSearchResultEntryObjectName.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/StoreSearchResultEntryObjectName.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/StoreSearchResultEntryObjectName.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/searchResultEntry/StoreSearchResultEntryObjectName.java Wed Feb  9 18:22:59 2011
@@ -33,10 +33,13 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to initialize the SearchResultEntry response
+ * The action used to store the SearchResultEntry name
  * <pre>
  * LdapMessage ::= ... SearchResultEntry ...
- * SearchResultEntry ::= [APPLICATION 4] SEQUENCE { ...
+ * SearchResultEntry ::= [APPLICATION 4] SEQUENCE {
+ *         objectName      LDAPDN,
+ *         ...
+ *
  * </pre>
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -53,7 +56,7 @@ public class StoreSearchResultEntryObjec
      */
     public StoreSearchResultEntryObjectName()
     {
-        super( "Init SearchResultEntry" );
+        super( "Store SearchResultEntry name" );
     }
 
 

Modified: directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/unbindRequest/InitUnbindRequest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/unbindRequest/InitUnbindRequest.java?rev=1069014&r1=1069013&r2=1069014&view=diff
==============================================================================
--- directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/unbindRequest/InitUnbindRequest.java (original)
+++ directory/shared/branches/m1/ldap-codec/src/main/java/org/apache/directory/shared/ldap/codec/actions/unbindRequest/InitUnbindRequest.java Wed Feb  9 18:22:59 2011
@@ -32,7 +32,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The action used to store the LdapMessage MessageID.
+ * The action used to initialize the UnbindRequest :
  * <pre>
  * LdapMessage ::= ... UnBindRequest ...
  * unbindRequest ::= [APPLICATION 2] NULL



Mime
View raw message