Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.5.3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.hyperic.hq.product
Class ServerControlPlugin

    java.lang.Object
      org.hyperic.hq.product.GenericPlugin
          org.hyperic.hq.product.ControlPlugin
              org.hyperic.hq.product.ServerControlPlugin

Direct Known Subclasses:
  MxServerControlPlugin, ScriptControlPlugin

    public abstract class ServerControlPlugin

extends ControlPlugin

This class is mainly helpful for control plugins which are script/process driven.

Field Summary
`static String` | `PROP_PIDFILE`
`static String` | `PROP_PROGRAM`
`static String` | `PROP_PROGRAMPREFIX`

Fields inherited from class org.hyperic.hq.product.ControlPlugin
`DEFAULT_TIMEOUT, manager, PROP_TIMEOUT, RESULT_FAILURE, RESULT_SUCCESS, STATE_RESTARTING, STATE_STARTED, STATE_STARTING, STATE_STOPPED, STATE_STOPPING, STATE_UNKNOWN`

Fields inherited from class org.hyperic.hq.product.GenericPlugin
`config, FILE_DELIM, FILE_DELIM_ESC, PROP_NAME`

Constructor Summary
`ServerControlPlugin()`

Method Summary
`void` | `configure(org.hyperic.util.config.ConfigResponse config)`
`protected int` | `doCommand()`
`protected int` | `doCommand(String command)`
`protected int` | `doCommand(String[] args)`
`protected int` | `doCommand(String program, String arg)`
`protected int` | `doCommand(String program, String[] params)`
`protected int` | `getBackgroundWaitTime()`
`protected String[]` | `getCommandArgs()` Override to add any additional arguments to the command line.
`protected String[]` | `getCommandEnv()` Override to pass any addition environment variables to the command.
`org.hyperic.util.config.ConfigSchema` | `getConfigSchema(TypeInfo info, org.hyperic.util.config.ConfigResponse config)` The ConfigSchema used to render config options for this resource in the UI and client shell.
`String` | `getControlProgram()`
`protected String` | `getControlProgramDir()`
`String` | `getControlProgramPrefix()`
`protected int` | `getExitCode()`
`String` | `getInstallPrefix()`
`String` | `getPidFile()`
`protected void` | `getServerConfigSchema(TypeInfo info, org.hyperic.util.config.ConfigSchema schema, org.hyperic.util.config.ConfigResponse response)`
`protected File` | `getWorkingDirectory()`
`protected void` | `handleResult(String stateWanted)`
`protected boolean` | `isBackgroundCommand()`
`protected boolean` | `isProcessRunning(int pid)`
`protected boolean` | `isProcessRunning(String pidFile)`
`protected boolean` | `isRunning()`
`protected void` | `setBackgroundWaitTime(int seconds)`
`void` | `setControlProgram(String val)`
`void` | `setControlProgramPrefix(String val)`
`void` | `setInstallPrefix(String val)`
`void` | `setPidFile(String val)`
`void` | `shutdown()` Called when the server or agent is shutdown.
`protected int` | `start(String command)`
`protected boolean` | `useConfigSchema(TypeInfo info)`
`protected boolean` | `useSigar()`
`protected void` | `validateControlProgram(String name)`

Methods inherited from class org.hyperic.hq.product.ControlPlugin
`detectState, doAction, doAction, getActions, getManager, getMessage, getResult, getTimeout, getTimeoutMillis, init, setManager, setMessage, setResult, setTimeout, setTimeout, waitForState`

Methods inherited from class org.hyperic.hq.product.GenericPlugin
`adjustClassPath, getAbsoluteFiles, getConfig, getConfig, getCustomPropertiesSchema, getCustomPropertiesSchema, getCustomPropertiesSchema, getDefaultInstallPath, getLog, getLogName, getManagerProperty, getName, getPlatformName, getPluginClassName, getPluginData, getPluginProperty, getProductPlugin, getProperties, getScriptExtension, getScriptExtension, getScriptExtension, getTypeInfo, getTypeNameProperty, getTypeNameProperty, getTypeProperties, getTypeProperty, getTypeProperty, getTypeProperty, isNetStatEnabled, isWin32, openResource, setData, setName, setTypeInfo, toFileList`

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

