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) |
protected void |
beginTransaction(String txID) |
void |
bufferReceived(Object connectionID,
HornetQBuffer 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) |
HornetQBuffer |
createBuffer(int size)
creates a new HornetQBuffer of the specified size.
|
ServerMessageImpl |
createServerMessage() |
StompFrame |
createStompMessage(ServerMessage serverMessage,
StompSubscription subscription,
int deliveryCount) |
StompFrame |
decode(HornetQBuffer buffer) |
void |
destroy()
destroys this connection.
|
void |
disconnect(boolean criticalError)
Disconnect the connection, closing all channels
|
boolean |
enableMessageID() |
void |
fail(HornetQException me)
called when the underlying connection fails.
|
void |
flush()
flush all outstanding data from the connection.
|
String |
getClientID() |
long |
getCreationTime()
Returns the creation time of the
RemotingConnection. |
List<FailureListener> |
getFailureListeners()
return all the failure listeners
|
VersionedStompFrameHandler |
getFrameHandler() |
String |
getHornetQServerName() |
Object |
getID()
Returns the unique id of the
RemotingConnection. |
String |
getLogin() |
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 |
isValid() |
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 durableSubscriberName) |
protected void |
validate() |
boolean |
validateUser(String login1,
String passcode1) |
protected static final String CONNECTION_ID_PROP
public StompFrame decode(HornetQBuffer buffer) throws HornetQStompException
HornetQStompExceptionpublic boolean hasBytes()
public void addFailureListener(FailureListener listener)
RemotingConnectionaddFailureListener in interface RemotingConnectionlistener - the listenerpublic boolean removeFailureListener(FailureListener listener)
RemotingConnectionremoveFailureListener in interface RemotingConnectionlistener - the lister to removepublic void addCloseListener(CloseListener listener)
RemotingConnectionaddCloseListener 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)
RemotingConnectionsetFailureListeners in interface RemotingConnectionlisteners - the listeners to add.protected void setDataReceived()
public boolean checkDataReceived()
RemotingConnectioncheckDataReceived in interface RemotingConnectionpublic void checkDestination(String destination) throws HornetQStompException
HornetQStompExceptionpublic HornetQBuffer createBuffer(int size)
RemotingConnectioncreateBuffer in interface RemotingConnectionsize - the size of buffer requiredpublic void destroy()
RemotingConnectiondestroy in interface RemotingConnectionpublic void fail(HornetQException me)
RemotingConnectionfail in interface RemotingConnectionme - the exception that caused the failurepublic 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, HornetQBuffer 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 HornetQStompException
HornetQStompExceptionpublic void setHost(String host) throws HornetQStompException
HornetQStompExceptionpublic void handleFrame(StompFrame request)
public void sendFrame(StompFrame frame)
public ServerMessageImpl createServerMessage()
public StompSession getSession(String txID) throws HornetQStompException
HornetQStompExceptionprotected void validate()
throws HornetQStompException
HornetQStompExceptionprotected void sendServerMessage(ServerMessageImpl message, String txID) throws HornetQStompException
HornetQStompExceptionpublic void disconnect(boolean criticalError)
RemotingConnectiondisconnect in interface RemotingConnectionprotected void beginTransaction(String txID) throws HornetQStompException
HornetQStompExceptionpublic void commitTransaction(String txID) throws HornetQStompException
HornetQStompExceptionpublic void abortTransaction(String txID) throws HornetQStompException
HornetQStompExceptionpublic void unsubscribe(String subscriptionID, String durableSubscriberName) throws HornetQStompException
HornetQStompExceptionpublic void acknowledge(String messageID, String subscriptionID) throws HornetQStompException
HornetQStompExceptionpublic String getVersion()
public String getHornetQServerName()
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()
Copyright © 2013 JBoss, a division of Red Hat. All rights reserved.