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,
Executor informerExecutor) |
Modifier and Type | Method and Description |
---|---|
void |
addEventHandler(ResourceEventHandler<? super T> handler)
add event callback
|
void |
addEventHandlerWithResyncPeriod(ResourceEventHandler<? super 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, wait
close, hasSynced
public void addEventHandler(ResourceEventHandler<? super T> handler)
addEventHandler
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
handler
- event handlerpublic void addEventHandlerWithResyncPeriod(ResourceEventHandler<? super T> handler, long resyncPeriodMillis)
SharedInformer
addEventHandlerWithResyncPeriod
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
handler
- the event handlerresyncPeriodMillis
- the specific resync periodpublic String lastSyncResourceVersion()
SharedInformer
lastSyncResourceVersion
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public void run()
SharedInformer
SharedInformer.stop()
is called.
run
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public void stop()
SharedInformer
stop
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public void addIndexers(Map<String,Function<T,List<String>>> indexers)
SharedIndexInformer
addIndexers
in interface SharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
indexers
- indexerspublic Indexer<T> getIndexer()
SharedIndexInformer
getIndexer
in interface SharedIndexInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public Store<T> getStore()
SharedInformer
getStore
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public boolean isRunning()
SharedInformer
isRunning
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
public boolean isWatching()
SharedInformer
SharedInformer.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()
SharedInformer
getApiTypeClass
in interface SharedInformer<T extends io.fabric8.kubernetes.api.model.HasMetadata>
Copyright © 2015–2020 Red Hat. All rights reserved.