directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1028966 [5/9] - in /directory/shared/branches/shared-config: all/ dsml-engine/ dsml-parser/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/ dsml-parser/src/main/java/org/apache/directory/shared/dsmlv2/reponse/ dsml-parser/src...
Date Sat, 30 Oct 2010 01:51:55 GMT
Propchange: directory/shared/branches/shared-config/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -5,3 +5,4 @@
 /directory/shared/branches/shared-subtree/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry:965208-965686
 /directory/shared/branches/xdbm-refactoring/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry:945830-946347
 /directory/shared/branches-dnfactory-experiment/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry:980350-980351
+/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultEntry:1023442-1028955

Propchange: directory/shared/branches/shared-config/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -5,3 +5,4 @@
 /directory/shared/branches/shared-subtree/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference:965208-965686
 /directory/shared/branches/xdbm-refactoring/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference:945830-946347
 /directory/shared/branches-dnfactory-experiment/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference:980350-980351
+/directory/shared/trunk/dsml-parser/src/test/resources/org/apache/directory/shared/dsmlv2/searchResponse/searchResultReference:1023442-1028955

Propchange: directory/shared/branches/shared-config/i18n/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/i18n:982370-987558
 /directory/shared/branches/shared-dnfactory-experiment/i18n:980352-980933
 /directory/shared/branches-dnfactory-experiment/i18n:980350-980351
+/directory/shared/trunk/i18n:1023442-1028955

Modified: directory/shared/branches/shared-config/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
(original)
+++ directory/shared/branches/shared-config/i18n/src/main/resources/org/apache/directory/shared/i18n/errors.properties
Sat Oct 30 01:51:50 2010
@@ -277,7 +277,7 @@ ERR_04151=Bad char
 ERR_04152=Expecting a '\=' 
 ERR_04153=An item is expected
 ERR_04154=Empty filterComp
-ERR_04155=No '(' at the begining of the filter
+ERR_04155=No '(' at the beginning of the filter
 ERR_04156=Bad filter
 ERR_04157=The filter has no right parenthese
 ERR_04158=Empty filter
@@ -300,7 +300,7 @@ ERR_04174=Failed to encode payload Store
 ERR_04175=class loading of procedure type not implemented
 ERR_04176=conversion of value to java type not implemented
 ERR_04177=provider monitor class {0} not found
-ERR_04178="provider monitor class {0} does not expose a public default constructor
+ERR_04178=provider monitor class {0} does not expose a public default constructor
 ERR_04179=provider monitor class {0} failed during instantiation
 ERR_04180=Could not instantiate provider - environment does not specify {0} property!
 ERR_04181=Count not find the Provider class {0}

Propchange: directory/shared/branches/shared-config/ldap/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/ldap:982370-987558
 /directory/shared/branches/shared-dnfactory-experiment/ldap:980352-980933
 /directory/shared/branches-dnfactory-experiment/ldap:980350-980351
+/directory/shared/trunk/ldap:1023442-1028955

Propchange: directory/shared/branches/shared-config/ldap-jndi/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -1,3 +1,4 @@
 /directory/shared/branches/shared-codec-merge/ldap-jndi:982370-987558
 /directory/shared/branches/shared-dnfactory-experiment/ldap-jndi:980352-980933
 /directory/shared/branches-dnfactory-experiment/ldap-jndi:980350-980351
+/directory/shared/trunk/ldap-jndi:1023442-1028955

Propchange: directory/shared/branches/shared-config/ldap-schema/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -6,3 +6,4 @@
 /directory/shared/branches/shared-subtree/ldap-schema:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-schema:945830-946347
 /directory/shared/branches-dnfactory-experiment/ldap-schema:980350-980351
+/directory/shared/trunk/ldap-schema:1023442-1028955

Propchange: directory/shared/branches/shared-config/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -5,4 +5,5 @@
 /directory/shared/branches/shared-subtree/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:945830-946347
 /directory/shared/branches-dnfactory-experiment/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:980350-980351
+/directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:1023442-1028955
 /directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl:806622-894844*

Propchange: directory/shared/branches/shared-config/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Oct 30 01:51:50 2010
@@ -5,4 +5,5 @@
 /directory/shared/branches/shared-subtree/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:965208-965686
 /directory/shared/branches/xdbm-refactoring/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:945830-946347
 /directory/shared/branches-dnfactory-experiment/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:980350-980351
+/directory/shared/trunk/ldap-schema/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:1023442-1028955
 /directory/shared/trunk/ldap-schema-manager/src/main/java/org/apache/directory/shared/ldap/schema/manager/impl/DefaultSchemaManager.java:806622-894844

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/AbstractContainer.java
Sat Oct 30 01:51:50 2010
@@ -45,14 +45,11 @@ public abstract class AbstractContainer 
     private TLVStateEnum state;
 
     /** The current transition */
-    private int transition;
+    private Enum<?> transition;
 
     /** The current TLV */
     private TLV tlv;
 
