Class AMQPSessionCallback

  • All Implemented Interfaces:
    org.apache.activemq.artemis.spi.core.protocol.SessionCallback

    public class AMQPSessionCallback
    extends java.lang.Object
    implements org.apache.activemq.artemis.spi.core.protocol.SessionCallback
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.apache.activemq.artemis.utils.IDGenerator consumerIDGenerator  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void ack​(org.apache.activemq.artemis.core.transaction.Transaction transaction, java.lang.Object brokerConsumer, org.apache.activemq.artemis.api.core.Message message)  
      void addProducer​(org.apache.activemq.artemis.core.server.ServerProducer serverProducer)  
      org.apache.activemq.artemis.core.server.AddressQueryResult addressQuery​(org.apache.activemq.artemis.api.core.SimpleString addressName, org.apache.activemq.artemis.api.core.RoutingType routingType, boolean autoCreate)  
      void afterDelivery()  
      void afterIO​(org.apache.activemq.artemis.core.io.IOCallback ioCallback)  
      void browserFinished​(org.apache.activemq.artemis.core.server.ServerConsumer consumer)  
      void cancel​(java.lang.Object brokerConsumer, org.apache.activemq.artemis.api.core.Message message, boolean updateCounts)  
      void check​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.core.security.CheckType checkType, org.apache.activemq.artemis.core.security.SecurityAuth session)  
      boolean checkAddressAndAutocreateIfPossible​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType)  
      void close()  
      void close​(boolean failed)  
      void closed()  
      void closeSender​(java.lang.Object brokerConsumer)  
      java.lang.Object createSender​(ProtonServerSenderContext protonSender, org.apache.activemq.artemis.api.core.SimpleString queue, java.lang.String filter, boolean browserOnly)  
      void createSharedDurableQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter)  
      void createSharedVolatileQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter)  
      AMQPStandardMessage createStandardMessage​(org.apache.qpid.proton.engine.Delivery delivery, org.apache.qpid.proton.codec.ReadableBuffer data)  
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.RoutingType routingType)  
      void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString filter)  
      void createUnsharedDurableQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.SimpleString filter)  
      void deleteQueue​(org.apache.activemq.artemis.api.core.SimpleString queueName)  
      void disconnect​(org.apache.activemq.artemis.core.server.ServerConsumer consumer, org.apache.activemq.artemis.api.core.SimpleString queueName)  
      void flow​(org.apache.activemq.artemis.api.core.SimpleString address, java.lang.Runnable runnable)
      Will execute a Runnable on an Address when there's space in memory
      org.apache.activemq.artemis.core.server.impl.AddressInfo getAddress​(org.apache.activemq.artemis.api.core.SimpleString address)  
      org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools getCoreMessageObjectPools()  
      org.apache.activemq.artemis.core.transaction.Transaction getCurrentTransaction()  
      org.apache.activemq.artemis.api.core.RoutingType getDefaultRoutingType​(org.apache.activemq.artemis.api.core.SimpleString address)  
      org.apache.activemq.artemis.api.core.SimpleString getMatchingQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.RoutingType routingType)  
      org.apache.activemq.artemis.api.core.SimpleString getMatchingQueue​(org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.RoutingType routingType)  
      ProtonProtocolManager getProtocolManager()  
      org.apache.activemq.artemis.core.persistence.OperationContext getSessionContext()  
      org.apache.activemq.artemis.core.persistence.StorageManager getStorageManager()  
      org.apache.activemq.artemis.core.transaction.Transaction getTransaction​(org.apache.qpid.proton.amqp.Binary txid, boolean remove)  
      ProtonTransactionHandler getTransactionHandler()  
      org.apache.activemq.artemis.spi.core.remoting.Connection getTransportConnection()  
      boolean hasCredits​(org.apache.activemq.artemis.core.server.ServerConsumer consumer)  
      void init​(AMQPSessionContext protonSession, SASLResult saslResult)  
      java.lang.String invokeIncoming​(AMQPMessage message, ActiveMQProtonRemotingConnection connection)  
      java.lang.String invokeOutgoing​(AMQPMessage message, ActiveMQProtonRemotingConnection connection)  
      boolean isWritable​(org.apache.activemq.artemis.spi.core.remoting.ReadyListener callback, java.lang.Object protocolContext)  
      org.apache.qpid.proton.amqp.Binary newTransaction()  
      org.apache.activemq.artemis.core.server.QueueQueryResult queueQuery​(org.apache.activemq.artemis.api.core.SimpleString queueName, org.apache.activemq.artemis.api.core.RoutingType routingType, boolean autoCreate)  
      org.apache.activemq.artemis.core.persistence.OperationContext recoverContext()  
      void reject​(java.lang.Object brokerConsumer, org.apache.activemq.artemis.api.core.Message message)  
      void removeProducer​(java.lang.String name)  
      void removeTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address)  
      void resetContext​(org.apache.activemq.artemis.core.persistence.OperationContext oldContext)  
      void resumeDelivery​(java.lang.Object consumer)  
      int sendLargeMessage​(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.api.core.Message message, org.apache.activemq.artemis.core.server.ServerConsumer consumer, long bodySize, int deliveryCount)  
      int sendLargeMessageContinuation​(org.apache.activemq.artemis.core.server.ServerConsumer consumer, byte[] body, boolean continues, boolean requiresResponse)  
      int sendMessage​(org.apache.activemq.artemis.core.server.MessageReference ref, org.apache.activemq.artemis.api.core.Message message, org.apache.activemq.artemis.core.server.ServerConsumer consumer, int deliveryCount)  
      void sendProducerCreditsFailMessage​(int credits, org.apache.activemq.artemis.api.core.SimpleString address)  
      void sendProducerCreditsMessage​(int credits, org.apache.activemq.artemis.api.core.SimpleString address)  
      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, org.apache.activemq.artemis.api.core.SimpleString address, org.apache.activemq.artemis.core.server.RoutingContext routingContext, AMQPMessage message)  
      void setTransactionHandler​(ProtonTransactionHandler transactionHandler)  
      void start()  
      void startSender​(java.lang.Object brokerConsumer)  
      boolean supportsDirectDelivery()  
      java.lang.String tempQueueName()  
      boolean updateDeliveryCountAfterCancel​(org.apache.activemq.artemis.core.server.ServerConsumer consumer, org.apache.activemq.artemis.core.server.MessageReference ref, boolean failed)  
      void withinContext​(java.lang.Runnable run)  
      void withinSessionExecutor​(java.lang.Runnable run)  
      • 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.spi.core.protocol.SessionCallback

        hasCredits
    • Field Detail

      • consumerIDGenerator

        protected final org.apache.activemq.artemis.utils.IDGenerator consumerIDGenerator
    • Constructor Detail

      • AMQPSessionCallback

        public AMQPSessionCallback​(AMQPConnectionCallback protonSPI,
                                   ProtonProtocolManager manager,
                                   AMQPConnectionContext connection,
                                   org.apache.activemq.artemis.spi.core.remoting.Connection transportConnection,
                                   java.util.concurrent.Executor executor,
                                   org.apache.activemq.artemis.core.persistence.OperationContext operationContext)
    • Method Detail

      • getStorageManager

        public org.apache.activemq.artemis.core.persistence.StorageManager getStorageManager()
      • getCoreMessageObjectPools

        public org.apache.activemq.artemis.core.persistence.CoreMessageObjectPools getCoreMessageObjectPools()
      • isWritable

        public boolean isWritable​(org.apache.activemq.artemis.spi.core.remoting.ReadyListener callback,
                                  java.lang.Object protocolContext)
        Specified by:
        isWritable in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • withinSessionExecutor

        public void withinSessionExecutor​(java.lang.Runnable run)
      • withinContext

        public void withinContext​(java.lang.Runnable run)
                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • afterIO

        public void afterIO​(org.apache.activemq.artemis.core.io.IOCallback ioCallback)
      • getSessionContext

        public org.apache.activemq.artemis.core.persistence.OperationContext getSessionContext()
      • browserFinished

        public void browserFinished​(org.apache.activemq.artemis.core.server.ServerConsumer consumer)
        Specified by:
        browserFinished in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • supportsDirectDelivery

        public boolean supportsDirectDelivery()
        Specified by:
        supportsDirectDelivery in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • init

        public void init​(AMQPSessionContext protonSession,
                         SASLResult saslResult)
                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • afterDelivery

        public void afterDelivery()
                           throws java.lang.Exception
        Specified by:
        afterDelivery in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
        Throws:
        java.lang.Exception
      • start

        public void start()
      • createSender

        public java.lang.Object createSender​(ProtonServerSenderContext protonSender,
                                             org.apache.activemq.artemis.api.core.SimpleString queue,
                                             java.lang.String filter,
                                             boolean browserOnly)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • startSender

        public void startSender​(java.lang.Object brokerConsumer)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createTemporaryQueue

        public void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                         org.apache.activemq.artemis.api.core.RoutingType routingType)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createTemporaryQueue

        public void createTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                         org.apache.activemq.artemis.api.core.SimpleString queueName,
                                         org.apache.activemq.artemis.api.core.RoutingType routingType,
                                         org.apache.activemq.artemis.api.core.SimpleString filter)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createUnsharedDurableQueue

        public void createUnsharedDurableQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                               org.apache.activemq.artemis.api.core.RoutingType routingType,
                                               org.apache.activemq.artemis.api.core.SimpleString queueName,
                                               org.apache.activemq.artemis.api.core.SimpleString filter)
                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createSharedDurableQueue

        public void createSharedDurableQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                             org.apache.activemq.artemis.api.core.RoutingType routingType,
                                             org.apache.activemq.artemis.api.core.SimpleString queueName,
                                             org.apache.activemq.artemis.api.core.SimpleString filter)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • createSharedVolatileQueue

        public void createSharedVolatileQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                              org.apache.activemq.artemis.api.core.RoutingType routingType,
                                              org.apache.activemq.artemis.api.core.SimpleString queueName,
                                              org.apache.activemq.artemis.api.core.SimpleString filter)
                                       throws java.lang.Exception
        Throws:
        java.lang.Exception
      • queueQuery

        public org.apache.activemq.artemis.core.server.QueueQueryResult queueQuery​(org.apache.activemq.artemis.api.core.SimpleString queueName,
                                                                                   org.apache.activemq.artemis.api.core.RoutingType routingType,
                                                                                   boolean autoCreate)
                                                                            throws java.lang.Exception
        Throws:
        java.lang.Exception
      • checkAddressAndAutocreateIfPossible

        public boolean checkAddressAndAutocreateIfPossible​(org.apache.activemq.artemis.api.core.SimpleString address,
                                                           org.apache.activemq.artemis.api.core.RoutingType routingType)
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addressQuery

        public org.apache.activemq.artemis.core.server.AddressQueryResult addressQuery​(org.apache.activemq.artemis.api.core.SimpleString addressName,
                                                                                       org.apache.activemq.artemis.api.core.RoutingType routingType,
                                                                                       boolean autoCreate)
                                                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • closeSender

        public void closeSender​(java.lang.Object brokerConsumer)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • tempQueueName

        public java.lang.String tempQueueName()
      • close

        public void close()
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • close

        public void close​(boolean failed)
        Specified by:
        close in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • ack

        public void ack​(org.apache.activemq.artemis.core.transaction.Transaction transaction,
                        java.lang.Object brokerConsumer,
                        org.apache.activemq.artemis.api.core.Message message)
                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • cancel

        public void cancel​(java.lang.Object brokerConsumer,
                           org.apache.activemq.artemis.api.core.Message message,
                           boolean updateCounts)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • reject

        public void reject​(java.lang.Object brokerConsumer,
                           org.apache.activemq.artemis.api.core.Message message)
                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resumeDelivery

        public void resumeDelivery​(java.lang.Object consumer)
      • 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,
                               org.apache.activemq.artemis.api.core.SimpleString address,
                               org.apache.activemq.artemis.core.server.RoutingContext routingContext,
                               AMQPMessage message)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • flow

        public void flow​(org.apache.activemq.artemis.api.core.SimpleString address,
                         java.lang.Runnable runnable)
        Will execute a Runnable on an Address when there's space in memory
      • deleteQueue

        public void deleteQueue​(org.apache.activemq.artemis.api.core.SimpleString queueName)
                         throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resetContext

        public void resetContext​(org.apache.activemq.artemis.core.persistence.OperationContext oldContext)
      • recoverContext

        public org.apache.activemq.artemis.core.persistence.OperationContext recoverContext()
      • sendProducerCreditsMessage

        public void sendProducerCreditsMessage​(int credits,
                                               org.apache.activemq.artemis.api.core.SimpleString address)
        Specified by:
        sendProducerCreditsMessage in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • updateDeliveryCountAfterCancel

        public boolean updateDeliveryCountAfterCancel​(org.apache.activemq.artemis.core.server.ServerConsumer consumer,
                                                      org.apache.activemq.artemis.core.server.MessageReference ref,
                                                      boolean failed)
        Specified by:
        updateDeliveryCountAfterCancel in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • sendProducerCreditsFailMessage

        public void sendProducerCreditsFailMessage​(int credits,
                                                   org.apache.activemq.artemis.api.core.SimpleString address)
        Specified by:
        sendProducerCreditsFailMessage in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • sendMessage

        public int sendMessage​(org.apache.activemq.artemis.core.server.MessageReference ref,
                               org.apache.activemq.artemis.api.core.Message message,
                               org.apache.activemq.artemis.core.server.ServerConsumer consumer,
                               int deliveryCount)
        Specified by:
        sendMessage in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • sendLargeMessage

        public int sendLargeMessage​(org.apache.activemq.artemis.core.server.MessageReference ref,
                                    org.apache.activemq.artemis.api.core.Message message,
                                    org.apache.activemq.artemis.core.server.ServerConsumer consumer,
                                    long bodySize,
                                    int deliveryCount)
        Specified by:
        sendLargeMessage in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • sendLargeMessageContinuation

        public int sendLargeMessageContinuation​(org.apache.activemq.artemis.core.server.ServerConsumer consumer,
                                                byte[] body,
                                                boolean continues,
                                                boolean requiresResponse)
        Specified by:
        sendLargeMessageContinuation in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • closed

        public void closed()
        Specified by:
        closed in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • disconnect

        public void disconnect​(org.apache.activemq.artemis.core.server.ServerConsumer consumer,
                               org.apache.activemq.artemis.api.core.SimpleString queueName)
        Specified by:
        disconnect in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • hasCredits

        public boolean hasCredits​(org.apache.activemq.artemis.core.server.ServerConsumer consumer)
        Specified by:
        hasCredits in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • getCurrentTransaction

        public org.apache.activemq.artemis.core.transaction.Transaction getCurrentTransaction()
        Specified by:
        getCurrentTransaction in interface org.apache.activemq.artemis.spi.core.protocol.SessionCallback
      • 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 org.apache.activemq.artemis.api.core.SimpleString getMatchingQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                                                                  org.apache.activemq.artemis.api.core.RoutingType routingType)
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getMatchingQueue

        public org.apache.activemq.artemis.api.core.SimpleString getMatchingQueue​(org.apache.activemq.artemis.api.core.SimpleString address,
                                                                                  org.apache.activemq.artemis.api.core.SimpleString queueName,
                                                                                  org.apache.activemq.artemis.api.core.RoutingType routingType)
                                                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getAddress

        public org.apache.activemq.artemis.core.server.impl.AddressInfo getAddress​(org.apache.activemq.artemis.api.core.SimpleString address)
      • removeTemporaryQueue

        public void removeTemporaryQueue​(org.apache.activemq.artemis.api.core.SimpleString address)
                                  throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getDefaultRoutingType

        public org.apache.activemq.artemis.api.core.RoutingType getDefaultRoutingType​(org.apache.activemq.artemis.api.core.SimpleString address)
      • check

        public void check​(org.apache.activemq.artemis.api.core.SimpleString address,
                          org.apache.activemq.artemis.core.security.CheckType checkType,
                          org.apache.activemq.artemis.core.security.SecurityAuth session)
                   throws java.lang.Exception
        Throws:
        java.lang.Exception
      • addProducer

        public void addProducer​(org.apache.activemq.artemis.core.server.ServerProducer serverProducer)
      • removeProducer

        public void removeProducer​(java.lang.String name)
      • getTransportConnection

        public org.apache.activemq.artemis.spi.core.remoting.Connection getTransportConnection()