|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.swiftmq.admin.cli.CLI
CLI is SwiftMQ's command line interface.
It can be invoked from command line and can also be used for programmatic
administration. For latter usage, CLI is to be constructed with a valid and stopped QueueConnection.
The user of this QueueConnection must have full administrator rights which takes
place if he has full right for the queue swiftmqmgmt of the respective routers or
if the authentication is disabled.
Programmatic administration with CLI is the same as invoking it from command line. All
CLI commands can be invoked by the executeCommand method. There is only
an exception regarding commands that return a result as 'ar', 'lc', 'show template'. These
commands are not available for programmatic administration. Invoking such a command
results in a CLIException.
Please refer to the CLI documentation to get involved with the available CLI commands.
Note (1):
To detect a connection lost, for example, as a result of a 'reboot' command for the
router the QueueConnection is connected to, you have to register your own ExceptionListener
on the QueueConnection.
Note (2):
CLI can be used only from a single thread of execution. Executing methods from different
threads concurrently can result in an unexpected behavior.
Constructor Summary | |
CLI(javax.jms.QueueConnection queueConnection)
Creates a new CLI object and does the necessary setup (creating some sessions, senders and receivers). |
Method Summary | |
void |
addRouterListener(RouterListener l)
Add a router listener |
void |
close()
Closed all resources created by CLI. |
void |
executeCommand(java.lang.String cmd)
Executes a CLI command. |
java.lang.String |
getActContext()
Returns the actual context, resulting from the last 'cc' command. |
java.lang.String |
getActRouter()
Returns the actual router name, resulting from the last 'sr' command. |
java.lang.String[] |
getAvailableRouters()
Returns all currently available router names. |
java.lang.String[] |
getContextEntities()
Returns an array with names of all entities of the actual context. |
java.lang.String |
getContextProperty(java.lang.String name)
Returns a property value from the actual context. |
static void |
main(java.lang.String[] args)
|
void |
onMessage(javax.jms.Message msg)
For internal use only! |
void |
removeRouterListener(RouterListener l)
Remove a router listener. |
void |
waitForRouter(java.lang.String routerName)
Wait for availability of a specific router. |
void |
waitForRouter(java.lang.String routerName,
long timeout)
Wait for availability of a specific router with timeout. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CLI(javax.jms.QueueConnection queueConnection) throws java.lang.Exception
queueConnection
- queue connection, should be in stopped modejava.lang.Exception
- if anything goes wrong during setupMethod Detail |
public java.lang.String getActRouter()
public java.lang.String getActContext()
public java.lang.String getContextProperty(java.lang.String name) throws CLIException
name
- name of the propertyCLIException
- if no actual context set or property is unknown in the actual contextpublic java.lang.String[] getContextEntities() throws CLIException
CLIException
- if no actual context setpublic java.lang.String[] getAvailableRouters()
public void waitForRouter(java.lang.String routerName)
routerName
- router namepublic void waitForRouter(java.lang.String routerName, long timeout)
routerName
- router nametimeout
- timeout value in millisecondspublic void executeCommand(java.lang.String cmd) throws CLIException
cmd
- CLI command to be executedCLIException
- if something goes wrong such as invalid command or command returns a resultpublic void addRouterListener(RouterListener l)
l
- router listenerpublic void removeRouterListener(RouterListener l)
l
- router listenerpublic void onMessage(javax.jms.Message msg)
onMessage
in interface javax.jms.MessageListener
public void close()
public static void main(java.lang.String[] args)
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |