Package com.tangosol.net.ssl
Class AbstractCertificateLoader
- java.lang.Object
-
- com.tangosol.net.ssl.AbstractCertificateLoader
-
- All Implemented Interfaces:
CertificateLoader
- Direct Known Subclasses:
URLCertificateLoader
public abstract class AbstractCertificateLoader extends Object implements CertificateLoader
A base class forCertificateLoaderimplementations.- Since:
- 22.06
- Author:
- Jonathan Knight 2020.01.25
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCertificateLoader(String sName)Create anAbstractCertificateLoader.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)protected abstract InputStreamgetInputStream()Open anInputStreamfor the specified named resource, which should be the contents of a JavaCertificatein the format required by thisCertificateLoaderimplementation.StringgetName()Returns the name of theCertificateto load.inthashCode()booleanisEnabled()Certificate[]load()Load aCertificate.protected voidsafeClose(Closeable closeable)StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tangosol.net.ssl.CertificateLoader
isRefreshable
-
-
-
-
Field Detail
-
m_sName
protected String m_sName
The name of the certificate to load.
-
-
Constructor Detail
-
AbstractCertificateLoader
protected AbstractCertificateLoader(String sName)
Create anAbstractCertificateLoader.- Parameters:
sName- the name of the certificate to load
-
-
Method Detail
-
load
public Certificate[] load() throws GeneralSecurityException, IOException
Description copied from interface:CertificateLoaderLoad aCertificate.- Specified by:
loadin interfaceCertificateLoader- Returns:
- the
CertificatesorCertificate[0]if noCertificateswere loaded - Throws:
GeneralSecurityExceptionIOException
-
isEnabled
public boolean isEnabled()
Description copied from interface:CertificateLoader- Specified by:
isEnabledin interfaceCertificateLoader- Returns:
trueif thisCertificateLoaderis enabled, orfalseifCertificateLoadershould not be used
-
getName
public String getName()
Returns the name of theCertificateto load.- Returns:
- the name of the
Certificateto load
-
getInputStream
protected abstract InputStream getInputStream() throws IOException
Open anInputStreamfor the specified named resource, which should be the contents of a JavaCertificatein the format required by thisCertificateLoaderimplementation.How the
InputStreamis created based on the name is purely dependent on how subclasses are implemented. For example, the name could be a URL, or it could refer to a name of a secret in some secrets store, etc.- Returns:
- an
InputStreamcontaining the named resource contents, ornullif noInputStreamcould be opened - Throws:
IOException- if an error occurs creating theInputStream
-
safeClose
protected void safeClose(Closeable closeable)
Close the specifiedCloseable, ignoring any errors or the fact that theCloseablemay benull.Any exception thrown calling
Closeable.close()will be ignored.- Parameters:
closeable- theCloseableto close
-
-