Class CLI
java.lang.Object
com.swiftmq.impl.streams.comp.management.CLI
Executor class for CLI commands. Note that you need to change to
the respective context before executing a command on it ("cc context").
- Author:
- IIT Software GmbH, Muenster/Germany, (c) 2016, All Rights Reserved
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the name of the admin role to use.contextJson
(String context) Returns the JSON output of the CLI context which must point to an Entity or EntityList.displayName
(String context) Returns the display name of a Property.String[]
entityNames
(String context) Returns a String array with the names of all entities.Tells CLI to don't throw exceptions when they occur on execute().Tells CLI to throw exceptions when they occur on execute().Executes a CLI command on the local router's management tree.executeWithResult
(String command) Executes a CLI command on the local router's management tree and returns the result as an Json Array.propertyValue
(String context, String propName) Return the value of a Property.long
sumProperty
(String context, String propName) Return the sum of a Property of an EntityList.
-
Constructor Details
-
CLI
Internal use.
-
-
Method Details
-
adminRole
Sets the name of the admin role to use.- Parameters:
name
-- Returns:
- this
- Throws:
Exception
-
exceptionOn
Tells CLI to throw exceptions when they occur on execute().- Returns:
- CLI
-
exceptionOff
Tells CLI to don't throw exceptions when they occur on execute(). This is useful if, e.g. a "new queue" command is executed but the queue is already defined.- Returns:
- CLI
-
displayName
Returns the display name of a Property. The context must point to an EntityList. For example, to get the display name of the "messagecount" Property of a queue, the context must be: "sys$queuemanager/usage/messagecount".- Parameters:
context
- CLI context- Returns:
- display name or "unknown"
-
entityNames
Returns a String array with the names of all entities. The context must point to an EntityList. For example, to get the names of all defined queues, the context must be: "sys$queuemanager/queues".- Parameters:
context
- CLI context- Returns:
- names
-
contextJson
Returns the JSON output of the CLI context which must point to an Entity or EntityList.- Parameters:
context
- CLI context- Returns:
- JSON
-
propertyValue
Return the value of a Property.- Parameters:
context
- CLI contextpropName
- Property name- Returns:
- value as String
- Throws:
Exception
-
sumProperty
Return the sum of a Property of an EntityList.- Parameters:
context
- CLI contextpropName
- Property name- Returns:
- sum
- Throws:
Exception
-
execute
Executes a CLI command on the local router's management tree.- Parameters:
command
- CLI command- Returns:
- CLI
- Throws:
Exception
- If an exception occurs and exceptionOn() is set (default)
-
executeWithResult
Executes a CLI command on the local router's management tree and returns the result as an Json Array.- Parameters:
command
- CLI command- Returns:
- result
- Throws:
Exception
- If an exception occurs and exceptionOn() is set (default)
-