@ThreadSafe public class CacheStatusInfo<T> extends Object implements StatusInfo<T>
| Constructor and Description |
|---|
CacheStatusInfo(T nodeGroup) |
| Modifier and Type | Method and Description |
|---|---|
long |
lastWatchRequestTime()
Returns the timestamp of the last discovery watch request.
|
T |
nodeGroup()
Returns the node grouping represented by this status, generated via
NodeGroup#hash(Node). |
int |
numWatches()
Returns the number of open watches.
|
void |
removeWatch(long watchId)
Removes the given watch from the tracked collection of watches.
|
void |
setLastWatchRequestTime(long lastWatchRequestTime)
Sets the timestamp of the last discovery watch request.
|
void |
setWatch(long watchId,
Watch watch)
Adds the given watch to the tracked collection of watches.
|
void |
watchesRemoveIf(BiFunction<Long,Watch,Boolean> filter)
Iterate over all tracked watches and execute the given function.
|
Set<Long> |
watchIds()
Returns the set of IDs for all watched currently being tracked.
|
public CacheStatusInfo(T nodeGroup)
public long lastWatchRequestTime()
lastWatchRequestTime in interface StatusInfo<T>public T nodeGroup()
NodeGroup#hash(Node).nodeGroup in interface StatusInfo<T>public int numWatches()
numWatches in interface StatusInfo<T>public void removeWatch(long watchId)
watchId - the ID for the watch that should be removedpublic void setLastWatchRequestTime(long lastWatchRequestTime)
lastWatchRequestTime - the latest watch request timestamppublic void setWatch(long watchId,
Watch watch)
watchId - the ID for the watch that should be addedwatch - the watch that should be addedpublic Set<Long> watchIds()
public void watchesRemoveIf(BiFunction<Long,Watch,Boolean> filter)
true, then the watch is
removed from the tracked collection. If it returns false, then the watch is not removed.filter - the function to execute on each watchCopyright © 2018 The Envoy Project. All rights reserved.