public class ConfigToken extends Object implements TrackingToken
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. |
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.
|
TrackingToken |
lowerBound(TrackingToken other)
Returns a token that represents the lower bound between this and the
other token. |
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, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
position
public 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–2020. All rights reserved.