Field Detail

### PROP_PIDFILE

    public static final String PROP_PIDFILE

See Also:
  Constant Field Values

### PROP_PROGRAM

    public static final String PROP_PROGRAM

See Also:
  Constant Field Values

### PROP_PROGRAMPREFIX

    public static final String PROP_PROGRAMPREFIX

See Also:
  Constant Field Values

Constructor Detail

### ServerControlPlugin

    public ServerControlPlugin()

Method Detail

### getInstallPrefix

    public String getInstallPrefix()

### setInstallPrefix

    public void setInstallPrefix(String val)

### getControlProgram

    public String getControlProgram()

### setControlProgram

    public void setControlProgram(String val)

### getControlProgramPrefix

    public String getControlProgramPrefix()

### setControlProgramPrefix

    public void setControlProgramPrefix(String val)

### getPidFile

    public String getPidFile()

### setPidFile

    public void setPidFile(String val)

### useSigar

    protected boolean useSigar()

### configure

    public void configure(org.hyperic.util.config.ConfigResponse config)
                   throws PluginException

  Overrides:
    `configure` in class `GenericPlugin`
  Throws:
    `PluginException`

### shutdown

    public void shutdown()
                  throws PluginException

  Description copied from class: `GenericPlugin`
  Called when the server or agent is shutdown. Use this method to cleanup any resources that were created during the init() method.

  Overrides:
    `shutdown` in class `GenericPlugin`
  Throws:
    `PluginException`

### getServerConfigSchema

    protected void getServerConfigSchema(TypeInfo info,
                                         org.hyperic.util.config.ConfigSchema schema,
                                         org.hyperic.util.config.ConfigResponse response)

### getConfigSchema

    public org.hyperic.util.config.ConfigSchema getConfigSchema(TypeInfo info,
                                                                org.hyperic.util.config.ConfigResponse config)

  Description copied from class: `GenericPlugin`
  The ConfigSchema used to render config options for this resource in the UI and client shell.

  Overrides:
    `getConfigSchema` in class `ControlPlugin`
  Parameters:
    `info` - The TypeInfo of this plugin from ProductPlugin.getTypes
    `config` - ConfigReponse of the parent resource (if any).
  Returns:
    ConfigSchema for this resource.

### useConfigSchema

    protected boolean useConfigSchema(TypeInfo info)

### isRunning

    protected boolean isRunning()

  Overrides:
    `isRunning` in class `ControlPlugin`

### isProcessRunning

    protected boolean isProcessRunning(int pid)

### isProcessRunning

    protected boolean isProcessRunning(String pidFile)

### getWorkingDirectory

    protected File getWorkingDirectory()

### getControlProgramDir

    protected String getControlProgramDir()

### validateControlProgram

    protected void validateControlProgram(String name)
                                   throws PluginException

  Throws:
    `PluginException`

### isBackgroundCommand

    protected boolean isBackgroundCommand()

### getBackgroundWaitTime

    protected int getBackgroundWaitTime()

  Returns:
    Seconds to wait on a background process

### setBackgroundWaitTime

    protected void setBackgroundWaitTime(int seconds)

### getCommandArgs

    protected String[] getCommandArgs()

  Override to add any additional arguments to the command line.

### getCommandEnv

    protected String[] getCommandEnv()

  Override to pass any addition environment variables to the command.

### doCommand

    protected int doCommand()

### doCommand

    protected int doCommand(String command)

### doCommand

    protected int doCommand(String[] args)

### doCommand

    protected int doCommand(String program,
                            String arg)

### doCommand

    protected int doCommand(String program,
                            String[] params)

### getExitCode

    protected int getExitCode()

  Returns:
    program exit code from doCommand()

### handleResult

    protected void handleResult(String stateWanted)

### start

    protected int start(String command)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Hyperic HQ Plugin API v. 4.5.3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2010 Hyperic, Inc. support@hyperic.net, All Rights Reserved.