Groovy Documentation

com.adaptc.mws.plugins
[Java] Class AbstractPlugin

java.lang.Object
  com.adaptc.mws.plugins.AbstractPluginInfo
      com.adaptc.mws.plugins.AbstractPlugin

public abstract class AbstractPlugin
extends AbstractPluginInfo

Optional base class for all plugin types and therefore plugin instances which extends AbstractPluginInfo. Contains method definitions to facilitate creating new plugin types.

Authors:
bsaville


Field Summary
 
Fields inherited from class AbstractPluginInfo
id
 
Constructor Summary
AbstractPlugin()

 
Method Summary
void afterStart()

Hook to do any post-start logic.

void afterStop()

Hook to do any post-stop teardown of the plugin after it stops.

void beforeStart()

Hook to do any initialization needed before the plugin starts.

void beforeStop()

Hook to start any processes needed to teardown the plugin before it stops.

void configure()

Verifies the configuration of the plugin and performs any initial setup needed each time the configuration is loaded or changed.

org.apache.commons.logging.Log getLog()

Returns a log that can be used throughout the Plugin.

boolean jobCancel(List jobs)

Cancels the specified job(s).

boolean jobModify(List jobs, Map properties)

Modifies the specified job(s) with the properties given.

boolean jobRequeue(List jobs)

Requeues the specified job(s).

boolean jobResume(List jobs)

Resumes the specified job(s).

boolean jobStart(String jobName, String taskList, String username)

Starts the specified job with a tasklist and username.

boolean jobStart(String jobName, String taskList, String username, Map properties)

Starts the specified job with a tasklist, username, and other properties.

boolean jobSubmit(Map properties)

Submits a new job specified by the properties given.

boolean jobSuspend(List jobs)

Suspends the specified job.

String message(Map parameters)

Returns an i18n message from any file ending in "-messages.properties" included in the project JAR file.

boolean nodeModify(List nodes, Map properties)

Modifies the specified node(s) with the properties given.

boolean nodePower(List nodes, NodeReportPower state)

Changes the power state of the specified node(s).

boolean resourceCreate(String type, String name, Map attributes)

Creates a resource with the specified arguments.

void start()

Starts the Plugin, including polling if enabled.

void stop()

Stops the Plugin, including polling if started.

boolean systemModify(Map properties)

Modifies system properties as specified.

List systemQuery(List attributes)

Retrieves the specified system attribute(s).

boolean virtualMachineMigrate(String vmName, String hypervisorName, String operationName)

Migrates a virtual machine with the specified ID to the specified hypervisor.

 
Methods inherited from class AbstractPluginInfo
getAutoStart, getConfig, getId, getPluginType, getPollInterval, getState, getSubstate, setId
 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Constructor Detail

AbstractPlugin

AbstractPlugin()


 
Method Detail

afterStart

public void afterStart()
Hook to do any post-start logic. Can be empty.


afterStop

public void afterStop()
Hook to do any post-stop teardown of the plugin after it stops. Can be empty.


beforeStart

public void beforeStart()
Hook to do any initialization needed before the plugin starts. Can be empty.


beforeStop

public void beforeStop()
Hook to start any processes needed to teardown the plugin before it stops. Can be empty.


configure

public void configure()
Verifies the configuration of the plugin and performs any initial setup needed each time the configuration is loaded or changed. This is called when the IPluginControlService.start method or the start() method is called, as well as any time the configuration of the Plugin is modified.
throws:
InvalidPluginConfigurationException Thrown when configuration is invalid. This exception should contain error messages.
See Also:
InvalidPluginConfigurationException.InvalidPluginConfigurationException
InvalidPluginConfigurationException.InvalidPluginConfigurationException


getLog

public org.apache.commons.logging.Log getLog()
Returns a log that can be used throughout the Plugin.
Returns:
A logging instance


jobCancel

public boolean jobCancel(List jobs)
Cancels the specified job(s).
Parameters:
jobs - The name(s) of the job(s) to cancel
Returns:
True if successful, false if an error occurred


jobModify

public boolean jobModify(List jobs, Map properties)
Modifies the specified job(s) with the properties given.
Parameters:
properties - The properties to modify on the job(s)
jobs - The name(s) of the job(s) to modify
Returns:
True if successful, false if an error occurred


jobRequeue

public boolean jobRequeue(List jobs)
Requeues the specified job(s).
Parameters:
jobs - The name(s) of the job(s) to requeue
Returns:
True if successful, false if an error occurred


jobResume

public boolean jobResume(List jobs)
Resumes the specified job(s).
Parameters:
jobs - The name(s) of the job(s) to resume
Returns:
True if successful, false if an error occurred


jobStart

public boolean jobStart(String jobName, String taskList, String username)
Starts the specified job with a tasklist and username.
Parameters:
jobName - The name of the job to start
taskList - The tasklist of the job
username - The user starting the job
Returns:
True if successful, false if an error occurred


jobStart

public boolean jobStart(String jobName, String taskList, String username, Map properties)
Starts the specified job with a tasklist, username, and other properties.
Parameters:
jobName - The name of the job to start
taskList - The tasklist of the job
username - The user starting the job
properties - The other properties to set when starting the job
Returns:
True if successful, false otherwise


jobSubmit

public boolean jobSubmit(Map properties)
Submits a new job specified by the properties given.
Parameters:
properties - The job's properties
Returns:
True if successful, false if an error occurred


jobSuspend

public boolean jobSuspend(List jobs)
Suspends the specified job.
Parameters:
jobs - The name(s) of the job(s)
Returns:
True if successful, false if an error occurred


message

public String message(Map parameters)
Returns an i18n message from any file ending in "-messages.properties" included in the project JAR file.
Parameters:
parameters - The parameters used to retrieve the message, such as code, error, default, and args.
Returns:
The resulting i18n message


nodeModify

public boolean nodeModify(List nodes, Map properties)
Modifies the specified node(s) with the properties given.
Parameters:
properties - The properties to modify on the node(s)
nodes - The name(s) of the node(s) to modify
Returns:
True if successful, false if an error occurred


nodePower

public boolean nodePower(List nodes, NodeReportPower state)
Changes the power state of the specified node(s).
Parameters:
state - The new requested power state of the node(s)
nodes - The name(s) of the node(s) to modify
Returns:
True if successful, false if an error occurred


resourceCreate

public boolean resourceCreate(String type, String name, Map attributes)
Creates a resource with the specified arguments.
Parameters:
type - The type of the resource (ie vm)
name - The name of the resource (ie hv1:vm1 for a VM)
attributes - The attributes used to create the resource
Returns:
True if successful, false if an error occurred


start

public void start()
Starts the Plugin, including polling if enabled.
throws:
PluginStartException If there is a problem while starting the Plugin


stop

public void stop()
Stops the Plugin, including polling if started.
throws:
PluginStopException If there is a problem while stopping the Plugin


systemModify

public boolean systemModify(Map properties)
Modifies system properties as specified.
Parameters:
properties - The system properties to modify
Returns:
True if successful, false if an error occurred


systemQuery

public List systemQuery(List attributes)
Retrieves the specified system attribute(s).
Parameters:
attributes - The attributes to query for
Returns:
A list of attribute values


virtualMachineMigrate

public boolean virtualMachineMigrate(String vmName, String hypervisorName, String operationName)
Migrates a virtual machine with the specified ID to the specified hypervisor.
Parameters:
vmName The - name of the virtual machine
hypervisorName The - name of the new desired hypervisor for the VM
operationName The - name of the operation
Returns:
True if successful, false if an error occurred


 

Groovy Documentation