Class CertificateProviderStore
- java.lang.Object
-
- io.grpc.xds.internal.security.certprovider.CertificateProviderStore
-
@ThreadSafe public final class CertificateProviderStore extends java.lang.Object
Global map of all ref-countedCertificateProvider
s that have been instantiated in the application. Also propagates updates received from aCertificateProvider
to all theCertificateProvider.Watcher
s registered for that CertificateProvider. The Store is meant to be used internally by gRPC and *not* a public API.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
CertificateProviderStore.CertProviderFactory
private static class
CertificateProviderStore.CertProviderKey
(package private) class
CertificateProviderStore.Handle
-
Field Summary
Fields Modifier and Type Field Description private CertificateProviderRegistry
certificateProviderRegistry
private ReferenceCountingMap<CertificateProviderStore.CertProviderKey,CertificateProvider>
certProviderMap
private static CertificateProviderStore
instance
private static java.util.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description CertificateProviderStore(CertificateProviderRegistry certificateProviderRegistry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateProviderStore.Handle
createOrGetProvider(java.lang.String certName, java.lang.String pluginName, java.lang.Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)
Creates or retrieves aCertificateProvider
instance, increments its ref-count and registers the watcher passed.private CertificateProviderStore.Handle
createProviderHelper(java.lang.String certName, java.lang.String pluginName, java.lang.Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)
static CertificateProviderStore
getInstance()
Gets the CertificateProviderStore singleton instance.
-
-
-
Field Detail
-
logger
private static final java.util.logging.Logger logger
-
instance
private static CertificateProviderStore instance
-
certificateProviderRegistry
private final CertificateProviderRegistry certificateProviderRegistry
-
certProviderMap
private final ReferenceCountingMap<CertificateProviderStore.CertProviderKey,CertificateProvider> certProviderMap
-
-
Constructor Detail
-
CertificateProviderStore
public CertificateProviderStore(CertificateProviderRegistry certificateProviderRegistry)
-
-
Method Detail
-
createOrGetProvider
public CertificateProviderStore.Handle createOrGetProvider(java.lang.String certName, java.lang.String pluginName, java.lang.Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)
Creates or retrieves aCertificateProvider
instance, increments its ref-count and registers the watcher passed. Returns aCertificateProviderStore.Handle
that can beCertificateProviderStore.Handle.close()
d when the instance is no longer needed by the caller.- Parameters:
notifyCertUpdates
- when true, the caller is interested in identity cert updates. When false, the caller cannot depend on receiving theCertificateProvider.Watcher.updateCertificate(java.security.PrivateKey, java.util.List<java.security.cert.X509Certificate>)
callbacks but may still receive these callbacks which should be ignored.- Throws:
java.lang.IllegalArgumentException
- in case of errors in processing config or the plugin is incapable of sending cert updates when notifyCertUpdates is true.java.lang.UnsupportedOperationException
- if the plugin is incapable of sending cert updates when notifyCertUpdates is true.
-
createProviderHelper
private CertificateProviderStore.Handle createProviderHelper(java.lang.String certName, java.lang.String pluginName, java.lang.Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)
-
getInstance
public static CertificateProviderStore getInstance()
Gets the CertificateProviderStore singleton instance.
-
-