Class CertificateProviderStore
- java.lang.Object
-
- io.grpc.xds.internal.security.certprovider.CertificateProviderStore
-
@ThreadSafe public final class CertificateProviderStore extends java.lang.ObjectGlobal map of all ref-countedCertificateProviders that have been instantiated in the application. Also propagates updates received from aCertificateProviderto all theCertificateProvider.Watchers 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 classCertificateProviderStore.CertProviderFactoryprivate static classCertificateProviderStore.CertProviderKey(package private) classCertificateProviderStore.Handle
-
Field Summary
Fields Modifier and Type Field Description private CertificateProviderRegistrycertificateProviderRegistryprivate ReferenceCountingMap<CertificateProviderStore.CertProviderKey,CertificateProvider>certProviderMapprivate static CertificateProviderStoreinstanceprivate static java.util.logging.Loggerlogger
-
Constructor Summary
Constructors Constructor Description CertificateProviderStore(CertificateProviderRegistry certificateProviderRegistry)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateProviderStore.HandlecreateOrGetProvider(java.lang.String certName, java.lang.String pluginName, java.lang.Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)Creates or retrieves aCertificateProviderinstance, increments its ref-count and registers the watcher passed.private CertificateProviderStore.HandlecreateProviderHelper(java.lang.String certName, java.lang.String pluginName, java.lang.Object config, CertificateProvider.Watcher watcher, boolean notifyCertUpdates)static CertificateProviderStoregetInstance()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 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:
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.
-
-