Class SharedInformerFactory

java.lang.Object
io.kubernetes.client.informer.SharedInformerFactory

public class SharedInformerFactory extends Object
SharedInformerFactory class constructs and caches informers for api types.
  • Field Details

  • Constructor Details

    • SharedInformerFactory

      @Deprecated public SharedInformerFactory()
      Deprecated.
      DEPRECATE: In favor of explicit apiClient constructor to avoid misguiding
    • SharedInformerFactory

      public SharedInformerFactory(io.kubernetes.client.openapi.ApiClient apiClient)
      Constructor w/ api client specified and default thread pool.
    • SharedInformerFactory

      public SharedInformerFactory(ExecutorService threadPool)
      Constructor w/ thread pool specified.
      Parameters:
      threadPool - specified thread pool
    • SharedInformerFactory

      public SharedInformerFactory(io.kubernetes.client.openapi.ApiClient client, ExecutorService threadPool)
      Constructor w/ api client and thread pool specified.
      Parameters:
      client - specific api client
      threadPool - specified thread pool
  • Method Details

    • sharedIndexInformerFor

      public <ApiType extends io.kubernetes.client.common.KubernetesObject, ApiListType extends io.kubernetes.client.common.KubernetesListObject> SharedIndexInformer<ApiType> sharedIndexInformerFor(CallGenerator callGenerator, Class<ApiType> apiTypeClass, Class<ApiListType> apiListTypeClass)
      Shared index informer for shared index informer.
      Type Parameters:
      ApiType - the type parameter
      ApiListType - the type parameter
      Parameters:
      callGenerator - the call generator
      apiTypeClass - the api type class
      apiListTypeClass - the api list type class
      Returns:
      the shared index informer
    • sharedIndexInformerFor

      public <ApiType extends io.kubernetes.client.common.KubernetesObject, ApiListType extends io.kubernetes.client.common.KubernetesListObject> SharedIndexInformer<ApiType> sharedIndexInformerFor(CallGenerator callGenerator, Class<ApiType> apiTypeClass, Class<ApiListType> apiListTypeClass, long resyncPeriodInMillis)
      Constructs and returns a shared index informer w/ resync period specified. But the informer cache will not be overwritten i.e. only the first registered informer will be kept.
      Type Parameters:
      ApiType - the type parameter
      ApiListType - the type parameter
      Parameters:
      callGenerator - the call generator
      apiTypeClass - the api type class
      apiListTypeClass - the api list type class
      resyncPeriodInMillis - the resync period in millis
      Returns:
      the shared index informer
    • sharedIndexInformerFor

      public <ApiType extends io.kubernetes.client.common.KubernetesObject, ApiListType extends io.kubernetes.client.common.KubernetesListObject> SharedIndexInformer<ApiType> sharedIndexInformerFor(ListerWatcher<ApiType,ApiListType> listerWatcher, Class<ApiType> apiTypeClass, long resyncPeriodInMillis)
      Constructs and returns a shared index informer by specifying lister-watcher. But the informer cache will not be overwritten on multiple call w/ the the same apiTypeClass i.e. only the first registered informer will be kept.
      Type Parameters:
      ApiType - the type parameter
      ApiListType - the type parameter
      Parameters:
      listerWatcher - the lister watcher
      apiTypeClass - the api type class
      resyncPeriodInMillis - the resync period in millis
      Returns:
      the shared index informer
    • sharedIndexInformerFor

      public <ApiType extends io.kubernetes.client.common.KubernetesObject, ApiListType extends io.kubernetes.client.common.KubernetesListObject> SharedIndexInformer<ApiType> sharedIndexInformerFor(ListerWatcher<ApiType,ApiListType> listerWatcher, Class<ApiType> apiTypeClass, long resyncPeriodInMillis, BiConsumer<Class<ApiType>,Throwable> exceptionHandler)
    • sharedIndexInformerFor

      public <ApiType extends io.kubernetes.client.common.KubernetesObject, ApiListType extends io.kubernetes.client.common.KubernetesListObject> SharedIndexInformer<ApiType> sharedIndexInformerFor(GenericKubernetesApi<ApiType,ApiListType> genericKubernetesApi, Class<ApiType> apiTypeClass, long resyncPeriodInMillis)
      Constructs and returns a shared index informer by specifying a generic api instance. But the informer cache will not be overwritten on multiple call w/ the the same apiTypeClass i.e. only the first registered informer will be kept.
      Type Parameters:
      ApiType - the type parameter
      ApiListType - the type parameter
      Parameters:
      genericKubernetesApi - the generic kubernetes api
      apiTypeClass - the api type class
      resyncPeriodInMillis - the resync period in millis
      Returns:
      the shared index informer
    • sharedIndexInformerFor

      public <ApiType extends io.kubernetes.client.common.KubernetesObject, ApiListType extends io.kubernetes.client.common.KubernetesListObject> SharedIndexInformer<ApiType> sharedIndexInformerFor(GenericKubernetesApi<ApiType,ApiListType> genericKubernetesApi, Class<ApiType> apiTypeClass, long resyncPeriodInMillis, String namespace)
      Working the same as sharedIndexInformerFor(io.kubernetes.client.util.CallGenerator, java.lang.Class<ApiType>, java.lang.Class<ApiListType>) above.

      Constructs and returns a shared index informer for a specific namespace.

      Type Parameters:
      ApiType - the type parameter
      ApiListType - the type parameter
      Parameters:
      genericKubernetesApi - the generic kubernetes api
      apiTypeClass - the api type class
      resyncPeriodInMillis - the resync period in millis
      namespace - the target namespace
      Returns:
      the shared index informer
    • getExistingSharedIndexInformer

      public <ApiType extends io.kubernetes.client.common.KubernetesObject> SharedIndexInformer<ApiType> getExistingSharedIndexInformer(Class<ApiType> apiTypeClass)
      Gets existing shared index informer, return null if the requesting informer is never constructed.
      Type Parameters:
      ApiType - the type parameter
      Parameters:
      apiTypeClass - the api type class
      Returns:
      the existing shared index informer
    • startAllRegisteredInformers

      public void startAllRegisteredInformers()
      Start all registered informers.
    • stopAllRegisteredInformers

      public void stopAllRegisteredInformers()
      Stop all registered informers and shut down the thread pool.
    • stopAllRegisteredInformers

      public void stopAllRegisteredInformers(boolean shutdownThreadPool)
      Stop all registered informers.
      Parameters:
      shutdownThreadPool - whether or not to shut down the thread pool.