Class CertificateProviderStore
java.lang.Object
io.grpc.xds.internal.security.certprovider.CertificateProviderStore
Global map of all ref-counted
CertificateProviders that have been instantiated in
the application. Also propagates updates received from a CertificateProvider to all
the CertificateProvider.Watchers 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 classprivate static final class(package private) final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CertificateProviderRegistryprivate static CertificateProviderStoreprivate 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 aCertificateProviderinstance, increments its ref-count and registers the watcher passed.private CertificateProviderStore.HandlecreateProviderHelper(String certName, String pluginName, Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates) static CertificateProviderStoreGets 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 aCertificateProviderinstance, increments its ref-count and registers the watcher passed. Returns aCertificateProviderStore.Handlethat 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.
-