Package org.springframework.amqp.core
Class Queue
- java.lang.Object
-
- org.springframework.amqp.core.AbstractDeclarable
-
- org.springframework.amqp.core.Queue
-
- All Implemented Interfaces:
java.lang.Cloneable
,Declarable
- Direct Known Subclasses:
AnonymousQueue
public class Queue extends AbstractDeclarable implements java.lang.Cloneable
Simple container collecting information to describe a queue. Used in conjunction with AmqpAdmin.- Author:
- Mark Pollack, Gary Russell
- See Also:
AmqpAdmin
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
X_QUEUE_LEADER_LOCATOR
Argument key for the queue leader locator.static java.lang.String
X_QUEUE_MASTER_LOCATOR
Deprecated.in favor ofX_QUEUE_LEADER_LOCATOR
.
-
Constructor Summary
Constructors Constructor Description Queue(java.lang.String name)
The queue is durable, non-exclusive and non auto-delete.Queue(java.lang.String name, boolean durable)
Construct a new queue, given a name and durability flag.Queue(java.lang.String name, boolean durable, boolean exclusive, boolean autoDelete)
Construct a new queue, given a name, durability, exclusive and auto-delete flags.Queue(java.lang.String name, boolean durable, boolean exclusive, boolean autoDelete, java.util.Map<java.lang.String,java.lang.Object> arguments)
Construct a new queue, given a name, durability flag, and auto-delete flag, and arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.Object
clone()
java.lang.String
getActualName()
Return the name provided to the constructor or the broker-generated name if that name is an empty String.java.lang.String
getName()
Return the name provided in the constructor.boolean
isAutoDelete()
True if the server should delete the queue when it is no longer in use (the last consumer is cancelled).boolean
isDurable()
A durable queue will survive a server restart.boolean
isExclusive()
True if the server should only send messages to the declarer's connection.void
setActualName(java.lang.String name)
Set the name from the DeclareOk.void
setLeaderLocator(java.lang.String locator)
Set the leader locator strategy argument for this queue.void
setMasterLocator(java.lang.String locator)
Deprecated.in favor ofsetLeaderLocator(String)
.java.lang.String
toString()
-
Methods inherited from class org.springframework.amqp.core.AbstractDeclarable
addArgument, getArguments, getDeclaringAdmins, isIgnoreDeclarationExceptions, removeArgument, setAdminsThatShouldDeclare, setIgnoreDeclarationExceptions, setShouldDeclare, shouldDeclare
-
-
-
-
Field Detail
-
X_QUEUE_MASTER_LOCATOR
@Deprecated public static final java.lang.String X_QUEUE_MASTER_LOCATOR
Deprecated.in favor ofX_QUEUE_LEADER_LOCATOR
.Argument key for the master locator.- Since:
- 2.1
- See Also:
- Constant Field Values
-
X_QUEUE_LEADER_LOCATOR
public static final java.lang.String X_QUEUE_LEADER_LOCATOR
Argument key for the queue leader locator.- Since:
- 2.1
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Queue
public Queue(java.lang.String name)
The queue is durable, non-exclusive and non auto-delete.- Parameters:
name
- the name of the queue.
-
Queue
public Queue(java.lang.String name, boolean durable)
Construct a new queue, given a name and durability flag. The queue is non-exclusive and non auto-delete.- Parameters:
name
- the name of the queue.durable
- true if we are declaring a durable queue (the queue will survive a server restart)
-
Queue
public Queue(java.lang.String name, boolean durable, boolean exclusive, boolean autoDelete)
Construct a new queue, given a name, durability, exclusive and auto-delete flags.- Parameters:
name
- the name of the queue.durable
- true if we are declaring a durable queue (the queue will survive a server restart)exclusive
- true if we are declaring an exclusive queue (the queue will only be used by the declarer's connection)autoDelete
- true if the server should delete the queue when it is no longer in use
-
Queue
public Queue(java.lang.String name, boolean durable, boolean exclusive, boolean autoDelete, @Nullable java.util.Map<java.lang.String,java.lang.Object> arguments)
Construct a new queue, given a name, durability flag, and auto-delete flag, and arguments.- Parameters:
name
- the name of the queue - must not be null; set to "" to have the broker generate the name.durable
- true if we are declaring a durable queue (the queue will survive a server restart)exclusive
- true if we are declaring an exclusive queue (the queue will only be used by the declarer's connection)autoDelete
- true if the server should delete the queue when it is no longer in usearguments
- the arguments used to declare the queue
-
-
Method Detail
-
getName
public java.lang.String getName()
Return the name provided in the constructor.- Returns:
- the name.
- See Also:
getActualName()
-
isDurable
public boolean isDurable()
A durable queue will survive a server restart.- Returns:
- true if durable.
-
isExclusive
public boolean isExclusive()
True if the server should only send messages to the declarer's connection.- Returns:
- true if exclusive.
-
isAutoDelete
public boolean isAutoDelete()
True if the server should delete the queue when it is no longer in use (the last consumer is cancelled). A queue that never has any consumers will not be deleted automatically.- Returns:
- true if auto-delete.
-
setActualName
public void setActualName(java.lang.String name)
Set the name from the DeclareOk.- Parameters:
name
- the name.- Since:
- 2.1
-
getActualName
public java.lang.String getActualName()
Return the name provided to the constructor or the broker-generated name if that name is an empty String.- Returns:
- the name.
- Since:
- 2.1
-
setMasterLocator
@Deprecated public final void setMasterLocator(@Nullable java.lang.String locator)
Deprecated.in favor ofsetLeaderLocator(String)
.Set the master locator strategy argument for this queue.- Parameters:
locator
- the locator; null to clear the argument.- Since:
- 2.1
-
setLeaderLocator
public final void setLeaderLocator(@Nullable java.lang.String locator)
Set the leader locator strategy argument for this queue.- Parameters:
locator
- the locator; null to clear the argument.- Since:
- 2.3.7
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-