Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter:
de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm

List of all members.

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

Detailed Description

This class implements the client-side core of the Jupiter control algorithm.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.Jupiter ( boolean  isClientSide)

Class constructor that creates a new Jupiter algorithm.

Parameters:
isClientSidetrue if the algorithm resides on the client side

Member Function Documentation

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.

Parameters:
siteIdthe site id of the sending site
timestampthe timestamp at the other site
Exceptions:
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.

Parameters:
timethe 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.

Parameters:
timethe 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.

Parameters:
opthe operation for which a JupiterActivity should be generated
userThe user who created this activity.
editorthe SPath for which this activity is to be created.
Returns:
the generated JupiterActivity
See also:
JupiterActivity

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.

Returns:
the current timestamp

Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.

Checks if this algorithm locates client side.

Returns:
true 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.

Exceptions:
TransformationExceptionIf 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.

Parameters:
jupiterActivitythe JupiterActivity to transform and apply
Returns:
the transformed Operation

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.

Parameters:
newOpthe operation to be transformed
Returns:
the transformed operation
See also:
ackJupiterActivityList
int de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.transformIndex ( int  index,
Operation  op 
) [protected]

Transforms the given index against the operation.

Parameters:
indexthe index to be transformed
opthe operation to be transformed
Returns:
the transformed index
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.

Parameters:
timestampthe timestamp at which the indices are valid
indicesthe array of integer indices
Returns:
the transformed array of 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
Parameters:
timestamp
Exceptions:
TransformationException

Implements de.fu_berlin.inf.dpp.concurrent.jupiter.Algorithm.

ChecksumActivity de.fu_berlin.inf.dpp.concurrent.jupiter.internal.Jupiter.withTimestamp ( ChecksumActivity  checksumActivity)

Member Data Documentation

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.

The inclusion transformation function used to transform operations.

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.

 All Classes Namespaces Files Functions Variables Enumerations