directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r576193 [4/6] - 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/service/ main/java/org/apache/directory/mi...
Date Sun, 16 Sep 2007 22:12:09 GMT
Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationProtocolHandler.java Sun Sep 16 15:12:06 2007
@@ -1,113 +1,113 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.handler;
-
-
-import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
-import org.apache.directory.mitosis.service.ReplicationContext;
-import org.apache.directory.mitosis.service.ReplicationService;
-import org.apache.directory.mitosis.service.DefaultReplicationContext;
-import org.apache.directory.server.core.DirectoryServiceConfiguration;
-import org.apache.mina.common.IdleStatus;
-import org.apache.mina.common.IoHandler;
-import org.apache.mina.common.IoSession;
-
-/**
- * A MINA {@link IoHandler} that wraps a {@link ReplicationContextHandler}
- * and provides a default implementation of {@link ReplicationContext}.
- *  
- * @author The Apache Directory Project (dev@directory.apache.org)
- * @version $Rev$, $Date$
- */
-public class ReplicationProtocolHandler implements IoHandler
-{
-    private static final String CONTEXT = "context";
-
-    private final ReplicationService service;
-    private final ReplicationConfiguration configuration;
-    private final DirectoryServiceConfiguration serviceCfg;
-    private final ReplicationContextHandler contextHandler;
-
-
-    public ReplicationProtocolHandler( ReplicationService service, ReplicationContextHandler contextHandler )
-    {
-        assert service != null;
-        assert contextHandler != null;
-
-        this.service = service;
-        this.configuration = service.getConfiguration();
-        this.serviceCfg = service.getFactoryConfiguration();
-        this.contextHandler = contextHandler;
-    }
-
-
-    public ReplicationContext getContext( IoSession session )
-    {
-        return ( ReplicationContext ) session.getAttribute( CONTEXT );
-    }
-    
-    public ReplicationContextHandler getContextHandler() {
-    	return contextHandler;
-    }
-
-
-    public void sessionCreated( IoSession session ) throws Exception
-    {
-        session.setAttribute( CONTEXT, new DefaultReplicationContext( service, serviceCfg, configuration, session ) );
-    }
-
-
-    public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
-    {
-        contextHandler.exceptionCaught( getContext( session ), cause );
-    }
-
-
-    public void messageReceived( IoSession session, Object message ) throws Exception
-    {
-        contextHandler.messageReceived( getContext( session ), message );
-    }
-
-
-    public void messageSent( IoSession session, Object message ) throws Exception
-    {
-        contextHandler.messageSent( getContext( session ), message );
-    }
-
-
-    public void sessionClosed( IoSession session ) throws Exception
-    {
-        ReplicationContext ctx = getContext( session );
-        contextHandler.contextEnd( ctx );
-        ctx.cancelAllExpirations();
-    }
-
-
-    public void sessionIdle( IoSession session, IdleStatus status ) throws Exception
-    {
-        contextHandler.contextIdle( getContext( session ), status );
-    }
-
-
-    public void sessionOpened( IoSession session ) throws Exception
-    {
-        contextHandler.contextBegin( getContext( session ) );
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.handler;
+
+
+import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
+import org.apache.directory.mitosis.service.ReplicationContext;
+import org.apache.directory.mitosis.service.ReplicationService;
+import org.apache.directory.mitosis.service.DefaultReplicationContext;
+import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.mina.common.IdleStatus;
+import org.apache.mina.common.IoHandler;
+import org.apache.mina.common.IoSession;
+
+/**
+ * A MINA {@link IoHandler} that wraps a {@link ReplicationContextHandler}
+ * and provides a default implementation of {@link ReplicationContext}.
+ *  
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
+public class ReplicationProtocolHandler implements IoHandler
+{
+    private static final String CONTEXT = "context";
+
+    private final ReplicationService service;
+    private final ReplicationConfiguration configuration;
+    private final DirectoryServiceConfiguration serviceCfg;
+    private final ReplicationContextHandler contextHandler;
+
+
+    public ReplicationProtocolHandler( ReplicationService service, ReplicationContextHandler contextHandler )
+    {
+        assert service != null;
+        assert contextHandler != null;
+
+        this.service = service;
+        this.configuration = service.getConfiguration();
+        this.serviceCfg = service.getFactoryConfiguration();
+        this.contextHandler = contextHandler;
+    }
+
+
+    public ReplicationContext getContext( IoSession session )
+    {
+        return ( ReplicationContext ) session.getAttribute( CONTEXT );
+    }
+    
+    public ReplicationContextHandler getContextHandler() {
+    	return contextHandler;
+    }
+
+
+    public void sessionCreated( IoSession session ) throws Exception
+    {
+        session.setAttribute( CONTEXT, new DefaultReplicationContext( service, serviceCfg, configuration, session ) );
+    }
+
+
+    public void exceptionCaught( IoSession session, Throwable cause ) throws Exception
+    {
+        contextHandler.exceptionCaught( getContext( session ), cause );
+    }
+
+
+    public void messageReceived( IoSession session, Object message ) throws Exception
+    {
+        contextHandler.messageReceived( getContext( session ), message );
+    }
+
+
+    public void messageSent( IoSession session, Object message ) throws Exception
+    {
+        contextHandler.messageSent( getContext( session ), message );
+    }
+
+
+    public void sessionClosed( IoSession session ) throws Exception
+    {
+        ReplicationContext ctx = getContext( session );
+        contextHandler.contextEnd( ctx );
+        ctx.cancelAllExpirations();
+    }
+
+
+    public void sessionIdle( IoSession session, IdleStatus status ) throws Exception
+    {
+        contextHandler.contextIdle( getContext( session ), status );
+    }
+
+
+    public void sessionOpened( IoSession session ) throws Exception
+    {
+        contextHandler.contextBegin( getContext( session ) );
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerProtocolHandler.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerProtocolHandler.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerProtocolHandler.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/handler/ReplicationServerProtocolHandler.java Sun Sep 16 15:12:06 2007
@@ -1,40 +1,40 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.handler;
-
-
-import org.apache.directory.mitosis.service.ReplicationService;
-
-/**
- * A {@link ReplicationProtocolHandler} for server-side, which uses
- * {@link ReplicationServerContextHandler}.  This class is actually 
- * a shortcut to creating a {@link ReplicationProtocolHandler} with a
- * new {@link ReplicationServerContextHandler}.
- * 
- * @author The Apache Directory Project (dev@directory.apache.org)
- * @version $Rev$, $Date$
- */
-public class ReplicationServerProtocolHandler extends ReplicationProtocolHandler
-{
-    public ReplicationServerProtocolHandler( ReplicationService service )
-    {
-        super( service, new ReplicationServerContextHandler() );
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.handler;
+
+
+import org.apache.directory.mitosis.service.ReplicationService;
+
+/**
+ * A {@link ReplicationProtocolHandler} for server-side, which uses
+ * {@link ReplicationServerContextHandler}.  This class is actually 
+ * a shortcut to creating a {@link ReplicationProtocolHandler} with a
+ * new {@link ReplicationServerContextHandler}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
+public class ReplicationServerProtocolHandler extends ReplicationProtocolHandler
+{
+    public ReplicationServerProtocolHandler( ReplicationService service )
+    {
+        super( service, new ReplicationServerContextHandler() );
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BaseMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BaseMessage.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BaseMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BaseMessage.java Sun Sep 16 15:12:06 2007
@@ -1,71 +1,71 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-import org.apache.directory.shared.ldap.util.EqualsBuilder;
-import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-
-
-public abstract class BaseMessage
-{
-
-    private final int sequence;
-
-
-    protected BaseMessage( int sequence )
-    {
-        this.sequence = sequence;
-    }
-
-
-    public abstract int getType();
-
-
-    public int getSequence()
-    {
-        return sequence;
-    }
-
-
-    public boolean equals( Object object )
-    {
-        if ( !( object instanceof BaseMessage ) )
-        {
-            return false;
-        }
-
-        BaseMessage rhs = ( BaseMessage ) object;
-
-        return new EqualsBuilder().append( this.sequence, rhs.sequence ).isEquals();
-    }
-
-
-    public int hashCode()
-    {
-        return new HashCodeBuilder( -1364566505, -1158072471 ).append( this.sequence ).toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return String.valueOf( sequence );
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+import org.apache.directory.shared.ldap.util.EqualsBuilder;
+import org.apache.directory.shared.ldap.util.HashCodeBuilder;
+
+
+public abstract class BaseMessage
+{
+
+    private final int sequence;
+
+
+    protected BaseMessage( int sequence )
+    {
+        this.sequence = sequence;
+    }
+
+
+    public abstract int getType();
+
+
+    public int getSequence()
+    {
+        return sequence;
+    }
+
+
+    public boolean equals( Object object )
+    {
+        if ( !( object instanceof BaseMessage ) )
+        {
+            return false;
+        }
+
+        BaseMessage rhs = ( BaseMessage ) object;
+
+        return new EqualsBuilder().append( this.sequence, rhs.sequence ).isEquals();
+    }
+
+
+    public int hashCode()
+    {
+        return new HashCodeBuilder( -1364566505, -1158072471 ).append( this.sequence ).toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return String.valueOf( sequence );
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BeginLogEntriesAckMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BeginLogEntriesAckMessage.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BeginLogEntriesAckMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/BeginLogEntriesAckMessage.java Sun Sep 16 15:12:06 2007
@@ -1,109 +1,109 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-import org.apache.directory.shared.ldap.util.EqualsBuilder;
-import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-import org.apache.directory.mitosis.common.CSNVector;
-import org.apache.directory.mitosis.service.protocol.Constants;
-
-
-public class BeginLogEntriesAckMessage extends ResponseMessage
-{
-    private final CSNVector purgeVector;
-    private final CSNVector updateVector;
-
-
-    public BeginLogEntriesAckMessage( int sequence, int responseCode, CSNVector purgeVector, CSNVector updateVector )
-    {
-        super( sequence, responseCode );
-
-        if ( responseCode == Constants.OK )
-        {
-            assert purgeVector != null;
-            assert updateVector != null;
-
-            this.purgeVector = purgeVector;
-            this.updateVector = updateVector;
-        }
-        else
-        {
-            this.purgeVector = null;
-            this.updateVector = null;
-        }
-    }
-
-
-    public int getType()
-    {
-        return Constants.GET_UPDATE_VECTOR_ACK;
-    }
-
-
-    public CSNVector getPurgeVector()
-    {
-        return purgeVector;
-    }
-
-
-    public CSNVector getUpdateVector()
-    {
-        return updateVector;
-    }
-
-
-    /**
-     * @see java.lang.Object#equals(Object)
-     */
-    public boolean equals( Object object )
-    {
-        if ( object == this )
-        {
-            return true;
-        }
-
-        if ( !( object instanceof BeginLogEntriesAckMessage ) )
-        {
-            return false;
-        }
-
-        BeginLogEntriesAckMessage rhs = ( BeginLogEntriesAckMessage ) object;
-
-        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.purgeVector, rhs.purgeVector )
-            .append( this.updateVector, rhs.updateVector ).isEquals();
-    }
-
-
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode()
-    {
-        return new HashCodeBuilder( 537917217, 1652875233 ).appendSuper( super.hashCode() ).append( this.purgeVector )
-            .append( this.updateVector ).toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return "[BeginLogEntriesAck] " + super.toString() + ", PV: " + purgeVector + ", UV: " + updateVector;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+import org.apache.directory.shared.ldap.util.EqualsBuilder;
+import org.apache.directory.shared.ldap.util.HashCodeBuilder;
+import org.apache.directory.mitosis.common.CSNVector;
+import org.apache.directory.mitosis.service.protocol.Constants;
+
+
+public class BeginLogEntriesAckMessage extends ResponseMessage
+{
+    private final CSNVector purgeVector;
+    private final CSNVector updateVector;
+
+
+    public BeginLogEntriesAckMessage( int sequence, int responseCode, CSNVector purgeVector, CSNVector updateVector )
+    {
+        super( sequence, responseCode );
+
+        if ( responseCode == Constants.OK )
+        {
+            assert purgeVector != null;
+            assert updateVector != null;
+
+            this.purgeVector = purgeVector;
+            this.updateVector = updateVector;
+        }
+        else
+        {
+            this.purgeVector = null;
+            this.updateVector = null;
+        }
+    }
+
+
+    public int getType()
+    {
+        return Constants.GET_UPDATE_VECTOR_ACK;
+    }
+
+
+    public CSNVector getPurgeVector()
+    {
+        return purgeVector;
+    }
+
+
+    public CSNVector getUpdateVector()
+    {
+        return updateVector;
+    }
+
+
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
+    public boolean equals( Object object )
+    {
+        if ( object == this )
+        {
+            return true;
+        }
+
+        if ( !( object instanceof BeginLogEntriesAckMessage ) )
+        {
+            return false;
+        }
+
+        BeginLogEntriesAckMessage rhs = ( BeginLogEntriesAckMessage ) object;
+
+        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.purgeVector, rhs.purgeVector )
+            .append( this.updateVector, rhs.updateVector ).isEquals();
+    }
+
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        return new HashCodeBuilder( 537917217, 1652875233 ).appendSuper( super.hashCode() ).append( this.purgeVector )
+            .append( this.updateVector ).toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return "[BeginLogEntriesAck] " + super.toString() + ", PV: " + purgeVector + ", UV: " + updateVector;
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryAckMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryAckMessage.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryAckMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryAckMessage.java Sun Sep 16 15:12:06 2007
@@ -1,74 +1,74 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-import org.apache.directory.mitosis.service.protocol.Constants;
-import org.apache.directory.shared.ldap.util.EqualsBuilder;
-import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-
-
-public class LogEntryAckMessage extends ResponseMessage
-{
-    public LogEntryAckMessage( int sequence, int responseCode )
-    {
-        super( sequence, responseCode );
-    }
-
-
-    public int getType()
-    {
-        return Constants.LOG_ENTRY_ACK;
-    }
-
-
-    /**
-     * @see java.lang.Object#equals(Object)
-     */
-    public boolean equals( Object object )
-    {
-        if ( object == this )
-        {
-            return true;
-        }
-
-        if ( !( object instanceof LogEntryAckMessage ) )
-        {
-            return false;
-        }
-
-        return new EqualsBuilder().appendSuper( super.equals( object ) ).isEquals();
-    }
-
-
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode()
-    {
-        return new HashCodeBuilder( -873557437, -1464393829 ).appendSuper( super.hashCode() ).toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return "[LogEntryAck] " + super.toString();
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+import org.apache.directory.mitosis.service.protocol.Constants;
+import org.apache.directory.shared.ldap.util.EqualsBuilder;
+import org.apache.directory.shared.ldap.util.HashCodeBuilder;
+
+
+public class LogEntryAckMessage extends ResponseMessage
+{
+    public LogEntryAckMessage( int sequence, int responseCode )
+    {
+        super( sequence, responseCode );
+    }
+
+
+    public int getType()
+    {
+        return Constants.LOG_ENTRY_ACK;
+    }
+
+
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
+    public boolean equals( Object object )
+    {
+        if ( object == this )
+        {
+            return true;
+        }
+
+        if ( !( object instanceof LogEntryAckMessage ) )
+        {
+            return false;
+        }
+
+        return new EqualsBuilder().appendSuper( super.equals( object ) ).isEquals();
+    }
+
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        return new HashCodeBuilder( -873557437, -1464393829 ).appendSuper( super.hashCode() ).toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return "[LogEntryAck] " + super.toString();
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryMessage.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/LogEntryMessage.java Sun Sep 16 15:12:06 2007
@@ -1,89 +1,89 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-import org.apache.directory.mitosis.operation.Operation;
-import org.apache.directory.mitosis.service.protocol.Constants;
-import org.apache.directory.shared.ldap.util.EqualsBuilder;
-import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-
-
-public class LogEntryMessage extends BaseMessage
-{
-    private final Operation operation;
-
-
-    public LogEntryMessage( int sequence, Operation operation )
-    {
-        super( sequence );
-        this.operation = operation;
-    }
-
-
-    public int getType()
-    {
-        return Constants.LOG_ENTRY;
-    }
-
-
-    public Operation getOperation()
-    {
-        return operation;
-    }
-
-
-    /**
-     * @see java.lang.Object#equals(Object)
-     */
-    public boolean equals( Object object )
-    {
-        if ( object == this )
-        {
-            return true;
-        }
-
-        if ( !( object instanceof LogEntryMessage ) )
-        {
-            return false;
-        }
-
-        LogEntryMessage rhs = ( LogEntryMessage ) object;
-
-        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.operation, rhs.operation )
-            .isEquals();
-    }
-
-
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode()
-    {
-        return new HashCodeBuilder( 633013569, -1063609843 ).appendSuper( super.hashCode() ).append( this.operation )
-            .toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return "[LogEntry] " + super.toString() + ", " + operation;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+import org.apache.directory.mitosis.operation.Operation;
+import org.apache.directory.mitosis.service.protocol.Constants;
+import org.apache.directory.shared.ldap.util.EqualsBuilder;
+import org.apache.directory.shared.ldap.util.HashCodeBuilder;
+
+
+public class LogEntryMessage extends BaseMessage
+{
+    private final Operation operation;
+
+
+    public LogEntryMessage( int sequence, Operation operation )
+    {
+        super( sequence );
+        this.operation = operation;
+    }
+
+
+    public int getType()
+    {
+        return Constants.LOG_ENTRY;
+    }
+
+
+    public Operation getOperation()
+    {
+        return operation;
+    }
+
+
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
+    public boolean equals( Object object )
+    {
+        if ( object == this )
+        {
+            return true;
+        }
+
+        if ( !( object instanceof LogEntryMessage ) )
+        {
+            return false;
+        }
+
+        LogEntryMessage rhs = ( LogEntryMessage ) object;
+
+        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.operation, rhs.operation )
+            .isEquals();
+    }
+
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        return new HashCodeBuilder( 633013569, -1063609843 ).appendSuper( super.hashCode() ).append( this.operation )
+            .toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return "[LogEntry] " + super.toString() + ", " + operation;
+    }
+}

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=576193&r1=576192&r2=576193&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 Sep 16 15:12:06 2007
@@ -1,89 +1,89 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-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;
-
-
-    public LoginAckMessage( int sequence, int responseCode, ReplicaId replicaId )
-    {
-        super( sequence, responseCode );
-        this.replicaId = replicaId;
-    }
-
-
-    public int getType()
-    {
-        return Constants.LOGIN_ACK;
-    }
-
-
-    public ReplicaId getReplicaId()
-    {
-        return replicaId;
-    }
-
-
-    /**
-     * @see java.lang.Object#equals(Object)
-     */
-    public boolean equals( Object object )
-    {
-        if ( object == this )
-        {
-            return true;
-        }
-
-        if ( !( object instanceof LoginAckMessage ) )
-        {
-            return false;
-        }
-
-        LoginAckMessage rhs = ( LoginAckMessage ) object;
-
-        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.replicaId, rhs.replicaId )
-            .isEquals();
-    }
-
-
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode()
-    {
-        return new HashCodeBuilder( -280394717, -328404193 ).appendSuper( super.hashCode() ).append( this.replicaId )
-            .toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return "[LoginAck] " + super.toString() + ", " + replicaId;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+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;
+
+
+    public LoginAckMessage( int sequence, int responseCode, ReplicaId replicaId )
+    {
+        super( sequence, responseCode );
+        this.replicaId = replicaId;
+    }
+
+
+    public int getType()
+    {
+        return Constants.LOGIN_ACK;
+    }
+
+
+    public ReplicaId getReplicaId()
+    {
+        return replicaId;
+    }
+
+
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
+    public boolean equals( Object object )
+    {
+        if ( object == this )
+        {
+            return true;
+        }
+
+        if ( !( object instanceof LoginAckMessage ) )
+        {
+            return false;
+        }
+
+        LoginAckMessage rhs = ( LoginAckMessage ) object;
+
+        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.replicaId, rhs.replicaId )
+            .isEquals();
+    }
+
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        return new HashCodeBuilder( -280394717, -328404193 ).appendSuper( super.hashCode() ).append( this.replicaId )
+            .toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return "[LoginAck] " + super.toString() + ", " + 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=576193&r1=576192&r2=576193&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 Sep 16 15:12:06 2007
@@ -1,85 +1,85 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-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;
-
-
-    public LoginMessage( int sequence, ReplicaId replicaId )
-    {
-        super( sequence );
-
-        this.replicaId = replicaId;
-    }
-
-
-    public int getType()
-    {
-        return Constants.LOGIN;
-    }
-
-
-    public ReplicaId getReplicaId()
-    {
-        return replicaId;
-    }
-
-
-    /**
-     * @see java.lang.Object#equals(Object)
-     */
-    public boolean equals( Object object )
-    {
-        if ( !( object instanceof LoginMessage ) )
-        {
-            return false;
-        }
-
-        LoginMessage rhs = ( LoginMessage ) object;
-
-        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.replicaId, rhs.replicaId )
-            .isEquals();
-    }
-
-
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode()
-    {
-        return new HashCodeBuilder( 1520317245, 1630850531 ).appendSuper( super.hashCode() ).append( this.replicaId )
-            .toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return "[Login] " + super.toString() + ", " + replicaId;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+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;
+
+
+    public LoginMessage( int sequence, ReplicaId replicaId )
+    {
+        super( sequence );
+
+        this.replicaId = replicaId;
+    }
+
+
+    public int getType()
+    {
+        return Constants.LOGIN;
+    }
+
+
+    public ReplicaId getReplicaId()
+    {
+        return replicaId;
+    }
+
+
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
+    public boolean equals( Object object )
+    {
+        if ( !( object instanceof LoginMessage ) )
+        {
+            return false;
+        }
+
+        LoginMessage rhs = ( LoginMessage ) object;
+
+        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.replicaId, rhs.replicaId )
+            .isEquals();
+    }
+
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        return new HashCodeBuilder( 1520317245, 1630850531 ).appendSuper( super.hashCode() ).append( this.replicaId )
+            .toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return "[Login] " + super.toString() + ", " + replicaId;
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/ResponseMessage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/ResponseMessage.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/ResponseMessage.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/service/protocol/message/ResponseMessage.java Sun Sep 16 15:12:06 2007
@@ -1,82 +1,82 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.service.protocol.message;
-
-
-import org.apache.directory.shared.ldap.util.EqualsBuilder;
-import org.apache.directory.shared.ldap.util.HashCodeBuilder;
-
-
-public abstract class ResponseMessage extends BaseMessage
-{
-    private final int responseCode;
-
-
-    public ResponseMessage( int sequence, int responseCode )
-    {
-        super( sequence );
-
-        this.responseCode = responseCode;
-    }
-
-
-    public int getResponseCode()
-    {
-        return responseCode;
-    }
-
-
-    /**
-     * @see java.lang.Object#equals(Object)
-     */
-    public boolean equals( Object object )
-    {
-        if ( object == this )
-        {
-            return true;
-        }
-
-        if ( !( object instanceof ResponseMessage ) )
-        {
-            return false;
-        }
-
-        ResponseMessage rhs = ( ResponseMessage ) object;
-
-        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.responseCode, rhs.responseCode )
-            .isEquals();
-    }
-
-
-    /**
-     * @see java.lang.Object#hashCode()
-     */
-    public int hashCode()
-    {
-        return new HashCodeBuilder( -710373179, 1116475565 ).appendSuper( super.hashCode() ).append( this.responseCode )
-            .toHashCode();
-    }
-
-
-    public String toString()
-    {
-        return super.toString() + ": " + responseCode;
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.service.protocol.message;
+
+
+import org.apache.directory.shared.ldap.util.EqualsBuilder;
+import org.apache.directory.shared.ldap.util.HashCodeBuilder;
+
+
+public abstract class ResponseMessage extends BaseMessage
+{
+    private final int responseCode;
+
+
+    public ResponseMessage( int sequence, int responseCode )
+    {
+        super( sequence );
+
+        this.responseCode = responseCode;
+    }
+
+
+    public int getResponseCode()
+    {
+        return responseCode;
+    }
+
+
+    /**
+     * @see java.lang.Object#equals(Object)
+     */
+    public boolean equals( Object object )
+    {
+        if ( object == this )
+        {
+            return true;
+        }
+
+        if ( !( object instanceof ResponseMessage ) )
+        {
+            return false;
+        }
+
+        ResponseMessage rhs = ( ResponseMessage ) object;
+
+        return new EqualsBuilder().appendSuper( super.equals( object ) ).append( this.responseCode, rhs.responseCode )
+            .isEquals();
+    }
+
+
+    /**
+     * @see java.lang.Object#hashCode()
+     */
+    public int hashCode()
+    {
+        return new HashCodeBuilder( -710373179, 1116475565 ).appendSuper( super.hashCode() ).append( this.responseCode )
+            .toHashCode();
+    }
+
+
+    public String toString()
+    {
+        return super.toString() + ": " + responseCode;
+    }
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationLogIterator.java Sun Sep 16 15:12:06 2007
@@ -1,52 +1,52 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.store;
-
-
-import java.sql.ResultSet;
-
-import org.apache.directory.mitosis.operation.Operation;
-
-/**
- * Iterates a set of {@link Operation}s, which is a result of a query on 
- * {@link ReplicationStore}.  It's usage is similar to that of JDBC
- * {@link ResultSet}.
- * 
- * @author The Apache Directory Project (dev@directory.apache.org)
- * @version $Rev$, $Date$
- */
-public interface ReplicationLogIterator
-{
-    /**
-     * Move on to the next item.
-     * @return <tt>true</tt> if and only if it has more item.
-     */
-    boolean next();
-
-    /**
-     * Releases all resources allocated to this iterator.
-     */
-    void close();
-
-    /**
-     * Returns the {@link Operation} on the current iterator position.
-     */
-    Operation getOperation();
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.store;
+
+
+import java.sql.ResultSet;
+
+import org.apache.directory.mitosis.operation.Operation;
+
+/**
+ * Iterates a set of {@link Operation}s, which is a result of a query on 
+ * {@link ReplicationStore}.  It's usage is similar to that of JDBC
+ * {@link ResultSet}.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
+public interface ReplicationLogIterator
+{
+    /**
+     * Move on to the next item.
+     * @return <tt>true</tt> if and only if it has more item.
+     */
+    boolean next();
+
+    /**
+     * Releases all resources allocated to this iterator.
+     */
+    void close();
+
+    /**
+     * Returns the {@link Operation} on the current iterator position.
+     */
+    Operation getOperation();
+}

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=576193&r1=576192&r2=576193&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 Sep 16 15:12:06 2007
@@ -1,146 +1,146 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.store;
-
-
-import java.util.Set;
-
-import javax.naming.Name;
-
-import org.apache.directory.mitosis.common.CSN;
-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.UUID;
-import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
-import org.apache.directory.mitosis.operation.Operation;
-import org.apache.directory.server.core.DirectoryServiceConfiguration;
-import org.apache.directory.shared.ldap.name.LdapDN;
-
-/**
- * Provides an abstract storage that stores data required to perform
- * replication, such as {@link UUID}-{@link LdapDN} mapping and
- * LDAP {@link Operation}s.  It also calculates the Update Vector (UV)
- * and the Purge Vector (PV) of a replica.
- * 
- * @author The Apache Directory Project (dev@directory.apache.org)
- * @version $Rev$, $Date#
- */
-public interface ReplicationStore
-{
-    /**
-     * Opens this storage.
-     */
-    void open( DirectoryServiceConfiguration serviceCfg, ReplicationConfiguration cfg );
-
-    /**
-     * Closes this storage and releases the resources allocated when it's
-     * opened.
-     */
-    void close();
-
-    /**
-     * Returns the {@link ReplicaId} of the {@link Replica} that this storage
-     * is associated with.
-     */
-    ReplicaId getReplicaId();
-
-    /**
-     * Returns the set of {@link ReplicaId}s of the {@link Replica}s that
-     * belongs to the same cluster.
-     */
-    Set<ReplicaId> getKnownReplicaIds();
-
-
-    // UUID to DN table operations
-
-    /**
-     * 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.
-     * @return <tt>true</tt> if and only if the mapping has been removed
-     */
-    boolean removeUUID( UUID uuid );
-
-
-    // Log entry operations
-
-    /**
-     * Puts the specified operation into this storage.
-     */
-    void putLog( Operation operation );
-
-    /**
-     * Queries all operations that is greater than the specified {@link CSN}.
-     * 
-     * @param inclusive <tt>true</tt> if you want to include <tt>fromCSN</tt>
-     *                  itself in the result set.
-     */
-    ReplicationLogIterator getLogs( CSN fromCSN, boolean inclusive );
-
-    /**
-     * Queries all operations that is greater than the specified
-     * {@link CSNVector}.
-     * 
-     * @param inclusive <tt>true</tt> if you want to include
-     *                  <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}.
-     * 
-     * @param inclusive <tt>true</tt> if you want to delete the
-     *                  <tt>toCSN</tt> itself, too.
-     * @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 Replica} with the specified {@link ReplicaId}
-     * in this storage .
-     */
-    int getLogSize( ReplicaId replicaId );
-
-    /**
-     * Calculates the Update Vector (UV) from this storage. 
-     */
-    CSNVector getUpdateVector();
-
-    /**
-     * Calculates the Purge Vector (PV) from this storage. 
-     */
-    CSNVector getPurgeVector();
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.store;
+
+
+import java.util.Set;
+
+import javax.naming.Name;
+
+import org.apache.directory.mitosis.common.CSN;
+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.UUID;
+import org.apache.directory.mitosis.configuration.ReplicationConfiguration;
+import org.apache.directory.mitosis.operation.Operation;
+import org.apache.directory.server.core.DirectoryServiceConfiguration;
+import org.apache.directory.shared.ldap.name.LdapDN;
+
+/**
+ * Provides an abstract storage that stores data required to perform
+ * replication, such as {@link UUID}-{@link LdapDN} mapping and
+ * LDAP {@link Operation}s.  It also calculates the Update Vector (UV)
+ * and the Purge Vector (PV) of a replica.
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date#
+ */
+public interface ReplicationStore
+{
+    /**
+     * Opens this storage.
+     */
+    void open( DirectoryServiceConfiguration serviceCfg, ReplicationConfiguration cfg );
+
+    /**
+     * Closes this storage and releases the resources allocated when it's
+     * opened.
+     */
+    void close();
+
+    /**
+     * Returns the {@link ReplicaId} of the {@link Replica} that this storage
+     * is associated with.
+     */
+    ReplicaId getReplicaId();
+
+    /**
+     * Returns the set of {@link ReplicaId}s of the {@link Replica}s that
+     * belongs to the same cluster.
+     */
+    Set<ReplicaId> getKnownReplicaIds();
+
+
+    // UUID to DN table operations
+
+    /**
+     * 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.
+     * @return <tt>true</tt> if and only if the mapping has been removed
+     */
+    boolean removeUUID( UUID uuid );
+
+
+    // Log entry operations
+
+    /**
+     * Puts the specified operation into this storage.
+     */
+    void putLog( Operation operation );
+
+    /**
+     * Queries all operations that is greater than the specified {@link CSN}.
+     * 
+     * @param inclusive <tt>true</tt> if you want to include <tt>fromCSN</tt>
+     *                  itself in the result set.
+     */
+    ReplicationLogIterator getLogs( CSN fromCSN, boolean inclusive );
+
+    /**
+     * Queries all operations that is greater than the specified
+     * {@link CSNVector}.
+     * 
+     * @param inclusive <tt>true</tt> if you want to include
+     *                  <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}.
+     * 
+     * @param inclusive <tt>true</tt> if you want to delete the
+     *                  <tt>toCSN</tt> itself, too.
+     * @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 Replica} with the specified {@link ReplicaId}
+     * in this storage .
+     */
+    int getLogSize( ReplicaId replicaId );
+
+    /**
+     * Calculates the Update Vector (UV) from this storage. 
+     */
+    CSNVector getUpdateVector();
+
+    /**
+     * Calculates the Purge Vector (PV) from this storage. 
+     */
+    CSNVector getPurgeVector();
+}

Modified: directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java?rev=576193&r1=576192&r2=576193&view=diff
==============================================================================
--- directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java (original)
+++ directory/apacheds/trunk/mitosis/src/main/java/org/apache/directory/mitosis/store/ReplicationStoreException.java Sun Sep 16 15:12:06 2007
@@ -1,57 +1,57 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.store;
-
-/**
- * A {@link RuntimeException} which is thrown when {@link ReplicationStore}
- * has a problem in accessing its underlying data source (e.g. a file).
- * 
- * @author The Apache Directory Project (dev@directory.apache.org)
- * @version $Rev$, $Date$
- */
-public class ReplicationStoreException extends RuntimeException
-{
-
-    private static final long serialVersionUID = 3257289127798913336L;
-
-
-    public ReplicationStoreException()
-    {
-        super();
-    }
-
-
-    public ReplicationStoreException( String message )
-    {
-        super( message );
-    }
-
-
-    public ReplicationStoreException( String message, Throwable cause )
-    {
-        super( message, cause );
-    }
-
-
-    public ReplicationStoreException( Throwable cause )
-    {
-        super( cause );
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.store;
+
+/**
+ * A {@link RuntimeException} which is thrown when {@link ReplicationStore}
+ * has a problem in accessing its underlying data source (e.g. a file).
+ * 
+ * @author The Apache Directory Project (dev@directory.apache.org)
+ * @version $Rev$, $Date$
+ */
+public class ReplicationStoreException extends RuntimeException
+{
+
+    private static final long serialVersionUID = 3257289127798913336L;
+
+
+    public ReplicationStoreException()
+    {
+        super();
+    }
+
+
+    public ReplicationStoreException( String message )
+    {
+        super( message );
+    }
+
+
+    public ReplicationStoreException( String message, Throwable cause )
+    {
+        super( message, cause );
+    }
+
+
+    public ReplicationStoreException( Throwable cause )
+    {
+        super( cause );
+    }
+}

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=576193&r1=576192&r2=576193&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 Sep 16 15:12:06 2007
@@ -1,100 +1,100 @@
-/*
- *  Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *  
- *    http://www.apache.org/licenses/LICENSE-2.0
- *  
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License. 
- *  
- */
-package org.apache.directory.mitosis.store.derby;
-
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-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;
-import org.apache.directory.mitosis.store.ReplicationLogIterator;
-import org.apache.directory.mitosis.store.ReplicationStoreException;
-
-
-class DerbyReplicationLogIterator implements ReplicationLogIterator
-{
-    private final OperationCodec codec;
-    private final Connection con;
-    private final Statement stmt;
-    private final ResultSet rs;
-
-
-    DerbyReplicationLogIterator( OperationCodec codec, Connection con, Statement stmt, ResultSet rs )
-    {
-        this.codec = codec;
-        this.con = con;
-        this.stmt = stmt;
-        this.rs = rs;
-    }
-
-
-    public boolean next()
-    {
-        try
-        {
-            return rs.next();
-        }
-        catch ( SQLException e )
-        {
-            throw new ReplicationStoreException( e );
-        }
-    }
-
-
-    public void close()
-    {
-        SQLUtil.cleanup( con, stmt, rs );
-    }
-
-
-    public CSN getCSN()
-    {
-        try
-        {
-            ReplicaId replicaId = new ReplicaId( rs.getString( 1 ) );
-            long timestamp = rs.getLong( 2 );
-            int operationSequence = rs.getInt( 3 );
-            return new DefaultCSN( timestamp, replicaId, operationSequence );
-        }
-        catch ( Exception e )
-        {
-            throw new ReplicationStoreException( e );
-        }
-    }
-
-
-    public Operation getOperation()
-    {
-        try
-        {
-            return codec.decode( rs.getBytes( 4 ) );
-        }
-        catch ( Exception e )
-        {
-            throw new ReplicationStoreException( e );
-        }
-    }
-}
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.mitosis.store.derby;
+
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+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;
+import org.apache.directory.mitosis.store.ReplicationLogIterator;
+import org.apache.directory.mitosis.store.ReplicationStoreException;
+
+
+class DerbyReplicationLogIterator implements ReplicationLogIterator
+{
+    private final OperationCodec codec;
+    private final Connection con;
+    private final Statement stmt;
+    private final ResultSet rs;
+
+
+    DerbyReplicationLogIterator( OperationCodec codec, Connection con, Statement stmt, ResultSet rs )
+    {
+        this.codec = codec;
+        this.con = con;
+        this.stmt = stmt;
+        this.rs = rs;
+    }
+
+
+    public boolean next()
+    {
+        try
+        {
+            return rs.next();
+        }
+        catch ( SQLException e )
+        {
+            throw new ReplicationStoreException( e );
+        }
+    }
+
+
+    public void close()
+    {
+        SQLUtil.cleanup( con, stmt, rs );
+    }
+
+
+    public CSN getCSN()
+    {
+        try
+        {
+            ReplicaId replicaId = new ReplicaId( rs.getString( 1 ) );
+            long timestamp = rs.getLong( 2 );
+            int operationSequence = rs.getInt( 3 );
+            return new DefaultCSN( timestamp, replicaId, operationSequence );
+        }
+        catch ( Exception e )
+        {
+            throw new ReplicationStoreException( e );
+        }
+    }
+
+
+    public Operation getOperation()
+    {
+        try
+        {
+            return codec.decode( rs.getBytes( 4 ) );
+        }
+        catch ( Exception e )
+        {
+            throw new ReplicationStoreException( e );
+        }
+    }
+}



Mime
View raw message