Interface SharedIndexInformerFactory


public interface SharedIndexInformerFactory
Informer factory interface.
  • Method Details

    • sharedIndexInformerFor

      @NonNull <ApiType extends KubernetesObject> @NonNull SharedIndexInformer<ApiType> sharedIndexInformerFor(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable String namespace)
      Creates a new SharedIndexInformer.
      Type Parameters:
      ApiType - kubernetes api type
      Parameters:
      apiTypeClass - the api type class
      namespace - the namespace should be set to null for cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the informer needs to handle kubernetes objects from all namespaces
      Returns:
      instance of SharedIndexInformer
    • sharedIndexInformerFor

      @NonNull <ApiType extends KubernetesObject> @NonNull SharedIndexInformer<ApiType> sharedIndexInformerFor(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable String namespace, @Nullable @Nullable String labelSelector)
      Creates a new SharedIndexInformer.
      Type Parameters:
      ApiType - kubernetes api type
      Parameters:
      apiTypeClass - the api type class
      namespace - the namespace should be set to null for cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the informer needs to handle kubernetes objects from all namespaces
      labelSelector - the label selector
      Returns:
      instance of SharedIndexInformer
    • sharedIndexInformerFor

      @NonNull <ApiType extends KubernetesObject> @NonNull SharedIndexInformer<ApiType> sharedIndexInformerFor(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable String namespace, @Nullable @Nullable String labelSelector, boolean waitForInitialSync)
      Creates a new SharedIndexInformer.
      Type Parameters:
      ApiType - kubernetes api type
      Parameters:
      apiTypeClass - the api type class
      namespace - the namespace should be set to null for cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the informer needs to handle kubernetes objects from all namespaces
      labelSelector - the label selector
      waitForInitialSync - if set to true, the startAllRegisteredInformers() method will block until existing kubernetes objects of given type (in given namespace and filtered by given label selector if provided) get loaded into the informer's in-memory storage or predefined timeout (InformerConfiguration.getSyncTimeout()) gets expired
      Returns:
      instance of SharedIndexInformer
    • sharedIndexInformerFor

      @NonNull <ApiType extends KubernetesObject> @NonNull SharedIndexInformer<ApiType> sharedIndexInformerFor(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable String namespace, @Nullable @Nullable String labelSelector, boolean waitForInitialSync, long resyncPeriodMillis)
      Creates a new SharedIndexInformer.
      Type Parameters:
      ApiType - kubernetes api type
      Parameters:
      apiTypeClass - the api type class
      namespace - the namespace should be set to null for cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the informer needs to handle kubernetes objects from all namespaces
      labelSelector - the label selector
      waitForInitialSync - if set to true, the startAllRegisteredInformers() method will block until existing kubernetes objects of given type (in given namespace and filtered by given label selector if provided) get loaded into the informer's in-memory storage or predefined timeout (InformerConfiguration.getSyncTimeout()) gets expired
      resyncPeriodMillis - the listener default resync period in milliseconds
      Returns:
      instance of SharedIndexInformer
    • sharedIndexInformerFor

      @NonNull <ApiType extends KubernetesObject> @NonNull SharedIndexInformer<ApiType> sharedIndexInformerFor(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable String namespace, @Nullable @Nullable String labelSelector, boolean waitForInitialSync, long resyncPeriodMillis, @Nullable @Nullable Function<ApiType,String> cacheKeyFunction, @Nullable @Nullable Map<String,Function<ApiType,List<String>>> cacheIndexFunctions)
      Creates a new SharedIndexInformer.
      Type Parameters:
      ApiType - api type
      Parameters:
      apiTypeClass - the api type class
      namespace - the namespace should be set to null for cluster-wide objects (e.g. V1Node) or for namespaced objects (e.g. V1Secret) when the informer needs to handle kubernetes objects from all namespaces
      labelSelector - the label selector
      waitForInitialSync - if set to true, the startAllRegisteredInformers() method will block until existing kubernetes objects of given type (in given namespace and filtered by given label selector if provided) get loaded into the informer's in-memory storage or predefined timeout (InformerConfiguration.getSyncTimeout()) gets expired
      resyncPeriodMillis - the listener default resync period in milliseconds
      cacheKeyFunction - the function that is used to create cache key
      cacheIndexFunctions - the map of functions used to create indexes
      Returns:
      instance of SharedIndexInformer
    • sharedIndexInformersFor

      @NonNull <ApiType extends KubernetesObject> @NonNull List<SharedIndexInformer<ApiType>> sharedIndexInformersFor(@NonNull @NonNull Class<ApiType> apiTypeClass, @NonNull @NonNull List<String> namespaces, @Nullable @Nullable String labelSelector, boolean waitForInitialSync, long resyncPeriodMillis)
      Creates a new SharedIndexInformer for each namespace.
      Type Parameters:
      ApiType - kubernetes api type
      Parameters:
      apiTypeClass - the api type class
      namespaces - the list of namespaces
      labelSelector - the label selector
      waitForInitialSync - if set to true, the startAllRegisteredInformers() method will block until existing kubernetes objects of given type (in given namespace and filtered by given label selector if provided) get loaded into the informer's in-memory storage or predefined timeout (InformerConfiguration.getSyncTimeout()) gets expired
      resyncPeriodMillis - the listener default resync period in milliseconds
      Returns:
      list of SharedIndexInformer instances. The order of informers in the returned list matches the order of namespaces in the input namespace list.
    • getExistingSharedIndexInformer

      @Nullable <ApiType extends KubernetesObject> @Nullable SharedIndexInformer<ApiType> getExistingSharedIndexInformer(@NonNull @NonNull Class<ApiType> apiTypeClass, @Nullable @Nullable String namespace)
      Returns already created SharedIndexInformer.
      Type Parameters:
      ApiType - api type
      Parameters:
      apiTypeClass - the api type class
      namespace - the namespace
      Returns:
      instance of SharedIndexInformer
    • startAllRegisteredInformers

      void startAllRegisteredInformers()
      Starts all registered informers. If there are informers created with waitForInitialSync=true, the method will block until in-memory storage of those informers get synced (existing kubernetes object loaded) or predefined timeout (InformerConfiguration.getSyncTimeout()) gets expired.
    • stopAllRegisteredInformers

      void stopAllRegisteredInformers()
      Stops all registered informers.