Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.admin.actions
Class OsCommandAction

    java.lang.Object
      oracle.ifs.utils.action.AbstractAction
          oracle.ifs.admin.actions.ForkProcessAction
              oracle.ifs.admin.actions.OsCommandAction

All Implemented Interfaces:
  Action, IfsParameters

    public class OsCommandAction

extends ForkProcessAction

The OsCommandAction class helps run a command on a specific OS. It provides the functionality of timout which is inherited from the parent class ForkProcessAction. You can specify the command and the OS on which to run the command. The possible general values for the Operating System can be "all", "windows", "unix". Or the value can be more specific to a particular Windows platform or unix platform such as "Windows 95", "Windows 98", "Windows NT", "Windows 2000", "Solaris". These values should EXACTLY match the value returned by the System property "os.name" when called from Java.

This class defines the following keys:
`os` - The possible general values for the Operating System can be "all", "windows", "unix". Or the value can be more specific to a particular Windows platform or unix platform such as "Windows 95", "Windows 98", "Windows NT", "Windows 2000", "Solaris". These values should EXACTLY match the value returned by the System property "os.name" when called from Java. `command` - The command to execute. It should be absolute path, if it points to an executable or script etc. This key is mandatory. If it is not passes then the action will not run anything.

Modified:
  lsaenz 06/20/2001 Created., kchellap 06/16/2005 added check for continue.on.error property.

Field Summary
`static java.lang.String` | `ALL_OS` Value for the key "os".
`static java.lang.String` | `COMMAND_KEY`
`static java.lang.String` | `OS_KEY`
`static java.lang.String` | `UNIX_OS` Value for the key "os".
`static java.lang.String` | `WINDOWS_OS` Value for the key "os".

Fields inherited from class oracle.ifs.admin.actions.ForkProcessAction
`LOG_KEY, m_log, TIMEOUT_KEY`

Fields inherited from class oracle.ifs.utils.action.AbstractAction
`CONTINUE_ON_ERROR, m_defaultOptions, m_options`

Fields inherited from interface oracle.ifs.utils.common.IfsParameters
`APPEND_LOG, DATABASE_URL, DB_USER_NAME, DB_USER_PASSWORD, DOMAIN_TYPE, ENABLE_SSL_SUPPORT, FOR_SCHEMA_UPGRADE, IFS_DOMAIN_DISPLAY_NAME, IFS_DOMAIN_NAME, IFS_SCHEMA_NAME, IFS_SCHEMA_PASSWORD, IFS_SERVICE_NAME, IFS_USER_NAME, IFS_USER_PASSWORD, INCLUDE_PATH, INITIAL_CONTEXT_FACTORY, LDAP_URL_DAS_LOOKUP, LDAP_USER_NAME, LDAP_USER_PASSWORD, OUTPUT_FILE, PARAMETER_FILE, REGISTRY, SCHEMA_VERSION_KEY, SECURITY_PROTOCOL_NAME, SERVICE_CONFIGURATION_NAME`

Constructor Summary
`OsCommandAction()`

Method Summary
`protected java.lang.String` | `getCommand()` Returns the OS command that should be invoked as an external process.
`protected void` | `processDestroyed(java.io.StringWriter out, java.io.StringWriter err)` Invoked when the external process was destroyed by this Action, due to a timeout, an interrupt from another Thread, or other exceptional conditions.
`protected void` | `processFinished(int code, java.io.StringWriter out, java.io.StringWriter err)` Invoked when the external process has finished on its own.

Methods inherited from class oracle.ifs.admin.actions.ForkProcessAction
`failed, perform, stop`

Methods inherited from class oracle.ifs.utils.action.AbstractAction
`getDescription, getName, getValue, isContinueOnError, putValue, setDefaultOptions, setDescription, setName, setOptions`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### OS_KEY

    public static final java.lang.String OS_KEY

See Also:
  Constant Field Values

### COMMAND_KEY

    public static final java.lang.String COMMAND_KEY

See Also:
  Constant Field Values

### ALL_OS

    public static final java.lang.String ALL_OS

  Description copied from class: `OsCommandAction`
  Value for the key "os". Specifies to run on all Operating Systems.

  See Also:
    Constant Field Values

### WINDOWS_OS

    public static final java.lang.String WINDOWS_OS

  Description copied from class: `OsCommandAction`
  Value for the key "os". Specifies to run on all Windows Systems.

  See Also:
    Constant Field Values

### UNIX_OS

    public static final java.lang.String UNIX_OS

  Description copied from class: `OsCommandAction`
  Value for the key "os". Specifies to run on all Unix Systems.

  See Also:
    Constant Field Values

Constructor Detail

### OsCommandAction

    public OsCommandAction()

Method Detail

### getCommand

    protected java.lang.String getCommand()

  Description copied from class: `OsCommandAction`
  Returns the OS command that should be invoked as an external process.

  Specified by:
    `getCommand` in class `ForkProcessAction`
  Returns:
    a command String that can be passed to the Runtime.exec method.

### processFinished

    protected void processFinished(int code,
                                   java.io.StringWriter out,
                                   java.io.StringWriter err)
                            throws ActionFailedException

  Description copied from class: `ForkProcessAction`
  Invoked when the external process has finished on its own.

  Note: subclasses may override this method; it has an empty implementation.

  Note: subclasses may decide (based on the output from the process or the exit code) that the process did not finish successfully. In this case, the subclass may throw an ActionFailedException to notify that the action has in fact failed, even though the external process finished.

  Overrides:
    `processFinished` in class `ForkProcessAction`
  Parameters:
    `code` - the exit code returned by the Process.
    `out` - a closed StringWriter with stdout output from the Process.
    `err` - a closed StringWriter with stderr output form the Process.
  Throws:
    `ActionFailedException` - if the process finished but was not considered (by the action implementing this method) a successful execution; thus the action has failed.

### processDestroyed

    protected void processDestroyed(java.io.StringWriter out,
                                    java.io.StringWriter err)

  Description copied from class: `ForkProcessAction`
  Invoked when the external process was destroyed by this Action, due to a timeout, an interrupt from another Thread, or other exceptional conditions.
  Note: subclasses may override this method; it has an empty implementation.

  Overrides:
    `processDestroyed` in class `ForkProcessAction`
  Parameters:
    `out` - a closed StringWriter with stdout output from the Process.
    `err` - a closed StringWriter with stderr output form the Process.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD