Class CertificateProviderStore
java.lang.Object
io.grpc.xds.internal.security.certprovider.CertificateProviderStore
Global map of all ref-counted
CertificateProvider
s that have been instantiated in
the application. Also propagates updates received from a CertificateProvider
to all
the CertificateProvider.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 ClassesModifier and TypeClassDescriptionprivate final class
private static final class
(package private) final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CertificateProviderRegistry
private static CertificateProviderStore
private static final Logger
-
Constructor Summary
ConstructorsConstructorDescriptionCertificateProviderStore
(CertificateProviderRegistry certificateProviderRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncreateOrGetProvider
(String certName, String pluginName, 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
(String certName, String pluginName, Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates) static CertificateProviderStore
Gets the CertificateProviderStore singleton instance.
-
Field Details
-
logger
-
instance
-
certificateProviderRegistry
-
certProviderMap
private final ReferenceCountingMap<CertificateProviderStore.CertProviderKey,CertificateProvider> certProviderMap
-
-
Constructor Details
-
CertificateProviderStore
-
-
Method Details
-
createOrGetProvider
public CertificateProviderStore.Handle createOrGetProvider(String certName, String pluginName, 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:
IllegalArgumentException
- in case of errors in processing config or the plugin is incapable of sending cert updates when notifyCertUpdates is true.UnsupportedOperationException
- if the plugin is incapable of sending cert updates when notifyCertUpdates is true.
-
createProviderHelper
private CertificateProviderStore.Handle createProviderHelper(String certName, String pluginName, Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates) -
getInstance
Gets the CertificateProviderStore singleton instance.
-