Modifier and Type | Field and Description |
---|---|
static String |
NAMESPACE_INDEX |
Constructor and Description |
---|
Cache() |
Cache(String indexName,
Function<T,List<String>> indexFunc,
Function<T,String> keyFunc) |
Modifier and Type | Method and Description |
---|---|
void |
add(T obj)
Add objects
|
List<T> |
byIndex(String indexName,
String indexKey)
By index list
|
void |
delete(T obj)
Delete the object.
|
static <T> String |
deletionHandlingMetaNamespaceKeyFunc(T object)
Checks for DeletedFinalStateUnknown objects before calling metaNamespaceKeyFunc
|
T |
get(T obj)
Get object
|
T |
getByKey(String key)
Gets get by key.
|
List<T> |
index(String indexName,
Object obj)
Get objects
|
List<String> |
indexKeys(String indexName,
String indexKey)
Index keys list
|
List<T> |
list()
List all objects in the cache.
|
List<String> |
listKeys()
List keys
|
static List<String> |
metaNamespaceIndexFunc(Object obj)
It is a default index function that indexes based on an object's namespace
|
static String |
metaNamespaceKeyFunc(Object obj)
It's is a convenient default KeyFunc which know show to make keys for API
objects which implement HasMetadata interface.
|
void |
replace(List<T> list,
String resourceVersion)
Replace the content in the cache completely.
|
void |
resync()
Resync
|
void |
update(T obj)
Update the object.
|
void |
updateIndices(T oldObj,
T newObj,
String key)
UpdateIndices modifies the objects location in the managed indexes, if there is
an update, you must provide an oldObj
|
public static final String NAMESPACE_INDEX
public void add(T obj)
public void update(T obj)
public void delete(T obj)
public void replace(List<T> list, String resourceVersion)
public void updateIndices(T oldObj, T newObj, String key)
oldObj
- old objectnewObj
- new objectkey
- the keypublic static <T> String deletionHandlingMetaNamespaceKeyFunc(T object)
T
- object typeobject
- the specific objectpublic static String metaNamespaceKeyFunc(Object obj)
obj
- specific objectCopyright © 2015–2019 Red Hat. All rights reserved.