public final class StompConnection extends Object implements RemotingConnection
| Modifier and Type | Field and Description |
|---|---|
protected static String |
CONNECTION_ID_PROP |
| Modifier and Type | Method and Description |
|---|---|
void |
abortTransaction(String txID) |
void |
acknowledge(String messageID,
String subscriptionID) |
void |
addCloseListener(CloseListener listener)
add a CloseListener.
|
void |
addFailureListener(FailureListener listener)
add a failure listener.
|
void |
addStompEventListener(FrameEventListener listener) |
void |
autoCreateDestinationIfPossible(String queue) |
protected void |
beginTransaction(String txID) |
void |
bufferReceived(Object connectionID,
ActiveMQBuffer buffer)
called by the remoting connection when a buffer is received.
|
boolean |
checkDataReceived()
returns true if any data has been received since the last time this method was called.
|
void |
checkDestination(String destination) |
void |
commitTransaction(String txID) |
ServerMessageImpl |
createServerMessage() |
StompFrame |
createStompMessage(ServerMessage serverMessage,
StompSubscription subscription,
int deliveryCount) |
ActiveMQBuffer |
createTransportBuffer(int size)
creates a new ActiveMQBuffer of the specified size.
|
StompFrame |
decode(ActiveMQBuffer buffer) |
void |
destroy()
destroys this connection.
|
void |
disconnect(boolean criticalError)
Disconnect the connection, closing all channels
|
void |
disconnect(String scaleDownNodeID,
boolean criticalError)
Disconnect the connection, closing all channels
|
boolean |
enableMessageID() |
void |
fail(ActiveMQException me)
called when the underlying connection fails.
|
void |
fail(ActiveMQException me,
String scaleDownTargetNodeID)
called when the underlying connection fails.
|
void |
flush()
flush all outstanding data from the connection.
|
Acceptor |
getAcceptorUsed() |
String |
getActiveMQServerName() |
String |
getClientID() |
long |
getCreationTime()
Returns the creation time of the
RemotingConnection. |
List<FailureListener> |
getFailureListeners()
return all the failure listeners
|
VersionedStompFrameHandler |
getFrameHandler() |
Object |
getID()
Returns the unique id of the
RemotingConnection. |
String |
getLogin() |
StompProtocolManager |
getManager() |
int |
getMinLargeMessageSize() |
String |
getPasscode() |
String |
getRemoteAddress()
returns a string representation of the remote address of this connection
|
StompSession |
getSession(String txID) |
Connection |
getTransportConnection()
return the underlying Connection.
|
String |
getVersion() |
void |
handleFrame(StompFrame request) |
boolean |
hasBytes() |
boolean |
isClient()
Returns whether or not the
RemotingConnection is a client |
boolean |
isDestroyed()
Returns true if this
RemotingConnection has been destroyed. |
boolean |
isSupportReconnect()
This will check if reconnects are supported on the protocol and configuration.
|
boolean |
isValid() |
boolean |
isWritable(ReadyListener callback) |
void |
killMessage(SimpleString nodeID)
if slow consumer is killed,send the msessage to client.
|
void |
negotiateVersion(StompFrame frame) |
void |
physicalSend(StompFrame frame) |
void |
ping(StompFrame pingFrame) |
boolean |
removeCloseListener(CloseListener listener)
remove a Close Listener
|
List<CloseListener> |
removeCloseListeners() |
boolean |
removeFailureListener(FailureListener listener)
remove the failure listener
|
List<FailureListener> |
removeFailureListeners() |
void |
sendFrame(StompFrame frame) |
protected void |
sendServerMessage(ServerMessageImpl message,
String txID) |
void |
setClientID(String clientID) |
void |
setCloseListeners(List<CloseListener> listeners) |
protected void |
setDataReceived() |
void |
setFailureListeners(List<FailureListener> listeners)
set the failure listeners.
|
void |
setHost(String host) |
void |
setValid(boolean valid) |
void |
unsubscribe(String subscriptionID,
String durableSubscriptionName) |
protected void |
validate() |
boolean |
validateUser(String login,
String pass,
X509Certificate[] certificates) |
protected static final String CONNECTION_ID_PROP
public boolean isSupportReconnect()
RemotingConnectionisSupportReconnect in interface RemotingConnectionpublic StompFrame decode(ActiveMQBuffer buffer) throws ActiveMQStompException
ActiveMQStompExceptionpublic boolean isWritable(ReadyListener callback)
isWritable in interface RemotingConnectionpublic boolean hasBytes()
public void addFailureListener(FailureListener listener)
RemotingConnectionThe listener will be called in the event of connection failure.
addFailureListener in interface RemotingConnectionlistener - the listenerpublic boolean removeFailureListener(FailureListener listener)
RemotingConnectionremoveFailureListener in interface RemotingConnectionlistener - the lister to removepublic void addCloseListener(CloseListener listener)
RemotingConnectionThis will be called in the event of the connection being closed.
addCloseListener in interface RemotingConnectionlistener - the listener to addpublic boolean removeCloseListener(CloseListener listener)
RemotingConnectionremoveCloseListener in interface RemotingConnectionlistener - the listener to removepublic List<CloseListener> removeCloseListeners()
removeCloseListeners in interface RemotingConnectionpublic List<FailureListener> removeFailureListeners()
removeFailureListeners in interface RemotingConnectionpublic void setCloseListeners(List<CloseListener> listeners)
setCloseListeners in interface RemotingConnectionpublic void setFailureListeners(List<FailureListener> listeners)
RemotingConnectionThese will be called in the event of the connection being closed. Any previosuly added listeners will be removed.
setFailureListeners in interface RemotingConnectionlisteners - the listeners to add.protected void setDataReceived()
public boolean checkDataReceived()
RemotingConnectioncheckDataReceived in interface RemotingConnectionpublic void checkDestination(String destination) throws ActiveMQStompException
ActiveMQStompExceptionpublic void autoCreateDestinationIfPossible(String queue) throws ActiveMQStompException
ActiveMQStompExceptionpublic ActiveMQBuffer createTransportBuffer(int size)
RemotingConnectioncreateTransportBuffer in interface RemotingConnectionsize - the size of buffer requiredpublic void destroy()
RemotingConnectiondestroy in interface RemotingConnectionpublic Acceptor getAcceptorUsed()
public void fail(ActiveMQException me)
RemotingConnectionfail in interface RemotingConnectionme - the exception that caused the failurepublic void fail(ActiveMQException me, String scaleDownTargetNodeID)
RemotingConnectionfail in interface RemotingConnectionme - the exception that caused the failurescaleDownTargetNodeID - the ID of the node where scale down is targetedpublic void flush()
RemotingConnectionflush in interface RemotingConnectionpublic List<FailureListener> getFailureListeners()
RemotingConnectiongetFailureListeners in interface RemotingConnectionpublic Object getID()
RemotingConnectionRemotingConnection.getID in interface RemotingConnectionpublic String getRemoteAddress()
RemotingConnectiongetRemoteAddress in interface RemotingConnectionpublic long getCreationTime()
RemotingConnectionRemotingConnection.getCreationTime in interface RemotingConnectionpublic Connection getTransportConnection()
RemotingConnectiongetTransportConnection in interface RemotingConnectionpublic boolean isClient()
RemotingConnectionRemotingConnection is a clientisClient in interface RemotingConnectionpublic boolean isDestroyed()
RemotingConnectionRemotingConnection has been destroyed.isDestroyed in interface RemotingConnectionpublic void bufferReceived(Object connectionID, ActiveMQBuffer buffer)
BufferHandlerbufferReceived in interface BufferHandlerconnectionID - the connection the buffer was received onbuffer - the buffer to decodepublic String getLogin()
public String getPasscode()
public void setClientID(String clientID)
public String getClientID()
public boolean isValid()
public void setValid(boolean valid)
public void negotiateVersion(StompFrame frame) throws ActiveMQStompException
ActiveMQStompExceptionpublic void setHost(String host) throws ActiveMQStompException
ActiveMQStompExceptionpublic void handleFrame(StompFrame request)
public void sendFrame(StompFrame frame)
public boolean validateUser(String login, String pass, X509Certificate[] certificates)
public ServerMessageImpl createServerMessage()
public StompSession getSession(String txID) throws ActiveMQStompException
ActiveMQStompExceptionprotected void validate()
throws ActiveMQStompException
ActiveMQStompExceptionprotected void sendServerMessage(ServerMessageImpl message, String txID) throws ActiveMQStompException
ActiveMQStompExceptionpublic void disconnect(boolean criticalError)
RemotingConnectiondisconnect in interface RemotingConnectionpublic void disconnect(String scaleDownNodeID, boolean criticalError)
RemotingConnectiondisconnect in interface RemotingConnectionprotected void beginTransaction(String txID) throws ActiveMQStompException
ActiveMQStompExceptionpublic void commitTransaction(String txID) throws ActiveMQStompException
ActiveMQStompExceptionpublic void abortTransaction(String txID) throws ActiveMQStompException
ActiveMQStompExceptionpublic void unsubscribe(String subscriptionID, String durableSubscriptionName) throws ActiveMQStompException
ActiveMQStompExceptionpublic void acknowledge(String messageID, String subscriptionID) throws ActiveMQStompException
ActiveMQStompExceptionpublic String getVersion()
public String getActiveMQServerName()
public StompFrame createStompMessage(ServerMessage serverMessage, StompSubscription subscription, int deliveryCount) throws Exception
Exceptionpublic void addStompEventListener(FrameEventListener listener)
public void ping(StompFrame pingFrame)
public void physicalSend(StompFrame frame) throws Exception
Exceptionpublic VersionedStompFrameHandler getFrameHandler()
public boolean enableMessageID()
public int getMinLargeMessageSize()
public StompProtocolManager getManager()
public void killMessage(SimpleString nodeID)
RemotingConnectionkillMessage in interface RemotingConnectionCopyright © 2024 The Apache Software Foundation. All rights reserved.