Saros
Distributed Collaborative Editing and Distributed Party Programming
de.fu_berlin.inf.dpp.activities.ChecksumActivity Class Reference
Inheritance diagram for de.fu_berlin.inf.dpp.activities.ChecksumActivity:
de.fu_berlin.inf.dpp.activities.AbstractResourceActivity de.fu_berlin.inf.dpp.activities.AbstractActivity de.fu_berlin.inf.dpp.activities.IResourceActivity de.fu_berlin.inf.dpp.activities.IActivity de.fu_berlin.inf.dpp.activities.IActivity

List of all members.

Public Member Functions

 ChecksumActivity (User source, SPath path, long hash, long length, Timestamp jupiterTimestamp)
ChecksumActivity withTimestamp (Timestamp jupiterTimestamp)
String toString ()
void dispatch (IActivityReceiver receiver)
int hashCode ()
boolean equals (Object obj)
Timestamp getTimestamp ()
long getLength ()
long getHash ()
boolean existsFile ()

Static Public Member Functions

static ChecksumActivity missing (User source, SPath path)

Static Public Attributes

static final int NON_EXISTING_DOC = -1

Protected Attributes

final long hash
final long length
final Timestamp jupiterTimestamp

Detailed Description

A ChecksumActivity is used to communicate checksums from the host to the clients.

A ChecksumActivity always relates to a certain file (given a path) and contains the hash and length of the file.

To indicate that a file is missing on the host NON_EXISTING_DOC is used.

A ChecksumActivity also may contain a Timestamp to indicate at which point of time the checksum was created. A user can use this information to see whether the checksum can be used to check for consistency or whether the local user has already written additional text which invalidates the checksum.


Constructor & Destructor Documentation

de.fu_berlin.inf.dpp.activities.ChecksumActivity.ChecksumActivity ( User  source,
SPath  path,
long  hash,
long  length,
Timestamp  jupiterTimestamp 
)

Constructor for ChecksumActivities. Timestamp can be null. ChecksumActivities created by the watchdog don't have access to the JupiterClients and therefore create an Activity without timestamp. Timestamps will be added later by the ConcurrentDocumentClient /-Server (by creating a new Activity with a timestamp)

Parameters:
sourceThe User that created this activity
pathThe SPath pointing to the document
hashThe hashcode of the document
lengthThe length of the document
jupiterTimestampThe current jupiterTimestamp for this document, may be null

Member Function Documentation

void de.fu_berlin.inf.dpp.activities.ChecksumActivity.dispatch ( IActivityReceiver  receiver)
boolean de.fu_berlin.inf.dpp.activities.ChecksumActivity.equals ( Object  obj)
boolean de.fu_berlin.inf.dpp.activities.ChecksumActivity.existsFile ( )
long de.fu_berlin.inf.dpp.activities.ChecksumActivity.getHash ( )
long de.fu_berlin.inf.dpp.activities.ChecksumActivity.getLength ( )
Timestamp de.fu_berlin.inf.dpp.activities.ChecksumActivity.getTimestamp ( )
int de.fu_berlin.inf.dpp.activities.ChecksumActivity.hashCode ( )
static ChecksumActivity de.fu_berlin.inf.dpp.activities.ChecksumActivity.missing ( User  source,
SPath  path 
) [static]

Create a ChecksumActivity which indicates that the file is missing on the host.

String de.fu_berlin.inf.dpp.activities.ChecksumActivity.toString ( )
ChecksumActivity de.fu_berlin.inf.dpp.activities.ChecksumActivity.withTimestamp ( Timestamp  jupiterTimestamp)

Returns a copy of the ChecksumActivity with a new Timestamp.


Member Data Documentation

Constant used for representing a missing file

 All Classes Namespaces Files Functions Variables Enumerations