Class AbstractExchange

java.lang.Object
org.springframework.amqp.core.AbstractDeclarable
org.springframework.amqp.core.AbstractExchange
All Implemented Interfaces:
Declarable, Exchange
Direct Known Subclasses:
ConsistentHashExchange, CustomExchange, DirectExchange, FanoutExchange, HeadersExchange, TopicExchange

public abstract class AbstractExchange extends AbstractDeclarable implements Exchange
Common properties that describe all exchange types.

Subclasses of this class are typically used with administrative operations that declare an exchange.

Author:
Mark Pollack, Gary Russell, Artem Bilan
See Also:
  • Constructor Details

    • AbstractExchange

      public AbstractExchange(String name)
      Construct a new durable, non-auto-delete Exchange with the provided name.
      Parameters:
      name - the name of the exchange.
    • AbstractExchange

      public AbstractExchange(String name, boolean durable, boolean autoDelete)
      Construct a new Exchange, given a name, durability flag, auto-delete flag.
      Parameters:
      name - the name of the exchange.
      durable - true if we are declaring a durable exchange (the exchange will survive a server restart)
      autoDelete - true if the server should delete the exchange when it is no longer in use
    • AbstractExchange

      public AbstractExchange(String name, boolean durable, boolean autoDelete, Map<String,Object> arguments)
      Construct a new Exchange, given a name, durability flag, and auto-delete flag, and arguments.
      Parameters:
      name - the name of the exchange.
      durable - true if we are declaring a durable exchange (the exchange will survive a server restart)
      autoDelete - true if the server should delete the exchange when it is no longer in use
      arguments - the arguments used to declare the exchange
  • Method Details

    • getType

      public abstract String getType()
      Description copied from interface: Exchange
      The type of the exchange. See ExchangeTypes for some well-known examples.
      Specified by:
      getType in interface Exchange
      Returns:
      the type of the exchange.
    • getName

      public String getName()
      Description copied from interface: Exchange
      The name of the exchange.
      Specified by:
      getName in interface Exchange
      Returns:
      the name of the exchange.
    • isDurable

      public boolean isDurable()
      Description copied from interface: Exchange
      A durable exchange will survive a server restart.
      Specified by:
      isDurable in interface Exchange
      Returns:
      true if durable.
    • isAutoDelete

      public boolean isAutoDelete()
      Description copied from interface: Exchange
      True if the server should delete the exchange when it is no longer in use (if all bindings are deleted).
      Specified by:
      isAutoDelete in interface Exchange
      Returns:
      true if auto-delete.
    • isDelayed

      public boolean isDelayed()
      Description copied from interface: Exchange
      Is a delayed message exchange; currently requires a broker plugin.
      Specified by:
      isDelayed in interface Exchange
      Returns:
      true if delayed.
    • setDelayed

      public void setDelayed(boolean delayed)
      Set the delayed flag.
      Parameters:
      delayed - the delayed.
      Since:
      1.6
      See Also:
    • isInternal

      public boolean isInternal()
      Description copied from interface: Exchange
      Is an exchange internal; i.e. can't be directly published to by a client, used for exchange-to-exchange binding only.
      Specified by:
      isInternal in interface Exchange
      Returns:
      true if internal.
    • setInternal

      public void setInternal(boolean internal)
      Set the internal flag.
      Parameters:
      internal - the internal.
      Since:
      1.6
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object