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
ReactorClient
implementation 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.Selector
selector
-
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 void
postConnect(OneTimeCallback callback)
Transport specific post connection functionality.void
postDisconnect()
Cleans resources after disconnect.protected int
read(java.nio.ByteBuffer buff)
Reads provided buffer.void
updateInterestedOps()
Updates selection key's operation set.protected void
write(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) throws ClientConnectionException
- Throws:
ClientConnectionException
-
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:ReactorClient
Updates selection key's operation set.- Specified by:
updateInterestedOps
in classReactorClient
-
read
protected int read(java.nio.ByteBuffer buff) throws java.io.IOException
Description copied from class:ReactorClient
Reads provided buffer.- Specified by:
read
in 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.IOException
Description copied from class:ReactorClient
Writes provided buffer.- Specified by:
write
in 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:ReactorClient
Transport specific post connection functionality.- Specified by:
postConnect
in 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:ReactorClient
Cleans resources after disconnect.- Specified by:
postDisconnect
in classReactorClient
-
-