Package io.micronaut.kubernetes.client
Class DiscoveryCache
java.lang.Object
io.micronaut.kubernetes.client.DiscoveryCache
@Requires(beans=io.kubernetes.client.Discovery.class)
@Singleton
@Internal
public class DiscoveryCache
extends Object
Bean that provides caching over the
Discovery
results.- Since:
- 3.1
- Author:
- Pavol Gressa
-
Constructor Summary
ConstructorDescriptionDiscoveryCache
(io.kubernetes.client.Discovery discovery, ApiClientConfiguration.ApiDiscoveryCacheConfiguration apiDiscoveryCacheConfiguration) Deprecated.DiscoveryCache
(jakarta.inject.Provider<io.kubernetes.client.Discovery> discovery, ApiClientConfiguration.ApiDiscoveryCacheConfiguration apiDiscoveryCacheConfiguration) Create a discovery cache. -
Method Summary
-
Constructor Details
-
DiscoveryCache
@Deprecated public DiscoveryCache(io.kubernetes.client.Discovery discovery, ApiClientConfiguration.ApiDiscoveryCacheConfiguration apiDiscoveryCacheConfiguration) Deprecated.Moved to use the lazy constructor, seeDiscoveryCache(Provider, ApiClientConfiguration.ApiDiscoveryCacheConfiguration)
Create a discovery cache.- Parameters:
discovery
- the discovery object to cacheapiDiscoveryCacheConfiguration
- the cache configuration
-
DiscoveryCache
@Inject public DiscoveryCache(jakarta.inject.Provider<io.kubernetes.client.Discovery> discovery, ApiClientConfiguration.ApiDiscoveryCacheConfiguration apiDiscoveryCacheConfiguration) Create a discovery cache.- Parameters:
discovery
- A provider for the discovery object to cacheapiDiscoveryCacheConfiguration
- the cache configuration- Since:
- 3.4.0
-
-
Method Details
-
findAll
public Set<io.kubernetes.client.Discovery.APIResource> findAll() throws io.kubernetes.client.openapi.ApiExceptionFind allDiscovery.APIResource
.- Returns:
- set of discovered resources
- Throws:
io.kubernetes.client.openapi.ApiException
- when failed to download api resources
-
find
public Optional<io.kubernetes.client.Discovery.APIResource> find(Class<? extends io.kubernetes.client.common.KubernetesObject> clazz) Finds theDiscovery.APIResource
for respectiveKubernetesObject
class.- Parameters:
clazz
- kubernetes object class- Returns:
- api resource
-
DiscoveryCache(Provider, ApiClientConfiguration.ApiDiscoveryCacheConfiguration)