Class DefaultDeliveryMemory

  • All Implemented Interfaces:
    DeliveryMemory

    public class DefaultDeliveryMemory
    extends java.lang.Object
    implements DeliveryMemory
    Default implementation of a DeliveryMemory which stores the content in an internal map. It is used when no delivery memory is specified.
    Author:
    IIT Software GmbH, Bremen/Germany, (c) 2012, All Rights Reserved
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addUnsettledDelivery​(UnsettledDelivery unsettledDelivery)
      Adds an unsettled delivery which consists of a delivery tag, the delivery state and the AMQP message.
      void deliverySettled​(DeliveryTag deliveryTag)
      Removes an unsettled delivery from the memory.
      java.lang.String getLinkName()
      Returns the link name,
      int getNumberUnsettled()
      Returns the number of unsettled deliveries contained in this memory.
      java.util.Collection<UnsettledDelivery> getUnsettled()
      Returns a collection of all unsettled deliveries.
      void setLinkName​(java.lang.String linkName)
      Will be called from the link to set its link name.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultDeliveryMemory

        public DefaultDeliveryMemory()
    • Method Detail

      • getLinkName

        public java.lang.String getLinkName()
        Description copied from interface: DeliveryMemory
        Returns the link name,
        Specified by:
        getLinkName in interface DeliveryMemory
        Returns:
        link name
      • setLinkName

        public void setLinkName​(java.lang.String linkName)
        Description copied from interface: DeliveryMemory
        Will be called from the link to set its link name. This is only done if the name has not been set before and ensures that new created links that use this delivery memory use the same link name as before.
        Specified by:
        setLinkName in interface DeliveryMemory
      • addUnsettledDelivery

        public void addUnsettledDelivery​(UnsettledDelivery unsettledDelivery)
        Description copied from interface: DeliveryMemory
        Adds an unsettled delivery which consists of a delivery tag, the delivery state and the AMQP message.
        Specified by:
        addUnsettledDelivery in interface DeliveryMemory
        Parameters:
        unsettledDelivery - unsettled delivery
      • deliverySettled

        public void deliverySettled​(DeliveryTag deliveryTag)
        Description copied from interface: DeliveryMemory
        Removes an unsettled delivery from the memory.
        Specified by:
        deliverySettled in interface DeliveryMemory
        Parameters:
        deliveryTag - delivery tag
      • getNumberUnsettled

        public int getNumberUnsettled()
        Description copied from interface: DeliveryMemory
        Returns the number of unsettled deliveries contained in this memory.
        Specified by:
        getNumberUnsettled in interface DeliveryMemory
        Returns:
        number unsettled deliveries
      • getUnsettled

        public java.util.Collection<UnsettledDelivery> getUnsettled()
        Description copied from interface: DeliveryMemory
        Returns a collection of all unsettled deliveries. The delivery memory remains untouched so the returned map is a copy (or better a clone) of the content.
        Specified by:
        getUnsettled in interface DeliveryMemory
        Returns:
        unsettled deliveries