@Entity public class TokenEntry extends AbstractTokenEntry<byte[]>
Modifier and Type | Class and Description |
---|---|
static class |
TokenEntry.PK
Primary key for token entries used by JPA
|
clock
Modifier | Constructor and Description |
---|---|
protected |
TokenEntry()
Default constructor for JPA
|
|
TokenEntry(String processorName,
int segment,
TrackingToken token,
Serializer serializer)
Initializes a new token entry for given
token , processorName and segment . |
Modifier and Type | Method and Description |
---|---|
String |
getProcessorName()
Returns the name of the process to which this token belongs.
|
int |
getSegment()
Returns the segment index of the process to which this token belongs.
|
void |
updateToken(TrackingToken token,
Serializer serializer)
Update this entry with the given
token , serializing it using given serializer . |
claim, getOwner, getSerializedToken, getToken, getTokenType, mayClaim, releaseClaim, timestamp, timestampAsString, updateToken
public TokenEntry(String processorName, int segment, TrackingToken token, Serializer serializer)
token
, processorName
and segment
. The given
serializer
can be used to serialize the token before it is stored.token
- The tracking token to storeprocessorName
- The name of the processor to store this token forsegment
- The segment index of the processorserializer
- The serializer to use when storing a serialized tokenprotected TokenEntry()
public void updateToken(TrackingToken token, Serializer serializer)
AbstractTokenEntry
token
, serializing it using given serializer
.updateToken
in class AbstractTokenEntry<byte[]>
token
- The token to update the entry withserializer
- The serializer to serialize data withpublic String getProcessorName()
AbstractTokenEntry
getProcessorName
in class AbstractTokenEntry<byte[]>
public int getSegment()
AbstractTokenEntry
getSegment
in class AbstractTokenEntry<byte[]>
Copyright © 2010–2017. All rights reserved.