|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.coweb.oe.OperationEngine
public class OperationEngine
| Constructor Summary | |
|---|---|
OperationEngine(int siteId)
Controls the operational transformation algorithm. |
|
| Method Summary | |
|---|---|
ContextVector |
copyContextVector()
Makes a copy of the engine context vector representing the local document state. |
Operation |
createOp(boolean local,
String key,
String value,
String type,
int position,
int site,
int[] cv,
int order)
Factory method that creates an operation object initialized with the given values. |
void |
freezeSite(int site)
Freezes a slot in the context vector table by inserting a reference to context vector of this engine. |
int |
getBufferSize()
Gets the size of the history buffer in terms of stored operations. |
int |
getSiteCount()
Gets the number of sites known to be participating, including this site. |
int |
getSiteId()
|
Object[] |
getState()
Gets the state of this engine instance to seed a new instance. |
boolean |
hasProcessedOp(Operation op)
Gets if the engine has already processed the give operation based on its context vector and the context vector of this engine instance. |
ContextVector |
purge()
Runs the garbage collection algorithm over the history buffer. |
Operation |
push(boolean local,
String key,
String value,
String type,
int position,
int site,
int[] cv,
int order)
Creates an operation object and pushes it into the operation engine algorithm. |
Operation |
pushLocalOp(Operation op)
Procceses a local operation and adds it to the history buffer. |
Operation |
pushRemoteOp(Operation op)
Procceses a remote operation, transforming it if required, and adds the original to the history buffer. |
void |
pushSync(int site,
ContextVector cv)
Processes an engine synchronization event. |
void |
pushSyncWithSites(int site,
int[] sites)
Processes an engine synchronization event. |
void |
setState(Object[] arr)
Sets the state of this engine instance to state received from another instance. |
void |
thawSite(int site)
Thaws a slot in the context vector table by inserting a zeroed context vector into the context vector table. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public OperationEngine(int siteId)
throws OperationEngineException
{Number} - siteId Unique integer site ID for this engine instance
OperationEngineException| Method Detail |
|---|
public String toString()
toString in class Objectpublic Object[] getState()
public void setState(Object[] arr)
throws OperationEngineException
{Object[]} - arr Array in the format returned by getState
OperationEngineException
public ContextVector copyContextVector()
throws OperationEngineException
OperationEngineException
public Operation createOp(boolean local,
String key,
String value,
String type,
int position,
int site,
int[] cv,
int order)
throws OperationEngineException
{Boolean} - local True if the operation was originated locally,
false if not{String} - key Operation key{String} - value Operation value{String} - type Type of operation: update, insert, delete{Number} - position Operation integer position{Number} - site Integer site ID where a remote op originated.
Ignored for local operations which adopt the local site ID.{ContextVector} - cv Operation context. Ignored for local operations
which adopt the local site context.{Number} - order Place of the operation in the total order. Ignored
for local operations which are not yet assigned a place in the
order.
OperationEngineException
public Operation push(boolean local,
String key,
String value,
String type,
int position,
int site,
int[] cv,
int order)
throws OperationEngineException
OperationEngineExceptionpublic Operation pushLocalOp(Operation op)
{Operation} - Local operation
public Operation pushRemoteOp(Operation op)
throws OperationEngineException
{Operation} - Remote operation
OperationEngineException
public void pushSync(int site,
ContextVector cv)
throws OperationEngineException
{Number} - site Integer site ID of where the sync originated{ContextVector} - cv Context vector sent by the engine at that site
OperationEngineException
public void pushSyncWithSites(int site,
int[] sites)
throws OperationEngineException
{Number} - site Integer site ID of where the sync originated{Number[]} - Array form of the context vector sent by the site
OperationEngineException
public ContextVector purge()
throws OperationEngineException
OperationEngineExceptionpublic int getBufferSize()
public boolean hasProcessedOp(Operation op)
{Operation} - op Operation to check
public void freezeSite(int site)
throws OperationEngineException
{Number} - site Integer ID of the site to freeze
OperationEngineException
public void thawSite(int site)
throws OperationEngineException
{Number} - site Integer ID of the site to thaw
OperationEngineExceptionpublic int getSiteCount()
public int getSiteId()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||