Class StompCommonClient
java.lang.Object
org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
org.ovirt.vdsm.jsonrpc.client.reactors.stomp.StompCommonClient
- Direct Known Subclasses:
PlainClient,SSLClient
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
ReactorClient.MessageListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CountDownLatchstatic final Stringstatic final Stringprotected ByteBufferprivate static final org.slf4j.Loggerprotected Messageprotected CountDownLatchFields inherited from class org.ovirt.vdsm.jsonrpc.client.reactors.ReactorClient
BUFFER_SIZE, channel, CLIENT_CLOSED, eventListeners, half, ibuff, key, outbox, PEER_CERTIFICATE_EMPTY_LIST, policy, reactor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected byte[]buildNetworkResponse(String reason) Builds network issue message for specific protocol.protected voidclean()Cleans internal state.close()protected voidemitOnMessageReceived(Message message) private MessagegetMessage(ByteBuffer buffer, int read) private voidlogMessageInTrace(byte[] message) protected voidProcess incoming channel.(package private) voidprocessMessage(Message message) voidsend(byte[] message) protected voidClient sends protocol specific heartbeat messagevoidsendNow(byte[] message) private voidvoidupdatePolicyWithHeartbeat(String heartbeat, boolean client) voidvalidate(ClientPolicy policy) Validates policy when it is set.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, postConnect, postDisconnect, process, processOutgoing, read, removeEventListener, scheduleTask, sendMessage, setClientPolicy, updateInterestedOps, updateLastIncomingHeartbeat, updateLastOutgoingHeartbeat, write
-
Field Details
-
DEFAULT_REQUEST_QUEUE
- See Also:
-
DEFAULT_RESPONSE_QUEUE
- See Also:
-
headerBuffer
-
message
-
connected
-
subscribed
-
subscriptionIds
-
LOG
private static final org.slf4j.Logger LOG
-
-
Constructor Details
-
StompCommonClient
-
-
Method Details
-
send
public void send(byte[] message) -
logMessageInTrace
private void logMessageInTrace(byte[] message) -
updateOps
private void updateOps() -
sendNow
public void sendNow(byte[] message) -
processMessage
-
close
- Overrides:
closein classReactorClient
-
processIncoming
Description copied from class:ReactorClientProcess incoming channel.- Specified by:
processIncomingin classReactorClient- Throws:
IOException- Thrown when reading issue occurred.ClientConnectionException- Thrown when issues with connection.
-
getMessage
- Throws:
ClientConnectionException
-
clean
protected void clean()Description copied from class:ReactorClientCleans internal state.- Specified by:
cleanin classReactorClient
-
emitOnMessageReceived
-
buildNetworkResponse
Description copied from class:ReactorClientBuilds network issue message for specific protocol.- Specified by:
buildNetworkResponsein classReactorClient- Parameters:
reason- why we want to build network response.- Returns:
- byte array containing response.
-
updatePolicyWithHeartbeat
-
sendHeartbeat
protected void sendHeartbeat()Description copied from class:ReactorClientClient sends protocol specific heartbeat message- Specified by:
sendHeartbeatin classReactorClient
-
validate
Description copied from class:ReactorClientValidates policy when it is set.- Specified by:
validatein classReactorClient- Parameters:
policy- - validated policy
-
getRequestQueue
-
getResponseQueue
-
getEventQueue
-