Class AMQPSessionCallback
java.lang.Object
org.apache.activemq.artemis.protocol.amqp.broker.AMQPSessionCallback
- All Implemented Interfaces:
SessionCallback
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAMQPSessionCallback(AMQPConnectionCallback protonSPI, ProtonProtocolManager manager, AMQPConnectionContext connection, Connection transportConnection, Executor executor, org.apache.activemq.artemis.core.persistence.OperationContext operationContext) -
Method Summary
Modifier and TypeMethodDescriptionvoidack(org.apache.activemq.artemis.core.transaction.Transaction transaction, Object brokerConsumer, Message message) addMetaData(String key, String value) Adds key / value based metadata into the underlying server session implementation for use by the connection resources.voidaddProducer(String name, String address) org.apache.activemq.artemis.core.server.AddressQueryResultaddressQuery(SimpleString addressName, RoutingType routingType, boolean autoCreate) voidvoidafterIO(IOCallback ioCallback) voidbrowserFinished(org.apache.activemq.artemis.core.server.ServerConsumer consumer) voidvoidcheck(SimpleString address, SimpleString queue, org.apache.activemq.artemis.core.security.CheckType checkType, org.apache.activemq.artemis.core.security.SecurityAuth session) voidcheck(SimpleString address, org.apache.activemq.artemis.core.security.CheckType checkType, org.apache.activemq.artemis.core.security.SecurityAuth session) booleancheckAddressAndAutocreateIfPossible(SimpleString address, RoutingType routingType) voidclose()voidclose(boolean failed) voidclosed()voidcloseSender(Object brokerConsumer) org.apache.activemq.artemis.core.server.ServerConsumercreateSender(ProtonServerSenderContext protonSender, SimpleString queue, String filter, boolean browserOnly) Creates a server consume that reads from the given named queue and forwards the read messages to the AMQP sender to dispatch to the remote peer.org.apache.activemq.artemis.core.server.ServerConsumercreateSender(ProtonServerSenderContext protonSender, SimpleString queue, String filter, boolean browserOnly, Number priority) Creates a server consume that reads from the given named queue and forwards the read messages to the AMQP sender to dispatch to the remote peer.voidcreateSharedDurableQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter) voidcreateSharedVolatileQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter) createStandardMessage(org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.codec.ReadableBuffer data) voidcreateTemporaryAddress(SimpleString address) voidcreateTemporaryQueue(SimpleString queueName, RoutingType routingType) voidcreateTemporaryQueue(SimpleString queueName, RoutingType routingType, Integer maxConsumers) voidcreateTemporaryQueue(SimpleString queueName, RoutingType routingType, Integer maxConsumers, Boolean internal) voidcreateTemporaryQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filter) voidcreateTemporaryQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filter, Integer maxConsumers) voidcreateTemporaryQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filter, Integer maxConsumers, Boolean internal) voidcreateUnsharedDurableQueue(SimpleString address, RoutingType routingType, SimpleString queueName, SimpleString filter) voiddeleteQueue(SimpleString queueName) voiddisconnect(org.apache.activemq.artemis.core.server.ServerConsumer consumer, String errorMessage) voidvoidflow(SimpleString address, Runnable runnable) Will execute a Runnable on an Address when there's space in memoryorg.apache.activemq.artemis.core.server.impl.AddressInfogetAddress(SimpleString address) org.apache.activemq.artemis.core.persistence.CoreMessageObjectPoolsorg.apache.activemq.artemis.core.transaction.TransactiongetDefaultRoutingType(SimpleString address) getMatchingQueue(SimpleString address, RoutingType routingType) getMatchingQueue(SimpleString address, SimpleString queueName, RoutingType routingType) getRoutingTypeFromPrefix(SimpleString address, RoutingType defaultRoutingType) org.apache.activemq.artemis.core.persistence.OperationContextorg.apache.activemq.artemis.core.persistence.StorageManagerorg.apache.activemq.artemis.core.transaction.TransactiongetTransaction(org.apache.qpid.proton.amqp.Binary txid, boolean remove) booleanhasCredits(org.apache.activemq.artemis.core.server.ServerConsumer consumer) voidinit(AMQPSessionContext protonSession, SASLResult saslResult) invokeIncoming(Message message, ActiveMQProtonRemotingConnection connection) invokeOutgoing(Message message, ActiveMQProtonRemotingConnection connection) booleanisWritable(ReadyListener callback, Object protocolContext) org.apache.qpid.proton.amqp.Binaryorg.apache.activemq.artemis.core.server.QueueQueryResultqueueQuery(QueueConfiguration configuration, boolean autoCreate) org.apache.activemq.artemis.core.server.QueueQueryResultqueueQuery(SimpleString queueName, RoutingType routingType, boolean autoCreate) org.apache.activemq.artemis.core.server.QueueQueryResultqueueQuery(SimpleString queueName, RoutingType routingType, boolean autoCreate, SimpleString filter) org.apache.activemq.artemis.core.persistence.OperationContextSet the proper operation context in the Thread Local.voidremovePrefix(SimpleString address) voidremoveProducer(String name) voidremoveTemporaryAddress(SimpleString address) voidremoveTemporaryQueue(SimpleString address) voidresetContext(org.apache.activemq.artemis.core.persistence.OperationContext oldContext) voidresumeDelivery(Object consumer) intsendLargeMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumer, long bodySize, int deliveryCount) intsendLargeMessageContinuation(org.apache.activemq.artemis.core.server.ServerConsumer consumer, byte[] body, boolean continues, boolean requiresResponse) intsendMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumer, int deliveryCount) voidsendProducerCreditsFailMessage(int credits, SimpleString address) voidsendProducerCreditsMessage(int credits, SimpleString address) voidserverSend(ProtonServerReceiverContext context, org.apache.activemq.artemis.core.transaction.Transaction transaction, org.apache.qpid.proton.engine.Receiver receiver, org.apache.qpid.proton.engine.Delivery delivery, SimpleString address, RoutingType routingType, org.apache.activemq.artemis.core.server.RoutingContext routingContext, Message message) voidsetTransactionHandler(ProtonTransactionHandler transactionHandler) voidstart()voidstartSender(Object brokerConsumer) booleanbooleanupdateDeliveryCountAfterCancel(org.apache.activemq.artemis.core.server.ServerConsumer consumer, org.apache.activemq.artemis.core.server.MessageReference ref, boolean failed) voidwithinContext(Runnable run) voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface SessionCallback
hasCredits
-
Field Details
-
consumerIDGenerator
-
-
Constructor Details
-
AMQPSessionCallback
public AMQPSessionCallback(AMQPConnectionCallback protonSPI, ProtonProtocolManager manager, AMQPConnectionContext connection, Connection transportConnection, Executor executor, org.apache.activemq.artemis.core.persistence.OperationContext operationContext)
-
-
Method Details
-
getStorageManager
public org.apache.activemq.artemis.core.persistence.StorageManager getStorageManager() -
getCoreMessageObjectPools
public org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools getCoreMessageObjectPools() -
getAMQPSessionContext
-
getProtocolManager
-
isWritable
- Specified by:
isWritablein interfaceSessionCallback
-
withinSessionExecutor
-
withinContext
-
execute
-
afterIO
-
getSessionContext
public org.apache.activemq.artemis.core.persistence.OperationContext getSessionContext() -
browserFinished
public void browserFinished(org.apache.activemq.artemis.core.server.ServerConsumer consumer) - Specified by:
browserFinishedin interfaceSessionCallback
-
supportsDirectDelivery
public boolean supportsDirectDelivery()- Specified by:
supportsDirectDeliveryin interfaceSessionCallback
-
init
- Throws:
Exception
-
afterDelivery
- Specified by:
afterDeliveryin interfaceSessionCallback- Throws:
Exception
-
start
public void start() -
createSender
public org.apache.activemq.artemis.core.server.ServerConsumer createSender(ProtonServerSenderContext protonSender, SimpleString queue, String filter, boolean browserOnly) throws Exception Creates a server consume that reads from the given named queue and forwards the read messages to the AMQP sender to dispatch to the remote peer. The consumer priority value is extracted from the remote link properties that were assigned by the remote receiver.- Parameters:
protonSender- TheProtonServerReceiverContextthat will be attached to the resulting consumerqueue- The target queue that the consumer reads from.filter- The filter assigned to the consumer of the target queue.browserOnly- Should the consumer act as a browser on the target queue.- Returns:
- a new
ServerConsumerattached to the given queue - Throws:
Exception- if an error occurs while creating the consumer instance.
-
createSender
public org.apache.activemq.artemis.core.server.ServerConsumer createSender(ProtonServerSenderContext protonSender, SimpleString queue, String filter, boolean browserOnly, Number priority) throws Exception Creates a server consume that reads from the given named queue and forwards the read messages to the AMQP sender to dispatch to the remote peer.- Parameters:
protonSender- TheProtonServerReceiverContextthat will be attached to the resulting consumerqueue- The target queue that the consumer reads from.filter- The filter assigned to the consumer of the target queue.browserOnly- Should the consumer act as a browser on the target queue.priority- The priority to assign the new consumer (server defaults are used if not set).- Returns:
- a new
ServerConsumerattached to the given queue - Throws:
Exception- if an error occurs while creating the consumer instance.
-
startSender
-
createTemporaryQueue
- Throws:
Exception
-
createTemporaryQueue
public void createTemporaryQueue(SimpleString queueName, RoutingType routingType, Integer maxConsumers) throws Exception - Throws:
Exception
-
createTemporaryQueue
public void createTemporaryQueue(SimpleString queueName, RoutingType routingType, Integer maxConsumers, Boolean internal) throws Exception - Throws:
Exception
-
createTemporaryQueue
public void createTemporaryQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filter) throws Exception - Throws:
Exception
-
createTemporaryQueue
public void createTemporaryQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filter, Integer maxConsumers) throws Exception - Throws:
Exception
-
createTemporaryQueue
public void createTemporaryQueue(SimpleString address, SimpleString queueName, RoutingType routingType, SimpleString filter, Integer maxConsumers, Boolean internal) throws Exception - Throws:
Exception
-
createTemporaryAddress
- Throws:
Exception
-
queueQuery
public org.apache.activemq.artemis.core.server.QueueQueryResult queueQuery(QueueConfiguration configuration, boolean autoCreate) throws Exception - Throws:
Exception
-
queueQuery
public org.apache.activemq.artemis.core.server.QueueQueryResult queueQuery(SimpleString queueName, RoutingType routingType, boolean autoCreate) throws Exception - Throws:
Exception
-
queueQuery
public org.apache.activemq.artemis.core.server.QueueQueryResult queueQuery(SimpleString queueName, RoutingType routingType, boolean autoCreate, SimpleString filter) throws Exception - Throws:
Exception
-
checkAddressAndAutocreateIfPossible
public boolean checkAddressAndAutocreateIfPossible(SimpleString address, RoutingType routingType) throws Exception - Throws:
Exception
-
addressQuery
public org.apache.activemq.artemis.core.server.AddressQueryResult addressQuery(SimpleString addressName, RoutingType routingType, boolean autoCreate) throws Exception - Throws:
Exception
-
removePrefix
-
closeSender
-
tempQueueName
-
close
-
close
public void close(boolean failed) - Specified by:
closein interfaceSessionCallback
-
ack
-
cancel
-
reject
-
resumeDelivery
-
createStandardMessage
public AMQPStandardMessage createStandardMessage(org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.codec.ReadableBuffer data) -
serverSend
public void serverSend(ProtonServerReceiverContext context, org.apache.activemq.artemis.core.transaction.Transaction transaction, org.apache.qpid.proton.engine.Receiver receiver, org.apache.qpid.proton.engine.Delivery delivery, SimpleString address, RoutingType routingType, org.apache.activemq.artemis.core.server.RoutingContext routingContext, Message message) throws Exception - Throws:
Exception
-
flow
Will execute a Runnable on an Address when there's space in memory -
deleteQueue
- Throws:
Exception
-
resetContext
public void resetContext(org.apache.activemq.artemis.core.persistence.OperationContext oldContext) -
recoverContext
public org.apache.activemq.artemis.core.persistence.OperationContext recoverContext()Set the proper operation context in the Thread Local. Return the old context -
sendProducerCreditsMessage
- Specified by:
sendProducerCreditsMessagein interfaceSessionCallback
-
updateDeliveryCountAfterCancel
public boolean updateDeliveryCountAfterCancel(org.apache.activemq.artemis.core.server.ServerConsumer consumer, org.apache.activemq.artemis.core.server.MessageReference ref, boolean failed) - Specified by:
updateDeliveryCountAfterCancelin interfaceSessionCallback
-
sendProducerCreditsFailMessage
- Specified by:
sendProducerCreditsFailMessagein interfaceSessionCallback
-
sendMessage
public int sendMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumer, int deliveryCount) - Specified by:
sendMessagein interfaceSessionCallback
-
sendLargeMessage
public int sendLargeMessage(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.core.server.ServerConsumer consumer, long bodySize, int deliveryCount) - Specified by:
sendLargeMessagein interfaceSessionCallback
-
sendLargeMessageContinuation
public int sendLargeMessageContinuation(org.apache.activemq.artemis.core.server.ServerConsumer consumer, byte[] body, boolean continues, boolean requiresResponse) - Specified by:
sendLargeMessageContinuationin interfaceSessionCallback
-
closed
public void closed()- Specified by:
closedin interfaceSessionCallback
-
disconnect
public void disconnect(org.apache.activemq.artemis.core.server.ServerConsumer consumer, String errorMessage) - Specified by:
disconnectin interfaceSessionCallback
-
hasCredits
public boolean hasCredits(org.apache.activemq.artemis.core.server.ServerConsumer consumer) - Specified by:
hasCreditsin interfaceSessionCallback
-
getCurrentTransaction
public org.apache.activemq.artemis.core.transaction.Transaction getCurrentTransaction()- Specified by:
getCurrentTransactionin interfaceSessionCallback
-
addMetaData
Adds key / value based metadata into the underlying server session implementation for use by the connection resources.- Parameters:
key- The key to add into the linked server session.value- The value to add into the linked server session attached to the given key.- Returns:
- this
AMQPSessionCallbackinstance - Throws:
Exception- if an error occurs while adding the metadata.
-
getTransaction
public org.apache.activemq.artemis.core.transaction.Transaction getTransaction(org.apache.qpid.proton.amqp.Binary txid, boolean remove) throws ActiveMQAMQPException - Throws:
ActiveMQAMQPException
-
newTransaction
public org.apache.qpid.proton.amqp.Binary newTransaction() -
getMatchingQueue
public SimpleString getMatchingQueue(SimpleString address, RoutingType routingType) throws Exception - Throws:
Exception
-
getMatchingQueue
public SimpleString getMatchingQueue(SimpleString address, SimpleString queueName, RoutingType routingType) throws Exception - Throws:
Exception
-
getAddress
-
removeTemporaryQueue
- Throws:
Exception
-
removeTemporaryAddress
- Throws:
Exception
-
getDefaultRoutingType
-
getRoutingTypeFromPrefix
-
check
public void check(SimpleString address, org.apache.activemq.artemis.core.security.CheckType checkType, org.apache.activemq.artemis.core.security.SecurityAuth session) throws Exception - Throws:
Exception
-
check
public void check(SimpleString address, SimpleString queue, org.apache.activemq.artemis.core.security.CheckType checkType, org.apache.activemq.artemis.core.security.SecurityAuth session) throws Exception - Throws:
Exception
-
invokeIncoming
-
invokeOutgoing
-
addProducer
-
removeProducer
-
setTransactionHandler
-
getTransportConnection
-
getTransactionHandler
-