Class AMQPConnectionContext
- java.lang.Object
-
- org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
-
- org.apache.activemq.artemis.protocol.amqp.proton.AMQPConnectionContext
-
- All Implemented Interfaces:
EventHandler
public class AMQPConnectionContext extends ProtonInitializable implements EventHandler
-
-
Field Summary
Fields Modifier and Type Field Description static StringAMQP_CONTAINER_IDstatic org.apache.qpid.proton.amqp.SymbolCONNECTION_OPEN_FAILEDprotected ProtonHandlerhandler-
Fields inherited from class org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
initialized
-
-
Constructor Summary
Constructors Constructor Description AMQPConnectionContext(ProtonProtocolManager protocolManager, AMQPConnectionCallback connectionSP, String containerId, int idleTimeout, int maxFrameSize, int channelMax, boolean useCoreSubscriptionNaming, ScheduledExecutorService scheduledPool, boolean isIncomingConnection, ClientSASLFactory saslClientFactory, Map<org.apache.qpid.proton.amqp.Symbol,Object> connectionProperties)AMQPConnectionContext(ProtonProtocolManager protocolManager, AMQPConnectionCallback connectionSP, String containerId, int idleTimeout, int maxFrameSize, int channelMax, boolean useCoreSubscriptionNaming, ScheduledExecutorService scheduledPool, boolean isIncomingConnection, ClientSASLFactory saslClientFactory, Map<org.apache.qpid.proton.amqp.Symbol,Object> connectionProperties, boolean bridgeConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEventHandler(EventHandler eventHandler)AMQPConnectionContextaddLinkRemoteCloseListener(String id, LinkCloseListener linkCloseListener)Adds a listener that will be invoked any time an AMQP link is remotely closed before having been closed on this end of the connection.voidafterFlush(Runnable runnable)booleancheckDataReceived()voidclearLinkRemoteCloseListeners()Clear all link remote close listeners, usually done before connection termination to avoid any remote close events triggering processing after the connection shutdown has already started.voidclose(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition)voiddestroy()voiddisableAutoRead()voidenableAutoRead()booleanflowControl(ReadyListener readyListener)voidflush()intgetAmqpCredits()intgetAmqpLowCredits()AMQPConnectionCallbackgetConnectionCallback()org.apache.qpid.proton.amqp.Symbol[]getConnectionCapabilitiesOffered()StringgetContainer()longgetCreationTime()ProtonHandlergetHandler()StringgetPassword()ProtonProtocolManagergetProtocolManager()StringgetPubSubPrefix()StringgetRemoteAddress()StringgetRemoteContainer()ClientSASLFactorygetSaslClientFactory()SASLResultgetSASLResult()org.apache.activemq.artemis.core.security.SecurityAuthgetSecurityAuth()AMQPSessionContextgetSessionExtension(org.apache.qpid.proton.engine.Session realSession)Map<org.apache.qpid.proton.engine.Session,AMQPSessionContext>getSessions()StringgetUser()StringgetValidatedUser()voidinitialize()protected voidinitInternal()voidinputBuffer(io.netty.buffer.ByteBuf buffer)voidinstantFlush()booleanisBridgeConnection()booleanisHandler()booleanisIncomingConnection()booleanisLargeMessageSync()booleanisSyncOnFlush()booleanisUseCoreSubscriptionNaming()protected AMQPSessionContextnewSessionExtension(org.apache.qpid.proton.engine.Session realSession)voidonAuthFailed(ProtonHandler protonHandler, org.apache.qpid.proton.engine.Connection connection)voidonAuthInit(ProtonHandler handler, org.apache.qpid.proton.engine.Connection connection, boolean sasl)voidonAuthSuccess(ProtonHandler protonHandler, org.apache.qpid.proton.engine.Connection connection)voidonDelivery(org.apache.qpid.proton.engine.Delivery delivery)voidonFlow(org.apache.qpid.proton.engine.Link link)voidonLocalDetach(org.apache.qpid.proton.engine.Link link)voidonLocalOpen(org.apache.qpid.proton.engine.Session session)voidonRemoteClose(org.apache.qpid.proton.engine.Connection connection)voidonRemoteClose(org.apache.qpid.proton.engine.Link link)voidonRemoteClose(org.apache.qpid.proton.engine.Session session)voidonRemoteDetach(org.apache.qpid.proton.engine.Link link)voidonRemoteOpen(org.apache.qpid.proton.engine.Connection connection)voidonRemoteOpen(org.apache.qpid.proton.engine.Link link)voidonRemoteOpen(org.apache.qpid.proton.engine.Session session)voidonSaslMechanismsOffered(ProtonHandler handler, String[] mechanisms)voidonSaslRemoteMechanismChosen(ProtonHandler handler, String mech)voidonTransport(org.apache.qpid.proton.engine.Transport transport)voidopen()voidpushBytes(io.netty.buffer.ByteBuf bytes)protected voidremoteLinkOpened(org.apache.qpid.proton.engine.Link link)voidremoveLinkRemoteCloseListener(String id)Remove the link remote close listener that is identified by the given ID.voidrequireInHandler()voidrunLater(Runnable run)voidrunNow(Runnable run)voidrunOnPool(Runnable run)voidscheduledFlush()protected booleanvalidateConnection(org.apache.qpid.proton.engine.Connection connection)-
Methods inherited from class org.apache.activemq.artemis.protocol.amqp.proton.ProtonInitializable
isInitialized
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.activemq.artemis.protocol.amqp.proton.handler.EventHandler
onFinal, onFinal, onFinal, onInit, onInit, onInit, onLocalClose, onLocalClose, onLocalClose, onLocalOpen, onLocalOpen
-
-
-
-
Field Detail
-
CONNECTION_OPEN_FAILED
public static final org.apache.qpid.proton.amqp.Symbol CONNECTION_OPEN_FAILED
-
AMQP_CONTAINER_ID
public static final String AMQP_CONTAINER_ID
- See Also:
- Constant Field Values
-
handler
protected final ProtonHandler handler
-
-
Constructor Detail
-
AMQPConnectionContext
public AMQPConnectionContext(ProtonProtocolManager protocolManager, AMQPConnectionCallback connectionSP, String containerId, int idleTimeout, int maxFrameSize, int channelMax, boolean useCoreSubscriptionNaming, ScheduledExecutorService scheduledPool, boolean isIncomingConnection, ClientSASLFactory saslClientFactory, Map<org.apache.qpid.proton.amqp.Symbol,Object> connectionProperties)
-
AMQPConnectionContext
public AMQPConnectionContext(ProtonProtocolManager protocolManager, AMQPConnectionCallback connectionSP, String containerId, int idleTimeout, int maxFrameSize, int channelMax, boolean useCoreSubscriptionNaming, ScheduledExecutorService scheduledPool, boolean isIncomingConnection, ClientSASLFactory saslClientFactory, Map<org.apache.qpid.proton.amqp.Symbol,Object> connectionProperties, boolean bridgeConnection)
-
-
Method Detail
-
disableAutoRead
public void disableAutoRead()
-
enableAutoRead
public void enableAutoRead()
-
isLargeMessageSync
public boolean isLargeMessageSync()
-
initialize
public void initialize() throws Exception- Specified by:
initializein classProtonInitializable- Throws:
Exception
-
addLinkRemoteCloseListener
public AMQPConnectionContext addLinkRemoteCloseListener(String id, LinkCloseListener linkCloseListener)
Adds a listener that will be invoked any time an AMQP link is remotely closed before having been closed on this end of the connection.- Parameters:
id- A unique ID assigned to the listener used to later remove it if needed.linkCloseListener- The instance of a closed listener.- Returns:
- this connection context instance.
-
removeLinkRemoteCloseListener
public void removeLinkRemoteCloseListener(String id)
Remove the link remote close listener that is identified by the given ID.- Parameters:
id- The unique ID assigned to the listener when it was added.
-
clearLinkRemoteCloseListeners
public void clearLinkRemoteCloseListeners()
Clear all link remote close listeners, usually done before connection termination to avoid any remote close events triggering processing after the connection shutdown has already started.
-
isBridgeConnection
public boolean isBridgeConnection()
-
requireInHandler
public void requireInHandler()
-
isHandler
public boolean isHandler()
-
scheduledFlush
public void scheduledFlush()
-
isIncomingConnection
public boolean isIncomingConnection()
-
getSaslClientFactory
public ClientSASLFactory getSaslClientFactory()
-
newSessionExtension
protected AMQPSessionContext newSessionExtension(org.apache.qpid.proton.engine.Session realSession) throws ActiveMQAMQPException
- Throws:
ActiveMQAMQPException
-
getSessions
public Map<org.apache.qpid.proton.engine.Session,AMQPSessionContext> getSessions()
-
getSecurityAuth
public org.apache.activemq.artemis.core.security.SecurityAuth getSecurityAuth()
-
getSASLResult
public SASLResult getSASLResult()
-
inputBuffer
public void inputBuffer(io.netty.buffer.ByteBuf buffer)
-
getHandler
public ProtonHandler getHandler()
-
getUser
public String getUser()
-
getPassword
public String getPassword()
-
getValidatedUser
public String getValidatedUser()
-
destroy
public void destroy()
-
isSyncOnFlush
public boolean isSyncOnFlush()
-
instantFlush
public void instantFlush()
-
flush
public void flush()
-
afterFlush
public void afterFlush(Runnable runnable)
-
close
public void close(org.apache.qpid.proton.amqp.transport.ErrorCondition errorCondition)
-
getSessionExtension
public AMQPSessionContext getSessionExtension(org.apache.qpid.proton.engine.Session realSession) throws ActiveMQAMQPException
- Throws:
ActiveMQAMQPException
-
runOnPool
public void runOnPool(Runnable run)
-
runNow
public void runNow(Runnable run)
-
runLater
public void runLater(Runnable run)
-
validateConnection
protected boolean validateConnection(org.apache.qpid.proton.engine.Connection connection)
-
checkDataReceived
public boolean checkDataReceived()
-
getCreationTime
public long getCreationTime()
-
getRemoteContainer
public String getRemoteContainer()
-
getPubSubPrefix
public String getPubSubPrefix()
-
getConnectionCallback
public AMQPConnectionCallback getConnectionCallback()
-
remoteLinkOpened
protected void remoteLinkOpened(org.apache.qpid.proton.engine.Link link) throws Exception- Throws:
Exception
-
getConnectionCapabilitiesOffered
public org.apache.qpid.proton.amqp.Symbol[] getConnectionCapabilitiesOffered()
-
open
public void open()
-
getContainer
public String getContainer()
-
addEventHandler
public void addEventHandler(EventHandler eventHandler)
-
getProtocolManager
public ProtonProtocolManager getProtocolManager()
-
getAmqpLowCredits
public int getAmqpLowCredits()
-
getAmqpCredits
public int getAmqpCredits()
-
isUseCoreSubscriptionNaming
public boolean isUseCoreSubscriptionNaming()
-
onAuthInit
public void onAuthInit(ProtonHandler handler, org.apache.qpid.proton.engine.Connection connection, boolean sasl)
- Specified by:
onAuthInitin interfaceEventHandler
-
onSaslRemoteMechanismChosen
public void onSaslRemoteMechanismChosen(ProtonHandler handler, String mech)
- Specified by:
onSaslRemoteMechanismChosenin interfaceEventHandler
-
onSaslMechanismsOffered
public void onSaslMechanismsOffered(ProtonHandler handler, String[] mechanisms)
- Specified by:
onSaslMechanismsOfferedin interfaceEventHandler
-
onAuthFailed
public void onAuthFailed(ProtonHandler protonHandler, org.apache.qpid.proton.engine.Connection connection)
- Specified by:
onAuthFailedin interfaceEventHandler
-
onAuthSuccess
public void onAuthSuccess(ProtonHandler protonHandler, org.apache.qpid.proton.engine.Connection connection)
- Specified by:
onAuthSuccessin interfaceEventHandler
-
onTransport
public void onTransport(org.apache.qpid.proton.engine.Transport transport)
- Specified by:
onTransportin interfaceEventHandler
-
pushBytes
public void pushBytes(io.netty.buffer.ByteBuf bytes)
- Specified by:
pushBytesin interfaceEventHandler
-
flowControl
public boolean flowControl(ReadyListener readyListener)
- Specified by:
flowControlin interfaceEventHandler
-
getRemoteAddress
public String getRemoteAddress()
- Specified by:
getRemoteAddressin interfaceEventHandler
-
onRemoteOpen
public void onRemoteOpen(org.apache.qpid.proton.engine.Connection connection) throws Exception- Specified by:
onRemoteOpenin interfaceEventHandler- Throws:
Exception
-
onRemoteClose
public void onRemoteClose(org.apache.qpid.proton.engine.Connection connection)
- Specified by:
onRemoteClosein interfaceEventHandler
-
onLocalOpen
public void onLocalOpen(org.apache.qpid.proton.engine.Session session) throws Exception- Specified by:
onLocalOpenin interfaceEventHandler- Throws:
Exception
-
onRemoteOpen
public void onRemoteOpen(org.apache.qpid.proton.engine.Session session) throws Exception- Specified by:
onRemoteOpenin interfaceEventHandler- Throws:
Exception
-
onRemoteClose
public void onRemoteClose(org.apache.qpid.proton.engine.Session session) throws Exception- Specified by:
onRemoteClosein interfaceEventHandler- Throws:
Exception
-
onRemoteOpen
public void onRemoteOpen(org.apache.qpid.proton.engine.Link link) throws Exception- Specified by:
onRemoteOpenin interfaceEventHandler- Throws:
Exception
-
onFlow
public void onFlow(org.apache.qpid.proton.engine.Link link) throws Exception- Specified by:
onFlowin interfaceEventHandler- Throws:
Exception
-
onRemoteClose
public void onRemoteClose(org.apache.qpid.proton.engine.Link link) throws Exception- Specified by:
onRemoteClosein interfaceEventHandler- Throws:
Exception
-
onRemoteDetach
public void onRemoteDetach(org.apache.qpid.proton.engine.Link link) throws Exception- Specified by:
onRemoteDetachin interfaceEventHandler- Throws:
Exception
-
onLocalDetach
public void onLocalDetach(org.apache.qpid.proton.engine.Link link) throws Exception- Specified by:
onLocalDetachin interfaceEventHandler- Throws:
Exception
-
onDelivery
public void onDelivery(org.apache.qpid.proton.engine.Delivery delivery) throws Exception- Specified by:
onDeliveryin interfaceEventHandler- Throws:
Exception
-
-