java.lang.Object
com.swiftmq.impl.streams.comp.management.CLI

public class CLI extends Object
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 Details

  • Method Details

    • adminRole

      public CLI adminRole(String name) throws Exception
      Sets the name of the admin role to use.
      Parameters:
      name -
      Returns:
      this
      Throws:
      Exception
    • exceptionOn

      public CLI exceptionOn()
      Tells CLI to throw exceptions when they occur on execute().
      Returns:
      CLI
    • exceptionOff

      public 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

      public String displayName(String context)
      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

      public String[] entityNames(String context)
      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

      public String contextJson(String context)
      Returns the JSON output of the CLI context which must point to an Entity or EntityList.
      Parameters:
      context - CLI context
      Returns:
      JSON
    • propertyValue

      public String propertyValue(String context, String propName) throws Exception
      Return the value of a Property.
      Parameters:
      context - CLI context
      propName - Property name
      Returns:
      value as String
      Throws:
      Exception
    • sumProperty

      public long sumProperty(String context, String propName) throws Exception
      Return the sum of a Property of an EntityList.
      Parameters:
      context - CLI context
      propName - Property name
      Returns:
      sum
      Throws:
      Exception
    • execute

      public CLI execute(String command) throws Exception
      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

      public String executeWithResult(String command) throws Exception
      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)