|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.amqp.rabbit.admin.RabbitBrokerAdmin
public class RabbitBrokerAdmin
Rabbit broker administration. Features:
start the broker
you might need to set some environment
properties. The most common are available via constructors or setters in this class (e.g.
RABBITMQ_LOG_BASE
). All others you can set via the OS (any setting that
RabbtMQ allows in its startup script), and some work via System properties as special convenience cases (
ERLANG_HOME
and RABBITMQ_HOME
).
Field Summary | |
---|---|
protected org.apache.commons.logging.Log |
logger
Logger available to subclasses |
Constructor Summary | |
---|---|
RabbitBrokerAdmin()
|
|
RabbitBrokerAdmin(String nodeName)
Create an instance by supplying the erlang node name (e.g. |
|
RabbitBrokerAdmin(String nodeName,
int port)
Create an instance by supplying the erlang node name and port number. |
|
RabbitBrokerAdmin(String nodeName,
int port,
String cookie)
Create an instance by supplying the erlang node name, port number and cookie (unique string). |
|
RabbitBrokerAdmin(String nodeName,
String cookie)
Create an instance by supplying the erlang node name and cookie (unique string). |
Method Summary | |
---|---|
void |
addUser(String username,
String password)
|
int |
addVhost(String vhostPath)
|
void |
changeUserPassword(String username,
String newPassword)
|
void |
clearPermissions(String username)
|
void |
clearPermissions(String username,
String vhostPath)
|
protected void |
createErlangTemplate(ConnectionFactory otpConnectionFactory)
|
void |
deleteUser(String username)
|
int |
deleteVhost(String vhostPath)
|
void |
forceResetNode()
The forceResetNode command differs from RabbitBrokerOperations.resetNode() in that it resets the node unconditionally, regardless
of the current management database state and cluster configuration. |
List<QueueInfo> |
getQueues()
|
List<QueueInfo> |
getQueues(String virtualHost)
|
RabbitStatus |
getStatus()
Returns the status of the node. |
protected void |
initializeDefaultErlangTemplate()
|
List<String> |
listPermissions()
|
List<String> |
listPermissions(String vhostPath)
|
List<String> |
listUserPermissions(String username)
|
List<String> |
listUsers()
|
void |
recoverAsync(boolean requeue)
|
void |
resetNode()
Removes the node from any cluster it belongs to, removes all data from the management database, such as configured users and vhosts, and deletes all persistent messages. |
void |
setEncoding(String encoding)
The encoding to use for converting host names to byte arrays (which is needed on the remote side). |
void |
setModuleAdapter(Map<String,String> moduleAdapter)
Allows users to adapt Erlang RPC (module, function) pairs to older, or different, versions of the
broker than the current target. |
void |
setPermissions(String username,
Pattern configure,
Pattern read,
Pattern write)
|
void |
setPermissions(String username,
Pattern configure,
Pattern read,
Pattern write,
String vhostPath)
|
void |
setRabbitLogBaseDirectory(String rabbitLogBaseDirectory)
The location of RABBITMQ_LOG_BASE to override the system default (which may be owned by another
user). |
void |
setRabbitMnesiaBaseDirectory(String rabbitMnesiaBaseDirectory)
The location of RABBITMQ_MNESIA_BASE to override the system default (which may be owned by another
user). |
void |
setStartupTimeout(long timeout)
Timeout (milliseconds) to wait for the broker to come up. |
void |
startBrokerApplication()
Starts the RabbitMQ application on an already running node. |
void |
startNode()
Starts the Erlang node where RabbitMQ is running by shelling out to the directory specified by RABBITMQ_HOME and executing the standard named start script. |
void |
stopBrokerApplication()
Stops the RabbitMQ application, leaving the Erlang node running. |
void |
stopNode()
Stops the halts the Erlang node on which RabbitMQ is running. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final org.apache.commons.logging.Log logger
Constructor Detail |
---|
public RabbitBrokerAdmin()
public RabbitBrokerAdmin(String nodeName)
nodeName
- the node name or hostname to usepublic RabbitBrokerAdmin(String nodeName, String cookie)
nodeName
- the node name or hostname to usecookie
- the cookie value to usepublic RabbitBrokerAdmin(String nodeName, int port)
RABBITMQ_LOG_BASE
and
#setRabbitMnesiaBaseDirectory(String)RABBITMQ_MNESIA_BASE
to point to writable directories).
nodeName
- the node name or hostname to useport
- the port number (overriding the default which is 5672)public RabbitBrokerAdmin(String nodeName, int port, String cookie)
@
character, it will be prepended with an alivename rabbit@
(interpreting the supplied value as just the hostname).
nodeName
- the node name or hostname to useport
- the port number (overriding the default which is 5672)cookie
- the cookie value to useMethod Detail |
---|
public void setRabbitLogBaseDirectory(String rabbitLogBaseDirectory)
RABBITMQ_LOG_BASE
to override the system default (which may be owned by another
user). Only needed for launching the broker process. Can also be set as a system property.
rabbitLogBaseDirectory
- the rabbit log base directory to setpublic void setRabbitMnesiaBaseDirectory(String rabbitMnesiaBaseDirectory)
RABBITMQ_MNESIA_BASE
to override the system default (which may be owned by another
user). Only needed for launching the broker process. Can also be set as a system property.
rabbitMnesiaBaseDirectory
- the rabbit Mnesia base directory to setpublic void setEncoding(String encoding)
encoding
- the encoding to use (default UTF-8)public void setStartupTimeout(long timeout)
timeout
- the timeout value to set in millisecondspublic void setModuleAdapter(Map<String,String> moduleAdapter)
(module, function)
pairs to older, or different, versions of the
broker than the current target. The map is from String to String in the form
input_module%input_function -> output_module%output_function
(using a %
separator).
moduleAdapter
- the module adapter to setpublic List<QueueInfo> getQueues()
getQueues
in interface RabbitBrokerOperations
public List<QueueInfo> getQueues(String virtualHost)
getQueues
in interface RabbitBrokerOperations
@ManagedOperation public void addUser(String username, String password)
addUser
in interface RabbitBrokerOperations
@ManagedOperation public void deleteUser(String username)
deleteUser
in interface RabbitBrokerOperations
@ManagedOperation public void changeUserPassword(String username, String newPassword)
changeUserPassword
in interface RabbitBrokerOperations
@ManagedOperation public List<String> listUsers()
listUsers
in interface RabbitBrokerOperations
public int addVhost(String vhostPath)
addVhost
in interface RabbitBrokerOperations
public int deleteVhost(String vhostPath)
deleteVhost
in interface RabbitBrokerOperations
public void setPermissions(String username, Pattern configure, Pattern read, Pattern write)
setPermissions
in interface RabbitBrokerOperations
public void setPermissions(String username, Pattern configure, Pattern read, Pattern write, String vhostPath)
setPermissions
in interface RabbitBrokerOperations
public void clearPermissions(String username)
clearPermissions
in interface RabbitBrokerOperations
public void clearPermissions(String username, String vhostPath)
clearPermissions
in interface RabbitBrokerOperations
public List<String> listPermissions()
listPermissions
in interface RabbitBrokerOperations
public List<String> listPermissions(String vhostPath)
listPermissions
in interface RabbitBrokerOperations
public List<String> listUserPermissions(String username)
listUserPermissions
in interface RabbitBrokerOperations
@ManagedOperation public void startBrokerApplication()
RabbitBrokerOperations
startBrokerApplication
in interface RabbitBrokerOperations
@ManagedOperation public void stopBrokerApplication()
RabbitBrokerOperations
stopBrokerApplication
in interface RabbitBrokerOperations
@ManagedOperation public void startNode()
RabbitBrokerOperations
startNode
in interface RabbitBrokerOperations
@ManagedOperation public void stopNode()
RabbitBrokerOperations
stopNode
in interface RabbitBrokerOperations
@ManagedOperation public void resetNode()
RabbitBrokerOperations
For RabbitBrokerOperations.resetNode()
and
RabbitBrokerOperations.forceResetNode()
to succeed the RabbitMQ application must have been stopped, e.g.
RabbitBrokerOperations.stopBrokerApplication()
resetNode
in interface RabbitBrokerOperations
@ManagedOperation public void forceResetNode()
RabbitBrokerOperations
RabbitBrokerOperations.resetNode()
in that it resets the node unconditionally, regardless
of the current management database state and cluster configuration. It should only be used as a last resort if
the database or cluster configuration has been corrupted. For RabbitBrokerOperations.resetNode()
and RabbitBrokerOperations.forceResetNode()
to succeed the RabbitMQ application must have been stopped, e.g. RabbitBrokerOperations.stopBrokerApplication()
forceResetNode
in interface RabbitBrokerOperations
@ManagedOperation public RabbitStatus getStatus()
RabbitBrokerOperations
getStatus
in interface RabbitBrokerOperations
public void recoverAsync(boolean requeue)
recoverAsync
in interface RabbitBrokerOperations
protected void initializeDefaultErlangTemplate()
protected void createErlangTemplate(ConnectionFactory otpConnectionFactory)
|
Spring AMQP | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |