public interface SharedIndexInformer<T> extends AutoCloseable
| Modifier and Type | Method and Description |
|---|---|
SharedIndexInformer<T> |
addEventHandler(ResourceEventHandler<? super T> handler)
Add event handler.
|
SharedIndexInformer<T> |
addEventHandlerWithResyncPeriod(ResourceEventHandler<? super T> handle,
long resyncPeriod)
Adds an event handler to the shared informer using the specified resync period.
|
SharedIndexInformer<T> |
addIndexers(Map<String,Function<T,List<String>>> indexers)
Add indexers
|
default void |
close() |
Class<T> |
getApiTypeClass()
Return the class this informer is watching
|
Indexer<T> |
getIndexer()
returns the internal indexer store.
|
Store<T> |
getStore()
Return the Store associated with this informer
|
default boolean |
hasSynced()
Return true if the informer has ever synced
|
SharedIndexInformer<T> |
initialState(Stream<T> items)
Sets the initial state of the informer store, which will
be replaced by the initial list operation.
|
boolean |
isRunning()
Return true if the informer is running
|
boolean |
isWatching()
Return true if the informer is actively watching
Will return false when isRunning() is true when the watch needs to be re-established. |
SharedIndexInformer<T> |
itemStore(ItemStore<T> itemStore) |
String |
lastSyncResourceVersion()
The resource version observed when last synced with the underlying store.
|
SharedIndexInformer<T> |
removeIndexer(String name)
Remove the named index
|
default SharedIndexInformer<T> |
removeNamespaceIndex()
Remove the namesapce index
|
SharedIndexInformer<T> |
run()
Starts the shared informer, which will be stopped when
stop() is called. |
CompletableFuture<Void> |
start()
A non-blocking alternative to run.
|
void |
stop()
Stops the shared informer.
|
SharedIndexInformer<T> addIndexers(Map<String,Function<T,List<String>>> indexers)
indexers - indexersdefault SharedIndexInformer<T> removeNamespaceIndex()
SharedIndexInformer<T> removeIndexer(String name)
name - Indexer<T> getIndexer()
SharedIndexInformer<T> addEventHandler(ResourceEventHandler<? super T> handler)
The handler methods will be called using the client's Executor
handler - event handlerSharedIndexInformer<T> addEventHandlerWithResyncPeriod(ResourceEventHandler<? super T> handle, long resyncPeriod)
The handler methods will be called using the client's Executor
handle - the event handlerresyncPeriod - the specific resync periodSharedIndexInformer<T> run()
stop() is called.
void stop()
default void close()
close in interface AutoCloseabledefault boolean hasSynced()
String lastSyncResourceVersion()
boolean isRunning()
boolean isWatching()
isRunning() is true when the watch needs to be re-established.SharedIndexInformer<T> initialState(Stream<T> items)
items - SharedIndexInformer<T> itemStore(ItemStore<T> itemStore)
CompletableFuture<Void> start()
stop() is called.
Copyright © 2015–2022 Red Hat. All rights reserved.