-    /** Store the different states for debug purpose */
-    protected States states;
-
     /** The parent TLV */
     private TLV parentTLV;
 
@@ -140,7 +137,7 @@ public abstract class AbstractContainer 
      * 
      * @return Returns the transition from the previous state to the new state
      */
-    public int getTransition()
+    public Enum<?> getTransition()
     {
         return transition;
     }
@@ -151,7 +148,7 @@ public abstract class AbstractContainer 
      * 
      * @param transition The transition to set
      */
-    public void setTransition( int transition )
+    public void setTransition( Enum<?> transition )
     {
         this.transition = transition;
     }
@@ -180,17 +177,6 @@ public abstract class AbstractContainer 
 
 
     /**
-     * Get the states for this container's grammars
-     * 
-     * @return Returns the states.
-     */
-    public States getStates()
-    {
-        return states;
-    }
-
-
-    /**
      * Get the parent TLV;
      * 
      * @return Returns the parent TLV, if any.
@@ -219,7 +205,7 @@ public abstract class AbstractContainer 
     {
         tlv = null;
         parentTLV = null;
-        transition = 0;
+        transition = ((States)transition).getStartState();
         state = TLVStateEnum.TAG_STATE_START;
     }
 

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/Asn1Container.java
Sat Oct 30 01:51:50 2010
@@ -21,7 +21,6 @@ package org.apache.directory.shared.asn1
 
 
 import org.apache.directory.shared.asn1.ber.grammar.Grammar;
-import org.apache.directory.shared.asn1.ber.grammar.States;
 import org.apache.directory.shared.asn1.ber.tlv.TLV;
 import org.apache.directory.shared.asn1.ber.tlv.TLVStateEnum;
 
@@ -78,7 +77,7 @@ public interface Asn1Container
      * 
      * @return Returns the transition from the previous state to the new state
      */
-    int getTransition();
+    Enum<?> getTransition();
 
 
     /**
@@ -86,13 +85,7 @@ public interface Asn1Container
      * 
      * @param transition The transition to set
      */
-    void setTransition( int transition );
-
-
-    /**
-     * @return Returns the states.
-     */
-    States getStates();
+    void setTransition( Enum<?> transition );
 
 
     /**

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/AbstractGrammar.java
Sat Oct 30 01:51:50 2010
@@ -52,10 +52,6 @@ public abstract class AbstractGrammar im
     /** The grammar name */
     private String name;
 
