public interface SharedInformer<T> extends AutoCloseable
Modifier and Type | Method and Description |
---|---|
void |
addEventHandler(ResourceEventHandler<? super T> handler)
Add event handler
|
void |
addEventHandlerWithResyncPeriod(ResourceEventHandler<? super T> handle,
long resyncPeriod)
Adds an event handler to the shared informer using the specified resync period.
|
default void |
close() |
Class<T> |
getApiTypeClass()
Return the class this informer is watching
|
Store<T> |
getStore()
Return the Store associated with this informer
|
default boolean |
hasSynced()
Return true if the informer has ever synced
|
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. |
String |
lastSyncResourceVersion()
The resource version observed when last synced with the underlying store.
|
void |
run()
Starts the shared informer, which will be stopped when
stop() is called. |
void |
stop()
Stops the shared informer.
|
void addEventHandler(ResourceEventHandler<? super T> handler)
handler
- event handlervoid addEventHandlerWithResyncPeriod(ResourceEventHandler<? super T> handle, long resyncPeriod)
handle
- the event handlerresyncPeriod
- the specific resync periodvoid run()
stop()
is called.
void stop()
default void close()
close
in interface AutoCloseable
default boolean hasSynced()
String lastSyncResourceVersion()
boolean isRunning()
boolean isWatching()
isRunning()
is true when the watch needs to be re-established.Copyright © 2015–2020 Red Hat. All rights reserved.