T
- resourcepublic interface Store<T>
Modifier and Type | Method and Description |
---|---|
void |
add(T obj)
Inserts an item into the store
|
void |
delete(T obj)
Removes an item from the store
|
Object |
get(T object)
Returns the requested item.
|
T |
getByKey(String key)
Returns the request item with specific key.
|
default boolean |
hasSynced()
true if synced
|
void |
isPopulated(boolean isPopulated)
Updates the status of cache in case of any API error from Kubernetes server
|
List<T> |
list()
Returns a list of all the items.
|
List<String> |
listKeys()
returns a list of all keys of the object currently in the store.
|
void |
replace(List<T> list,
String resourceVersion)
Deletes the contents of the store, using instead the given list.
|
void |
resync()
Sends a resync event for each item.
|
void |
update(T obj)
Sets an item in the store to its updated state.
|
void add(T obj)
obj
- objectvoid update(T obj)
obj
- objectvoid delete(T obj)
obj
- objectList<String> listKeys()
Object get(T object)
object
- objectT getByKey(String key)
key
- specific keyvoid replace(List<T> list, String resourceVersion)
list
- list of objectsresourceVersion
- resource versionvoid resync()
void isPopulated(boolean isPopulated)
isPopulated
- boolean value indicating whether cache is populated or notdefault boolean hasSynced()
Copyright © 2015–2022 Red Hat. All rights reserved.