-    /** The grammar's states */
-    private States statesEnum;
-
-
     /** Default constructor */
     public AbstractGrammar()
     {
@@ -91,9 +87,9 @@ public abstract class AbstractGrammar im
      * @param tag The current tag
      * @return A valid transition if any, or null.
      */
-    public GrammarTransition getTransition( int state, int tag )
+    public GrammarTransition getTransition( Enum<?> state, int tag )
     {
-        return transitions[state][tag & 0x00FF];
+        return transitions[state.ordinal()][tag & 0x00FF];
     }
 
 
@@ -107,11 +103,9 @@ public abstract class AbstractGrammar im
     public void executeAction( Asn1Container container ) throws DecoderException
     {
 
-        int currentState = container.getTransition();
-        Grammar currentGrammar = container.getGrammar();
-
+        Enum<?> currentState = container.getTransition();
         // We have to deal with the special case of a GRAMMAR_END state
-        if ( currentState == States.END_STATE )
+        if ( ((States)currentState).isEndState() )
         {
             return;
         }
@@ -124,8 +118,7 @@ public abstract class AbstractGrammar im
 
         if ( transition == null )
         {
-            String errorMessage = I18n.err( I18n.ERR_00001_BAD_TRANSITION_FROM_STATE, currentGrammar.getStatesEnum()
-                .getState( currentState ), Asn1StringUtils.dumpByte( tagByte ) );
+            String errorMessage = I18n.err( I18n.ERR_00001_BAD_TRANSITION_FROM_STATE, currentState,
Asn1StringUtils.dumpByte( tagByte ) );
 
             LOG.error( errorMessage );
 
@@ -136,7 +129,7 @@ public abstract class AbstractGrammar im
 
         if ( IS_DEBUG )
         {
-            LOG.debug( transition.toString( currentGrammar.getStatesEnum() ) );
+            LOG.debug( transition.toString() );
         }
 
         if ( transition.hasAction() )
@@ -147,26 +140,4 @@ public abstract class AbstractGrammar im
 
         container.setTransition( transition.getCurrentState() );
     }
-
-
-    /**
-     * Get the states of the current grammar
-     * 
-     * @return Returns the statesEnum.
-     */
-    public States getStatesEnum()
-    {
-        return statesEnum;
-    }
-
-
-    /**
-     * Set the states for this grammar
-     * 
-     * @param statesEnum The statesEnum to set.
-     */
-    public void setStatesEnum( States statesEnum )
-    {
-        this.statesEnum = statesEnum;
-    }
 }

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/Grammar.java
Sat Oct 30 01:51:50 2010
@@ -25,7 +25,7 @@ import org.apache.directory.shared.asn1.
 
 
 /**
- * The interface which expose common behavior of a Gramar implementer.
+ * The interface which expose common behavior of a Grammar implementer.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
@@ -50,14 +50,6 @@ public interface Grammar
 
 
     /**
-     * Get the statesEnum for the current grammar
-     * 
-     * @return The specific States Enum for the current grammar
-     */
-    States getStatesEnum();
-
-
-    /**
      * Set the grammar's name
      * 
      * @param name The grammar name

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/GrammarTransition.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/GrammarTransition.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/GrammarTransition.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/GrammarTransition.java
Sat Oct 30 01:51:50 2010
@@ -35,10 +35,10 @@ public class GrammarTransition
     private Action action;
 
     /** The previous state */
-    private int previousState;
+    private Enum<?> previousState;
 
     /** The current state */
-    private int currentState;
+    private Enum<?> currentState;
 
     /** The current tag */
     private int currentTag;
@@ -52,7 +52,7 @@ public class GrammarTransition
      * @param currentTag the current TLV's tag
      * @param action The action to execute. It could be null.
      */
-    public GrammarTransition( int previousState, int currentState, int currentTag, Action
action )
+    public GrammarTransition( Enum<?> previousState, Enum<?> currentState, int
currentTag, Action action )
     {
         this.previousState = previousState;
         this.currentState = currentState;
@@ -84,7 +84,7 @@ public class GrammarTransition
     /**
      * @return The current state
      */
-    public int getCurrentState()
+    public Enum<?> getCurrentState()
     {
         return currentState;
     }
@@ -93,7 +93,7 @@ public class GrammarTransition
     /**
      * @return The previous state
      */
-    public int getPreviousState()
+    public Enum<?> getPreviousState()
     {
         return previousState;
     }
@@ -103,12 +103,12 @@ public class GrammarTransition
      * @param statesEnum Starting state.
      * @return A representation of the transition as a string.
      */
-    public String toString( States statesEnum )
+    public String toString( )
     {
         StringBuilder sb = new StringBuilder();
 
-        sb.append( "Transition from state <" ).append( statesEnum.getState( previousState
) ).append( "> " );
-        sb.append( "to state <" ).append( statesEnum.getState( currentState ) ).append(
">, " );
+        sb.append( "Transition from state <" ).append( previousState ).append( "> "
);
+        sb.append( "to state <" ).append( currentState ).append( ">, " );
         sb.append( "tag <" ).append( Asn1StringUtils.dumpByte( ( byte ) currentTag ) ).append(
">, " );
         sb.append( "action : " );
 

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/States.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/States.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/States.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/asn1/ber/grammar/States.java
Sat Oct 30 01:51:50 2010
@@ -21,47 +21,19 @@ package org.apache.directory.shared.asn1
 
 
 /**
- * This interface is used to store the different states of a grammar. While
- * tracing debugging information, the methods to dump the current state as a
- * string are called.
+ * Interface to get custom function from enum when casting.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
 public interface States
 {
-    /** The initial state of every grammar */
-    int INIT_GRAMMAR_STATE = 0;
-
-    /** The ending state for every grammars */
-    int GRAMMAR_END = -1;
-
-    /** The END_STATE */
-    int END_STATE = -1;
-
-
-    /** 
-     * Get the current state's name 
-     * 
-     * @param state the current state
-     * @return the associated name for this state
+    /**
+     * @return True if this is the END_STATE
      */
-    String getState( int state );
-
-
-    /** 
-     * Return the grammar name of a grammar
-     * 
-     * @param grammar the grammar from which we want the name
-     * @return the grammar's name
-     */
-    String getGrammarName( Grammar grammar );
-
-
-    /** 
-     * Return the grammar name from a grammar number 
-     * 
-     * @param grammar the grammar number from which we want the name
-     * @return the grammar's name
+    public boolean isEndState();
+    
+    /**
+     * @return The START_STATE of the enum
      */
-    String getGrammarName( int grammar );
+    public Enum<?> getStartState();
 }

Modified: directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java?rev=1028966&r1=1028965&r2=1028966&view=diff
==============================================================================
--- directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
(original)
+++ directory/shared/branches/shared-config/ldap/src/main/java/org/apache/directory/shared/ldap/codec/LdapMessageContainer.java
Sat Oct 30 01:51:50 2010
@@ -102,8 +102,8 @@ public class LdapMessageContainer extend
         super();
         this.stateStack = new int[10];
         this.grammar = LdapMessageGrammar.getInstance();
-        this.states = LdapStatesEnum.getInstance();
         this.binaryAttributeDetector = binaryAttributeDetector;
+        setTransition( LdapStatesEnum.START_STATE );
     }
 
 



Mime
View raw message