public class SharedInformerFactory extends Object
Constructor and Description |
---|
SharedInformerFactory(ExecutorService threadPool,
okhttp3.OkHttpClient okHttpClient,
Config configuration)
Constructor with thread pool specified.
|
SharedInformerFactory(okhttp3.OkHttpClient okHttpClient,
Config configuration) |
Modifier and Type | Method and Description |
---|---|
void |
addSharedInformerEventListener(SharedInformerEventListener event) |
<T> SharedIndexInformer<T> |
getExistingSharedIndexInformer(Class<T> apiTypeClass)
Gets existing shared index informer, return null if the requesting informer
is never constructed.
|
List<Map.Entry<OperationContext,SharedIndexInformer>> |
getExistingSharedIndexInformers()
Deprecated.
use
getExistingSharedIndexInformer(Class) instead |
SharedInformerFactory |
inNamespace(String namespace)
Deprecated.
use
Informable instead |
<T extends io.fabric8.kubernetes.api.model.HasMetadata> |
sharedIndexInformerFor(Class<T> apiTypeClass,
long resyncPeriodInMillis)
Constructs and returns a shared index informer with resync period specified.
|
<T extends io.fabric8.kubernetes.api.model.HasMetadata> |
sharedIndexInformerFor(Class<T> apiTypeClass,
OperationContext operationContext,
long resyncPeriodInMillis)
Deprecated.
use
Informable instead |
<T extends CustomResource<?,?>,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> |
sharedIndexInformerForCustomResource(Class<T> apiTypeClass,
Class<L> apiListTypeClass,
long resyncPeriodInMillis)
Constructs and returns a shared index informer with resync period specified for custom resources.
|
<T extends CustomResource<?,?>> |
sharedIndexInformerForCustomResource(Class<T> apiTypeClass,
long resyncPeriodInMillis)
Constructs and returns a shared index informer with resync period specified for custom resources.
|
<T extends CustomResource<?,?>> |
sharedIndexInformerForCustomResource(Class<T> apiTypeClass,
OperationContext operationContext,
long resyncPeriodInMillis)
Deprecated.
use
Informable instead |
<T extends CustomResource<?,?>,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> |
sharedIndexInformerForCustomResource(CustomResourceDefinitionContext customResourceContext,
Class<T> apiTypeClass,
Class<L> apiListTypeClass,
long resyncPeriodInMillis)
Deprecated.
Since 5.x versions of client
CustomResourceDefinitionContext are configured via annotations in CustomResource implementations, please use any of the alternative sharedIndexInformerForCustomResource methods |
SharedIndexInformer<io.fabric8.kubernetes.api.model.GenericKubernetesResource> |
sharedIndexInformerForCustomResource(CustomResourceDefinitionContext genericResourceContext,
long resyncPeriodInMillis)
Constructs and returns a shared index informer with resync period specified for a Custom Resource.
|
Future<Void> |
startAllRegisteredInformers()
Starts all registered informers in an asynchronous fashion.
|
void |
stopAllRegisteredInformers()
Stop all registered informers and shut down thread pool.
|
void |
stopAllRegisteredInformers(boolean shutDownThreadPool)
Stop all registered informers
|
SharedInformerFactory |
withName(String name)
Deprecated.
use
Informable instead |
public SharedInformerFactory(okhttp3.OkHttpClient okHttpClient, Config configuration)
public SharedInformerFactory(ExecutorService threadPool, okhttp3.OkHttpClient okHttpClient, Config configuration)
threadPool
- specified thread pool.okHttpClient
- OkHttp clientconfiguration
- configuration for client@Deprecated public SharedInformerFactory inNamespace(String namespace)
Informable
insteadSharedInformerFactory
namespace
- namespace to configureSharedInformerFactory
with namespace configured@Deprecated public SharedInformerFactory withName(String name)
Informable
insteadSharedInformerFactory
name
- name to be configuredSharedInformerFactory
with name configuredpublic <T extends io.fabric8.kubernetes.api.model.HasMetadata> SharedIndexInformer<T> sharedIndexInformerFor(Class<T> apiTypeClass, long resyncPeriodInMillis)
T
- the type parameter (should extend HasMetadata
and implement Namespaced
) if Namespace scoped resourceapiTypeClass
- apiType classresyncPeriodInMillis
- resync period in milliseconds@Deprecated public <T extends io.fabric8.kubernetes.api.model.HasMetadata> SharedIndexInformer<T> sharedIndexInformerFor(Class<T> apiTypeClass, OperationContext operationContext, long resyncPeriodInMillis)
Informable
insteadT
- the type parameter (should extend HasMetadata
and implement Namespaced
) if Namespace scoped resourceapiTypeClass
- apiType classoperationContext
- OperationContext
Operation ContextresyncPeriodInMillis
- resync period in milliseconds@Deprecated public <T extends CustomResource<?,?>,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> SharedIndexInformer<T> sharedIndexInformerForCustomResource(CustomResourceDefinitionContext customResourceContext, Class<T> apiTypeClass, Class<L> apiListTypeClass, long resyncPeriodInMillis)
CustomResourceDefinitionContext
are configured via annotations in CustomResource implementations, please use any of the alternative sharedIndexInformerForCustomResource methodsT
- the type parameter (should extend HasMetadata
and implement Namespaced
)L
- the type's list parameter (should extend KubernetesResourceList
customResourceContext
- basic information about the Custom Resource Definition corresponding to that custom resourceapiTypeClass
- apiType classapiListTypeClass
- api list type classresyncPeriodInMillis
- resync period in millisecondspublic SharedIndexInformer<io.fabric8.kubernetes.api.model.GenericKubernetesResource> sharedIndexInformerForCustomResource(CustomResourceDefinitionContext genericResourceContext, long resyncPeriodInMillis)
CustomResourceDefinitionContext
Note:It watches for events in ALL NAMESPACES.genericResourceContext
- object containing details about resource like apiGroup, version and plural, etc.resyncPeriodInMillis
- resync period in milliseconds.SharedIndexInformer
for GenericKubernetesResource@Deprecated public <T extends CustomResource<?,?>> SharedIndexInformer<T> sharedIndexInformerForCustomResource(Class<T> apiTypeClass, OperationContext operationContext, long resyncPeriodInMillis)
Informable
insteadT
- the type parameter (should extend CustomResource
and implement Namespaced
)apiTypeClass
- apiType classresyncPeriodInMillis
- resync period in millisecondspublic <T extends CustomResource<?,?>> SharedIndexInformer<T> sharedIndexInformerForCustomResource(Class<T> apiTypeClass, long resyncPeriodInMillis)
T
- the type parameter (should extend HasMetadata
and implement Namespaced
)apiTypeClass
- apiType classresyncPeriodInMillis
- resync period in millisecondspublic <T extends CustomResource<?,?>,L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> SharedIndexInformer<T> sharedIndexInformerForCustomResource(Class<T> apiTypeClass, Class<L> apiListTypeClass, long resyncPeriodInMillis)
T
- the type parameter (should extend HasMetadata
and implement Namespaced
)L
- the type's list parameter (should extend KubernetesResourceList
apiTypeClass
- apiType classapiListTypeClass
- api list type classresyncPeriodInMillis
- resync period in millisecondspublic <T> SharedIndexInformer<T> getExistingSharedIndexInformer(Class<T> apiTypeClass)
T
- type of API typeapiTypeClass
- API type class@Deprecated public List<Map.Entry<OperationContext,SharedIndexInformer>> getExistingSharedIndexInformers()
getExistingSharedIndexInformer(Class)
insteadOperationContext
, SharedIndexInformer
) registered
by the user.OperationContext
and SharedIndexInformer
public Future<Void> startAllRegisteredInformers()
Future
for status of all started informer tasks.public void stopAllRegisteredInformers()
public void stopAllRegisteredInformers(boolean shutDownThreadPool)
shutDownThreadPool
- Whether to shut down thread pool or not.public void addSharedInformerEventListener(SharedInformerEventListener event)
Copyright © 2015–2020 Red Hat. All rights reserved.