|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.qpid.client.protocol.AMQProtocolSession
public class AMQProtocolSession
Wrapper for protocol session that provides type-safe access to session attributes.
The underlying protocol session is still available but clients should not use it to obtain session attributes.
Field Summary | |
---|---|
protected ConcurrentMap<Integer,AMQSession> |
_channelId2SessionMap
Maps from the channel id to the AMQSession that it represents. |
protected ConcurrentMap |
_closingChannels
|
protected AMQConnection |
_connection
|
protected static org.slf4j.Logger |
_logger
|
protected AMQProtocolHandler |
_protocolHandler
The handler from which this session was created and which is used to handle protocol events. |
protected int |
_queueId
Counter to ensure unique queue names |
protected Object |
_queueIdLock
|
protected static String |
AMQ_CONNECTION
|
protected static String |
CONNECTION_TUNE_PARAMETERS
|
protected static int |
LAST_WRITE_FUTURE_JOIN_TIMEOUT
|
static String |
PROTOCOL_INITIATION_RECEIVED
|
protected static String |
SASL_CLIENT
|
Constructor Summary | |
---|---|
AMQProtocolSession(AMQProtocolHandler protocolHandler,
AMQConnection connection)
|
Method Summary | |
---|---|
boolean |
channelClosed(int channelId,
org.apache.qpid.protocol.AMQConstant code,
String text)
Called from the ChannelClose handler when a channel close frame is received. |
void |
closeProtocolSession()
|
void |
closeSession(AMQSession session)
Starts the process of closing a session |
void |
confirmConsumerCancelled(int channelId,
org.apache.qpid.framing.AMQShortString consumerTag)
|
void |
contentBodyReceived(int channelId,
org.apache.qpid.framing.ContentBody contentBody)
|
void |
contentHeaderReceived(int channelId,
org.apache.qpid.framing.ContentHeaderBody contentHeader)
|
void |
failover(String host,
int port)
|
protected org.apache.qpid.framing.AMQShortString |
generateQueueName()
|
AMQConnection |
getAMQConnection()
|
String |
getClientID()
|
ConnectionTuneParameters |
getConnectionTuneParameters()
|
org.apache.qpid.framing.MethodDispatcher |
getMethodDispatcher()
|
org.apache.qpid.framing.MethodRegistry |
getMethodRegistry()
|
String |
getPassword()
|
byte |
getProtocolMajorVersion()
|
byte |
getProtocolMinorVersion()
|
org.apache.qpid.framing.ProtocolVersion |
getProtocolVersion()
|
SaslClient |
getSaslClient()
|
protected AMQSession |
getSession(int channelId)
|
AMQStateManager |
getStateManager()
|
String |
getUsername()
|
String |
getVirtualHost()
|
void |
heartbeatBodyReceived(int channelId,
org.apache.qpid.framing.HeartbeatBody body)
|
void |
init()
|
void |
methodFrameReceived(int channel,
org.apache.qpid.framing.AMQMethodBody amqMethodBody)
|
void |
notifyError(Exception error)
|
void |
setClientID(String clientID)
|
void |
setConnectionTuneParameters(ConnectionTuneParameters params)
|
void |
setFlowControl(int channelId,
boolean active)
|
void |
setMethodDispatcher(org.apache.qpid.framing.MethodDispatcher methodDispatcher)
|
void |
setProtocolVersion(org.apache.qpid.framing.ProtocolVersion pv)
|
void |
setSaslClient(SaslClient client)
Store the SASL client currently being used for the authentication handshake |
void |
setSender(org.apache.qpid.transport.Sender<ByteBuffer> sender)
|
void |
setTicket(int ticket,
int channelId)
|
String |
toString()
|
void |
unprocessedMessageReceived(int channelId,
UnprocessedMessage message)
Callback invoked from the BasicDeliverMethodHandler when a message has been received. |
void |
writeFrame(org.apache.qpid.framing.AMQDataBlock frame)
Convenience method that writes a frame to the protocol session. |
void |
writeFrame(org.apache.qpid.framing.AMQDataBlock frame,
boolean wait)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final int LAST_WRITE_FUTURE_JOIN_TIMEOUT
protected static final org.slf4j.Logger _logger
public static final String PROTOCOL_INITIATION_RECEIVED
protected static final String CONNECTION_TUNE_PARAMETERS
protected static final String AMQ_CONNECTION
protected static final String SASL_CLIENT
protected final AMQProtocolHandler _protocolHandler
protected ConcurrentMap<Integer,AMQSession> _channelId2SessionMap
protected ConcurrentMap _closingChannels
protected int _queueId
protected final Object _queueIdLock
protected final AMQConnection _connection
Constructor Detail |
---|
public AMQProtocolSession(AMQProtocolHandler protocolHandler, AMQConnection connection)
Method Detail |
---|
public void init()
init
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
public String getClientID()
public void setClientID(String clientID) throws JMSException
JMSException
public AMQStateManager getStateManager()
public String getVirtualHost()
public String getUsername()
public String getPassword()
public SaslClient getSaslClient()
public void setSaslClient(SaslClient client)
client
- if non-null, stores this in the session. if null clears any existing client being storedpublic ConnectionTuneParameters getConnectionTuneParameters()
public void setConnectionTuneParameters(ConnectionTuneParameters params)
public void unprocessedMessageReceived(int channelId, UnprocessedMessage message) throws org.apache.qpid.AMQException
message
-
org.apache.qpid.AMQException
- if this was not expectedpublic void contentHeaderReceived(int channelId, org.apache.qpid.framing.ContentHeaderBody contentHeader) throws org.apache.qpid.AMQException
contentHeaderReceived
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
org.apache.qpid.AMQException
public void contentBodyReceived(int channelId, org.apache.qpid.framing.ContentBody contentBody) throws org.apache.qpid.AMQException
contentBodyReceived
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
org.apache.qpid.AMQException
public void heartbeatBodyReceived(int channelId, org.apache.qpid.framing.HeartbeatBody body) throws org.apache.qpid.AMQException
heartbeatBodyReceived
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
org.apache.qpid.AMQException
protected AMQSession getSession(int channelId)
public void writeFrame(org.apache.qpid.framing.AMQDataBlock frame)
writeFrame
in interface org.apache.qpid.protocol.AMQProtocolWriter
frame
- the frame to writepublic void writeFrame(org.apache.qpid.framing.AMQDataBlock frame, boolean wait)
public void closeSession(AMQSession session)
session
- the AMQSession being closedpublic boolean channelClosed(int channelId, org.apache.qpid.protocol.AMQConstant code, String text) throws org.apache.qpid.AMQException
channelId
- the id of the channel (session)
org.apache.qpid.AMQException
public AMQConnection getAMQConnection()
public void closeProtocolSession() throws org.apache.qpid.AMQException
org.apache.qpid.AMQException
public void failover(String host, int port)
protected org.apache.qpid.framing.AMQShortString generateQueueName()
public void confirmConsumerCancelled(int channelId, org.apache.qpid.framing.AMQShortString consumerTag)
public void setProtocolVersion(org.apache.qpid.framing.ProtocolVersion pv)
public byte getProtocolMinorVersion()
getProtocolMinorVersion
in interface org.apache.qpid.protocol.ProtocolVersionAware
public byte getProtocolMajorVersion()
getProtocolMajorVersion
in interface org.apache.qpid.protocol.ProtocolVersionAware
public org.apache.qpid.framing.ProtocolVersion getProtocolVersion()
getProtocolVersion
in interface org.apache.qpid.protocol.ProtocolVersionAware
public org.apache.qpid.framing.MethodRegistry getMethodRegistry()
getMethodRegistry
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
public org.apache.qpid.framing.MethodDispatcher getMethodDispatcher()
public void setTicket(int ticket, int channelId)
public void setMethodDispatcher(org.apache.qpid.framing.MethodDispatcher methodDispatcher)
public void setFlowControl(int channelId, boolean active)
public void methodFrameReceived(int channel, org.apache.qpid.framing.AMQMethodBody amqMethodBody) throws org.apache.qpid.AMQException
methodFrameReceived
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
org.apache.qpid.AMQException
public void notifyError(Exception error)
public void setSender(org.apache.qpid.transport.Sender<ByteBuffer> sender)
setSender
in interface org.apache.qpid.protocol.AMQVersionAwareProtocolSession
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |