Interface CuratorCacheStorage
- All Superinterfaces:
CuratorCacheAccessor
Interface for maintaining data in a
CuratorCache
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset the storage to zero entriesstatic CuratorCacheStorage
Return a new storage instance that does not retain the data bytes.Return an entry from storageAdd an entry to storage and return any previous entry at that pathRemove the entry from storage and return any previous entry at that pathint
size()
Return the current number of entries in storagestatic CuratorCacheStorage
standard()
Return a new standard storage instancestream()
Return a stream over the storage entries.
-
Method Details
-
standard
Return a new standard storage instance- Returns:
- storage instance
-
dataNotCached
Return a new storage instance that does not retain the data bytes. i.e. ChildData objects returned by this storage will always returnnull
forChildData.getData()
.- Returns:
- storage instance that does not retain data bytes
-
put
Add an entry to storage and return any previous entry at that path- Parameters:
data
- entry to add- Returns:
- previous entry or
empty()
-
remove
Remove the entry from storage and return any previous entry at that path- Parameters:
path
- path to remove- Returns:
- previous entry or
empty()
-
clear
void clear()Reset the storage to zero entries -
get
Return an entry from storage- Specified by:
get
in interfaceCuratorCacheAccessor
- Parameters:
path
- path to get- Returns:
- entry or
empty()
-
size
int size()Return the current number of entries in storage- Specified by:
size
in interfaceCuratorCacheAccessor
- Returns:
- number of entries
-
stream
Return a stream over the storage entries. Note: for a standard storage instance, the stream behaves like a stream returned byConcurrentHashMap.entrySet()
- Specified by:
stream
in interfaceCuratorCacheAccessor
- Returns:
- stream over entries
-