Class CallAS7

java.lang.Object
org.jboss.as.jdr.commands.JdrCommand
org.jboss.as.jdr.commands.CallAS7

public class CallAS7 extends JdrCommand

Command to call the AS 7 management system and store the output in a file.

This class' methods are meant to be chained together to describe a management call. For example:

 new CallAS7("my_file").resource("foo", "bar").operation("read-resource")

will return a configured CallAS7 instance that will, when executed call read-resource on the /foo=bar/ resource, and store the output in a file called my_file.json.

  • Constructor Details

    • CallAS7

      public CallAS7(String name)
      constructs an instance and sets the resulting file name
      Parameters:
      name - of the file to write results to
  • Method Details

    • operation

      public CallAS7 operation(String operation)
      sets the operation to call
      Parameters:
      operation - to call, defaults to read-resource
      Returns:
      this
    • param

      public CallAS7 param(String key, String val)
      adds a key/value parameter pair to the call
      Parameters:
      key -
      val -
      Returns:
      this
    • resource

      public CallAS7 resource(String... parts)
      appends resource parts to the resource to call

      If you want to call /foo=bar/baz=boo/, do this:
       .resource("foo", "bar", "baz", "boo")
       
      Parameters:
      parts - to call
      Returns:
      this
    • execute

      public void execute() throws Exception
      Description copied from class: JdrCommand
      executes the command JdrPlugin implementations do not need to call this method.
      Specified by:
      execute in class JdrCommand
      Throws:
      Exception