Package org.apache.ignite.ssl
Class AbstractSslContextFactory
- java.lang.Object
-
- org.apache.ignite.ssl.AbstractSslContextFactory
-
- All Implemented Interfaces:
Serializable,javax.cache.configuration.Factory<SSLContext>
- Direct Known Subclasses:
SslContextFactory
public abstract class AbstractSslContextFactory extends Object implements javax.cache.configuration.Factory<SSLContext>
Represents abstract implementation of SSL Context Factory that caches the result of the first successful attempt to create anSSLContextand always returns it as a result of further invocations of thecreate()} method.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected String[]cipherSuitesEnabled cipher suites.static StringDFLT_SSL_PROTOCOLDefault SSL protocol.protected StringprotoSSL protocol.protected String[]protocolsEnabled protocols.protected AtomicReference<SSLContext>sslCtxCached instance of anSSLContext.
-
Constructor Summary
Constructors Constructor Description AbstractSslContextFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidcheckNullParameter(Object param, String name)protected abstract voidcheckParameters()Checks that all required parameters are set.SSLContextcreate()protected abstract KeyManager[]createKeyManagers()protected abstract TrustManager[]createTrustManagers()String[]getCipherSuites()Gets enabled cipher suites.StringgetProtocol()Gets protocol for secure transport.String[]getProtocols()Gets enabled protocols.voidsetCipherSuites(String... cipherSuites)Sets enabled cipher suites.voidsetProtocol(String proto)Sets protocol for secure transport.voidsetProtocols(String... protocols)Sets enabled protocols.
-
-
-
Field Detail
-
DFLT_SSL_PROTOCOL
public static final String DFLT_SSL_PROTOCOL
Default SSL protocol.- See Also:
- Constant Field Values
-
proto
protected String proto
SSL protocol.
-
cipherSuites
protected String[] cipherSuites
Enabled cipher suites.
-
protocols
protected String[] protocols
Enabled protocols.
-
sslCtx
protected final AtomicReference<SSLContext> sslCtx
Cached instance of anSSLContext.
-
-
Method Detail
-
getProtocol
public String getProtocol()
Gets protocol for secure transport.- Returns:
- SSL protocol name.
-
setProtocol
public void setProtocol(String proto)
Sets protocol for secure transport. If not specified,DFLT_SSL_PROTOCOLwill be used.- Parameters:
proto- SSL protocol name.
-
setCipherSuites
public void setCipherSuites(String... cipherSuites)
Sets enabled cipher suites.- Parameters:
cipherSuites- enabled cipher suites.
-
getCipherSuites
public String[] getCipherSuites()
Gets enabled cipher suites.- Returns:
- enabled cipher suites
-
getProtocols
public String[] getProtocols()
Gets enabled protocols.- Returns:
- Enabled protocols.
-
setProtocols
public void setProtocols(String... protocols)
Sets enabled protocols.- Parameters:
protocols- Enabled protocols.
-
checkNullParameter
protected void checkNullParameter(Object param, String name) throws SSLException
- Parameters:
param- Value.name- Name.- Throws:
SSLException- Ifnull.
-
checkParameters
protected abstract void checkParameters() throws SSLExceptionChecks that all required parameters are set.- Throws:
SSLException- If any of required parameters is missing.
-
createKeyManagers
protected abstract KeyManager[] createKeyManagers() throws SSLException
- Returns:
- Created Key Managers.
- Throws:
SSLException- If Key Managers could not be created.
-
createTrustManagers
protected abstract TrustManager[] createTrustManagers() throws SSLException
- Returns:
- Created Trust Managers.
- Throws:
SSLException- If Trust Managers could not be created.
-
create
public SSLContext create()
- Specified by:
createin interfacejavax.cache.configuration.Factory<SSLContext>
-
-