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 forCertificateLoader
implementations.- Since:
- 22.06
- Author:
- Jonathan Knight 2020.01.25
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractCertificateLoader(String sName)
Create anAbstractCertificateLoader
.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
protected abstract InputStream
getInputStream()
Open anInputStream
for the specified named resource, which should be the contents of a JavaCertificate
in the format required by thisCertificateLoader
implementation.String
getName()
Returns the name of theCertificate
to load.int
hashCode()
boolean
isEnabled()
Certificate[]
load()
Load aCertificate
.protected void
safeClose(Closeable closeable)
String
toString()
-
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:CertificateLoader
Load aCertificate
.- Specified by:
load
in interfaceCertificateLoader
- Returns:
- the
Certificates
orCertificate[0]
if noCertificates
were loaded - Throws:
GeneralSecurityException
IOException
-
isEnabled
public boolean isEnabled()
Description copied from interface:CertificateLoader
- Specified by:
isEnabled
in interfaceCertificateLoader
- Returns:
true
if thisCertificateLoader
is enabled, orfalse
ifCertificateLoader
should not be used
-
getName
public String getName()
Returns the name of theCertificate
to load.- Returns:
- the name of the
Certificate
to load
-
getInputStream
protected abstract InputStream getInputStream() throws IOException
Open anInputStream
for the specified named resource, which should be the contents of a JavaCertificate
in the format required by thisCertificateLoader
implementation.How the
InputStream
is 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
InputStream
containing the named resource contents, ornull
if noInputStream
could 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 theCloseable
may benull
.Any exception thrown calling
Closeable.close()
will be ignored.- Parameters:
closeable
- theCloseable
to close
-
-