# Command Invocation

The toolkit provides a simple interface for invoking commands from the command line.

The class com.Endeca.soleng.eac.toolkit.Controller exposes a main method that can be executed from the command line.

This method can be used to invoke a method on any object defined in the application configuration document. The Controller's usage information describes the command line arguments.

    USAGE:
    java Controller [options] --app-config <app config> <object> <method> [args]

    The controller will invoke a method on an object defined in the app
    configuration document. Method return values are not captured and
    only String arguments may be passed as method parameters. The controller
    will typically be used to run scripts, components or utilities. More
    complex invocations should usually be wrapped in a BeanShell script.

    By default, the controller will compare provisioning in the app config
    document to the provisioning in the EAC. If any definition changes are
    found, elements are re-provisioned.

      Available options:
        --help
            Displays this usage information. If app config
            document and object name specified, available
            methods will be displayed.
        --update-definition
            Updates application provisioning without invoking
            any action. Any specified object, method and args
            will be ignored.
        --skip-definition
            Skips the default provisioning check, invoking the
            requested action with the app definition currently
            provisioned in the EAC.
        --remove-app
            Removes the application from the EAC.
            WARNING: Any active components will be stopped.
        --print-status
            Displays the status of application components.
        --config-override <override props file>
            Name of an app configuration override properties
            file to read from the classpath. Multiple override
            files may be specified.

      <app config>
          Name of the app configuration document to read
          from the classpath. Multiple documents may be specified.
      <object>
          ID of object defined in app config document.
      <method>
          Method to invoke on the specified object. Default: run.
      [args]
          Arguments to pass to the specified method. Only String
          arguments are allowed. Methods requiring other
          argument types may be wrapped in BeanShell script.

- Invoke a method on an object
  By default, the controller tries to invoke a method called "`run`" with no arguments on the specified object.
- Identify available methods
  In order to help users identify the objects and methods available for invocation, the controller provides a help argument that can be called to list all available objects or methods available on an object.
- Update application definition
  By default, the controller will test the application definition in the configuration document against the provisioned definition in the EAC and update EAC provisioning if the definition in the document has changed.
- Remove an application
  The controller provides a convenience method for removing an application from the EAC's central store.
- Display component status
  The controller provides a convenience method for displaying the status of all components defined in the configuration document.