public class DefaultSharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> extends Object implements SharedIndexInformer<T>
| Constructor and Description |
|---|
DefaultSharedIndexInformer(Class<T> apiTypeClass,
ListerWatcher<T,L> listerWatcher,
long resyncPeriod,
OperationContext context,
Executor informerExecutor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEventHandler(ResourceEventHandler<T> handler)
add event callback
|
void |
addEventHandlerWithResyncPeriod(ResourceEventHandler<T> handler,
long resyncPeriodMillis)
Adds an event handler to the shared informer using the specified resync period.
|
void |
addIndexers(Map<String,Function<T,List<String>>> indexers)
Add indexers
|
Class<T> |
getApiTypeClass()
Return the class this informer is watching
|
long |
getFullResyncPeriod() |
Indexer<T> |
getIndexer()
returns the internal indexer store.
|
Store<T> |
getStore()
Return the Store associated with this informer
|
boolean |
isRunning()
Return true if the informer is running
|
boolean |
isWatching()
Return true if the informer is actively watching
Will return false when SharedInformer.isRunning() is true when the watch needs to be re-established. |
String |
lastSyncResourceVersion()
The resource version observed when last synced with the underlying store.
|
void |
run()
Starts the shared informer, which will be stopped when
SharedInformer.stop() is called. |
void |
stop()
Stops the shared informer.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, hasSyncedpublic DefaultSharedIndexInformer(Class<T> apiTypeClass, ListerWatcher<T,L> listerWatcher, long resyncPeriod, OperationContext context, Executor informerExecutor)
public void addEventHandler(ResourceEventHandler<T> handler)
addEventHandler in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>handler - event handlerpublic void addEventHandlerWithResyncPeriod(ResourceEventHandler<T> handler, long resyncPeriodMillis)
SharedInformeraddEventHandlerWithResyncPeriod in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>handler - the event handlerresyncPeriodMillis - the specific resync periodpublic String lastSyncResourceVersion()
SharedInformerlastSyncResourceVersion in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public void run()
SharedInformerSharedInformer.stop() is called.
run in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public void stop()
SharedInformerstop in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public void addIndexers(Map<String,Function<T,List<String>>> indexers)
SharedIndexInformeraddIndexers in interface SharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>indexers - indexerspublic Indexer<T> getIndexer()
SharedIndexInformergetIndexer in interface SharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public Store<T> getStore()
SharedInformergetStore in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public boolean isRunning()
SharedInformerisRunning in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public boolean isWatching()
SharedInformerSharedInformer.isRunning() is true when the watch needs to be re-established.isWatching in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>public long getFullResyncPeriod()
public Class<T> getApiTypeClass()
SharedInformergetApiTypeClass in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>Copyright © 2015–2020 Red Hat. All rights reserved.