Class SSLClient
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
-
- org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient
-
- org.ovirt.vdsm.jsonrpc.client.reactors.SSLClient
-
- Direct Known Subclasses:
SSLStompClient
public abstract class SSLClient extends StompCommonClient
ReactorClientimplementation to provide encrypted communication.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
ReactorClient.MessageListener
-
-
Field Summary
Fields Modifier and Type Field Description private booleanclientprotected static org.slf4j.Loggerlogprotected SSLEngineNioHelpernioEngineprotected java.nio.channels.Selectorselectorprivate javax.net.ssl.SSLContextsslContext-
Fields inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient
connected, DEFAULT_REQUEST_QUEUE, DEFAULT_RESPONSE_QUEUE, headerBuffer, message, subscribed, subscriptionIds
-
Fields inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
BUFFER_SIZE, channel, CLIENT_CLOSED, eventListeners, half, ibuff, key, outbox, policy, reactor
-
-
Constructor Summary
Constructors Constructor Description SSLClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port, javax.net.ssl.SSLContext sslctx)SSLClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port, javax.net.ssl.SSLContext sslctx, java.nio.channels.SocketChannel socketChannel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.net.ssl.SSLEnginecreateSSLEngine(boolean clientMode)java.util.List<java.security.cert.Certificate>getPeerCertificates()private java.lang.RunnablependingOperations()protected voidpostConnect(OneTimeCallback callback)Transport specific post connection functionality.voidpostDisconnect()Cleans resources after disconnect.voidprocess()protected intread(java.nio.ByteBuffer buff)Reads provided buffer.voidupdateInterestedOps()Updates selection key's operation set.protected voidwrite(java.nio.ByteBuffer buff)Writes provided buffer.-
Methods inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient
buildNetworkResponse, clean, close, emitOnMessageReceived, getEventQueue, getRequestQueue, getResponseQueue, processIncoming, send, sendHeartbeat, sendNow, updatePolicyWithHeartbeat, validate
-
Methods inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
addEventListener, closeChannel, connect, disconnect, emitOnMessageReceived, getClientId, getConnectionId, getHostname, getPostConnectCallback, getRetryPolicy, getSelectionKey, isInInit, isOpen, now, performAction, processOutgoing, removeEventListener, scheduleTask, sendMessage, setClientPolicy, updateLastIncomingHeartbeat, updateLastOutgoingHeartbeat
-
-
-
-
Field Detail
-
log
protected static org.slf4j.Logger log
-
selector
protected final java.nio.channels.Selector selector
-
nioEngine
protected SSLEngineNioHelper nioEngine
-
sslContext
private javax.net.ssl.SSLContext sslContext
-
client
private boolean client
-
-
Constructor Detail
-
SSLClient
public SSLClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port, javax.net.ssl.SSLContext sslctx)
-
SSLClient
public SSLClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port, javax.net.ssl.SSLContext sslctx, java.nio.channels.SocketChannel socketChannel) throws ClientConnectionException
- Throws:
ClientConnectionException
-
-
Method Detail
-
createSSLEngine
protected javax.net.ssl.SSLEngine createSSLEngine(boolean clientMode)
-
updateInterestedOps
public void updateInterestedOps()
Description copied from class:ReactorClientUpdates selection key's operation set.- Specified by:
updateInterestedOpsin classReactorClient
-
pendingOperations
private java.lang.Runnable pendingOperations() throws java.io.IOException, ClientConnectionException- Throws:
java.io.IOExceptionClientConnectionException
-
read
protected int read(java.nio.ByteBuffer buff) throws java.io.IOExceptionDescription copied from class:ReactorClientReads provided buffer.- Specified by:
readin classReactorClient- Parameters:
buff- provided buffer to be read.- Returns:
- Number of bytes read.
- Throws:
java.io.IOException- when networking issue occurs.
-
write
protected void write(java.nio.ByteBuffer buff) throws java.io.IOExceptionDescription copied from class:ReactorClientWrites provided buffer.- Specified by:
writein classReactorClient- Parameters:
buff- provided buffer to be written.- Throws:
java.io.IOException- when networking issue occurs.
-
process
public void process() throws java.io.IOException, ClientConnectionException- Overrides:
processin classReactorClient- Throws:
java.io.IOExceptionClientConnectionException
-
postConnect
protected void postConnect(OneTimeCallback callback) throws ClientConnectionException
Description copied from class:ReactorClientTransport specific post connection functionality.- Specified by:
postConnectin classReactorClient- Parameters:
callback- - callback which is executed after connection is estabilished.- Throws:
ClientConnectionException- when issues with connection.
-
postDisconnect
public void postDisconnect()
Description copied from class:ReactorClientCleans resources after disconnect.- Specified by:
postDisconnectin classReactorClient
-
getPeerCertificates
public java.util.List<java.security.cert.Certificate> getPeerCertificates()
- Overrides:
getPeerCertificatesin classReactorClient- Returns:
- the peer certificates of the current session
-
-