public class DefaultSharedIndexInformer<ApiType,ApiListType> extends java.lang.Object implements SharedIndexInformer<ApiType>
Constructor and Description |
---|
DefaultSharedIndexInformer(java.lang.Class<ApiType> apiTypeClass,
ListerWatcher listerWatcher,
long resyncPeriod) |
Modifier and Type | Method and Description |
---|---|
void |
addEventHandler(ResourceEventHandler<ApiType> handler)
add event callback
|
void |
addEventHandlerWithResyncPeriod(ResourceEventHandler<ApiType> handler,
long resyncPeriodMillis)
add event callback with a resync period
|
void |
addIndexers(java.util.Map indexers)
Add indexers.
|
Indexer |
getIndexer()
getIndexer returns the internal indexer store.
|
boolean |
hasSynced()
hasSynced returns true if the shared informer's store has synced.
|
java.lang.String |
lastSyncResourceVersion()
Last sync resource version string.
|
void |
run()
run starts the shared informer, which will be stopped until stop() is called.
|
void |
stop()
stop stops the shared informer.
|
public DefaultSharedIndexInformer(java.lang.Class<ApiType> apiTypeClass, ListerWatcher listerWatcher, long resyncPeriod)
public void addEventHandler(ResourceEventHandler<ApiType> handler)
addEventHandler
in interface SharedInformer<ApiType>
handler
- the handlerpublic void addEventHandlerWithResyncPeriod(ResourceEventHandler<ApiType> handler, long resyncPeriodMillis)
addEventHandlerWithResyncPeriod
in interface SharedInformer<ApiType>
handler
- the event handlerresyncPeriodMillis
- the specific resync periodpublic java.lang.String lastSyncResourceVersion()
SharedInformer
lastSyncResourceVersion
in interface SharedInformer<ApiType>
public void run()
SharedInformer
run
in interface SharedInformer<ApiType>
public void stop()
SharedInformer
stop
in interface SharedInformer<ApiType>
public boolean hasSynced()
SharedInformer
hasSynced
in interface SharedInformer<ApiType>
public void addIndexers(java.util.Map indexers)
SharedIndexInformer
addIndexers
in interface SharedIndexInformer<ApiType>
indexers
- the indexerspublic Indexer getIndexer()
SharedIndexInformer
getIndexer
in interface SharedIndexInformer<ApiType>
Copyright © 2019. All rights reserved.