|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tranche.server.logs.LogEntry
public class LogEntry
Handles the complicated work of translating to and from bytes for transmission using a checksum.
| Constructor Summary | |
|---|---|
LogEntry()
|
|
| Method Summary | |
|---|---|
static LogEntry |
createFromBytes(byte[] data)
Create a log entry. |
byte |
getAction()
|
java.lang.String |
getClientIP()
Retrieve the client's IP address as a string. |
BigHash |
getHash()
Retrieve BigHash. |
byte[] |
getSignatureMD5()
Retrieve MD5 signature. |
long |
getTimestamp()
Retrieve log entry timestamp. |
long |
length()
Return the length, in bytes, of the entry, including the checksum. |
static LogEntry |
logGetConfiguration(long timestamp,
java.lang.String ip)
Return a new log entry with the current log entry's configuration data. |
static LogEntry |
logGetData(long timestamp,
java.lang.String ip,
BigHash hash)
Return a new log entry of the current log entry's data. |
static LogEntry |
logGetMetaData(long timestamp,
java.lang.String ip,
BigHash hash)
Return a new log entry of the current log entry's meta data. |
static LogEntry |
logGetNonce(long timestamp,
java.lang.String ip)
Return a new log entry with the current log enty's nonce data. |
static LogEntry |
logSetConfiguration(long timestamp,
java.lang.String ip,
Signature sig)
Create a log entry with configuration data. |
static LogEntry |
logSetData(long timestamp,
java.lang.String ip,
BigHash hash,
Signature sig)
Create a log entry with set data. |
static LogEntry |
logSetMetaData(long timestamp,
java.lang.String ip,
BigHash hash,
Signature sig)
Create a log entry with meta data. |
byte[] |
toByteArray()
Serialized byte array representation of a log entry. |
java.lang.String |
toString()
Return simple string representation of log entry. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LogEntry()
| Method Detail |
|---|
public static LogEntry createFromBytes(byte[] data)
throws java.lang.Exception
data - An array of bytes without the first long value, number of bytes, attached.
java.lang.Exceptionpublic long length()
public static LogEntry logSetData(long timestamp,
java.lang.String ip,
BigHash hash,
Signature sig)
throws java.lang.Exception
timestamp - ip - hash - sig -
java.lang.Exception
public static LogEntry logSetMetaData(long timestamp,
java.lang.String ip,
BigHash hash,
Signature sig)
throws java.lang.Exception
timestamp - ip - hash - sig -
java.lang.Exception
public static LogEntry logSetConfiguration(long timestamp,
java.lang.String ip,
Signature sig)
throws java.lang.Exception
timestamp - ip - sig -
java.lang.Exception
public static LogEntry logGetData(long timestamp,
java.lang.String ip,
BigHash hash)
throws java.lang.Exception
timestamp - ip - hash -
java.lang.Exception
public static LogEntry logGetMetaData(long timestamp,
java.lang.String ip,
BigHash hash)
throws java.lang.Exception
timestamp - ip - hash -
java.lang.Exception
public static LogEntry logGetConfiguration(long timestamp,
java.lang.String ip)
throws java.lang.Exception
timestamp - ip -
java.lang.Exception
public static LogEntry logGetNonce(long timestamp,
java.lang.String ip)
throws java.lang.Exception
timestamp - ip -
java.lang.Exception
public byte[] toByteArray()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class java.lang.Objectpublic byte getAction()
public long getTimestamp()
throws java.lang.Exception
java.lang.Exception
public java.lang.String getClientIP()
throws java.lang.Exception
java.lang.Exception
public BigHash getHash()
throws java.lang.Exception
java.lang.Exception
public byte[] getSignatureMD5()
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||