Saros
Distributed Collaborative Editing and Distributed Party Programming
|
Classes | |
class | OperationWrapper |
Public Member Functions | |
Jupiter (boolean isClientSide) | |
JupiterActivity | generateJupiterActivity (Operation op, User source, SPath editor) |
boolean | isCurrent (Timestamp timestamp) throws TransformationException |
Operation | receiveJupiterActivity (JupiterActivity jupiterActivity) throws TransformationException |
void | acknowledge (int siteId, Timestamp timestamp) throws TransformationException |
int[] | transformIndices (Timestamp timestamp, int[] indices) throws TransformationException |
JupiterActivity | undo () |
JupiterActivity | redo () |
synchronized Timestamp | getTimestamp () |
boolean | isClientSide () |
void | updateVectorTime (Timestamp timestamp) throws TransformationException |
ChecksumActivity | withTimestamp (ChecksumActivity checksumActivity) |
Protected Member Functions | |
int | transformIndex (int index, Operation op) |
void | discardAcknowledgedOperations (JupiterVectorTime time) |
Operation | transform (Operation newOp) |
void | checkPreconditions (JupiterVectorTime time) throws TransformationException |
Protected Attributes | |
InclusionTransformation | inclusion |
JupiterVectorTime | vectorTime |
final boolean | isClientSide |
final List< OperationWrapper > | ackJupiterActivityList |
This class implements the client-side core of the Jupiter control algorithm.
de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.Jupiter | ( | boolean | isClientSide | ) |
Class constructor that creates a new Jupiter algorithm.
isClientSide | true if the algorithm resides on the client side |
void de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.acknowledge | ( | int | siteId, |
Timestamp | timestamp | ||
) | throws TransformationException |
Notifies the algorithm that the site specified by the site id has processed the number of messages in the timestamp.
siteId | the site id of the sending site |
timestamp | the timestamp at the other site |
TransformationException |
Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.
void de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.checkPreconditions | ( | JupiterVectorTime | time | ) | throws TransformationException [protected] |
Test 3 preconditions that must be fulfilled before transforming. They are taken from the Jupiter paper.
time | the JupiterVectorTime to test whether it makes sense in the current situation. |
void de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.discardAcknowledgedOperations | ( | JupiterVectorTime | time | ) | [protected] |
Discard from the other site (client/server) acknowledged operations.
time | the remote JupiterVectorTime |
JupiterActivity de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.generateJupiterActivity | ( | Operation | op, |
User | user, | ||
SPath | editor | ||
) |
Generates a JupiterActivity for the given operation. The operation is a locally generated operation. The returned JupiterActivity must be sent to the other sites.
op | the operation for which a JupiterActivity should be generated |
user | The user who created this activity. |
editor | the SPath for which this activity is to be created. |
Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.
synchronized Timestamp de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.getTimestamp | ( | ) |
Gets the current timestamp at the local site.
Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.
Checks if this algorithm locates client side.
boolean de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.isCurrent | ( | Timestamp | timestamp | ) | throws TransformationException |
Returns whether the local user represented by this Jupiter instance has not modified the document locally.
This is done by comparing the remote component of the given timestamp to the local operation count.
TransformationException | If the given timestamp has a remote operation count which is larger than our local time (which indicates that the remote timestamp refers to an event which did not yet occur) |
If this timestamp is null, this means it was sent to us while we still had User.Permission#READONLY_ACCESS
Operation de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.receiveJupiterActivity | ( | JupiterActivity | jupiterActivity | ) | throws TransformationException |
Receives a JupiterActivity from a remote site. The JupiterActivity must be transformed and the resulting operation is returned.
jupiterActivity | the JupiterActivity to transform and apply |
Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.
JupiterActivity de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.redo | ( | ) |
Throws a CannotRedoException because undo is not supported by this implementation.
This method used to be part of the Algorithm interface
Operation de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.transform | ( | Operation | newOp | ) | [protected] |
Transforms an operation with the operations in the outgoing queue ackJupiterActivityList.
newOp | the operation to be transformed |
int de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.transformIndex | ( | int | index, |
Operation | op | ||
) | [protected] |
Transforms the given index against the operation.
index | the index to be transformed |
op | the operation to be transformed |
int [] de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.transformIndices | ( | Timestamp | timestamp, |
int[] | indices | ||
) | throws TransformationException |
Transform the array of indices from the state indicated by the timestamp to the current timestamp at the local site. The transformed indices are returned to the client.
timestamp | the timestamp at which the indices are valid |
indices | the array of integer indices |
Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.
JupiterActivity de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.undo | ( | ) |
Throws a CannotUndoException because undo is not supported by this implementation.
This method used to be part of the Algorithm interface
void de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.updateVectorTime | ( | Timestamp | timestamp | ) | throws TransformationException |
timestamp |
TransformationException |
Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.
ChecksumActivity de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.withTimestamp | ( | ChecksumActivity | checksumActivity | ) |
final List<OperationWrapper> de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.ackJupiterActivityList [protected] |
A list that contains the JupiterActivities sent to the server which are to be acknowledged by the server before they can be removed. This list corresponds to the 'outgoing' list in the Jupiter pseudo code description.
InclusionTransformation de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.inclusion [protected] |
The inclusion transformation function used to transform operations.
final boolean de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.isClientSide [protected] |
Flag indicating whether this algorithm is used on the client-side. In some situations, the JupiterActivities from the server-side have a higher priority in transformations.
The vector time, representing the number of processed JupiterActivities, of this algorithm.