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) |
ServerMessageImpl |
createServerMessage() |
StompFrame |
createStompMessage(ServerMessage serverMessage,
StompSubscription subscription,
int deliveryCount) |
HornetQBuffer |
createTransportBuffer(int size)
creates a new HornetQBuffer of the specified size.
|
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
HornetQStompException
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 HornetQStompException
HornetQStompException
public HornetQBuffer createTransportBuffer(int size)
RemotingConnection
createTransportBuffer
in interface RemotingConnection
size
- the size of buffer requiredpublic void destroy()
RemotingConnection
destroy
in interface RemotingConnection
public void fail(HornetQException me)
RemotingConnection
fail
in interface RemotingConnection
me
- the exception that caused the failurepublic 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, HornetQBuffer 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 HornetQStompException
HornetQStompException
public void setHost(String host) throws HornetQStompException
HornetQStompException
public void handleFrame(StompFrame request)
public void sendFrame(StompFrame frame)
public ServerMessageImpl createServerMessage()
public StompSession getSession(String txID) throws HornetQStompException
HornetQStompException
protected void validate() throws HornetQStompException
HornetQStompException
protected void sendServerMessage(ServerMessageImpl message, String txID) throws HornetQStompException
HornetQStompException
public void disconnect(boolean criticalError)
RemotingConnection
disconnect
in interface RemotingConnection
protected void beginTransaction(String txID) throws HornetQStompException
HornetQStompException
public void commitTransaction(String txID) throws HornetQStompException
HornetQStompException
public void abortTransaction(String txID) throws HornetQStompException
HornetQStompException
public void unsubscribe(String subscriptionID, String durableSubscriberName) throws HornetQStompException
HornetQStompException
public void acknowledge(String messageID, String subscriptionID) throws HornetQStompException
HornetQStompException
public String getVersion()
public String getHornetQServerName()
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()
Copyright © 2016 JBoss, a division of Red Hat. All rights reserved.