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()
RemotingConnection
isSupportReconnect
in interface RemotingConnection
public StompFrame decode(ActiveMQBuffer buffer) throws ActiveMQStompException
ActiveMQStompException
public boolean isWritable(ReadyListener callback)
isWritable
in interface RemotingConnection
public boolean hasBytes()
public void addFailureListener(FailureListener listener)
RemotingConnection
The listener will be called in the event of connection failure.
addFailureListener
in interface RemotingConnection
listener
- the listenerpublic boolean removeFailureListener(FailureListener listener)
RemotingConnection
removeFailureListener
in interface RemotingConnection
listener
- the lister to removepublic void addCloseListener(CloseListener listener)
RemotingConnection
This will be called in the event of the connection being closed.
addCloseListener
in interface RemotingConnection
listener
- the listener to addpublic boolean removeCloseListener(CloseListener listener)
RemotingConnection
removeCloseListener
in interface RemotingConnection
listener
- the listener to removepublic List<CloseListener> removeCloseListeners()
removeCloseListeners
in interface RemotingConnection
public List<FailureListener> removeFailureListeners()
removeFailureListeners
in interface RemotingConnection
public void setCloseListeners(List<CloseListener> listeners)
setCloseListeners
in interface RemotingConnection
public void setFailureListeners(List<FailureListener> listeners)
RemotingConnection
These will be called in the event of the connection being closed. Any previosuly added listeners will be removed.
setFailureListeners
in interface RemotingConnection
listeners
- the listeners to add.protected void setDataReceived()
public boolean checkDataReceived()
RemotingConnection
checkDataReceived
in interface RemotingConnection
public void checkDestination(String destination) throws ActiveMQStompException
ActiveMQStompException
public void autoCreateDestinationIfPossible(String queue) throws ActiveMQStompException
ActiveMQStompException
public ActiveMQBuffer createTransportBuffer(int size)
RemotingConnection
createTransportBuffer
in interface RemotingConnection
size
- the size of buffer requiredpublic void destroy()
RemotingConnection
destroy
in interface RemotingConnection
public Acceptor getAcceptorUsed()
public void fail(ActiveMQException me)
RemotingConnection
fail
in interface RemotingConnection
me
- the exception that caused the failurepublic void fail(ActiveMQException me, String scaleDownTargetNodeID)
RemotingConnection
fail
in interface RemotingConnection
me
- the exception that caused the failurescaleDownTargetNodeID
- the ID of the node where scale down is targetedpublic void flush()
RemotingConnection
flush
in interface RemotingConnection
public List<FailureListener> getFailureListeners()
RemotingConnection
getFailureListeners
in interface RemotingConnection
public Object getID()
RemotingConnection
RemotingConnection
.getID
in interface RemotingConnection
public String getRemoteAddress()
RemotingConnection
getRemoteAddress
in interface RemotingConnection
public long getCreationTime()
RemotingConnection
RemotingConnection
.getCreationTime
in interface RemotingConnection
public Connection getTransportConnection()
RemotingConnection
getTransportConnection
in interface RemotingConnection
public boolean isClient()
RemotingConnection
RemotingConnection
is a clientisClient
in interface RemotingConnection
public boolean isDestroyed()
RemotingConnection
RemotingConnection
has been destroyed.isDestroyed
in interface RemotingConnection
public void bufferReceived(Object connectionID, ActiveMQBuffer buffer)
BufferHandler
bufferReceived
in interface BufferHandler
connectionID
- 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
ActiveMQStompException
public void setHost(String host) throws ActiveMQStompException
ActiveMQStompException
public 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
ActiveMQStompException
protected void validate() throws ActiveMQStompException
ActiveMQStompException
protected void sendServerMessage(ServerMessageImpl message, String txID) throws ActiveMQStompException
ActiveMQStompException
public void disconnect(boolean criticalError)
RemotingConnection
disconnect
in interface RemotingConnection
public void disconnect(String scaleDownNodeID, boolean criticalError)
RemotingConnection
disconnect
in interface RemotingConnection
protected void beginTransaction(String txID) throws ActiveMQStompException
ActiveMQStompException
public void commitTransaction(String txID) throws ActiveMQStompException
ActiveMQStompException
public void abortTransaction(String txID) throws ActiveMQStompException
ActiveMQStompException
public void unsubscribe(String subscriptionID, String durableSubscriptionName) throws ActiveMQStompException
ActiveMQStompException
public void acknowledge(String messageID, String subscriptionID) throws ActiveMQStompException
ActiveMQStompException
public String getVersion()
public String getActiveMQServerName()
public StompFrame createStompMessage(ServerMessage serverMessage, StompSubscription subscription, int deliveryCount) throws Exception
Exception
public void addStompEventListener(FrameEventListener listener)
public void ping(StompFrame pingFrame)
public void physicalSend(StompFrame frame) throws Exception
Exception
public VersionedStompFrameHandler getFrameHandler()
public boolean enableMessageID()
public int getMinLargeMessageSize()
public StompProtocolManager getManager()
public void killMessage(SimpleString nodeID)
RemotingConnection
killMessage
in interface RemotingConnection
Copyright © 2016 The Apache Software Foundation. All rights reserved.