Class PlainClient
- java.lang.Object
-
- org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
-
- org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient
-
- org.ovirt.vdsm.jsonrpc.client.reactors.PlainClient
-
- Direct Known Subclasses:
StompClient
public abstract class PlainClient extends StompCommonClient
ReactorClientimplementation to provide not 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 protected java.nio.channels.Selectorselector-
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 PlainClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port)PlainClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port, java.nio.channels.SocketChannel socketChannel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidpostConnect(OneTimeCallback callback)Transport specific post connection functionality.voidpostDisconnect()Cleans resources after disconnect.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, getPeerCertificates, getPostConnectCallback, getRetryPolicy, getSelectionKey, isInInit, isOpen, now, performAction, process, processOutgoing, removeEventListener, scheduleTask, sendMessage, setClientPolicy, updateLastIncomingHeartbeat, updateLastOutgoingHeartbeat
-
-
-
-
Constructor Detail
-
PlainClient
public PlainClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port)
-
PlainClient
public PlainClient(Reactor reactor, java.nio.channels.Selector selector, java.lang.String hostname, int port, java.nio.channels.SocketChannel socketChannel) throws ClientConnectionException
- Throws:
ClientConnectionException
-
-
Method Detail
-
updateInterestedOps
public void updateInterestedOps()
Description copied from class:ReactorClientUpdates selection key's operation set.- Specified by:
updateInterestedOpsin classReactorClient
-
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.
-
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
-
-