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 an `SSLContext` and always returns it as a result of further invocations of the `create()`} method.

See Also:
  Serialized Form

### Field Summary

Fields
`protected String[]` `cipherSuites` Enabled cipher suites.
`static String` `DFLT_SSL_PROTOCOL` Default SSL protocol.
`protected String` `proto` SSL protocol.
`protected String[]` `protocols` Enabled protocols.
`protected AtomicReference<SSLContext>` `sslCtx` Cached instance of an `SSLContext`.

### Constructor Summary

Constructors
`AbstractSslContextFactory()`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected void` `checkNullParameter​(Object param, String name)`
`protected abstract void` `checkParameters()` Checks that all required parameters are set.
`SSLContext` `create()`
`protected abstract KeyManager[]` `createKeyManagers()`
`protected abstract TrustManager[]` `createTrustManagers()`
`String[]` `getCipherSuites()` Gets enabled cipher suites.
`String` `getProtocol()` Gets protocol for secure transport.
`String[]` `getProtocols()` Gets enabled protocols.
`void` `setCipherSuites​(String... cipherSuites)` Sets enabled cipher suites.
`void` `setProtocol​(String proto)` Sets protocol for secure transport.
`void` `setProtocols​(String... protocols)` Sets enabled protocols.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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 an `SSLContext`.

### Constructor Detail

#### AbstractSslContextFactory

    public AbstractSslContextFactory()

### 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_PROTOCOL` will 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` - If `null`.

#### checkParameters

    protected abstract void checkParameters()
                                     throws SSLException

Checks 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:
  `create` in interface `javax.cache.configuration.Factory<SSLContext>`