UM Java API
6.16.1
|
Public Member Functions | |
void | set (long s, long m) throws LBMSDMException |
LBMSDMRawTimestamp () throws LBMSDMException | |
LBMSDMRawTimestamp (long s, long m) throws LBMSDMException | |
LBMSDMRawTimestamp (String s) throws LBMSDMException | |
long | get_sec () throws LBMSDMException |
long | get_usec () throws LBMSDMException |
String | toString () |
int | format (byte[] buf, int offset) throws LBMSDMException |
int | parse (byte[] buf, int offset) throws LBMSDMException |
LBMSDMRawTimestamp | clone () throws CloneNotSupportedException |
String | toDbgString () |
void | set_debug_level (int level) |
void | log (String s) |
Static Public Attributes | |
static int | length = 8 |
static final int | DEBUG_BASIC = 1 |
static final int | DEBUG_VERBOSE_PARSING = 2 |
Protected Attributes | |
int | debug_level = 0 |
An LBMSDMRawTimestamp is a helper class to minimise the effort of formatting and parsing Timestamps. A Timestamp is the number of seconds and microseconds since Unix epoch
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp | ( | ) | throws LBMSDMException |
Create a raw timestamp field, defaulting to 0
Referenced by com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.clone().
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp | ( | long | s, |
long | m | ||
) | throws LBMSDMException |
Set a raw timestamp field providing the seconds and microseconds since UNIX epoch
s | The number of seconds since epoch |
m | The number of microseconds since epoch |
LBMSDMUnsignedException | if an unsigned value is passed in |
com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp | ( | String | s | ) | throws LBMSDMException |
Set a raw timestamp field providing a string formatted timestamp
s | The string containing the time ("sec.micro" or "now") |
LBMSDMUnsignedException | if an unsigned value is passed in |
LBMSDMRawTimestamp com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.clone | ( | ) | throws CloneNotSupportedException |
Get a copy of this object
References com.latencybusters.lbm.sdm.LBMSDMRawUint32.clone(), com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.clone(), and com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.LBMSDMRawTimestamp().
Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.clone(), com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.clone(), com.latencybusters.lbm.sdm.LBMSDMArrayTimestamp.parse(), and com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.set().
int com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.format | ( | byte [] | buf, |
int | offset | ||
) | throws LBMSDMException |
Format the raw timestamp value into a byte buffer
buf | The buffer to contain the formatted value |
offset | The offset in to the buffer to start formatting |
References com.latencybusters.lbm.sdm.LBMSDMRawUint32.format(), and com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.length.
Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.format(), and com.latencybusters.lbm.sdm.LBMSDMArrayTimestamp.format().
long com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.get_sec | ( | ) | throws LBMSDMException |
Get the number of seconds since epoch
long com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.get_usec | ( | ) | throws LBMSDMException |
Get the number of microseconds since the start of the current second
|
inherited |
Log an event. If debug level is set greater than 0, output to stderr
Referenced by com.latencybusters.lbm.sdm.LBMSDMFields.get_attr(), com.latencybusters.lbm.sdm.LBMSDMFields.LBMSDMFields(), com.latencybusters.lbm.sdm.LBMSDMFieldBlob.set(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.set(), com.latencybusters.lbm.sdm.LBMSDMFieldDecimal.set(), com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.set(), com.latencybusters.lbm.sdm.LBMSDMArrayDecimal.set(), and com.latencybusters.lbm.sdm.LBMSDMArrayUint64.set().
int com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.parse | ( | byte [] | buf, |
int | offset | ||
) | throws LBMSDMException |
Parse the raw timestamp value from a byte buffer
buf | The buffer that contains the formatted value |
offset | The offset in to the buffer to start parsing |
References com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.length, and com.latencybusters.lbm.sdm.LBMSDMRawUint32.parse().
Referenced by com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.parse().
void com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.set | ( | long | s, |
long | m | ||
) | throws LBMSDMException |
Set a uint32 field providing the value as a long
s | The number of seconds since epoch |
m | The number of microseconds since epoch |
LBMSDMUnsignedException | if an unsigned value is passed in |
References com.latencybusters.lbm.sdm.LBMSDMRawUint32.set().
|
inherited |
Set the debug level for processing this SDM message. Currently all debugs go to standard out.
|
inherited |
Get a debug string for this object. This is not expected to be called and exists for child classes.
Referenced by com.latencybusters.lbm.sdm.LBMSDMBadRawObjectException.LBMSDMBadRawObjectException().
String com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.toString | ( | ) |
Get a string version of a timestamp
|
staticinherited |
Debug flag for basic debug output
|
protectedinherited |
Debug mask for SDM implementation.
Referenced by com.latencybusters.lbm.sdm.LBMSDMessage.data(), com.latencybusters.lbm.sdm.LBMSDMessage.parse(), com.latencybusters.lbm.sdm.LBMSDMFieldMessage.parse(), and com.latencybusters.lbm.sdm.LBMSDMArrayMessage.parse().
|
staticinherited |
Debug flag for verbose message parsing output
|
static |
The number of bytes needed to store a raw LBMSDMRawTimestamp
Referenced by com.latencybusters.lbm.sdm.LBMSDMArrayTimestamp.append(), com.latencybusters.lbm.sdm.LBMSDMArrayTimestamp.clone(), com.latencybusters.lbm.sdm.LBMSDMFieldTimestamp.fixed_size(), com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.format(), com.latencybusters.lbm.sdm.LBMSDMArrayTimestamp.LBMSDMArrayTimestamp(), and com.latencybusters.lbm.sdm.LBMSDMRawTimestamp.parse().