Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorslewis2008-10-13 22:53:07 -0400
committerslewis2008-10-13 22:53:07 -0400
commit64d637038ea2a261c2e1e605a630a64ce328541e (patch)
tree53438d874d3890b8c49537044064f578b8eecf92 /framework/bundles/org.eclipse.ecf.sync
parentbcdffe5925add6cb2a25e28ca9e0069b62554c4d (diff)
downloadorg.eclipse.ecf-64d637038ea2a261c2e1e605a630a64ce328541e.tar.gz
org.eclipse.ecf-64d637038ea2a261c2e1e605a630a64ce328541e.tar.xz
org.eclipse.ecf-64d637038ea2a261c2e1e605a630a64ce328541e.zip
Refactoring of sync interfaces to create IModelSynchronizationStrategy.
Diffstat (limited to 'framework/bundles/org.eclipse.ecf.sync')
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/META-INF/MANIFEST.MF3
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDeletionTransformationStrategy.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDocumentChangeMessage.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaInsertionTransformationStategy.java2
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java40
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java6
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategy.java26
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java5
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java (renamed from framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChangeMessage.java)7
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java37
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java (renamed from framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/SerializationException.java)2
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java (renamed from framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/messages/DocumentChangeMessage.java)9
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java4
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategy.java58
-rw-r--r--framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java11
16 files changed, 106 insertions, 112 deletions
diff --git a/framework/bundles/org.eclipse.ecf.sync/META-INF/MANIFEST.MF b/framework/bundles/org.eclipse.ecf.sync/META-INF/MANIFEST.MF
index 06b098b6b..b92239e96 100644
--- a/framework/bundles/org.eclipse.ecf.sync/META-INF/MANIFEST.MF
+++ b/framework/bundles/org.eclipse.ecf.sync/META-INF/MANIFEST.MF
@@ -18,5 +18,4 @@ Export-Package: org.eclipse.ecf.internal.sync;x-internal:=true,
org.eclipse.ecf.internal.sync.doc.cola;x-internal:=true,
org.eclipse.ecf.internal.sync.doc.identity;x-internal:=true,
org.eclipse.ecf.sync,
- org.eclipse.ecf.sync.doc,
- org.eclipse.ecf.sync.doc.messages
+ org.eclipse.ecf.sync.doc
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDeletionTransformationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDeletionTransformationStrategy.java
index 22eaa757f..fb4613a71 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDeletionTransformationStrategy.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDeletionTransformationStrategy.java
@@ -14,7 +14,7 @@ package org.eclipse.ecf.internal.sync.doc.cola;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.sync.Activator;
import org.eclipse.ecf.internal.sync.SyncDebugOptions;
-import org.eclipse.ecf.sync.doc.messages.DocumentChangeMessage;
+import org.eclipse.ecf.sync.doc.DocumentChangeMessage;
public class ColaDeletionTransformationStrategy implements ColaTransformationStrategy {
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDocumentChangeMessage.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDocumentChangeMessage.java
index 4ab9c577f..e7bbfd6a5 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDocumentChangeMessage.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaDocumentChangeMessage.java
@@ -17,7 +17,7 @@ import java.util.List;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.sync.Activator;
import org.eclipse.ecf.internal.sync.SyncDebugOptions;
-import org.eclipse.ecf.sync.doc.messages.DocumentChangeMessage;
+import org.eclipse.ecf.sync.doc.DocumentChangeMessage;
public class ColaDocumentChangeMessage extends DocumentChangeMessage {
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaInsertionTransformationStategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaInsertionTransformationStategy.java
index e91f728bd..b653b51df 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaInsertionTransformationStategy.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaInsertionTransformationStategy.java
@@ -14,7 +14,7 @@ package org.eclipse.ecf.internal.sync.doc.cola;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.sync.Activator;
import org.eclipse.ecf.internal.sync.SyncDebugOptions;
-import org.eclipse.ecf.sync.doc.messages.DocumentChangeMessage;
+import org.eclipse.ecf.sync.doc.DocumentChangeMessage;
public class ColaInsertionTransformationStategy implements ColaTransformationStrategy {
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java
index e9d4362be..822532982 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategy.java
@@ -23,14 +23,15 @@ import org.eclipse.ecf.core.identity.ID;
import org.eclipse.ecf.core.util.Trace;
import org.eclipse.ecf.internal.sync.Activator;
import org.eclipse.ecf.internal.sync.SyncDebugOptions;
+import org.eclipse.ecf.sync.IModelChange;
+import org.eclipse.ecf.sync.IModelChangeMessage;
+import org.eclipse.ecf.sync.IModelSynchronizationStrategy;
+import org.eclipse.ecf.sync.SerializationException;
+import org.eclipse.ecf.sync.doc.DocumentChangeMessage;
import org.eclipse.ecf.sync.doc.IDocumentChange;
-import org.eclipse.ecf.sync.doc.IDocumentChangeMessage;
-import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy;
-import org.eclipse.ecf.sync.doc.SerializationException;
-import org.eclipse.ecf.sync.doc.messages.DocumentChangeMessage;
import org.eclipse.osgi.util.NLS;
-public class ColaSynchronizationStrategy implements IDocumentSynchronizationStrategy {
+public class ColaSynchronizationStrategy implements IModelSynchronizationStrategy {
// <ColaDocumentChangeMessage>
private final LinkedList unacknowledgedLocalOperations;
@@ -187,32 +188,35 @@ public class ColaSynchronizationStrategy implements IDocumentSynchronizationStra
}
/* (non-Javadoc)
- * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#registerLocalChange(org.eclipse.ecf.sync.doc.IDocumentChange)
+ * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#registerLocalChange(org.eclipse.ecf.sync.doc.IModelChange)
*/
- public IDocumentChangeMessage[] registerLocalChange(IDocumentChange localChange) {
+ public IModelChangeMessage[] registerLocalChange(IModelChange localChange) {
Trace.entering(Activator.PLUGIN_ID, SyncDebugOptions.METHODS_ENTERING, this.getClass(), "registerLocalChange", localChange); //$NON-NLS-1$
- final ColaDocumentChangeMessage colaMsg = new ColaDocumentChangeMessage(new DocumentChangeMessage(localChange.getOffset(), localChange.getLengthOfReplacedText(), localChange.getText()), localOperationsCount, remoteOperationsCount);
- if (!colaMsg.isReplacement()) {
- unacknowledgedLocalOperations.add(colaMsg);
- localOperationsCount++;
- }
- Trace.exiting(Activator.PLUGIN_ID, SyncDebugOptions.METHODS_EXITING, this.getClass(), "registerLocalChange", colaMsg); //$NON-NLS-1$
- return new IDocumentChangeMessage[] {colaMsg};
+ if (localChange instanceof IDocumentChange) {
+ final IDocumentChange docChange = (IDocumentChange) localChange;
+ final ColaDocumentChangeMessage colaMsg = new ColaDocumentChangeMessage(new DocumentChangeMessage(docChange.getOffset(), docChange.getLengthOfReplacedText(), docChange.getText()), localOperationsCount, remoteOperationsCount);
+ if (!colaMsg.isReplacement()) {
+ unacknowledgedLocalOperations.add(colaMsg);
+ localOperationsCount++;
+ }
+ Trace.exiting(Activator.PLUGIN_ID, SyncDebugOptions.METHODS_EXITING, this.getClass(), "registerLocalChange", colaMsg); //$NON-NLS-1$
+ return new IModelChangeMessage[] {colaMsg};
+ } else return new IModelChangeMessage[0];
}
/* (non-Javadoc)
* @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#toDocumentChangeMessage(byte[])
*/
- public IDocumentChange deserializeRemoteChange(byte[] bytes) throws SerializationException {
+ public IModelChange deserializeRemoteChange(byte[] bytes) throws SerializationException {
return DocumentChangeMessage.deserialize(bytes);
}
/* (non-Javadoc)
- * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#transformRemoteChange(org.eclipse.ecf.sync.doc.IDocumentChangeMessage)
+ * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#transformRemoteChange(org.eclipse.ecf.sync.doc.IModelChangeMessage)
*/
- public IDocumentChange[] transformRemoteChange(IDocumentChange remoteChange) {
+ public IModelChange[] transformRemoteChange(IModelChange remoteChange) {
if (!(remoteChange instanceof DocumentChangeMessage))
- return new IDocumentChange[] {};
+ return new IDocumentChange[0];
final DocumentChangeMessage m = (DocumentChangeMessage) remoteChange;
final List l = this.transformIncomingMessage(m);
return (IDocumentChange[]) l.toArray(new IDocumentChange[] {});
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java
index 9aa128c2f..54dc553a9 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/cola/ColaSynchronizationStrategyFactory.java
@@ -12,7 +12,7 @@
package org.eclipse.ecf.internal.sync.doc.cola;
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy;
+import org.eclipse.ecf.sync.IModelSynchronizationStrategy;
import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategyFactory;
/**
@@ -30,9 +30,9 @@ public class ColaSynchronizationStrategyFactory implements IDocumentSynchronizat
}
/* (non-Javadoc)
- * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategyFactory#getSyncronizationStrategy(org.eclipse.ecf.core.identity.ID, boolean)
+ * @see org.eclipse.ecf.sync.IModelSynchronizationStrategy#getSyncronizationStrategy(org.eclipse.ecf.core.identity.ID, boolean)
*/
- public IDocumentSynchronizationStrategy createDocumentSynchronizationStrategy(ID uniqueID, boolean isInitiator) {
+ public IModelSynchronizationStrategy createDocumentSynchronizationStrategy(ID uniqueID, boolean isInitiator) {
return ColaSynchronizationStrategy.getInstanceFor(uniqueID, isInitiator);
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategy.java
index d6bdaf924..b2dc92690 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategy.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategy.java
@@ -11,36 +11,40 @@
package org.eclipse.ecf.internal.sync.doc.identity;
+import org.eclipse.ecf.sync.IModelChange;
+import org.eclipse.ecf.sync.IModelChangeMessage;
+import org.eclipse.ecf.sync.IModelSynchronizationStrategy;
+import org.eclipse.ecf.sync.SerializationException;
+import org.eclipse.ecf.sync.doc.DocumentChangeMessage;
import org.eclipse.ecf.sync.doc.IDocumentChange;
-import org.eclipse.ecf.sync.doc.IDocumentChangeMessage;
-import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy;
-import org.eclipse.ecf.sync.doc.SerializationException;
-import org.eclipse.ecf.sync.doc.messages.DocumentChangeMessage;
/**
*
*/
-public class IdentitySynchronizationStrategy implements IDocumentSynchronizationStrategy {
+public class IdentitySynchronizationStrategy implements IModelSynchronizationStrategy {
/* (non-Javadoc)
* @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#deserializeToDocumentChange(byte[])
*/
- public IDocumentChange deserializeRemoteChange(byte[] bytes) throws SerializationException {
+ public IModelChange deserializeRemoteChange(byte[] bytes) throws SerializationException {
return DocumentChangeMessage.deserialize(bytes);
}
/* (non-Javadoc)
* @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#registerLocalChange(org.eclipse.ecf.sync.doc.IDocumentChange)
*/
- public IDocumentChangeMessage[] registerLocalChange(IDocumentChange localChange) {
- return new IDocumentChangeMessage[] {new DocumentChangeMessage(localChange.getOffset(), localChange.getLengthOfReplacedText(), localChange.getText())};
+ public IModelChangeMessage[] registerLocalChange(IModelChange localChange) {
+ if (localChange instanceof IDocumentChange) {
+ IDocumentChange docChange = (IDocumentChange) localChange;
+ return new IModelChangeMessage[] {new DocumentChangeMessage(docChange.getOffset(), docChange.getLengthOfReplacedText(), docChange.getText())};
+ } else return new IModelChangeMessage[0];
}
/* (non-Javadoc)
- * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#transformRemoteChange(org.eclipse.ecf.sync.doc.IDocumentChange)
+ * @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy#transformRemoteChange(org.eclipse.ecf.sync.IModelChange)
*/
- public IDocumentChange[] transformRemoteChange(IDocumentChange remoteChange) {
- return new IDocumentChange[] {remoteChange};
+ public IModelChange[] transformRemoteChange(IModelChange remoteChange) {
+ return new IModelChange[] {remoteChange};
}
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java
index b19edeccf..77576f6d6 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/internal/sync/doc/identity/IdentitySynchronizationStrategyFactory.java
@@ -12,7 +12,7 @@
package org.eclipse.ecf.internal.sync.doc.identity;
import org.eclipse.ecf.core.identity.ID;
-import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategy;
+import org.eclipse.ecf.sync.IModelSynchronizationStrategy;
import org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategyFactory;
/**
@@ -31,7 +31,7 @@ public class IdentitySynchronizationStrategyFactory implements IDocumentSynchron
/* (non-Javadoc)
* @see org.eclipse.ecf.sync.doc.IDocumentSynchronizationStrategyFactory#getSyncronizationStrategy(org.eclipse.ecf.core.identity.ID, boolean)
*/
- public IDocumentSynchronizationStrategy createDocumentSynchronizationStrategy(ID uniqueID, boolean isInitiator) {
+ public IModelSynchronizationStrategy createDocumentSynchronizationStrategy(ID uniqueID, boolean isInitiator) {
return new IdentitySynchronizationStrategy();
}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java
new file mode 100644
index 000000000..5880a01f8
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChange.java
@@ -0,0 +1,5 @@
+package org.eclipse.ecf.sync;
+
+public interface IModelChange {
+
+}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChangeMessage.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java
index 16893c588..2f1d42d9c 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChangeMessage.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelChangeMessage.java
@@ -9,14 +9,15 @@
* Composent, Inc. - initial API and implementation
*****************************************************************************/
-package org.eclipse.ecf.sync.doc;
+package org.eclipse.ecf.sync;
+
/**
- * Document change message. Instances of this interface
+ * Change message. Instances of this interface
* may be serialized to a byte [] so that they can be
* communicated to remote processes.
*/
-public interface IDocumentChangeMessage {
+public interface IModelChangeMessage {
public byte[] serialize() throws SerializationException;
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java
new file mode 100644
index 000000000..744f6a5d6
--- /dev/null
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/IModelSynchronizationStrategy.java
@@ -0,0 +1,37 @@
+package org.eclipse.ecf.sync;
+
+
+
+public interface IModelSynchronizationStrategy {
+
+ /**
+ * Register local model change with synchronization strategy. This method
+ * should be synchronously called when a local model change has
+ * been made to the underlying model.
+ * @param localChange the IModelChange made to the local model
+ * @return IModelChangeMessage[] an array of change message to be
+ * delivered to remote participants.
+ */
+ public IModelChangeMessage[] registerLocalChange(IModelChange localChange);
+
+ /**
+ * Transform remote change into a set of local changes to
+ * be synchronously applied to the local model.
+ * @param remoteChange the remote model change instance to
+ * be transformed by this synchronization strategy.
+ * @return IDocumentChange[] to apply to local model
+ */
+ public IModelChange[] transformRemoteChange(IModelChange remoteChange);
+
+
+ /**
+ * Deserialization of given byte array to concrete instance of
+ * IModelChange object to represent local change to be applied
+ *
+ * @param bytes the bytes to be deserialized
+ * @return IModelChange instance from bytes. Will not be <code>null</code>.
+ * @throws SerializationException thrown if some problem deserializing given bytes.
+ */
+ public IModelChange deserializeRemoteChange(byte[] bytes) throws SerializationException;
+
+}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/SerializationException.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java
index e477717b7..5023649c6 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/SerializationException.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/SerializationException.java
@@ -9,7 +9,7 @@
* Composent, Inc. - initial API and implementation
*****************************************************************************/
-package org.eclipse.ecf.sync.doc;
+package org.eclipse.ecf.sync;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/messages/DocumentChangeMessage.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java
index ac345ed9a..f2db9789d 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/messages/DocumentChangeMessage.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/DocumentChangeMessage.java
@@ -10,7 +10,7 @@
* Mustafa K. Isik
*****************************************************************************/
-package org.eclipse.ecf.sync.doc.messages;
+package org.eclipse.ecf.sync.doc;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -18,14 +18,13 @@ import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import org.eclipse.ecf.sync.doc.IDocumentChange;
-import org.eclipse.ecf.sync.doc.IDocumentChangeMessage;
-import org.eclipse.ecf.sync.doc.SerializationException;
+import org.eclipse.ecf.sync.IModelChangeMessage;
+import org.eclipse.ecf.sync.SerializationException;
/**
*
*/
-public class DocumentChangeMessage implements IDocumentChange, IDocumentChangeMessage {
+public class DocumentChangeMessage implements IDocumentChange, IModelChangeMessage {
private static final long serialVersionUID = -3195542805471664496L;
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java
index 8743b7c59..2520feaef 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentChange.java
@@ -11,11 +11,13 @@
package org.eclipse.ecf.sync.doc;
+import org.eclipse.ecf.sync.IModelChange;
+
/**
* Local document change. Instances of this class represent
* local changes to a replicated document.
*/
-public interface IDocumentChange {
+public interface IDocumentChange extends IModelChange {
/**
* Get offset in document where change has or will occur.
* @return int the offset
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategy.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategy.java
deleted file mode 100644
index 972e56942..000000000
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategy.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/****************************************************************************
- * Copyright (c) 2008 Composent, Inc. and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Composent, Inc. - initial API and implementation
- *****************************************************************************/
-
-package org.eclipse.ecf.sync.doc;
-
-/**
- * Document synchronization strategy. Instances implementing this interface
- * expose the ability for clients to synchronize combinations of local
- * and remote documents.
- * <p></p>
- * Owners that wish to synchronize local and remote changes
- * should call {@link #registerLocalChange(IDocumentChange)} when local
- * changes occur, and then serialize returned {@link IDocumentChangeMessage}s and
- * deliver the change message to remotes. When remote change messages are received,
- * they should first be deserized via {@link #deserializeRemoteChange(byte[])}, and then
- * passed to {@link #transformRemoteChange(IDocumentChange)} to transform
- * the change so that when the returned IDocumentChanges are applied to the local
- * document its state will be consistent with other client(s).
- */
-public interface IDocumentSynchronizationStrategy {
-
- /**
- * Register local document change with document synchronization strategy. This method
- * should be synchronously called when a local change has
- * been made to the underlying document.
- * @param localChange the IDocumentChange made to the local document
- * @return IDocumentChangeMessage[] an array of document change message to be
- * delivered to remote participants.
- */
- public IDocumentChangeMessage[] registerLocalChange(IDocumentChange localChange);
-
- /**
- * Transform remote document change into a set of local document changes to
- * be synchronously applied to the local document.
- * @param remoteChange the remote document change instance to
- * be transformed by this synchronization strategy.
- * @return IDocumentChange[] to apply to local document
- */
- public IDocumentChange[] transformRemoteChange(IDocumentChange remoteChange);
-
- /**
- * Deserialization of given byte array to concrete instance of
- * IDocumentChange object to represent local change to be applied
- *
- * @param bytes the bytes to be deserialized
- * @return IDocumentChange instance from bytes. Will not be <code>null</code>.
- * @throws SerializationException thrown if some problem deserializing given bytes.
- */
- public IDocumentChange deserializeRemoteChange(byte[] bytes) throws SerializationException;
-}
diff --git a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java
index de5ed3530..ca68a7e33 100644
--- a/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java
+++ b/framework/bundles/org.eclipse.ecf.sync/src/org/eclipse/ecf/sync/doc/IDocumentSynchronizationStrategyFactory.java
@@ -12,9 +12,10 @@
package org.eclipse.ecf.sync.doc;
import org.eclipse.ecf.core.identity.ID;
+import org.eclipse.ecf.sync.IModelSynchronizationStrategy;
/**
- * Factory for creating {@link IDocumentSynchronizationStrategy} instances for
+ * Factory for creating {@link IModelSynchronizationStrategy} instances for
* a uniquely identified entity. This interface is exposed as a service and
* provides an entry point for clients.
*/
@@ -23,13 +24,13 @@ public interface IDocumentSynchronizationStrategyFactory {
public static final String SYNCHSTRATEGY_TYPE = "org.eclipse.ecf.sync.doc";
/**
- * Get an IDocumentSynchronizationStrategy for a unique ID. Should not be <code>null</code>.
- * @param uniqueID the uniqueID to identify the client of the {@link IDocumentSynchronizationStrategy}.
+ * Get an IModelSynchronizationStrategy for a unique ID. Should not be <code>null</code>.
+ * @param uniqueID the uniqueID to identify the client of the {@link IModelSynchronizationStrategy}.
* @param isInitiator whether the client is the initiator of the
* shared editing, or the receiver.
- * @return IDocumentSynchronizationStrategy for the given uniqueID.
+ * @return IModelSynchronizationStrategy for the given uniqueID.
*/
- public IDocumentSynchronizationStrategy createDocumentSynchronizationStrategy(ID uniqueID, boolean isInitiator);
+ public IModelSynchronizationStrategy createDocumentSynchronizationStrategy(ID uniqueID, boolean isInitiator);
/**
* Clean up the synchronization strategy caching for a given uniqueID. Should not be <code>null</code>.

Back to the top