directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r488514 - in /directory/trunks/apacheds/mitosis/src: main/java/org/apache/directory/mitosis/common/ main/java/org/apache/directory/mitosis/configuration/ main/java/org/apache/directory/mitosis/operation/support/ main/java/org/apache/directo...
Date Tue, 19 Dec 2006 03:24:39 GMT
Author: trustin
Date: Mon Dec 18 19:24:38 2006
New Revision: 488514

URL: http://svn.apache.org/viewvc?view=rev&rev=488514
Log:
Renamed Simple* classes with no alternative implementation to Default*

Added:
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java
      - copied, changed from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSN.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java
      - copied, changed from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSNFactory.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUID.java
      - copied, changed from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUID.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUIDFactory.java
      - copied, changed from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUIDFactory.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/DefaultCSNTest.java
      - copied, changed from r488484, directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
Removed:
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSN.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSNFactory.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUID.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUIDFactory.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
Modified:
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java
    directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
    directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java

Copied: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java
(from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSN.java)
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java?view=diff&rev=488514&p1=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSN.java&r1=488484&p2=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSN.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSN.java
Mon Dec 18 19:24:38 2006
@@ -30,7 +30,7 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SimpleCSN implements CSN, Serializable, Comparable
+public class DefaultCSN implements CSN, Serializable, Comparable
 {
     /**
      * Declares the Serial Version Uid.
@@ -64,7 +64,7 @@
      * @param replicaId Replica ID where modification occurred (<tt>[-_A-Za-z0-9]{1,16}</tt>)
      * @param operationSequence Operation sequence
      */
-    public SimpleCSN( long timestamp, ReplicaId replicaId, int operationSequence )
+    public DefaultCSN( long timestamp, ReplicaId replicaId, int operationSequence )
     {
         this.timestamp = timestamp;
         this.replicaId = replicaId;
@@ -80,7 +80,7 @@
      *
      * @param value The String containing the CSN
      */
-    public SimpleCSN( String value ) throws InvalidCSNException
+    public DefaultCSN( String value ) throws InvalidCSNException
     {
         assert value != null;
 
@@ -129,7 +129,7 @@
      *
      * @param value The byte array which contains the serialized CSN
      */
-    public SimpleCSN( byte[] value )
+    public DefaultCSN( byte[] value )
     {
         timestamp = ( ( long ) ( value[0] & 0x00FF ) << 56 ) | ( ( long ) ( value[1]
& 0x00FF ) << 48 )
             | ( ( long ) ( value[2] & 0x00FF ) << 40 ) | ( ( long ) ( value[3]
& 0x00FF ) << 32 )

Copied: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java
(from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSNFactory.java)
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java?view=diff&rev=488514&p1=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSNFactory.java&r1=488484&p2=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleCSNFactory.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultCSNFactory.java
Mon Dec 18 19:24:38 2006
@@ -25,13 +25,13 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SimpleCSNFactory implements CSNFactory
+public class DefaultCSNFactory implements CSNFactory
 {
     private static int operationSequence;
     private static long lastTimestamp = System.currentTimeMillis();
 
 
-    public SimpleCSNFactory()
+    public DefaultCSNFactory()
     {
     }
 
@@ -58,7 +58,7 @@
             operationSequence = 0;
         }
 
-        CSN newCSN = new SimpleCSN( newTimestamp, replicaId, operationSequence++ );
+        CSN newCSN = new DefaultCSN( newTimestamp, replicaId, operationSequence++ );
         lastTimestamp = newTimestamp;
         return newCSN;
     }

Copied: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUID.java
(from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUID.java)
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUID.java?view=diff&rev=488514&p1=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUID.java&r1=488484&p2=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUID.java&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUID.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUID.java
Mon Dec 18 19:24:38 2006
@@ -28,14 +28,14 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SimpleUUID implements UUID
+public class DefaultUUID implements UUID
 {
     private static final long serialVersionUID = 3256721788405953846L;
 
     private final String uuid;
 
 
-    public SimpleUUID( byte[] uuid )
+    public DefaultUUID( byte[] uuid )
     {
         if ( uuid.length != 16 )
         {
@@ -46,7 +46,7 @@
     }
 
 
-    public SimpleUUID( String uuid )
+    public DefaultUUID( String uuid )
     {
         String newUUID = uuid.replaceAll( "[^0-9A-Za-z]", "" );
 

Copied: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUIDFactory.java
(from r488484, directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUIDFactory.java)
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUIDFactory.java?view=diff&rev=488514&p1=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUIDFactory.java&r1=488484&p2=directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUIDFactory.java&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/SimpleUUIDFactory.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/common/DefaultUUIDFactory.java
Mon Dec 18 19:24:38 2006
@@ -28,12 +28,12 @@
  * 
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SimpleUUIDFactory implements UUIDFactory
+public class DefaultUUIDFactory implements UUIDFactory
 {
     private static final UUIDGenerator generator = UUIDGenerator.getInstance();
 
 
-    public SimpleUUIDFactory()
+    public DefaultUUIDFactory()
     {
     }
 
@@ -44,6 +44,6 @@
     public UUID newInstance()
     {
         org.safehaus.uuid.UUID uuid = generator.generateTimeBasedUUID();
-        return new SimpleUUID( uuid.asByteArray() );
+        return new DefaultUUID( uuid.asByteArray() );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/configuration/ReplicationConfiguration.java
Mon Dec 18 19:24:38 2006
@@ -33,8 +33,8 @@
 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.SimpleCSNFactory;
-import org.apache.directory.mitosis.common.SimpleUUIDFactory;
+import org.apache.directory.mitosis.common.DefaultCSNFactory;
+import org.apache.directory.mitosis.common.DefaultUUIDFactory;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.common.UUIDFactory;
 import org.apache.directory.mitosis.service.ReplicationService;
@@ -67,8 +67,8 @@
 
     private final Set<Replica> peerReplicas = new HashSet<Replica>();
     
-    private UUIDFactory uuidFactory = new SimpleUUIDFactory();
-    private CSNFactory csnFactory = new SimpleCSNFactory();
+    private UUIDFactory uuidFactory = new DefaultUUIDFactory();
+    private CSNFactory csnFactory = new DefaultCSNFactory();
     private ReplicationStore store = new DerbyReplicationStore();
     private int logMaxAge = DEFAULT_LOG_MAX_AGE; // a week (days)
 
@@ -154,7 +154,7 @@
 
     /**
      * Returns the {@link CSNFactory} for generating {@link CSN}s.
-     * The default factory is {@link SimpleCSNFactory}.
+     * The default factory is {@link DefaultCSNFactory}.
      */
     public CSNFactory getCsnFactory()
     {
@@ -164,7 +164,7 @@
 
     /**
      * Sets the {@link CSNFactory} for generating {@link CSN}s.
-     * The default factory is {@link SimpleCSNFactory}.
+     * The default factory is {@link DefaultCSNFactory}.
      */
     public void setCsnFactory( CSNFactory csnFactory )
     {
@@ -273,7 +273,7 @@
     /**
      * Returns the {@link UUIDFactory} which generates {@link UUID}s for
      * new directory entries.  The default implementation is
-     * {@link SimpleUUIDFactory}.
+     * {@link DefaultUUIDFactory}.
      */
     public UUIDFactory getUuidFactory()
     {
@@ -283,7 +283,7 @@
     /**
      * Sets the {@link UUIDFactory} which generates {@link UUID}s for
      * new directory entries.  The default implementation is
-     * {@link SimpleUUIDFactory}.
+     * {@link DefaultUUIDFactory}.
      */
     public void setUuidFactory( UUIDFactory uuidFactory )
     {

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/operation/support/EntryUtil.java
Mon Dec 18 19:24:38 2006
@@ -32,7 +32,7 @@
 import org.apache.directory.shared.ldap.util.NamespaceTools;
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.Constants;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 
 
 public class EntryUtil
@@ -59,7 +59,7 @@
 
             try
             {
-                oldCSN = new SimpleCSN( String.valueOf( entryCSNAttr.get() ) );
+                oldCSN = new DefaultCSN( String.valueOf( entryCSNAttr.get() ) );
             }
             catch ( IllegalArgumentException e )
             {

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/ReplicationService.java
Mon Dec 18 19:24:38 2006
@@ -41,7 +41,7 @@
 import org.apache.directory.mitosis.common.Constants;
 import org.apache.directory.mitosis.common.Replica;
 import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.Operation;
 import org.apache.directory.mitosis.operation.OperationFactory;
@@ -274,7 +274,7 @@
             throw new NamingException( "No namingContexts attributes in rootDSE." );
         }
 
-        CSN purgeCSN = new SimpleCSN( System.currentTimeMillis() - configuration.getLogMaxAge()
* 1000L * 60L * 60L
+        CSN purgeCSN = new DefaultCSN( System.currentTimeMillis() - configuration.getLogMaxAge()
* 1000L * 60L * 60L
             * 24L, // convert days to millis
             new ReplicaId( "ZZZZZZZZZZZZZZZZ" ), Integer.MAX_VALUE );
         FilterParser parser = new FilterParserImpl();

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageDecoder.java
Mon Dec 18 19:24:38 2006
@@ -26,7 +26,7 @@
 
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 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;
@@ -85,7 +85,7 @@
                 throw new ProtocolDecoderException( "Invalid replicaId", e );
             }
 
-            updateVector.setCSN( new SimpleCSN( in.getLong(), replicaId, in.getInt() ) );
+            updateVector.setCSN( new DefaultCSN( in.getLong(), replicaId, in.getInt() ) );
         }
     }
 

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationClientContextHandler.java
Mon Dec 18 19:24:38 2006
@@ -39,7 +39,7 @@
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.Replica;
 import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.operation.AddEntryOperation;
 import org.apache.directory.mitosis.operation.Operation;
 import org.apache.directory.mitosis.service.ReplicationContext;
@@ -324,7 +324,7 @@
                 CSN csn = null;
                 try
                 {
-                    csn = new SimpleCSN( String.valueOf( entryCSNAttr.get() ) );
+                    csn = new DefaultCSN( String.valueOf( entryCSNAttr.get() ) );
                 }
                 catch ( IllegalArgumentException ex )
                 {

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationLogIterator.java
Mon Dec 18 19:24:38 2006
@@ -27,7 +27,7 @@
 
 import org.apache.directory.mitosis.common.CSN;
 import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.operation.Operation;
 import org.apache.directory.mitosis.operation.OperationCodec;
 import org.apache.directory.mitosis.store.ReplicationLogIterator;
@@ -77,7 +77,7 @@
             ReplicaId replicaId = new ReplicaId( rs.getString( 1 ) );
             long timestamp = rs.getLong( 2 );
             int operationSequence = rs.getInt( 3 );
-            return new SimpleCSN( timestamp, replicaId, operationSequence );
+            return new DefaultCSN( timestamp, replicaId, operationSequence );
         }
         catch ( Exception e )
         {

Modified: directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java
(original)
+++ directory/trunks/apacheds/mitosis/src/main/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStore.java
Mon Dec 18 19:24:38 2006
@@ -39,7 +39,7 @@
 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.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
 import org.apache.directory.mitosis.operation.Operation;
@@ -550,7 +550,7 @@
             Iterator<ReplicaId> i = knownReplicaIds.iterator();
             while ( i.hasNext() )
             {
-                newUV.setCSN( new SimpleCSN( 0, i.next(), 0 ) );
+                newUV.setCSN( new DefaultCSN( 0, i.next(), 0 ) );
             }
         }
 
@@ -718,7 +718,7 @@
                 rs = ps.executeQuery();
                 if ( rs.next() )
                 {
-                    result.setCSN( new SimpleCSN( rs.getLong( 1 ), replicaId, rs.getInt(
2 ) ) );
+                    result.setCSN( new DefaultCSN( rs.getLong( 1 ), replicaId, rs.getInt(
2 ) ) );
                 }
                 rs.close();
                 rs = null;

Copied: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/DefaultCSNTest.java
(from r488484, directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java)
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/DefaultCSNTest.java?view=diff&rev=488514&p1=directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java&r1=488484&p2=directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/DefaultCSNTest.java&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/SimpleCSNTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/common/DefaultCSNTest.java
Mon Dec 18 19:24:38 2006
@@ -29,14 +29,14 @@
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class SimpleCSNTest extends TestCase
+public class DefaultCSNTest extends TestCase
 {
 
     public void testCSN()
     {
         long ts = System.currentTimeMillis();
 
-        CSN csn = new SimpleCSN( Long.toString( ts, 16 ) + ":abcdefghi0123:" + 1 );
+        CSN csn = new DefaultCSN( Long.toString( ts, 16 ) + ":abcdefghi0123:" + 1 );
 
         assertEquals( ts, csn.getTimestamp() );
         assertEquals( 1, csn.getOperationSequence() );
@@ -48,7 +48,7 @@
     {
         try
         {
-            new SimpleCSN( "" );
+            new DefaultCSN( "" );
             fail();
         }
         catch ( AssertionError ae )
@@ -66,7 +66,7 @@
     {
         try
         {
-            new SimpleCSN( "123" );
+            new DefaultCSN( "123" );
             fail();
         }
         catch ( AssertionError ae )
@@ -84,7 +84,7 @@
     {
         try
         {
-            new SimpleCSN( "zzz:abc:1" );
+            new DefaultCSN( "zzz:abc:1" );
             fail();
         }
         catch ( AssertionError ae )
@@ -102,7 +102,7 @@
     {
         try
         {
-            new SimpleCSN( ":abc:1" );
+            new DefaultCSN( ":abc:1" );
             fail();
         }
         catch ( AssertionError ae )
@@ -120,7 +120,7 @@
     {
         try
         {
-            new SimpleCSN( "123:*:1" );
+            new DefaultCSN( "123:*:1" );
             fail();
         }
         catch ( AssertionError ae )
@@ -138,7 +138,7 @@
     {
         try
         {
-            new SimpleCSN( "123::1" );
+            new DefaultCSN( "123::1" );
             fail();
         }
         catch ( AssertionError ae )
@@ -156,7 +156,7 @@
     {
         try
         {
-            new SimpleCSN( "123:abc:zzz" );
+            new DefaultCSN( "123:abc:zzz" );
             fail();
         }
         catch ( AssertionError ae )
@@ -174,7 +174,7 @@
     {
         try
         {
-            new SimpleCSN( "123:abc:" );
+            new DefaultCSN( "123:abc:" );
             fail();
         }
         catch ( AssertionError ae )
@@ -192,7 +192,7 @@
     {
         try
         {
-            new SimpleCSN( "123:abc" );
+            new DefaultCSN( "123:abc" );
             fail();
         }
         catch ( AssertionError ae )
@@ -208,7 +208,7 @@
 
     public void testCSNToBytes()
     {
-        CSN csn = new SimpleCSN( "0123456789abcdef:test:5678cdef" );
+        CSN csn = new DefaultCSN( "0123456789abcdef:test:5678cdef" );
 
         byte[] bytes = csn.toBytes();
 
@@ -227,7 +227,7 @@
 
         assertEquals( "test", new String( bytes, 12, bytes.length - 12 ) );
 
-        CSN deserializedCSN = new SimpleCSN( bytes );
+        CSN deserializedCSN = new DefaultCSN( bytes );
         assertEquals( csn, deserializedCSN );
     }
 }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/BeginLogEntriesAckMessageCodecTest.java
Mon Dec 18 19:24:38 2006
@@ -22,7 +22,7 @@
 
 import org.apache.directory.mitosis.common.CSNVector;
 import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.service.protocol.Constants;
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesAckMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.BeginLogEntriesAckMessageEncoder;
@@ -37,15 +37,15 @@
 
     static
     {
-        PURGE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() - 400, new ReplicaId(
"replica0" ), 3456 ) );
-        PURGE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() - 300, new ReplicaId(
"replica1" ), 9012 ) );
-        PURGE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() - 200, new ReplicaId(
"replica2" ), 5678 ) );
-        PURGE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() - 100, new ReplicaId(
"replica3" ), 1234 ) );
+        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 SimpleCSN( System.currentTimeMillis() + 000, new ReplicaId(
"replica0" ), 1234 ) );
-        UPDATE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() + 100, new ReplicaId(
"replica1" ), 5678 ) );
-        UPDATE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() + 200, new ReplicaId(
"replica2" ), 9012 ) );
-        UPDATE_VECTOR.setCSN( new SimpleCSN( System.currentTimeMillis() + 300, new ReplicaId(
"replica3" ), 3456 ) );
+        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 ) );
     }
 
 

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/service/protocol/codec/LogEntryMessageCodecTest.java
Mon Dec 18 19:24:38 2006
@@ -24,7 +24,7 @@
 import javax.naming.directory.BasicAttribute;
 
 import org.apache.directory.mitosis.common.ReplicaId;
-import org.apache.directory.mitosis.common.SimpleCSN;
+import org.apache.directory.mitosis.common.DefaultCSN;
 import org.apache.directory.mitosis.operation.AddAttributeOperation;
 import org.apache.directory.mitosis.service.protocol.codec.LogEntryMessageDecoder;
 import org.apache.directory.mitosis.service.protocol.codec.LogEntryMessageEncoder;
@@ -39,7 +39,7 @@
     public LogEntryMessageCodecTest() throws InvalidNameException
     {
         super(
-            new LogEntryMessage( 1234, new AddAttributeOperation( new SimpleCSN( System.currentTimeMillis(),
+            new LogEntryMessage( 1234, new AddAttributeOperation( new DefaultCSN( System.currentTimeMillis(),
                 new ReplicaId( "testReplica0" ), 1234 ), new LdapDN( "ou=system" ),
                 new BasicAttribute( "Hello", "Test" ) ) ), new LogEntryMessageEncoder(),
new LogEntryMessageDecoder() );
     }

Modified: directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java?view=diff&rev=488514&r1=488513&r2=488514
==============================================================================
--- directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
(original)
+++ directory/trunks/apacheds/mitosis/src/test/java/org/apache/directory/mitosis/store/derby/DerbyReplicationStoreTest.java
Mon Dec 18 19:24:38 2006
@@ -51,9 +51,9 @@
 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.SimpleCSN;
-import org.apache.directory.mitosis.common.SimpleCSNFactory;
-import org.apache.directory.mitosis.common.SimpleUUIDFactory;
+import org.apache.directory.mitosis.common.DefaultCSN;
+import org.apache.directory.mitosis.common.DefaultCSNFactory;
+import org.apache.directory.mitosis.common.DefaultUUIDFactory;
 import org.apache.directory.mitosis.common.UUID;
 import org.apache.directory.mitosis.common.UUIDFactory;
 import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
@@ -75,8 +75,8 @@
     private static final ReplicaId OTHER_REPLICA_ID_2 = new ReplicaId( "OTHER_REPLICA_2"
);
     private static final File DB_PATH = new File( "target/testDB" );
 
-    private final UUIDFactory uuidFactory = new SimpleUUIDFactory();
-    private final CSNFactory csnFactory = new SimpleCSNFactory();
+    private final UUIDFactory uuidFactory = new DefaultUUIDFactory();
+    private final CSNFactory csnFactory = new DefaultCSNFactory();
     private DerbyReplicationStore store;
     private int testCount;
     private long startTime;
@@ -258,7 +258,7 @@
         CSN csn;
         ReplicationLogIterator it;
 
-        it = store.getLogs( new SimpleCSN( 0, REPLICA_ID, 0 ), false );
+        it = store.getLogs( new DefaultCSN( 0, REPLICA_ID, 0 ), false );
         it.next();
         csn = it.getOperation().getCSN();
         it.close();
@@ -267,7 +267,7 @@
         Assert.assertEquals( 1, store.removeLogs( csn, true ) );
         Assert.assertEquals( 0, store.getLogSize( REPLICA_ID ) );
 
-        it = store.getLogs( new SimpleCSN( 0, OTHER_REPLICA_ID, 0 ), false );
+        it = store.getLogs( new DefaultCSN( 0, OTHER_REPLICA_ID, 0 ), false );
         Assert.assertTrue( it.next() );
         csn = it.getOperation().getCSN();
         it.close();
@@ -282,10 +282,10 @@
 
     private void subTestVectors() throws Exception
     {
-        CSN csnA = new SimpleCSN( 0, REPLICA_ID, 0 );
-        CSN csnB = new SimpleCSN( 1, REPLICA_ID, 0 );
-        CSN csnC = new SimpleCSN( 0, OTHER_REPLICA_ID_2, 0 );
-        CSN csnD = new SimpleCSN( 0, OTHER_REPLICA_ID_2, 1 );
+        CSN csnA = new DefaultCSN( 0, REPLICA_ID, 0 );
+        CSN csnB = new DefaultCSN( 1, REPLICA_ID, 0 );
+        CSN csnC = new DefaultCSN( 0, OTHER_REPLICA_ID_2, 0 );
+        CSN csnD = new DefaultCSN( 0, OTHER_REPLICA_ID_2, 1 );
         store.putLog( new Operation( csnA ) );
         store.putLog( new Operation( csnB ) );
         store.putLog( new Operation( csnC ) );



Mime
View raw message