|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.coweb.oe.Operation
public abstract class Operation
| Field Summary | |
|---|---|
protected ContextVector |
contextVector
|
protected boolean |
immutable
|
protected static int |
infinity
|
protected String |
key
|
protected boolean |
local
|
protected int |
order
|
protected int |
position
|
protected int |
seqId
|
protected int |
siteId
|
protected String |
type
|
protected String |
value
|
protected Vector<Operation> |
xCache
|
| Constructor Summary | |
|---|---|
protected |
Operation(Map<String,Object> args)
Contains information about a local or remote event for transformation. |
| Method Summary | |
|---|---|
void |
addToCache(int siteCount)
Caches a transformed copy of this original operation for faster future transformations. |
int |
compareByContext(Operation op)
Computes an ordered comparison of this op and another based on their context vectors. |
int |
compareByOrder(Operation op)
Computes an ordered comparison of this op and another based on their position in the total op order. |
Operation |
copy()
Makes a copy of this operation object. |
static String |
createHistoryKey(int site,
int seq)
|
static Operation |
createOperationFromState(Object[] state)
|
static Operation |
createOperationFromType(String type,
Map<String,Object> args)
|
ContextVector |
getContextVector()
|
Operation |
getFromCache(ContextVector cv)
Gets a version of the given operation previously transformed into the given context if available. |
int |
getPosition()
|
int |
getSeqId()
|
int |
getSiteId()
|
Object[] |
getState()
Serializes the operation as an array of values for transmission. |
String |
getValue()
|
void |
setImmutable(boolean immutable)
|
void |
setState(Object[] arr)
Unserializes operation data and sets it as the instance data. |
String |
toString()
|
Operation |
transformWith(Operation op)
Transforms this operation to include the effects of the operation provided as a parameter IT(this, op). |
abstract Operation |
transformWithDelete(Operation op)
|
abstract Operation |
transformWithInsert(Operation op)
|
abstract Operation |
transformWithUpdate(Operation op)
|
void |
upgradeContextTo(Operation op)
Upgrades the context of this operation to reflect the inclusion of a single other operation from some site. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final int infinity
protected int siteId
protected int seqId
protected String type
protected boolean local
protected ContextVector contextVector
protected String key
protected String value
protected int position
protected int order
protected boolean immutable
protected Vector<Operation> xCache
| Constructor Detail |
|---|
protected Operation(Map<String,Object> args)
throws OperationEngineException
{Object[]} - args.state Array in format returned by getState
bundling the following individual parameter values{Number} - args.siteId Integer site ID where the op originated{ContextVector} - args.contextVector Context in which the op
occurred{String} - args.key Name of the property the op affected{String} - args.value Value of the op{Number} - args.position Integer position of the op in a linear
collection{Number} - args.order Integer sequence number of the op in the
total op order across all sites{Number} - args.seqId Integer sequence number of the op at its
originating site. If undefined, computed from the context vector and
site ID.{Boolean} - args.immutable True if the op cannot be changed, most
likely because it is in a history buffer somewhere
to this instance
OperationEngineException| Method Detail |
|---|
public static Operation createOperationFromType(String type,
Map<String,Object> args)
throws OperationEngineException
OperationEngineException
public static Operation createOperationFromState(Object[] state)
throws OperationEngineException
OperationEngineException
public static String createHistoryKey(int site,
int seq)
public String toString()
toString in class Objectpublic abstract Operation transformWithDelete(Operation op)
public abstract Operation transformWithInsert(Operation op)
public abstract Operation transformWithUpdate(Operation op)
public Object[] getState()
public void setState(Object[] arr)
throws OperationEngineException
{Object[]} - arr Array in the format returned by getState
OperationEngineException
public Operation copy()
throws OperationEngineException
OperationEngineException
public Operation getFromCache(ContextVector cv)
throws OperationEngineException
{ContextVector} - cv Context of the transformed op to seek
OperationEngineException
public void addToCache(int siteCount)
throws OperationEngineException
{Number} - Integer count of active sites, including the local one
OperationEngineExceptionpublic int compareByContext(Operation op)
{Operation} - op Other operationpublic int compareByOrder(Operation op)
{Operation} - op Other operation
public Operation transformWith(Operation op)
throws OperationEngineException
OperationEngineException
{Error} - If this op to be transformed is immutable or if the
this operation subclass does not implement the transform method needed
to handle the passed op
public void upgradeContextTo(Operation op)
throws OperationEngineException
{Operation} - The operation to include in the context of this op
OperationEngineException
{Error} - If this op to be upgraded is immutablepublic int getSiteId()
public int getSeqId()
public String getValue()
public int getPosition()
public ContextVector getContextVector()
public void setImmutable(boolean immutable)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||