Class AmqpConnection
- java.lang.Object
-
- org.apache.activemq.transport.amqp.protocol.AmqpConnection
-
- All Implemented Interfaces:
AmqpProtocolConverter
public class AmqpConnection extends Object implements AmqpProtocolConverter
Implements the mechanics of managing a single remote peer connection.
-
-
Constructor Summary
Constructors Constructor Description AmqpConnection(AmqpTransport transport, BrokerService brokerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getClientId()
int
getConfiguredReceiverCredit()
String
getConfiguredTransformer()
protected org.apache.qpid.proton.amqp.Symbol[]
getConnectionCapabilitiesOffered()
Load and return a[]Symbol
that contains the connection capabilities offered to new connectionsConnectionId
getConnectionId()
protected Map<org.apache.qpid.proton.amqp.Symbol,Object>
getConnetionProperties()
Load and return aMap
that contains the properties that this connection supplies to incoming connections.protected Map<org.apache.qpid.proton.amqp.Symbol,Object>
getFailedConnetionProperties()
Load and return aMap
that contains the properties that this connection supplies to incoming connections when the open has failed and the remote should expect a close to follow.long
getMaxFrameSize()
long
keepAlive()
Perform any keep alive processing for the connection such as sending empty frames or closing connections due to remote end being inactive for to long.void
onActiveMQCommand(Command command)
Incoming Command object from ActiveMQ.void
onAMQPData(Object command)
A new incoming data packet from the remote peer is handed off to the protocol converter for processing.void
onAMQPException(IOException error)
Called when the transport detects an exception that the converter needs to respond to.protected void
processConnectionClose(org.apache.qpid.proton.engine.Connection connection)
protected void
processConnectionOpen(org.apache.qpid.proton.engine.Connection connection)
protected void
processDelivery(org.apache.qpid.proton.engine.Delivery delivery)
protected void
processLinkClose(org.apache.qpid.proton.engine.Link link)
protected void
processLinkDetach(org.apache.qpid.proton.engine.Link link)
protected void
processLinkFlow(org.apache.qpid.proton.engine.Link link)
protected void
processLinkOpen(org.apache.qpid.proton.engine.Link link)
protected void
processSessionClose(org.apache.qpid.proton.engine.Session protonSession)
protected void
processSessionOpen(org.apache.qpid.proton.engine.Session protonSession)
void
updateTracer()
On changes to the transport tracing options the Protocol Converter should update its internal state so that the proper AMQP data is logged.
-
-
-
Constructor Detail
-
AmqpConnection
public AmqpConnection(AmqpTransport transport, BrokerService brokerService)
-
-
Method Detail
-
getConnectionCapabilitiesOffered
protected org.apache.qpid.proton.amqp.Symbol[] getConnectionCapabilitiesOffered()
Load and return a[]Symbol
that contains the connection capabilities offered to new connections- Returns:
- the capabilities that are offered to new clients on connect.
-
getConnetionProperties
protected Map<org.apache.qpid.proton.amqp.Symbol,Object> getConnetionProperties()
Load and return aMap
that contains the properties that this connection supplies to incoming connections.- Returns:
- the properties that are offered to the incoming connection.
-
getFailedConnetionProperties
protected Map<org.apache.qpid.proton.amqp.Symbol,Object> getFailedConnetionProperties()
Load and return aMap
that contains the properties that this connection supplies to incoming connections when the open has failed and the remote should expect a close to follow.- Returns:
- the properties that are offered to the incoming connection.
-
updateTracer
public void updateTracer()
Description copied from interface:AmqpProtocolConverter
On changes to the transport tracing options the Protocol Converter should update its internal state so that the proper AMQP data is logged.- Specified by:
updateTracer
in interfaceAmqpProtocolConverter
-
keepAlive
public long keepAlive() throws IOException
Description copied from interface:AmqpProtocolConverter
Perform any keep alive processing for the connection such as sending empty frames or closing connections due to remote end being inactive for to long.- Specified by:
keepAlive
in interfaceAmqpProtocolConverter
- Throws:
IOException
- if an error occurs on writing heart-beats to the wire.
-
getConfiguredReceiverCredit
public int getConfiguredReceiverCredit()
- Returns:
- the amount of credit assigned to AMQP receiver links created from sender links on the remote peer.
-
getConfiguredTransformer
public String getConfiguredTransformer()
- Returns:
- the transformer type that was configured for this AMQP transport.
-
getConnectionId
public ConnectionId getConnectionId()
- Returns:
- the ActiveMQ ConnectionId that identifies this AMQP Connection.
-
getClientId
public String getClientId()
- Returns:
- the Client ID used to create the connection with ActiveMQ
-
getMaxFrameSize
public long getMaxFrameSize()
- Returns:
- the configured max frame size allowed for incoming messages.
-
onAMQPData
public void onAMQPData(Object command) throws Exception
Description copied from interface:AmqpProtocolConverter
A new incoming data packet from the remote peer is handed off to the protocol converter for processing. The type can vary and be either an AmqpHeader at the handshake phase or a byte buffer containing the next incoming frame data from the remote.- Specified by:
onAMQPData
in interfaceAmqpProtocolConverter
- Parameters:
command
- the next incoming data object from the remote peer.- Throws:
Exception
- if an error occurs processing the incoming data packet.
-
processConnectionOpen
protected void processConnectionOpen(org.apache.qpid.proton.engine.Connection connection) throws Exception
- Throws:
Exception
-
processConnectionClose
protected void processConnectionClose(org.apache.qpid.proton.engine.Connection connection) throws Exception
- Throws:
Exception
-
processSessionOpen
protected void processSessionOpen(org.apache.qpid.proton.engine.Session protonSession) throws Exception
- Throws:
Exception
-
processSessionClose
protected void processSessionClose(org.apache.qpid.proton.engine.Session protonSession) throws Exception
- Throws:
Exception
-
processLinkOpen
protected void processLinkOpen(org.apache.qpid.proton.engine.Link link) throws Exception
- Throws:
Exception
-
processLinkDetach
protected void processLinkDetach(org.apache.qpid.proton.engine.Link link) throws Exception
- Throws:
Exception
-
processLinkClose
protected void processLinkClose(org.apache.qpid.proton.engine.Link link) throws Exception
- Throws:
Exception
-
processLinkFlow
protected void processLinkFlow(org.apache.qpid.proton.engine.Link link) throws Exception
- Throws:
Exception
-
processDelivery
protected void processDelivery(org.apache.qpid.proton.engine.Delivery delivery) throws Exception
- Throws:
Exception
-
onAMQPException
public void onAMQPException(IOException error)
Description copied from interface:AmqpProtocolConverter
Called when the transport detects an exception that the converter needs to respond to.- Specified by:
onAMQPException
in interfaceAmqpProtocolConverter
- Parameters:
error
- the error that triggered this call.
-
onActiveMQCommand
public void onActiveMQCommand(Command command) throws Exception
Description copied from interface:AmqpProtocolConverter
Incoming Command object from ActiveMQ.- Specified by:
onActiveMQCommand
in interfaceAmqpProtocolConverter
- Parameters:
command
- the next incoming command from the broker.- Throws:
Exception
- if an error occurs processing the command.
-
-