public final class ConnectionSpecSelector
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<ConnectionSpec> |
connectionSpecs |
private boolean |
isFallback |
private boolean |
isFallbackPossible |
private int |
nextModeIndex |
| Constructor and Description |
|---|
ConnectionSpecSelector(java.util.List<ConnectionSpec> connectionSpecs) |
| Modifier and Type | Method and Description |
|---|---|
ConnectionSpec |
configureSecureSocket(javax.net.ssl.SSLSocket sslSocket)
Configures the supplied
SSLSocket to connect to the specified host using an appropriate
ConnectionSpec. |
boolean |
connectionFailed(java.io.IOException e)
Reports a failure to complete a connection.
|
private boolean |
isFallbackPossible(javax.net.ssl.SSLSocket socket)
Returns
true if any later ConnectionSpec in the fallback strategy looks
possible based on the supplied SSLSocket. |
private final java.util.List<ConnectionSpec> connectionSpecs
private int nextModeIndex
private boolean isFallbackPossible
private boolean isFallback
public ConnectionSpecSelector(java.util.List<ConnectionSpec> connectionSpecs)
public ConnectionSpec configureSecureSocket(javax.net.ssl.SSLSocket sslSocket) throws java.io.IOException
SSLSocket to connect to the specified host using an appropriate
ConnectionSpec. Returns the chosen ConnectionSpec, never null.java.io.IOException - if the socket does not support any of the TLS modes availablepublic boolean connectionFailed(java.io.IOException e)
ConnectionSpec to try,
if any.true if the connection should be retried using configureSecureSocket(SSLSocket) or false if notprivate boolean isFallbackPossible(javax.net.ssl.SSLSocket socket)
true if any later ConnectionSpec in the fallback strategy looks
possible based on the supplied SSLSocket. It assumes that a future socket will have the
same capabilities as the supplied socket.