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 StringgetClientId()intgetConfiguredReceiverCredit()StringgetConfiguredTransformer()protected org.apache.qpid.proton.amqp.Symbol[]getConnectionCapabilitiesOffered()Load and return a[]Symbolthat contains the connection capabilities offered to new connectionsConnectionIdgetConnectionId()protected Map<org.apache.qpid.proton.amqp.Symbol,Object>getConnetionProperties()Load and return aMapthat contains the properties that this connection supplies to incoming connections.protected Map<org.apache.qpid.proton.amqp.Symbol,Object>getFailedConnetionProperties()Load and return aMapthat contains the properties that this connection supplies to incoming connections when the open has failed and the remote should expect a close to follow.longgetMaxFrameSize()longkeepAlive()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.voidonActiveMQCommand(Command command)Incoming Command object from ActiveMQ.voidonAMQPData(Object command)A new incoming data packet from the remote peer is handed off to the protocol converter for processing.voidonAMQPException(IOException error)Called when the transport detects an exception that the converter needs to respond to.protected voidprocessConnectionClose(org.apache.qpid.proton.engine.Connection connection)protected voidprocessConnectionOpen(org.apache.qpid.proton.engine.Connection connection)protected voidprocessDelivery(org.apache.qpid.proton.engine.Delivery delivery)protected voidprocessLinkClose(org.apache.qpid.proton.engine.Link link)protected voidprocessLinkDetach(org.apache.qpid.proton.engine.Link link)protected voidprocessLinkFlow(org.apache.qpid.proton.engine.Link link)protected voidprocessLinkOpen(org.apache.qpid.proton.engine.Link link)protected voidprocessSessionClose(org.apache.qpid.proton.engine.Session protonSession)protected voidprocessSessionOpen(org.apache.qpid.proton.engine.Session protonSession)voidupdateTracer()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[]Symbolthat 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 aMapthat 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 aMapthat 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:AmqpProtocolConverterOn changes to the transport tracing options the Protocol Converter should update its internal state so that the proper AMQP data is logged.- Specified by:
updateTracerin interfaceAmqpProtocolConverter
-
keepAlive
public long keepAlive() throws IOExceptionDescription copied from interface:AmqpProtocolConverterPerform 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:
keepAlivein 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:AmqpProtocolConverterA 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:
onAMQPDatain 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:AmqpProtocolConverterCalled when the transport detects an exception that the converter needs to respond to.- Specified by:
onAMQPExceptionin interfaceAmqpProtocolConverter- Parameters:
error- the error that triggered this call.
-
onActiveMQCommand
public void onActiveMQCommand(Command command) throws Exception
Description copied from interface:AmqpProtocolConverterIncoming Command object from ActiveMQ.- Specified by:
onActiveMQCommandin interfaceAmqpProtocolConverter- Parameters:
command- the next incoming command from the broker.- Throws:
Exception- if an error occurs processing the command.
-
-