directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r688573 - in /directory/apacheds/trunk/mitosis/src: main/java/org/apache/directory/mitosis/common/ main/java/org/apache/directory/mitosis/configuration/ main/java/org/apache/directory/mitosis/operation/ main/java/org/apache/directory/mitosi...
Date Sun, 24 Aug 2008 23:01:43 GMT
Author: elecharny
Date: Sun Aug 24 16:01:41 2008
New Revision: 688573

URL: http://svn.apache.org/viewvc?rev=688573&view=rev
Log:
o Removed the ReplicaId class
o Replaced it with a String, and a check in the propertyConfigurator
o Cleaned the CSN class, added some JavaDoc
o Removed some Iterators

Removed:
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/ReplicaId.java
Modified:
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSN.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNFactory.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNVector.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/Replica.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicaIdPropertyEditor.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginAckMessage.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginMessage.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java
    directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java
    directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java
    directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
    directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
    directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java
    directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java
    directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSN.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSN.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSN.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSN.java Sun Aug 24 16:01:41 2008
@@ -29,13 +29,25 @@
  * A CSN is a composition of a timestamp, a replica ID and a 
  * operation sequence number.
  * 
+ * It's described in http://tools.ietf.org/html/draft-sermersheim-ldap-csn-02.
+ * 
+ * The syntax is :
+ * <pre>
+ * ChangeSequenceNumber ::= SEQUENCE {
+ *     time GeneralizedTime,
+ *     timeCount INTEGER (0 ..  MaxInt),
+ *     replicaID UTF8String,
+ *     changeCount INTEGER (0 ..  MaxInt)}
+ * }
+ * </pre>
+ * 
  * It distinguishes a change made on an object on a server,
  * and if two operations take place during the same timeStamp,
  * the operation sequence number makes those operations distinct.
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public interface CSN extends Serializable, Comparable
+public interface CSN extends Serializable, Comparable<CSN>
 {
     /**
      * Returns GMT timestamp of modification.
@@ -46,7 +58,7 @@
     /**
      * Returns replica ID.
      */
-    ReplicaId getReplicaId();
+    String getReplicaId();
 
 
     /**

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNFactory.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNFactory.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNFactory.java Sun Aug 24 16:01:41 2008
@@ -36,15 +36,4 @@
      *        string.
      */
     CSN newInstance( String replicaId );
-
-
-    /**
-     * Returns a new {@link CSN}.
-     * Generated CSN can be duplicate if user generates CSNs more than 2G 
-     * times a milliseconds.
-     * 
-     * @param replicaId Replica ID.  ReplicaID must be 1-8 digit alphanumeric
-     *        string.
-     */
-    CSN newInstance( ReplicaId replicaId );
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNVector.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNVector.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNVector.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/CSNVector.java Sun Aug 24 16:01:41 2008
@@ -33,8 +33,8 @@
 /**
  * Creates a set of {@link CSN}s, which is defined in LDUP specification.
  * Each {@link CSN} in the same {@link CSNVector} has different
- * {@link ReplicaId} component from each other.  Its data structure is 
- * similar to a {@link Map} whose key is {@link ReplicaId}.
+ * Replica Id from each other.  Its data structure is 
+ * similar to a {@link Map} whose key is the Replica Id.
  * <p>
  * {@link CSNVector} is usually used to represent 'Update Vector (UV)' and
  * 'Purge Vector (PV)'.  Please refer to the LDUP specification and other 
@@ -53,7 +53,7 @@
      */
     private static final long serialVersionUID = 1L;
 
-    private final Map<ReplicaId,CSN> csns = new HashMap<ReplicaId,CSN>();
+    private final Map<String,CSN> csns = new HashMap<String,CSN>();
 
     /**
      * Creates a new empty instance.
@@ -64,7 +64,7 @@
 
     /**
      * Adds the specified <tt>csn</tt> to this vector.  If there's a
-     * {@link CSN} with the same {@link ReplicaId}, it is replaced by
+     * {@link CSN} with the same Replica Id, it is replaced by
      * the specified <tt>csn</tt>.
      */
     public void setCSN( CSN csn )
@@ -75,7 +75,7 @@
 
     /**
      * Adds all {@link CSN}s that the specified <tt>vector</tt> contains to
-     * this vector.  If there's a {@link CSN} with the same {@link ReplicaId}
+     * this vector.  If there's a {@link CSN} with the same Replica Id
      * in this vector, it is replaced by the {@link CSN} in the specified
      * <tt>vector</tt>.
      */
@@ -94,29 +94,29 @@
      * 
      * @return <tt>null</tt> if there's no match
      */
-    public CSN getCSN( ReplicaId replicaId )
+    public CSN getCSN( String replicaId )
     {
         return csns.get( replicaId );
     }
 
 
     /**
-     * Removed the {@link CSN} whith the specified <tt>replicaId</tt> from
+     * Removed the {@link CSN} whith the specified <tt>replica Id</tt> from
      * this vector and returns the removed {@link CSN}.
      * 
      * @return <tt>null</tt> if there's no match
      */
-    public CSN removeCSN( ReplicaId replicaId )
+    public CSN removeCSN( String replicaId )
     {
         return csns.remove( replicaId );
     }
 
 
     /**
-     * Returns the {@link Set} of the {@link ReplicaId}s extracted from
+     * Returns the {@link Set} of the Replica Ids extracted from
      * the {@link CSN}s in this vector.
      */
-    public Set<ReplicaId> getReplicaIds()
+    public Set<String> getReplicaIds()
     {
         return csns.keySet();
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java Sun Aug 24 16:01:41 2008
@@ -30,7 +30,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class DefaultCSN implements CSN, Serializable, Comparable
+public class DefaultCSN implements CSN, Serializable, Comparable<CSN>
 {
     /**
      * Declares the Serial Version Uid.
@@ -45,7 +45,7 @@
     private final long timestamp;
 
     /** The server identification */
-    private final ReplicaId replicaId;
+    private final String replicaId;
 
     /** The operation number in the same timestamp */
     private final int operationSequence;
@@ -64,7 +64,7 @@
      * @param replicaId Replica ID where modification occurred (<tt>[-_A-Za-z0-9]{1,16}</tt>)
      * @param operationSequence Operation sequence
      */
-    public DefaultCSN( long timestamp, ReplicaId replicaId, int operationSequence )
+    public DefaultCSN( long timestamp, String replicaId, int operationSequence )
     {
         this.timestamp = timestamp;
         this.replicaId = replicaId;
@@ -106,7 +106,7 @@
 
         try
         {
-            replicaId = new ReplicaId( value.substring( sepTS + 1, sepID ) );
+            replicaId = value.substring( sepTS + 1, sepID );
         }
         catch ( IllegalArgumentException iae )
         {
@@ -146,7 +146,7 @@
             chars[i - 12] = ( char ) ( value[i] & 0x00FF );
         }
 
-        replicaId = new ReplicaId( new String( chars ) );
+        replicaId = new String( chars );
         bytes = value;
     }
 
@@ -186,7 +186,7 @@
     {
         if ( bytes == null )
         {
-            String id = replicaId.getId();
+            String id = replicaId;
             byte[] bb = new byte[8 + id.length() + 4];
 
             bb[0] = ( byte ) ( timestamp >> 56 );
@@ -226,7 +226,7 @@
     /**
      * @return The replicaId
      */
-    public ReplicaId getReplicaId()
+    public String getReplicaId()
     {
         return replicaId;
     }
@@ -301,7 +301,7 @@
      * @return  a negative integer, zero, or a positive integer as this object
      *      is less than, equal to, or greater than the specified object.
      */
-    public int compareTo( Object o )
+    public int compareTo( CSN o )
     {
         CSN that = ( CSN ) o;
         long thatTimestamp = that.getTimestamp();

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java Sun Aug 24 16:01:41 2008
@@ -43,17 +43,13 @@
      * @param replicaId Replica ID.  ReplicaID must be 1-8 digit alphanumeric
      *        string.
      */
-    public CSN newInstance( String replicaId )
-    {
-        return newInstance( new ReplicaId( replicaId ) );
-    }
-
-
-    public synchronized CSN newInstance( ReplicaId replicaId )
+    public synchronized CSN newInstance( String replicaId )
     {
         long newTimestamp = System.currentTimeMillis();
+        
         if ( operationSequence == Integer.MAX_VALUE )
         {
+            // Roll over when reaching the limit.
             operationSequence = 0;
         }
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/Replica.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/Replica.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/Replica.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/common/Replica.java Sun Aug 24 16:01:41 2008
@@ -41,7 +41,7 @@
     private static final boolean IS_DEBUG = log.isDebugEnabled();
 
     /** The replicaId */
-    private final ReplicaId id;
+    private final String id;
 
     /** The server address */
     private final InetSocketAddress address;
@@ -82,7 +82,7 @@
             throw new IllegalArgumentException( "Port number not found in replica : " + replica );
         }
 
-        id = new ReplicaId( replica.substring( 0, atPos ) );
+        id = replica.substring( 0, atPos );
         String server = replica.substring( atPos + 1, colonPos );
         int port = -1;
 
@@ -120,7 +120,7 @@
      * @param id The Replica Id
      * @param address The server address.
      */
-    public Replica( ReplicaId id, InetSocketAddress address )
+    public Replica( String id, InetSocketAddress address )
     {
         assert id != null;
         assert address != null;
@@ -142,7 +142,7 @@
     /**
      * @return the replica Id
      */
-    public ReplicaId getId()
+    public String getId()
     {
         return id;
     }
@@ -150,7 +150,7 @@
 
     /**
      * Compute the instance's hash code
-     * @return the instance's hashcode 
+     * @return the instance's hash code 
      */
     public int hashCode()
     {

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicaIdPropertyEditor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicaIdPropertyEditor.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicaIdPropertyEditor.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicaIdPropertyEditor.java Sun Aug 24 16:01:41 2008
@@ -22,12 +22,13 @@
 
 import java.beans.PropertyEditor;
 import java.beans.PropertyEditorSupport;
+import java.util.regex.Pattern;
 
-import org.apache.directory.mitosis.common.ReplicaId;
+import org.apache.directory.shared.ldap.util.StringTools;
 
 
 /**
- * A {@link PropertyEditor} that converts strings into {@link ReplicaId}s
+ * A {@link PropertyEditor} that converts strings into Replica Ids
  * and vice versa.
  *
  * @author The Apache Directory Project (dev@directory.apache.org)
@@ -35,6 +36,9 @@
  */
 public class ReplicaIdPropertyEditor extends PropertyEditorSupport
 {
+    /** The replica pattern. */
+    private static final Pattern REPLICA_ID_PATTERN = Pattern.compile( "[-_A-Z0-9]{1,16}" );
+
     public ReplicaIdPropertyEditor()
     {
         super();
@@ -47,9 +51,39 @@
     }
 
 
+    /**
+     * Check a new instance of ReplicaId. The id must be a String 
+     * which respect the pattern :
+     * 
+     * [-_a-zA-Z0-9]*
+     * 
+     * and must be between 1 and 16 chars length
+     *
+     * @param id The replica to check
+     * @return true if the replicaId is well formed
+     */
+    public static boolean check( String id )
+    {
+        if ( StringTools.isEmpty( id ) )
+        {
+            throw new IllegalArgumentException( "Empty ID: " + id );
+        }
+
+        String tmpId = id.trim().toUpperCase();
+
+        if ( !REPLICA_ID_PATTERN.matcher( tmpId ).matches() )
+        {
+            return false;
+        }
+
+        return true;
+    }
+    
+    
     public String getAsText()
     {
         Object val = getValue();
+        
         if ( val == null )
         {
             return "";
@@ -64,13 +98,21 @@
     public void setAsText( String text ) throws IllegalArgumentException
     {
         text = text.trim();
+        
         if ( text.length() == 0 )
         {
             setValue( null );
         }
         else
         {
-            setValue( new ReplicaId( text ) );
+            if ( check( text ) )
+            {
+                setValue( text );
+            }
+            else
+            {
+                setValue( null );
+            }
         }
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java Sun Aug 24 16:01:41 2008
@@ -24,7 +24,6 @@
 import java.net.UnknownHostException;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeSet;
@@ -32,7 +31,6 @@
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNFactory;
 import org.apache.directory.mitosis.common.Replica;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.DefaultCSNFactory;
 import org.apache.directory.mitosis.common.DefaultUUIDFactory;
 import org.apache.directory.mitosis.common.UUID;
@@ -63,7 +61,7 @@
     private static Logger log = LoggerFactory.getLogger( ReplicationConfiguration.class );
 
     /** The server identifier */ 
-    private ReplicaId replicaId;
+    private String replicaId;
     
     /** Default values for the communication part */
     private int serverPort = DEFAULT_SERVER_PORT;
@@ -157,6 +155,7 @@
         {
             replicationInterval = 0;
         }
+        
         this.replicationInterval = replicationInterval;
     }
 
@@ -220,24 +219,21 @@
     /**
      * Sets the remote peer replica list.
      */
-    public void setPeerReplicas( Set replicas )
+    public void setPeerReplicas( Set<Replica> replicas )
     {
         assert replicas != null;
 
         Set<Replica> normalizedReplicas = new HashSet<Replica>();
-        Iterator i = replicas.iterator();
         
-        while ( i.hasNext() )
+        for ( Object replica:replicas )
         {
-            Object o = i.next();
-            
-            if ( o instanceof Replica )
+            if ( replica instanceof Replica )
             {
-                normalizedReplicas.add( ( Replica ) o );
+                normalizedReplicas.add( ( Replica ) replica );
             }
             else
             {
-                normalizedReplicas.add( new Replica( o.toString() ) );
+                normalizedReplicas.add( new Replica( replica.toString() ) );
             }
         }
         
@@ -248,7 +244,7 @@
     /**
      * Returns the ID of the replica this configuration is configuring.
      */
-    public ReplicaId getReplicaId()
+    public String getReplicaId()
     {
         return replicaId;
     }
@@ -256,9 +252,8 @@
     /**
      * Sets the ID of the replica this configuration is configuring.
      */
-    public void setReplicaId( ReplicaId replicaId )
+    public void setReplicaId( String replicaId )
     {
-        assert replicaId != null;
         this.replicaId = replicaId;
     }
 
@@ -397,7 +392,7 @@
         Map<String, Integer> servers = new HashMap<String, Integer>();
 
         // Initialize the set with this server replicaId
-        ids.add( replicaId.getId() );
+        ids.add( replicaId );
 
         // And store the local inetadress
         servers.put( "localhost", serverPort );
@@ -415,7 +410,7 @@
 
         for ( Replica peer:peerReplicas )
         {
-            if ( ids.contains( peer.getId().getId() ) )
+            if ( ids.contains( peer.getId() ) )
             {
                 log.error( "Peer replica ID '{}' has already been declared.", peer.getId() );
                 throw new ReplicationConfigurationException( "Peer replica ID '" + peer.getId()

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/CompositeOperation.java Sun Aug 24 16:01:41 2008
@@ -22,7 +22,6 @@
 
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.store.ReplicationLogIterator;
@@ -59,13 +58,13 @@
         }
 
 
-        public ReplicaId getReplicaId()
+        public String getReplicaId()
         {
             return null;
         }
 
 
-        public Set<ReplicaId> getKnownReplicaIds()
+        public Set<String> getKnownReplicaIds()
         {
             return null;
         }
@@ -118,7 +117,7 @@
         }
 
 
-        public int getLogSize( ReplicaId replicaId )
+        public int getLogSize( String replicaId )
         {
             return 0;
         }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/operation/OperationFactory.java Sun Aug 24 16:01:41 2008
@@ -23,7 +23,6 @@
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNFactory;
 import org.apache.directory.mitosis.common.Constants;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.UUIDFactory;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -86,7 +85,7 @@
  */
 public class OperationFactory
 {
-    private final ReplicaId replicaId;
+    private final String replicaId;
     private final PartitionNexus nexus;
     private final UUIDFactory uuidFactory;
     private final CSNFactory csnFactory;

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ClientConnectionManager.java Sun Aug 24 16:01:41 2008
@@ -29,7 +29,6 @@
 import java.util.concurrent.TimeUnit;
 
 import org.apache.directory.mitosis.common.Replica;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.service.protocol.codec.ReplicationClientProtocolCodecFactory;
 import org.apache.directory.mitosis.service.protocol.handler.ReplicationClientContextHandler;
@@ -73,7 +72,7 @@
     private final ReplicationInterceptor interceptor;
     private final IoConnector connector = new SocketConnector();
     private final IoConnectorConfig connectorConfig = new SocketConnectorConfig();
-    private final Map<ReplicaId,Connection> sessions = new HashMap<ReplicaId,Connection>();
+    private final Map<String,Connection> sessions = new HashMap<String,Connection>();
     private ReplicationConfiguration configuration;
     private ConnectionMonitor monitor;
 
@@ -170,6 +169,7 @@
             for ( Replica replica : configuration.getPeerReplicas() )
             {
                 Connection con = sessions.get( replica.getId() );
+                
                 if ( con == null )
                 {
                     con = new Connection();
@@ -284,10 +284,11 @@
             LOG.info( "[Replica-{}] Closing all connections...", configuration.getReplicaId() );
             for ( ;; )
             {
-                Iterator i = sessions.values().iterator();
+                Iterator<Connection> i = sessions.values().iterator();
+                
                 while ( i.hasNext() )
                 {
-                    Connection con = ( Connection ) i.next();
+                    Connection con = i.next();
                     synchronized ( con )
                     {
                         if ( con.inProgress )
@@ -404,7 +405,7 @@
         private int delay = -1;
         private boolean inProgress;
         private Connector connector;
-        private ReplicaId replicaId;
+        private String replicaId;
 
 
         public Connection()

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationInterceptor.java Sun Aug 24 16:01:41 2008
@@ -23,7 +23,6 @@
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.Constants;
 import org.apache.directory.mitosis.common.DefaultCSN;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.Operation;
 import org.apache.directory.mitosis.operation.OperationFactory;
@@ -149,7 +148,7 @@
     private static final Logger LOG = LoggerFactory.getLogger( ReplicationInterceptor.class );
 
     /** The service name */
-    public static final String NAME = "replicationService";
+    public static final String DEFAULT_SERVICE_NAME = "replicationService";
 
 
     private static final String ENTRY_CSN_OID = "1.3.6.1.4.1.18060.0.4.1.2.30";
@@ -158,7 +157,7 @@
     /**
      * default name is the service name?
      */
-    private String name = NAME;
+    private String name = DEFAULT_SERVICE_NAME;
 
     private DirectoryService directoryService;
     private ReplicationConfiguration configuration;
@@ -170,19 +169,31 @@
     private Registries registries;
 
 
+    /**
+     * Creates a new instance of ReplicationInterceptor.
+     */
     public ReplicationInterceptor()
     {
     }
 
     /**
-     * this interceptor has configuration so it might be useful to allow several instances in a chain.
+     * This interceptor has configuration so it might be useful to allow several instances in a chain.
+     * 
      * @return configured name for this interceptor.
      */
-    public String getName() {
+    public String getName() 
+    {
         return name;
     }
 
-    public void setName(String name) {
+    
+    /**
+     * Set the name for this service instance
+     *
+     * @param name The new name
+     */
+    public void setName( String name ) 
+    {
         this.name = name;
     }
 
@@ -192,11 +203,19 @@
     }
 
 
-    public void setConfiguration(ReplicationConfiguration configuration) {
+    public void setConfiguration(ReplicationConfiguration configuration) 
+    {
         this.configuration = configuration;
     }
 
 
+    /**
+     * Initialize the Replication service. We have to check that the configuration
+     * is valid, initialize a store for pending operations, and start the communication
+     * with the other LDAP servers.
+     * 
+     * @param directoryService the DirectoryService instance 
+     */
     public void init( DirectoryService directoryService ) throws Exception
     {
         configuration.validate();
@@ -315,7 +334,7 @@
 
         CSN purgeCSN = new DefaultCSN( System.currentTimeMillis() - configuration.getLogMaxAge() * 1000L * 60L * 60L
             * 24L, // convert days to millis
-            new ReplicaId( "ZZZZZZZZZZZZZZZZ" ), Integer.MAX_VALUE );
+            "ZZZZZZZZZZZZZZZZ", Integer.MAX_VALUE );
         ExprNode filter;
 
         try

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java Sun Aug 24 16:01:41 2008
@@ -25,7 +25,6 @@
 import java.nio.charset.CharsetDecoder;
 
 import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
@@ -75,10 +74,11 @@
 
         for ( ; nReplicas > 0; nReplicas-- )
         {
-            ReplicaId replicaId;
+            String replicaId;
+            
             try
             {
-                replicaId = new ReplicaId( in.getString( utf8decoder ) );
+                replicaId = in.getString( utf8decoder );
             }
             catch ( CharacterCodingException e )
             {

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageEncoder.java Sun Aug 24 16:01:41 2008
@@ -24,13 +24,11 @@
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 import org.apache.mina.common.ByteBuffer;
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.BeginLogEntriesAckMessage;
@@ -65,18 +63,18 @@
 
     private void writeCSNVector( ByteBuffer out, CSNVector csns )
     {
-        Set replicaIds = csns.getReplicaIds();
+        Set<String> replicaIds = csns.getReplicaIds();
 
         int nReplicas = replicaIds.size();
         out.putInt( nReplicas );
-        Iterator it = replicaIds.iterator();
-        while ( it.hasNext() )
+        
+        for ( String replicaId:replicaIds )
         {
-            ReplicaId replicaId = ( ReplicaId ) it.next();
             CSN csn = csns.getCSN( replicaId );
+            
             try
             {
-                out.putString( replicaId.getId(), utf8encoder );
+                out.putString( replicaId, utf8encoder );
                 out.put( ( byte ) 0x00 );
                 out.putLong( csn.getTimestamp() );
                 out.putInt( csn.getOperationSequence() );
@@ -89,9 +87,9 @@
     }
 
 
-    public Set getMessageTypes()
+    public Set<Class<?>> getMessageTypes()
     {
-        Set<Class> set = new HashSet<Class>();
+        Set<Class<?>> set = new HashSet<Class<?>>();
         set.add( BeginLogEntriesAckMessage.class );
         return set;
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesMessageEncoder.java Sun Aug 24 16:01:41 2008
@@ -40,9 +40,9 @@
     }
 
 
-    public Set getMessageTypes()
+    public Set<Class<?>> getMessageTypes()
     {
-        Set<Class> set = new HashSet<Class>();
+        Set<Class<?>> set = new HashSet<Class<?>>();
         set.add( BeginLogEntriesMessage.class );
         return set;
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageDecoder.java Sun Aug 24 16:01:41 2008
@@ -26,7 +26,6 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LoginAckMessage;
@@ -45,7 +44,7 @@
 
     protected BaseMessage decodeBody( int sequence, int bodyLength, int responseCode, ByteBuffer in ) throws Exception
     {
-        return new LoginAckMessage( sequence, responseCode, new ReplicaId( in.getString( utf8decoder ) ) );
+        return new LoginAckMessage( sequence, responseCode, in.getString( utf8decoder ) );
     }
 
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageEncoder.java Sun Aug 24 16:01:41 2008
@@ -40,9 +40,9 @@
     }
 
 
-    public Set getMessageTypes()
+    public Set<Class<?>> getMessageTypes()
     {
-        Set<Class> set = new HashSet<Class>();
+        Set<Class<?>> set = new HashSet<Class<?>>();
         set.add( LoginAckMessage.class );
         return set;
     }
@@ -52,7 +52,7 @@
     {
         LoginAckMessage m = ( LoginAckMessage ) in;
         super.encodeBody( in, out );
-        out.putString( m.getReplicaId().getId(), utf8encoder );
+        out.putString( m.getReplicaId(), utf8encoder );
     }
 
 }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageDecoder.java Sun Aug 24 16:01:41 2008
@@ -26,7 +26,6 @@
 import org.apache.mina.common.ByteBuffer;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.filter.codec.ProtocolDecoderOutput;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.message.BaseMessage;
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
@@ -46,7 +45,7 @@
 
     protected BaseMessage decodeBody( int sequence, int bodyLength, ByteBuffer in ) throws Exception
     {
-        return new LoginMessage( sequence, new ReplicaId( in.getString( utf8decoder ) ) );
+        return new LoginMessage( sequence, in.getString( utf8decoder ) );
     }
 
 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageEncoder.java Sun Aug 24 16:01:41 2008
@@ -48,7 +48,7 @@
 
         try
         {
-            out.putString( m.getReplicaId().getId(), utf8encoder );
+            out.putString( m.getReplicaId(), utf8encoder );
         }
         catch ( CharacterCodingException e )
         {
@@ -57,9 +57,9 @@
     }
 
 
-    public Set getMessageTypes()
+    public Set<Class<?>> getMessageTypes()
     {
-        Set<Class> set = new HashSet<Class>();
+        Set<Class<?>> set = new HashSet<Class<?>>();
         set.add( LoginMessage.class );
 
         return set;

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java Sun Aug 24 16:01:41 2008
@@ -24,7 +24,6 @@
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.common.Replica;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.AddEntryOperation;
 import org.apache.directory.mitosis.operation.Operation;
@@ -266,8 +265,8 @@
             // Initiate replication process asking update vector.
             if ( SessionLog.isDebugEnabled( ctx.getSession() ) )
             {
-                SessionLog.debug( ctx.getSession(), "(" + ctx.getConfiguration().getReplicaId().getId() + "->"
-                    + ( ctx.getPeer() != null ? ctx.getPeer().getId().getId() : "null" ) + ") Beginning replication. " );
+                SessionLog.debug( ctx.getSession(), "(" + ctx.getConfiguration().getReplicaId() + "->"
+                    + ( ctx.getPeer() != null ? ctx.getPeer().getId() : "null" ) + ") Beginning replication. " );
             }
             ctx.getSession().write( new BeginLogEntriesMessage( ctx.getNextSequence() ) );
             return true;
@@ -276,8 +275,8 @@
         {
             if ( SessionLog.isDebugEnabled( ctx.getSession() ) )
             {
-                SessionLog.debug( ctx.getSession(), "(" + ctx.getConfiguration().getReplicaId().getId() + "->"
-                    + ( ctx.getPeer() != null ? ctx.getPeer().getId().getId() : "null" )
+                SessionLog.debug( ctx.getSession(), "(" + ctx.getConfiguration().getReplicaId() + "->"
+                    + ( ctx.getPeer() != null ? ctx.getPeer().getId() : "null" )
                     + ") Couldn't begin replication.  State:" + ctx.getState() + ", scheduledExpirations:"
                     + ctx.getScheduledExpirations() + ", scheduledWriteRequests:"
                     + ctx.getSession().getScheduledWriteRequests() );
@@ -450,10 +449,11 @@
     @SuppressWarnings("unchecked")
     private void sendReplicationLogs( ReplicationContext ctx, CSNVector myPV, CSNVector yourUV )
     {
-        for ( ReplicaId replicaId : myPV.getReplicaIds() )
+        for ( String replicaId : myPV.getReplicaIds() )
         {
             CSN myCSN = myPV.getCSN( replicaId );
             CSN yourCSN = yourUV.getCSN( replicaId );
+            
             if ( yourCSN != null && ( myCSN == null || yourCSN.compareTo( myCSN ) < 0 ) )
             {
                 SessionLog.warn( ctx.getSession(), "Remote update vector (" + yourUV

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginAckMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginAckMessage.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginAckMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginAckMessage.java Sun Aug 24 16:01:41 2008
@@ -22,16 +22,15 @@
 
 import org.apache.directory.shared.ldap.util.EqualsBuilder;
 import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 
 
 public class LoginAckMessage extends ResponseMessage
 {
-    private ReplicaId replicaId;
+    private String replicaId;
 
 
-    public LoginAckMessage( int sequence, int responseCode, ReplicaId replicaId )
+    public LoginAckMessage( int sequence, int responseCode, String replicaId )
     {
         super( sequence, responseCode );
         this.replicaId = replicaId;
@@ -44,7 +43,7 @@
     }
 
 
-    public ReplicaId getReplicaId()
+    public String getReplicaId()
     {
         return replicaId;
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginMessage.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LoginMessage.java Sun Aug 24 16:01:41 2008
@@ -22,16 +22,15 @@
 
 import org.apache.directory.shared.ldap.util.EqualsBuilder;
 import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.Constants;
 
 
 public class LoginMessage extends BaseMessage
 {
-    private final ReplicaId replicaId;
+    private final String replicaId;
 
 
-    public LoginMessage( int sequence, ReplicaId replicaId )
+    public LoginMessage( int sequence, String replicaId )
     {
         super( sequence );
 
@@ -45,7 +44,7 @@
     }
 
 
-    public ReplicaId getReplicaId()
+    public String getReplicaId()
     {
         return replicaId;
     }

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStore.java Sun Aug 24 16:01:41 2008
@@ -22,7 +22,6 @@
 
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.Operation;
@@ -47,24 +46,27 @@
      * Opens this storage.
      */
     void open( DirectoryService directoryService, ReplicationConfiguration cfg );
+    
 
     /**
      * Closes this storage and releases the resources allocated when it's
      * opened.
      */
     void close();
+    
 
     /**
-     * Returns the {@link ReplicaId} of the {@link ReplicaId} that this storage
+     * Returns the ReplicaId of the ReplicaId that this storage
      * is associated with.
      */
-    ReplicaId getReplicaId();
+    String getReplicaId();
+    
 
     /**
-     * Returns the set of {@link ReplicaId}s of the {@link ReplicaId}s that
+     * Returns the set of ReplicaIds of the ReplicaIds that
      * belongs to the same cluster.
      */
-    Set<ReplicaId> getKnownReplicaIds();
+    Set<String> getKnownReplicaIds();
 
 
     // UUID to DN table operations
@@ -73,12 +75,14 @@
      * Finds the {@link Name} of an entry with the specified {@link UUID}.
      */
     Name getDN( UUID uuid );
+    
 
     /**
      * Associates the specified name and UUID so a user can
      * find an entry's name from a UUID.
      */
     boolean putUUID( UUID uuid, Name dn );
+    
 
     /**
      * Removed the specified UUID mapping from this storage.
@@ -93,6 +97,7 @@
      * Puts the specified operation into this storage.
      */
     void putLog( Operation operation );
+    
 
     /**
      * Queries all operations that is greater than the specified {@link CSN}.
@@ -101,6 +106,7 @@
      *                  itself in the result set.
      */
     ReplicationLogIterator getLogs( CSN fromCSN, boolean inclusive );
+    
 
     /**
      * Queries all operations that is greater than the specified
@@ -110,6 +116,7 @@
      *                  <tt>updateVector</tt> itself in the result set.
      */
     ReplicationLogIterator getLogs( CSNVector updateVector, boolean inclusive );
+    
 
     /**
      * Removes all operations that is less than the specified {@link CSN}.
@@ -119,23 +126,27 @@
      * @return the number of deleted {@link Operation}s
      */
     int removeLogs( CSN toCSN, boolean inclusive );
+    
 
     /**
      * Returns the number of {@link Operation}s logged in this storage.
      */
     int getLogSize();
+    
 
     /**
      * Returns the number of {@link Operation}s logged by
-     * the {@link ReplicaId} with the specified {@link ReplicaId}
+     * the ReplicaId with the specified ReplicaId
      * in this storage .
      */
-    int getLogSize( ReplicaId replicaId );
+    int getLogSize( String replicaId );
+    
 
     /**
      * Calculates the Update Vector (UV) from this storage. 
      */
     CSNVector getUpdateVector();
+    
 
     /**
      * Calculates the Purge Vector (PV) from this storage. 

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java Sun Aug 24 16:01:41 2008
@@ -26,7 +26,6 @@
 import java.sql.Statement;
 
 import org.apache.directory.mitosis.common.CSN;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.operation.Operation;
 import org.apache.directory.mitosis.operation.OperationCodec;
@@ -74,7 +73,7 @@
     {
         try
         {
-            ReplicaId replicaId = new ReplicaId( rs.getString( 1 ) );
+            String replicaId = rs.getString( 1 );
             long timestamp = rs.getLong( 2 );
             int operationSequence = rs.getInt( 3 );
             return new DefaultCSN( timestamp, replicaId, operationSequence );

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java Sun Aug 24 16:01:41 2008
@@ -24,7 +24,6 @@
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.DefaultCSN;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.Operation;
@@ -46,7 +45,6 @@
 import java.sql.SQLException;
 import java.sql.Statement;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.Set;
 
 
@@ -62,12 +60,12 @@
 
     private String dbURI;
     private BasicDataSource dataSource;
-    private ReplicaId replicaId;
+    private String replicaId;
     private String tablePrefix = DEFAULT_TABLE_PREFIX;
     private String metadataTableName;
     private String uuidTableName;
     private String logTableName;
-    private Set<ReplicaId> knownReplicaIds;
+    private Set<String> knownReplicaIds;
     private final Object knownReplicaIdsLock = new Object();
     private final OperationCodec operationCodec = new OperationCodec();
 
@@ -216,7 +214,7 @@
             {
                 // If already registered, match it with what user specified.
                 String actualReplicaId = rs.getString( 1 );
-                if ( !replicaId.getId().equalsIgnoreCase( actualReplicaId ) )
+                if ( !replicaId.equalsIgnoreCase( actualReplicaId ) )
                 {
                     throw new ReplicationStoreException( "Replica ID mismatches: " + actualReplicaId + " (expected: "
                         + replicaId + ")" );
@@ -233,7 +231,7 @@
                 // If not registered yet, register with what user specified.
                 ps = con.prepareStatement( "INSERT INTO " + metadataTableName + " (M_KEY, M_VALUE) VALUES (?,?)" );
                 ps.setString( 1, KEY_REPLICA_ID );
-                ps.setString( 2, replicaId.getId() );
+                ps.setString( 2, replicaId );
                 ps.executeUpdate();
             }
 
@@ -248,10 +246,11 @@
             // Get known replica IDs.
             ps = con.prepareStatement( "SELECT DISTINCT CSN_REPLICA_ID FROM " + logTableName );
             rs = ps.executeQuery();
-            knownReplicaIds = new HashSet<ReplicaId>();
+            knownReplicaIds = new HashSet<String>();
+            
             while ( rs.next() )
             {
-                knownReplicaIds.add( new ReplicaId( rs.getString( 1 ) ) );
+                knownReplicaIds.add( rs.getString( 1 ) );
             }
         }
         catch ( Exception e )
@@ -293,15 +292,15 @@
     }
 
 
-    public ReplicaId getReplicaId()
+    public String getReplicaId()
     {
         return replicaId;
     }
 
 
-    public Set<ReplicaId> getKnownReplicaIds()
+    public Set<String> getKnownReplicaIds()
     {
-        return new HashSet<ReplicaId>( knownReplicaIds );
+        return new HashSet<String>( knownReplicaIds );
     }
 
 
@@ -441,7 +440,7 @@
             // Check if the specified uuid already exists
             ps = con.prepareStatement( "INSERT INTO " + logTableName
                 + " (CSN_REPLICA_ID, CSN_TIMESTAMP, CSN_OP_SEQ, OPERATION) VALUES(?,?,?,?)" );
-            ps.setString( 1, csn.getReplicaId().getId() );
+            ps.setString( 1, csn.getReplicaId() );
             ps.setLong( 2, csn.getTimestamp() );
             ps.setInt( 3, csn.getOperationSequence() );
             ps.setBytes( 4, encodedOp );
@@ -468,7 +467,7 @@
         {
             synchronized ( knownReplicaIdsLock )
             {
-                Set<ReplicaId> newKnownReplicaIds = new HashSet<ReplicaId>( knownReplicaIds );
+                Set<String> newKnownReplicaIds = new HashSet<String>( knownReplicaIds );
                 newKnownReplicaIds.add( csn.getReplicaId() );
                 knownReplicaIds = newKnownReplicaIds;
             }
@@ -520,18 +519,17 @@
             // Check if the specified uuid already exists
             ps = con.prepareStatement( query );
 
-            Iterator<ReplicaId> i = updateVector.getReplicaIds().iterator();
             int paramIdx = 1;
             
-            while ( i.hasNext() )
+            for ( String replicaId:updateVector.getReplicaIds() )
             {
-                ReplicaId replicaId = i.next();
                 CSN csn = updateVector.getCSN( replicaId );
-                ps.setString( paramIdx++, replicaId.getId() );
+                ps.setString( paramIdx++, replicaId );
                 ps.setLong( paramIdx++, csn.getTimestamp() );
                 ps.setInt( paramIdx++, csn.getOperationSequence() );
                 ps.setLong( paramIdx++, csn.getTimestamp() );
             }
+            
             rs = ps.executeQuery();
 
             return new DerbyReplicationLogIterator( operationCodec, con, ps, rs );
@@ -548,7 +546,7 @@
         CSNVector newUV = new CSNVector();
         synchronized ( knownReplicaIds )
         {
-            for ( ReplicaId knownReplicaId : knownReplicaIds )
+            for ( String knownReplicaId : knownReplicaIds )
             {
                 newUV.setCSN( new DefaultCSN( 0, knownReplicaId, 0 ) );
             }
@@ -578,7 +576,7 @@
                     + " " + "WHERE CSN_REPLICA_ID = ? AND (CSN_TIMESTAMP = ? AND CSN_OP_SEQ >"
                     + ( inclusive ? "=" : "" ) + " ? OR CSN_TIMESTAMP > ?) "
                     + "ORDER BY CSN_TIMESTAMP ASC, CSN_OP_SEQ ASC" );
-            ps.setString( 1, fromCSN.getReplicaId().getId() );
+            ps.setString( 1, fromCSN.getReplicaId() );
             ps.setLong( 2, fromCSN.getTimestamp() );
             ps.setInt( 3, fromCSN.getOperationSequence() );
             ps.setLong( 4, fromCSN.getTimestamp() );
@@ -609,7 +607,7 @@
             ps = con.prepareStatement( "DELETE FROM " + logTableName + " WHERE "
                 + "CSN_REPLICA_ID = ? AND (CSN_TIMESTAMP = ? AND CSN_OP_SEQ <" + ( inclusive ? "=" : "" )
                 + " ? OR CSN_TIMESTAMP < ?)" );
-            ps.setString( 1, toCSN.getReplicaId().getId() );
+            ps.setString( 1, toCSN.getReplicaId() );
             ps.setLong( 2, toCSN.getTimestamp() );
             ps.setInt( 3, toCSN.getOperationSequence() );
             ps.setLong( 4, toCSN.getTimestamp() );
@@ -653,7 +651,7 @@
     }
 
 
-    public int getLogSize( ReplicaId replicaId )
+    public int getLogSize( String replicaId )
     {
         Connection con = null;
         PreparedStatement ps = null;
@@ -665,7 +663,7 @@
             con.setTransactionIsolation( Connection.TRANSACTION_READ_COMMITTED );
             con.setReadOnly( true );
             ps = con.prepareStatement( "SELECT COUNT(*) FROM " + logTableName + " WHERE CSN_REPLICA_ID=?" );
-            ps.setString( 1, replicaId.getId() );
+            ps.setString( 1, replicaId );
             rs = ps.executeQuery();
             rs.next();
             return rs.getInt( 1 );
@@ -710,16 +708,16 @@
             ps = con.prepareStatement( "SELECT CSN_TIMESTAMP, CSN_OP_SEQ FROM " + logTableName
                 + " WHERE CSN_REPLICA_ID=? ORDER BY CSN_TIMESTAMP " + ORDER + ", CSN_OP_SEQ " + ORDER );
 
-            Iterator<ReplicaId> it = knownReplicaIds.iterator();
-            while ( it.hasNext() )
+            for ( String replicaId:knownReplicaIds )
             {
-                ReplicaId replicaId = it.next();
-                ps.setString( 1, replicaId.getId() );
+                ps.setString( 1, replicaId );
                 rs = ps.executeQuery();
+                
                 if ( rs.next() )
                 {
                     result.setCSN( new DefaultCSN( rs.getLong( 1 ), replicaId, rs.getInt( 2 ) ) );
                 }
+                
                 rs.close();
                 rs = null;
                 ps.clearParameters();

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/AbstractReplicationServiceTestCase.java Sun Aug 24 16:01:41 2008
@@ -22,7 +22,6 @@
 
 import org.apache.commons.io.FileUtils;
 import org.apache.directory.mitosis.common.Replica;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.server.constants.ServerDNConstants;
 import org.apache.directory.server.core.DefaultDirectoryService;
@@ -86,7 +85,7 @@
             int replicationPort = AvailablePortFinder.getNextAvailable( lastAvailablePort );
             lastAvailablePort = replicationPort + 1;
 
-            replicas[ i ] = new Replica( new ReplicaId( names[ i ] ),
+            replicas[ i ] = new Replica( names[ i ],
                     new InetSocketAddress( "127.0.0.1", replicationPort ) );
         }
 
@@ -97,7 +96,7 @@
 
         for ( Replica replica : replicas )
         {
-            String replicaId = replica.getId().getId();
+            String replicaId = replica.getId();
             DirectoryService service = new DefaultDirectoryService();
             service.setInstanceId( replicaId );
             File workDir = new File( homeDirectory + File.separator + service.getInstanceId() );

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java Sun Aug 24 16:01:41 2008
@@ -21,7 +21,6 @@
 
 
 import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesAckMessageDecoder;
@@ -37,15 +36,15 @@
 
     static
     {
-        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 400, new ReplicaId( "replica0" ), 3456 ) );
-        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 300, new ReplicaId( "replica1" ), 9012 ) );
-        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 200, new ReplicaId( "replica2" ), 5678 ) );
-        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 100, new ReplicaId( "replica3" ), 1234 ) );
-
-        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 000, new ReplicaId( "replica0" ), 1234 ) );
-        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 100, new ReplicaId( "replica1" ), 5678 ) );
-        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 200, new ReplicaId( "replica2" ), 9012 ) );
-        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 300, new ReplicaId( "replica3" ), 3456 ) );
+        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 400, "replica0", 3456 ) );
+        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 300, "replica1", 9012 ) );
+        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 200, "replica2", 5678 ) );
+        PURGE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() - 100, "replica3", 1234 ) );
+
+        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 000, "replica0", 1234 ) );
+        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 100, "replica1", 5678 ) );
+        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 200, "replica2", 9012 ) );
+        UPDATE_VECTOR.setCSN( new DefaultCSN( System.currentTimeMillis() + 300, "replica3", 3456 ) );
     }
 
 

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java Sun Aug 24 16:01:41 2008
@@ -26,7 +26,6 @@
 import javax.naming.InvalidNameException;
 import javax.naming.NamingException;
 
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.operation.AddAttributeOperation;
 import org.apache.directory.mitosis.service.protocol.codec.LogEntryMessageDecoder;
@@ -70,7 +69,7 @@
                 1234, 
                 new AddAttributeOperation( 
                     new DefaultCSN( System.currentTimeMillis(),
-                        new ReplicaId( "testReplica0" ), 1234 ), 
+                        "testReplica0", 1234 ), 
                     new LdapDN( "ou=system" ).normalize( oids ),
                     new DefaultServerAttribute( "ou", 
                         service.getRegistries().getAttributeTypeRegistry().lookup( "ou" ), "Test" ) ) ), 

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginAckMessageCodecTest.java Sun Aug 24 16:01:41 2008
@@ -20,7 +20,6 @@
 package org.apache.directory.mitosis.service.protocol.codec;
 
 
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.codec.LoginAckMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.LoginAckMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.LoginAckMessage;
@@ -31,7 +30,7 @@
 
     public LoginAckMessageCodecTest()
     {
-        super( new LoginAckMessage( 1234, 5678, new ReplicaId( "ReplicaABCD" ) ), new LoginAckMessageEncoder(),
+        super( new LoginAckMessage( 1234, 5678, "ReplicaABCD" ), new LoginAckMessageEncoder(),
             new LoginAckMessageDecoder() );
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LoginMessageCodecTest.java Sun Aug 24 16:01:41 2008
@@ -20,7 +20,6 @@
 package org.apache.directory.mitosis.service.protocol.codec;
 
 
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.service.protocol.codec.LoginMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.LoginMessageEncoder;
 import org.apache.directory.mitosis.service.protocol.message.LoginMessage;
@@ -31,7 +30,7 @@
 
     public LoginMessageCodecTest()
     {
-        super( new LoginMessage( 1234, new ReplicaId( "myReplica0" ) ), new LoginMessageEncoder(),
+        super( new LoginMessage( 1234, "myReplica0" ), new LoginMessageEncoder(),
             new LoginMessageDecoder() );
     }
 }

Modified: directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java?rev=688573&r1=688572&r2=688573&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java (original)
+++ directory/apacheds/trunk/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java Sun Aug 24 16:01:41 2008
@@ -47,7 +47,6 @@
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.CSNFactory;
 import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.common.ReplicaId;
 import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.common.DefaultCSNFactory;
 import org.apache.directory.mitosis.common.DefaultUUIDFactory;
@@ -66,9 +65,9 @@
 
 public class DerbyReplicationStoreTest extends TestCase
 {
-    private static final ReplicaId REPLICA_ID = new ReplicaId( "TEST_REPLICA" );
-    private static final ReplicaId OTHER_REPLICA_ID = new ReplicaId( "OTHER_REPLICA" );
-    private static final ReplicaId OTHER_REPLICA_ID_2 = new ReplicaId( "OTHER_REPLICA_2" );
+    private static final String REPLICA_ID = "TEST_REPLICA";
+    private static final String OTHER_REPLICA_ID = "OTHER_REPLICA";
+    private static final String OTHER_REPLICA_ID_2 = "OTHER_REPLICA_2";
     private static final File DB_PATH = new File( "target/testDB" );
 
     private final UUIDFactory uuidFactory = new DefaultUUIDFactory();
@@ -87,7 +86,7 @@
     }
 
 
-    private void startupDatabase( ReplicaId replicaId ) throws Exception
+    private void startupDatabase( String replicaId ) throws Exception
     {
         // Prepare configuration
         ReplicationConfiguration cfg = new ReplicationConfiguration();
@@ -316,7 +315,7 @@
         store.putLog( new Operation( csnC ) );
         store.putLog( new Operation( csnD ) );
 
-        Set<ReplicaId> expectedKnownReplicaIds = new HashSet<ReplicaId>();
+        Set<String> expectedKnownReplicaIds = new HashSet<String>();
         expectedKnownReplicaIds.add( REPLICA_ID );
         expectedKnownReplicaIds.add( OTHER_REPLICA_ID );
         expectedKnownReplicaIds.add( OTHER_REPLICA_ID_2 );



Mime
View raw message