public class Queue extends AbstractDeclarable implements Cloneable
AmqpAdmin
Modifier and Type | Field and Description |
---|---|
static String |
X_QUEUE_MASTER_LOCATOR
Argument key for the master locator.
|
Constructor and Description |
---|
Queue(String name)
The queue is durable, non-exclusive and non auto-delete.
|
Queue(String name,
boolean durable)
Construct a new queue, given a name and durability flag.
|
Queue(String name,
boolean durable,
boolean exclusive,
boolean autoDelete)
Construct a new queue, given a name, durability, exclusive and auto-delete flags.
|
Queue(String name,
boolean durable,
boolean exclusive,
boolean autoDelete,
Map<String,Object> arguments)
Construct a new queue, given a name, durability flag, and auto-delete flag, and arguments.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
String |
getActualName()
Return the name provided to the constructor or the broker-generated name
if that name is an empty String.
|
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(String name)
Set the name from the DeclareOk.
|
void |
setMasterLocator(String locator)
Set the master locator strategy argument for this queue.
|
String |
toString() |
addArgument, getArguments, getDeclaringAdmins, isIgnoreDeclarationExceptions, removeArgument, setAdminsThatShouldDeclare, setIgnoreDeclarationExceptions, setShouldDeclare, shouldDeclare
public static final String X_QUEUE_MASTER_LOCATOR
public Queue(String name)
name
- the name of the queue.public Queue(String name, boolean durable)
name
- the name of the queue.durable
- true if we are declaring a durable queue (the queue will survive a server restart)public Queue(String name, boolean durable, boolean exclusive, boolean autoDelete)
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 usepublic Queue(String name, boolean durable, boolean exclusive, boolean autoDelete, @Nullable Map<String,Object> arguments)
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 queuepublic String getName()
getActualName()
public boolean isDurable()
public boolean isExclusive()
public boolean isAutoDelete()
public void setActualName(String name)
name
- the name.public String getActualName()
public final void setMasterLocator(@Nullable String locator)
locator
- the locator; null to clear the argument.