Class SharedInformerFactory

    • Constructor Detail

      • SharedInformerFactory

        public SharedInformerFactory​(ExecutorService threadPool,
                                     okhttp3.OkHttpClient okHttpClient,
                                     Config configuration)
        Constructor with thread pool specified.
        Parameters:
        threadPool - specified thread pool.
        okHttpClient - OkHttp client
        configuration - configuration for client
    • Method Detail

      • sharedIndexInformerFor

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> SharedIndexInformer<T> sharedIndexInformerFor​(Class<T> apiTypeClass,
                                                                                                                     long resyncPeriodInMillis)
        Constructs and returns a shared index informer with resync period specified. And the informer cache will be overwritten. Note:It watches for events in ALL NAMESPACES.
        Type Parameters:
        T - the type parameter (should extend HasMetadata and implement Namespaced) if Namespace scoped resource
        Parameters:
        apiTypeClass - apiType class
        resyncPeriodInMillis - resync period in milliseconds
        Returns:
        the shared index informer
      • sharedIndexInformerFor

        public <T extends io.fabric8.kubernetes.api.model.HasMetadata> SharedIndexInformer<T> sharedIndexInformerFor​(Class<T> apiTypeClass,
                                                                                                                     OperationContext operationContext,
                                                                                                                     long resyncPeriodInMillis)
        Constructs and returns a shared index informer with resync period specified. Note:It watches for events in ALL NAMESPACES.
        Type Parameters:
        T - the type parameter (should extend HasMetadata and implement Namespaced) if Namespace scoped resource
        Parameters:
        apiTypeClass - apiType class
        operationContext - OperationContext Operation Context
        resyncPeriodInMillis - resync period in milliseconds
        Returns:
        the shared index informer
      • sharedIndexInformerForCustomResource

        @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)
        Deprecated.
        Since 5.x versions of client CustomResourceDefinitionContext are configured via annotations in CustomResource implementations, please use any of the alternative sharedIndexInformerForCustomResource methods
        Constructs and returns a shared index informer with resync period specified for custom resources. Note:It watches for events in ALL NAMESPACES.
        Type Parameters:
        T - the type parameter (should extend HasMetadata and implement Namespaced)
        L - the type's list parameter (should extend KubernetesResourceList
        Parameters:
        customResourceContext - basic information about the Custom Resource Definition corresponding to that custom resource
        apiTypeClass - apiType class
        apiListTypeClass - api list type class
        resyncPeriodInMillis - resync period in milliseconds
        Returns:
        the shared index informer
      • sharedIndexInformerForCustomResource

        public <T extends CustomResource<?,​?>> SharedIndexInformer<T> sharedIndexInformerForCustomResource​(Class<T> apiTypeClass,
                                                                                                                 OperationContext operationContext,
                                                                                                                 long resyncPeriodInMillis)
        Constructs and returns a shared index informer with resync period specified for custom resources.
        Type Parameters:
        T - the type parameter (should extend CustomResource and implement Namespaced)
        Parameters:
        apiTypeClass - apiType class
        resyncPeriodInMillis - resync period in milliseconds
        Returns:
        the shared index informer
      • sharedIndexInformerForCustomResource

        public <T extends CustomResource<?,​?>> SharedIndexInformer<T> sharedIndexInformerForCustomResource​(Class<T> apiTypeClass,
                                                                                                                 long resyncPeriodInMillis)
        Constructs and returns a shared index informer with resync period specified for custom resources. POJO
        Type Parameters:
        T - the type parameter (should extend HasMetadata and implement Namespaced)
        Parameters:
        apiTypeClass - apiType class
        resyncPeriodInMillis - resync period in milliseconds
        Returns:
        the shared index informer
      • sharedIndexInformerForCustomResource

        public <T extends CustomResource<?,​?>,​L extends io.fabric8.kubernetes.api.model.KubernetesResourceList<T>> SharedIndexInformer<T> sharedIndexInformerForCustomResource​(Class<T> apiTypeClass,
                                                                                                                                                                                           Class<L> apiListTypeClass,
                                                                                                                                                                                           long resyncPeriodInMillis)
        Constructs and returns a shared index informer with resync period specified for custom resources. Note:It watches for events in ALL NAMESPACES.
        Type Parameters:
        T - the type parameter (should extend HasMetadata and implement Namespaced)
        L - the type's list parameter (should extend KubernetesResourceList
        Parameters:
        apiTypeClass - apiType class
        apiListTypeClass - api list type class
        resyncPeriodInMillis - resync period in milliseconds
        Returns:
        the shared index informer
      • getExistingSharedIndexInformer

        public <T> SharedIndexInformer<T> getExistingSharedIndexInformer​(Class<T> apiTypeClass)
        Gets existing shared index informer, return null if the requesting informer is never constructed. If there are multiple SharedIndexInformer objects corresponding to a Kubernetes resource, then it returns the first one
        Type Parameters:
        T - type of API type
        Parameters:
        apiTypeClass - API type class
        Returns:
        SharedIndexInformer object
      • startAllRegisteredInformers

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

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

        public void stopAllRegisteredInformers​(boolean shutDownThreadPool)
        Stop all registered informers
        Parameters:
        shutDownThreadPool - Whether to shut down thread pool or not.