public class ConfigToken extends Object implements TrackingToken, Serializable
TokenStore
instance.
This class merely implements TrackingToken
to adhere to certain API requirements. It is not meant to be used
as a means to track progress of event stream processing.
Constructor and Description |
---|
ConfigToken(Map<String,String> config)
Initialize a ConfigToken instance using the given
config properties. |
Modifier and Type | Method and Description |
---|---|
boolean |
covers(TrackingToken other)
Indicates whether this token covers the
other token completely. |
boolean |
equals(Object o) |
String |
get(String key)
Retrieves the value of the configuration element for the given
key . |
Map<String,String> |
getConfig()
Returns the properties contained in this token as a Map.
|
int |
hashCode() |
TrackingToken |
lowerBound(TrackingToken other)
Returns a token that represents the lower bound between this and the
other token. |
String |
toString() |
TrackingToken |
upperBound(TrackingToken other)
Returns the token that represents the furthest possible position in a stream that either this token or the given
other represents. |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
position
@ConstructorProperties(value="config") public ConfigToken(Map<String,String> config)
config
properties.config
- the properties to store as part of this ConfigTokenpublic Map<String,String> getConfig()
public String get(String key)
key
.key
- the key for which to retrieve the configuration elementnull
if no such key was present.public TrackingToken lowerBound(TrackingToken other)
TrackingToken
other
token. Effectively, the
returned token will cause messages not received by both this and the other
token to be redelivered.lowerBound
in interface TrackingToken
other
- The token to compare to this onepublic TrackingToken upperBound(TrackingToken other)
TrackingToken
other
represents. Effectively, this means this token will only deliver messages that neither this, nor
the other have been received.upperBound
in interface TrackingToken
other
- The token to compare this token topublic boolean covers(TrackingToken other)
TrackingToken
other
token completely. That means that this token represents a
position in a stream that has received all of the messages that a stream represented by the other
token
has received.
Note that this operation is only safe when comparing tokens obtained from messages from the same
StreamableMessageSource
.
covers
in interface TrackingToken
other
- The token to compare to this onetrue
if this token covers the other, otherwise false
Copyright © 2010–2022. All rights reserved.