|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.logs.activity.Activity
public class Activity
Entry in activity log, which is used to log all requests that impact data held by Tranche server.
| Field Summary | |
|---|---|
static byte |
ACTION_ANY
We reserved the four high-order bits for action types so can expand (up to 128 values) |
static byte |
ACTION_DELETE
|
static byte |
ACTION_REPLACE
|
static byte |
ACTION_SET
|
static byte |
ANY
Mask for all activities, regardless of chunk type (data, meta, etc?) and action. |
static byte |
CHUNK_ANY
We reserved the four low-order bits for chunk types so can expand (up to 128 values) |
static byte |
CHUNK_DATA
|
static byte |
CHUNK_META_DATA
|
static byte |
DELETE_DATA
Action byte representing a data chunk being deleted. |
static byte |
DELETE_META_DATA
Action byte representing a meta data chunk being deleted. |
static byte |
REPLACE_META_DATA
Action byte representing a meta data chunk being replaced. |
static byte |
SET_DATA
Action byte representing a data chunk being set. |
static byte |
SET_META_DATA
Action byte representing a meta data chunk being set. |
static long |
UNSET_TIMESTAMP
The value used when a timestamp is not known. |
| Constructor Summary | |
|---|---|
Activity(byte[] bytes)
|
|
Activity(byte action,
Signature signature,
BigHash hash)
Used to create an Activity object that will be written to ActivityLog. |
|
Activity(java.io.InputStream in)
|
|
Activity(long timestamp,
byte action,
Signature signature,
BigHash hash)
Used to create an Activity object that was read from the ActivityLog. |
|
| Method Summary | |
|---|---|
int |
compareTo(Activity a)
|
protected void |
deserialize(java.io.InputStream in)
|
boolean |
equals(java.lang.Object o)
|
byte |
getAction()
|
BigHash |
getHash()
|
Signature |
getSignature()
|
long |
getTimestamp()
|
int |
hashCode()
|
boolean |
isData()
|
static boolean |
isData(byte actionByte)
|
boolean |
isMetaData()
|
static boolean |
isMetaData(byte actionByte)
|
boolean |
isTimestampSet()
|
protected void |
serialize(java.io.OutputStream out)
|
void |
setTimestamp(long timestamp)
|
byte[] |
toByteArray()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long UNSET_TIMESTAMP
The value used when a timestamp is not known.
A timestamp is not known until it is written. This is because all entries must be in chronological order, so timestamp is recordered when thread is writing.
public static final byte CHUNK_ANY
public static final byte CHUNK_DATA
public static final byte CHUNK_META_DATA
public static final byte ACTION_ANY
public static final byte ACTION_SET
public static final byte ACTION_DELETE
public static final byte ACTION_REPLACE
public static final byte ANY
Mask for all activities, regardless of chunk type (data, meta, etc?) and action.
public static final byte SET_DATA
Action byte representing a data chunk being set.
public static final byte SET_META_DATA
Action byte representing a meta data chunk being set.
public static final byte DELETE_DATA
Action byte representing a data chunk being deleted.
public static final byte DELETE_META_DATA
Action byte representing a meta data chunk being deleted.
public static final byte REPLACE_META_DATA
Action byte representing a meta data chunk being replaced.
| Constructor Detail |
|---|
public Activity(byte action,
Signature signature,
BigHash hash)
throws java.lang.Exception
Used to create an Activity object that will be written to ActivityLog.
Note that there is no timestamp parameter. When an Activity is written to the activity log, the timestamp will be recorded.
action - signature - hash -
java.lang.Exception
public Activity(long timestamp,
byte action,
Signature signature,
BigHash hash)
throws java.lang.Exception
Used to create an Activity object that was read from the ActivityLog.
In the other constructor, there is no timestamp parameter since the timestamp is unknown until the Activity is recorded. Here, the timestamp is known and must be supplied as a parameter.
timestamp - action - signature - hash -
java.lang.Exception
public Activity(java.io.InputStream in)
throws java.io.IOException,
java.security.GeneralSecurityException
in -
java.io.IOException
java.security.GeneralSecurityException
public Activity(byte[] bytes)
throws java.io.IOException,
java.security.GeneralSecurityException
bytes -
java.io.IOException
java.security.GeneralSecurityException| Method Detail |
|---|
public long getTimestamp()
public void setTimestamp(long timestamp)
timestamp - public byte getAction()
public Signature getSignature()
public BigHash getHash()
public boolean isTimestampSet()
public boolean isMetaData()
public boolean isData()
public static boolean isMetaData(byte actionByte)
actionByte -
public static boolean isData(byte actionByte)
actionByte -
public byte[] toByteArray()
throws java.io.IOException,
java.security.cert.CertificateEncodingException
java.io.IOException
java.security.cert.CertificateEncodingException
protected void serialize(java.io.OutputStream out)
throws java.io.IOException,
java.security.cert.CertificateEncodingException
out -
java.io.IOException
java.security.cert.CertificateEncodingException
protected void deserialize(java.io.InputStream in)
throws java.io.IOException,
java.security.GeneralSecurityException
in -
java.io.IOException
java.security.GeneralSecurityExceptionpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objecto -
public int compareTo(Activity a)
compareTo in interface java.lang.Comparable<Activity>a -
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||