public class TcpClientChannel extends TcpChannel implements CSMPPublisherChannel, CSMPSubscriberChannel, SubscriberWireMessageHandler
| Modifier and Type | Class and Description |
|---|---|
static class |
TcpClientChannel.ChannelMode |
class |
TcpClientChannel.ReconnectStartNotYetInitConnected |
class |
TcpClientChannel.ReconnectStartOnceConnected |
static class |
TcpClientChannel.SmpInterceptState |
TcpChannel.KeepaliveWriteResult, TcpChannel.WriteBlockPolicy_contextGENERAL_PUB_ALLOCATOR_NAMEGENERAL_SUB_ALLOCATOR_NAMEATTACHMENT_HEADER_LENGTH, ATTACHMENT_TYPE, ATTACHMENT_ZERO, AUTH_BASIC, CAP_ADCTRL, CAP_ADMESSAGING, CAP_PUBCTRL, CAP_SUBCTRL, COLON, CONSUMER_DISPATCHER_QUEUE_SIZE_DEFAULT, CONSUMER_THREAD, CONTENT_LENGTH, CONTENT_TYPE, CRLF, CSMP_URI, CSMP_VERSION, CSMP_VERSION_NUMBER, CSMPISNOTOK, CSMPISOK, DEFAULT_CSMPVRID, DEFAULT_FLOW_QUEUE_CONGESTED, DEFAULT_FLOW_QUEUE_UNCONGESTED, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_MAX_METADATA_LENGTH, DEFAULT_RX_MESSAGE_PRIORITY, DEFAULT_VRIDNAME, DOCID, EMPTY_DOCID, ENVVAR_DISABLE_STATS, ENVVAR_LOCALHOST, HOST, HOST_PORT_SEPERATOR, HTTP, HTTP_200_RESPONSE, HTTP_400_RESPONSE, HTTP_401_RESPONSE, HTTP_403_RESPONSE, HTTP_500_RESPONSE, HTTP_501_RESPONSE, HTTP_503_RESPONSE, HTTP_HEADER, HTTP_STR_OK, HTTP_URL_INSECURE, HTTP_URL_SECURE, HTTP1_1_CRLF, HTTPS, INVALID_VIRTUAL_ROUTER, ISO_CHARSET, LGM_MSG_ID, LGM_NUM_SEGMENTS, LGM_SEG_DEST_PREFIX, LGM_SEG_ID, LGM_TOTAL_SIZE, MAX_AD_APPACK_PER_MSG, MAX_CONSUMED_MESSAGEFLOWS_PER_XA_TRANSACTION, MAX_CONSUMED_MESSAGES_PER_FLOW_PER_XA_TRANSACTION, MAX_LGM_NUM_SEGMENTS, MAX_NACK_COUNTER, MAX_PORT_NUMBER, MAX_RECONNECTS_ALLOWED_BY_FREQ_MANAGER_DEFAULT, MAX_SENDMULTIPLE_VECTOR_LEN, MAX_USERDATA_LENGTH, MESSAGE_ROUTER_SW_VERSION_LATEST, MSGTYPECODE_DIRECT, MSGTYPECODE_NONPERSISTENT, MSGTYPECODE_PERSISTENT, NACK_HOLD_DOWN_TIME_IN_MILLIS, OK_RESPONSE, PERSISTENT, POST, PREV_DOCID, PRI, PRODUCER_DISPATCHER_QUEUE_SIZE_DEFAULT, PUB_HTTP_KA_THREAD, PUB_KEEPALIVE_URI, PUBCTRL_URI, PUBCTRL_VERSION, PUBCTRL_VERSION_NUMBER, PUBMSG_URI, PUBPRI, REDELIVERED, RESP_AD_NOT_READY, RESP_UNKNOWN_PROTOCOL, ROUTER_SW_VERSION, SLASH, SMF_507_RESPONSE, SOLACE_ATTACHMENT, STREAM_PUB_RESP_THREAD, SUB_HTTP_ENQUEUE_THREAD, SUB_HTTP_FQ_THREAD, SUB_HTTP_KA_THREAD, SUB_HTTP_NACK_HOLDDOWN_THREAD, SUB_KEEPALIVE_URI, SUB_UDPMULTI_ENQUEUE_THREAD, SUB_UDPUNI_ENQUEUE_THREAD, SUBCTRL_URI, SUBCTRL_VERSION, SUBCTRL_VERSION_NUMBER, SUPPORTED_PROTOCOL_CSMP, SUPPORTED_PROTOCOL_HTTP, SUPPORTED_PROTOCOL_HTTPS, SUPPORTED_PROTOCOL_MULTICAST, SUPPORTED_PROTOCOL_SMF, SUPPORTED_PROTOCOL_SMFS, SUPPORTED_PROTOCOL_TCP, SUPPORTED_PROTOCOL_UDP, SUPPORTED_PROTOCOL_UNICAST, SYSPROP_JAAS_LOGIN_CONTEXT, SYSPROP_USE_DIRECT_BUF_MSG, SYSPROP_XA_RECOVER_NUM_XIDS, TEXT_XML_CONTENT, TTL, URI_AMP_SEPERATOR, URI_EQUAL_SEPERATOR, URI_QMARK_SEPERATOR, USER_DATA, UTF8_CHARSET, ZERO_LENGTH_MESSAGE| Constructor and Description |
|---|
TcpClientChannel(JCSMPProperties props,
SecureProperties secureProps,
JCSMPSessionStats stats,
String sessionId,
JCSMPBasicSession session,
ContextImpl context,
TcpClientChannel.ChannelMode channelMode) |
| Modifier and Type | Method and Description |
|---|---|
void |
addOutstandingRequest(ClientRequestResponse req,
int corr) |
boolean |
autoConnect() |
void |
cancelAllOutstandingRequests(JCSMPException cause) |
void |
checkSmpResponseOK(WireMessage wmsg) |
void |
cleanupBuffers() |
void |
close()
Close the underlying connection
|
boolean |
connected()
Subclass may want to overrider this method to get better performance.
|
void |
deregisterChannelToReactor() |
WireMessage |
doSmfBlockingRequestNoRetry(WireMessage request) |
WireMessage |
doSmfSharedRequest(WireMessage request,
Integer idTag) |
WireMessage |
doSmfSharedRequest(WireMessage request,
Integer idTag,
Long corrId,
boolean noReconnOnTimeout) |
WireMessage |
doSmfSharedRequest(WireMessage request,
long max_tries,
Integer idTag) |
WireMessage |
doSmfSharedRequest(WireMessage request,
long max_tries,
Integer idTag,
Long corrId,
boolean noReconnOnTimeout) |
WireMessage |
doSmfSharedRequest(WireMessage request,
long max_tries,
Integer idTag,
Long corrId,
boolean noReconnOnTimeout,
boolean allowOnStateSub) |
WireMessage |
doSmfSharedRequest(WireMessage request,
long max_tries,
Integer idTag,
Long corrId,
boolean noReconnOnTimeout,
boolean allowOnStateSub,
JCSMPResponseListener listener,
Object listenerKey,
Endpoint endpoint) |
void |
doSmfSharedRequestNoResponse(WireMessage request,
boolean setCorrId) |
WireMessage |
doSmfSharedRequestRetryForever(WireMessage request,
Integer idTag,
Long corrId) |
WireMessage |
doSmfSharedRequestRetryForever(WireMessage request,
Integer idTag,
Long corrId,
boolean allowOnStateSub) |
WireMessage |
doSmfSubSingleShotRequest(WireMessage request,
boolean allowOnStateSub,
boolean waitConfirm,
TcpChannel.WriteBlockPolicy wpolicy,
Integer idTag,
Long corrId) |
void |
doSmpRequest(SmpHeaderBean request,
boolean waitForConfirm) |
void |
doSmpRequest(SmpHeaderBean request,
JCSMPResponseListener listener,
Object key,
Endpoint endpoint) |
void |
drainOutstandingNonADMsgsTo(List<JCSMPXMLMessage> msgs) |
void |
enqueuePriorityData(WireMessage msg) |
JndiMessage |
executeJndiQuery(JndiMessage request) |
PubADManager |
getADSettings() |
Integer |
getConnCounterTag() |
String |
getDbgId() |
DeliveryMode |
getDefaultDeliveryMode() |
SeqNumAllocator |
getGeneralSeqAllocator() |
JCSMPReconnectEventHandler |
getReconnectHandler() |
TcpClientChannel.SmpInterceptState |
getSmpRespInterceptState() |
SubFlowManagerImpl |
getSubFlowManager() |
TransactedSessionManager |
getTransactedSessionMgr() |
XASessionManager |
getXASessionMgr() |
void |
handleException(Exception ex) |
void |
handleMessage(WireMessage msg) |
boolean |
isAutoReconnector()
Checks to see if the underlying channel is an auto-reconnector.
|
boolean |
isExplicitAckEnabled() |
boolean |
isUserCloseable() |
void |
open()
Open the channel (connect to the router).
|
void |
open(boolean isReconn) |
static JCSMPXMLMessage |
parse(SeqNumAllocator seqAllocator,
WireMessage _wmsg,
TcpClientChannel.ChannelMode parseMode) |
boolean |
processCtrlResponse(WireMessage response) |
void |
putRef(ContentBuffer cb,
ByteBuffer[] vec,
int pos) |
void |
removeOutstandingRequest(int corr) |
void |
resume() |
int |
send(JCSMPXMLMessage[] entries,
int offset,
int length,
boolean newMsg,
JCSMPXMLMessageProducer producer,
boolean allowBlock,
Integer expectedChannelTag,
boolean dropOnWouldBlock,
boolean allowStateSub) |
int |
sendAckMessage(WireMessage ackMsg,
boolean allowOnStateSub,
boolean allowReactorFinishWrite) |
int |
sendAdCtrlRequest(WireMessage msgReq,
boolean allowOnStateSub,
TcpChannel.WriteBlockPolicy wpolicy,
boolean stopOnNoconnection) |
void |
sendBindRequest(Endpoint bindTo,
Topic topicName,
int winSz,
int corrTag,
boolean allowOnStateSub,
String flowName,
AssuredCtrlEnums.FlowType flowType,
long lastMsgIdAcked,
long lastMsgIdRecved,
String sqlSelector,
EndpointProperties tmpEpCreateProperties,
Long transactedSessionId,
boolean noLocal,
boolean activeFlowIndication,
TcpChannel.WriteBlockPolicy wpolicy) |
void |
sendBindRequest(Endpoint bindTo,
Topic topicName,
int winSz,
int corrTag,
boolean allowOnStateSub,
String flowName,
AssuredCtrlEnums.FlowType flowType,
long lastMsgIdAcked,
long lastMsgIdRecved,
String sqlSelector,
EndpointProperties tmpEpCreateProperties,
Long transactedSessionId,
boolean noLocal,
boolean activeFlowIndication,
TcpChannel.WriteBlockPolicy wpolicy,
ReplayStartLocation startLocation,
Long endpointErrorId) |
void |
sendFlowChangeUpdateResponse(long flowId,
boolean activeFlowIndication,
int respCode,
String respString) |
boolean |
sendUnbindRequest(long flowId,
Integer corrTag,
boolean allowOnStateSub,
boolean linger,
TcpChannel.WriteBlockPolicy wpolicy,
Long lastMsgIdAcked) |
boolean |
sendUnbindRequest(long flowId,
Integer corrTag,
boolean allowOnStateSub,
boolean linger,
TcpChannel.WriteBlockPolicy wpolicy,
Long lastMsgIdAcked,
Long errorId) |
void |
sendUnsubscribeRequest(String endpointName,
int corrTag,
boolean allowOnStateSub,
TcpChannel.WriteBlockPolicy wpolicy) |
void |
setADSettings(PubADManager winAdSettings) |
void |
setExplicitAckEnabled(boolean value) |
void |
setObserver(CSMPPublisherChannelObserver observer) |
void |
setProducerId(long value) |
void |
setReconnectEventHandler(JCSMPReconnectEventHandler handler) |
int |
setReqCorrelationTag(WireMessage request) |
void |
setReqCorrelationTag(WireMessage request,
long corr) |
void |
setSessionModeSup(SessionModeSupport modeSup) |
void |
setSmpInterceptState(TcpClientChannel.SmpInterceptState state) |
void |
setSubFlowManager(SubFlowManagerImpl subFlowMgr) |
void |
setTransactedSessionMgr(TransactedSessionManager _txsessionMgr) |
void |
setXASessionMgr(XASessionManager xasessionMgr) |
boolean |
socketConnected() |
void |
start()
Enable reading message from underlying connection
|
void |
startFreqDisconnect(Exception ex) |
void |
startReconnect(JCSMPException e,
boolean allowBlockingRec) |
void |
stop()
Disable reading message from underlying connection
|
void |
suspend() |
void |
synchSeqAllocator(long value) |
void |
updateClientDescription(String clientDesc) |
void |
updateClientName(String uniqueName,
String defaultName) |
getChannelProperties, getLocalIPUsed, getLocalPort, getNetworkInfoString, getRemoteAddr, getRemotePort, getSmfClientequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetChannelPropertiespublic TcpClientChannel(JCSMPProperties props, SecureProperties secureProps, JCSMPSessionStats stats, String sessionId, JCSMPBasicSession session, ContextImpl context, TcpClientChannel.ChannelMode channelMode)
public String getDbgId()
public Integer getConnCounterTag()
public boolean autoConnect()
autoConnect in interface CSMPPublisherChannelpublic void drainOutstandingNonADMsgsTo(List<JCSMPXMLMessage> msgs)
drainOutstandingNonADMsgsTo in interface CSMPPublisherChannelpublic PubADManager getADSettings()
getADSettings in interface CSMPPublisherChannelpublic DeliveryMode getDefaultDeliveryMode()
getDefaultDeliveryMode in interface CSMPPublisherChannelpublic boolean isExplicitAckEnabled()
isExplicitAckEnabled in interface CSMPPublisherChannelpublic boolean connected()
TcpChannelconnected in interface CSMPChannelconnected in class TcpChannelCSMPChannel.connected()public boolean socketConnected()
public void open()
throws JCSMPException
CSMPChannelopen in interface CSMPChannelopen in class TcpChannelJCSMPException - on errorCSMPChannel.open()public void open(boolean isReconn)
throws JCSMPException
open in interface CSMPPublisherChannelJCSMPExceptionpublic void updateClientDescription(String clientDesc) throws JCSMPException
JCSMPExceptionpublic void updateClientName(String uniqueName, String defaultName) throws JCSMPException
JCSMPExceptionpublic void cleanupBuffers()
cleanupBuffers in interface CSMPChannelcleanupBuffers in class TcpChannelpublic void close()
TcpChannelclose in interface CSMPChannelclose in class TcpChannelpublic void deregisterChannelToReactor()
deregisterChannelToReactor in interface SubscriberWireMessageHandlerpublic void resume()
resume in interface CSMPPublisherChannelpublic int send(JCSMPXMLMessage[] entries, int offset, int length, boolean newMsg, JCSMPXMLMessageProducer producer, boolean allowBlock, Integer expectedChannelTag, boolean dropOnWouldBlock, boolean allowStateSub) throws JCSMPException
send in interface CSMPPublisherChannelJCSMPExceptionpublic void putRef(ContentBuffer cb, ByteBuffer[] vec, int pos)
public void setADSettings(PubADManager winAdSettings)
setADSettings in interface CSMPPublisherChannelpublic void setExplicitAckEnabled(boolean value)
setExplicitAckEnabled in interface CSMPPublisherChannelpublic void setObserver(CSMPPublisherChannelObserver observer)
setObserver in interface CSMPPublisherChannelpublic void setProducerId(long value)
setProducerId in interface CSMPPublisherChannelpublic void suspend()
suspend in interface CSMPPublisherChannelpublic void synchSeqAllocator(long value)
synchSeqAllocator in interface CSMPPublisherChannelpublic final SeqNumAllocator getGeneralSeqAllocator()
public void setSessionModeSup(SessionModeSupport modeSup)
public void start()
throws JCSMPException
CSMPSubscriberChannelstart in interface CSMPSubscriberChannelJCSMPException - on errorpublic void stop()
CSMPSubscriberChannelstop in interface CSMPSubscriberChannelpublic void startFreqDisconnect(Exception ex)
public JndiMessage executeJndiQuery(JndiMessage request) throws JCSMPException
JCSMPExceptionpublic void doSmpRequest(SmpHeaderBean request, boolean waitForConfirm) throws JCSMPException
JCSMPExceptionpublic void doSmpRequest(SmpHeaderBean request, JCSMPResponseListener listener, Object key, Endpoint endpoint) throws JCSMPException
JCSMPExceptionpublic void checkSmpResponseOK(WireMessage wmsg) throws JCSMPErrorResponseException
JCSMPErrorResponseExceptionpublic void doSmfSharedRequestNoResponse(WireMessage request, boolean setCorrId) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequestRetryForever(WireMessage request, Integer idTag, Long corrId) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequestRetryForever(WireMessage request, Integer idTag, Long corrId, boolean allowOnStateSub) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequest(WireMessage request, Integer idTag) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequest(WireMessage request, Integer idTag, Long corrId, boolean noReconnOnTimeout) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequest(WireMessage request, long max_tries, Integer idTag) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequest(WireMessage request, long max_tries, Integer idTag, Long corrId, boolean noReconnOnTimeout) throws JCSMPException
JCSMPExceptionpublic void addOutstandingRequest(ClientRequestResponse req, int corr)
public void removeOutstandingRequest(int corr)
public void cancelAllOutstandingRequests(JCSMPException cause)
public WireMessage doSmfSharedRequest(WireMessage request, long max_tries, Integer idTag, Long corrId, boolean noReconnOnTimeout, boolean allowOnStateSub) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSharedRequest(WireMessage request, long max_tries, Integer idTag, Long corrId, boolean noReconnOnTimeout, boolean allowOnStateSub, JCSMPResponseListener listener, Object listenerKey, Endpoint endpoint) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfSubSingleShotRequest(WireMessage request, boolean allowOnStateSub, boolean waitConfirm, TcpChannel.WriteBlockPolicy wpolicy, Integer idTag, Long corrId) throws JCSMPException
JCSMPExceptionpublic WireMessage doSmfBlockingRequestNoRetry(WireMessage request) throws JCSMPException
JCSMPExceptionpublic int setReqCorrelationTag(WireMessage request)
public void setReqCorrelationTag(WireMessage request, long corr)
public void handleException(Exception ex)
handleException in interface SubscriberWireMessageHandlerpublic void enqueuePriorityData(WireMessage msg)
enqueuePriorityData in interface CSMPSubscriberChannelpublic void startReconnect(JCSMPException e, boolean allowBlockingRec)
public boolean processCtrlResponse(WireMessage response)
public void setSmpInterceptState(TcpClientChannel.SmpInterceptState state)
public TcpClientChannel.SmpInterceptState getSmpRespInterceptState()
public void handleMessage(WireMessage msg)
handleMessage in interface SubscriberWireMessageHandlerpublic static JCSMPXMLMessage parse(SeqNumAllocator seqAllocator, WireMessage _wmsg, TcpClientChannel.ChannelMode parseMode) throws JCSMPException
JCSMPExceptionpublic int sendAdCtrlRequest(WireMessage msgReq, boolean allowOnStateSub, TcpChannel.WriteBlockPolicy wpolicy, boolean stopOnNoconnection) throws JCSMPException
JCSMPExceptionpublic void sendBindRequest(Endpoint bindTo, Topic topicName, int winSz, int corrTag, boolean allowOnStateSub, String flowName, AssuredCtrlEnums.FlowType flowType, long lastMsgIdAcked, long lastMsgIdRecved, String sqlSelector, EndpointProperties tmpEpCreateProperties, Long transactedSessionId, boolean noLocal, boolean activeFlowIndication, TcpChannel.WriteBlockPolicy wpolicy, ReplayStartLocation startLocation, Long endpointErrorId) throws JCSMPException
JCSMPExceptionpublic boolean sendUnbindRequest(long flowId,
Integer corrTag,
boolean allowOnStateSub,
boolean linger,
TcpChannel.WriteBlockPolicy wpolicy,
Long lastMsgIdAcked)
throws JCSMPException
sendUnbindRequest in interface CSMPSubscriberChannelJCSMPExceptionpublic boolean sendUnbindRequest(long flowId,
Integer corrTag,
boolean allowOnStateSub,
boolean linger,
TcpChannel.WriteBlockPolicy wpolicy,
Long lastMsgIdAcked,
Long errorId)
throws JCSMPException
JCSMPExceptionpublic void sendUnsubscribeRequest(String endpointName, int corrTag, boolean allowOnStateSub, TcpChannel.WriteBlockPolicy wpolicy) throws JCSMPException
sendUnsubscribeRequest in interface CSMPSubscriberChannelJCSMPExceptionpublic void sendFlowChangeUpdateResponse(long flowId,
boolean activeFlowIndication,
int respCode,
String respString)
public SubFlowManagerImpl getSubFlowManager()
getSubFlowManager in interface CSMPSubscriberChannelpublic void setSubFlowManager(SubFlowManagerImpl subFlowMgr)
setSubFlowManager in interface CSMPSubscriberChannelpublic void setTransactedSessionMgr(TransactedSessionManager _txsessionMgr)
public TransactedSessionManager getTransactedSessionMgr()
public void setXASessionMgr(XASessionManager xasessionMgr)
public XASessionManager getXASessionMgr()
public int sendAckMessage(WireMessage ackMsg, boolean allowOnStateSub, boolean allowReactorFinishWrite) throws JCSMPException
sendAckMessage in interface CSMPSubscriberChannelJCSMPExceptionpublic JCSMPReconnectEventHandler getReconnectHandler()
getReconnectHandler in interface CSMPSubscriberChannelpublic void setReconnectEventHandler(JCSMPReconnectEventHandler handler)
setReconnectEventHandler in interface CSMPSubscriberChannelpublic boolean isAutoReconnector()
CSMPChannelisAutoReconnector in interface CSMPChannelpublic boolean isUserCloseable()
isUserCloseable in interface CSMPChannelpublic void sendBindRequest(Endpoint bindTo, Topic topicName, int winSz, int corrTag, boolean allowOnStateSub, String flowName, AssuredCtrlEnums.FlowType flowType, long lastMsgIdAcked, long lastMsgIdRecved, String sqlSelector, EndpointProperties tmpEpCreateProperties, Long transactedSessionId, boolean noLocal, boolean activeFlowIndication, TcpChannel.WriteBlockPolicy wpolicy) throws JCSMPException
sendBindRequest in interface CSMPSubscriberChannelJCSMPExceptionCopyright 2004-2020 Solace Corporation. All rights reserved.