public abstract class StompCommonClient extends ReactorClient
ReactorClient.MessageListener
Modifier and Type | Field and Description |
---|---|
protected CountDownLatch |
connected |
static String |
DEFAULT_REQUEST_QUEUE |
static String |
DEFAULT_RESPONSE_QUEUE |
protected ByteBuffer |
headerBuffer |
protected Message |
message |
protected CountDownLatch |
subscribed |
protected List<String> |
subscriptionIds |
BUFFER_SIZE, channel, CLIENT_CLOSED, eventListeners, ibuff, key, outbox, policy, reactor
Constructor and Description |
---|
StompCommonClient(Reactor reactor,
String hostname,
int port) |
Modifier and Type | Method and Description |
---|---|
protected byte[] |
buildNetworkResponse(String reason)
Builds network issue message for specific protocol.
|
protected void |
clean()
Cleans internal state.
|
Future<Void> |
close() |
protected void |
emitOnMessageReceived(Message message) |
String |
getEventQueue() |
String |
getRequestQueue() |
String |
getResponseQueue() |
protected void |
processIncoming()
Process incoming channel.
|
void |
send(byte[] message) |
protected void |
sendHeartbeat()
Client sends protocol specific heartbeat message
|
void |
sendNow(byte[] message) |
void |
updatePolicyWithHeartbeat(String heartbeat,
boolean client) |
void |
validate(ClientPolicy policy)
Validates policy when it is set.
|
addEventListener, closeChannel, connect, disconnect, emitOnMessageReceived, getClientId, getConnectionId, getHostname, getPeerCertificates, getPostConnectCallback, getRetryPolicy, getSelectionKey, isInInit, isOpen, performAction, postConnect, postDisconnect, process, processOutgoing, read, removeEventListener, scheduleTask, sendMessage, setClientPolicy, updateInterestedOps, updateLastIncomingHeartbeat, updateLastOutgoingHeartbeat
public static final String DEFAULT_REQUEST_QUEUE
public static final String DEFAULT_RESPONSE_QUEUE
protected ByteBuffer headerBuffer
protected Message message
protected CountDownLatch connected
protected CountDownLatch subscribed
public void send(byte[] message)
public void sendNow(byte[] message)
public Future<Void> close()
close
in class ReactorClient
protected void processIncoming() throws IOException, ClientConnectionException
ReactorClient
processIncoming
in class ReactorClient
IOException
- Thrown when reading issue occurred.ClientConnectionException
- Thrown when issues with connection.protected void clean()
ReactorClient
clean
in class ReactorClient
protected void emitOnMessageReceived(Message message)
protected byte[] buildNetworkResponse(String reason)
ReactorClient
buildNetworkResponse
in class ReactorClient
reason
- why we want to build network response.public void updatePolicyWithHeartbeat(String heartbeat, boolean client)
protected void sendHeartbeat()
ReactorClient
sendHeartbeat
in class ReactorClient
public void validate(ClientPolicy policy)
ReactorClient
validate
in class ReactorClient
policy
- - validated policypublic String getRequestQueue()
public String getResponseQueue()
public String getEventQueue()
Copyright © 2019. All rights reserved.