Class Plugin
java.lang.Object
org.gcube.vremanagement.executor.plugin.Plugin
- All Implemented Interfaces:
PluginDefinition
This class represent the contract for a plugin runnable by the executor.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringProperty name for plugin descriptionstatic final StringProperty name for plugin group IDprotected intCurrent iteration number of the plugin executionstatic final StringProperty name for plugin artifact ID (name)protected PercentageSetterInterface for reporting execution progress percentagestatic final StringSuffix for plugin properties filesprotected PropertiesPlugin configuration propertiesprotected UUIDUnique identifier for this plugin execution instancestatic final StringProperty name for plugin version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionThis method is used by executor to retrieve the Plugin human oriented description.getGroup()This method is used by executor to retrieve the Plugin group It will be published on the IS instance created by the executorintgetName()This method is used by executor to retrieve the Plugin name It will be published on the IS instance created by the executorThis method is used by the Executor to get a key-valueMapto be published on IS , so a client which want to launch a Plugin only under certain condition can query the IS to obtain its own filtered list.getUUID()This method is used by executor to retrieve the plugin version.abstract voidLaunch the plugin with the provided input.protected abstract voidonStop()This function is used to correctly stop the pluginvoidsetIterationNumber(int iterationNumber) protected voidsetPercentageEvolution(Integer integer) Sets the percentage evolution for the current plugin execution.voidsetPercentageSetter(PercentageSetter percentageSetter) voidvoidstop()Invoke onStop() function to allow the plugin to safely stop the execution
-
Field Details
-
PLUGIN_PROPERTIES_SUFFIX_FILENAME
Suffix for plugin properties files- See Also:
-
GROUP_PROPERTY
Property name for plugin group ID- See Also:
-
NAME_PROPERTY
Property name for plugin artifact ID (name)- See Also:
-
VERSION_PROPERTY
Property name for plugin version- See Also:
-
DESCRIPTION_PROPERTY
Property name for plugin description- See Also:
-
properties
Plugin configuration properties -
uuid
Unique identifier for this plugin execution instance -
iterationNumber
protected int iterationNumberCurrent iteration number of the plugin execution -
percentageSetter
Interface for reporting execution progress percentage
-
-
Constructor Details
-
Plugin
public Plugin()Default constructor for Plugin. Initializes the plugin with default settings and percentage setter.
-
-
Method Details
-
getGroup
Description copied from interface:PluginDefinitionThis method is used by executor to retrieve the Plugin group It will be published on the IS instance created by the executor- Specified by:
getGroupin interfacePluginDefinition- Returns:
- the plugin group.
-
getName
Description copied from interface:PluginDefinitionThis method is used by executor to retrieve the Plugin name It will be published on the IS instance created by the executor- Specified by:
getNamein interfacePluginDefinition- Returns:
- the plugin name.
-
getVersion
Description copied from interface:PluginDefinitionThis method is used by executor to retrieve the plugin version. It will be published on the IS instance created by the executor- Specified by:
getVersionin interfacePluginDefinition- Returns:
- the plugin version.
-
getDescription
Description copied from interface:PluginDefinitionThis method is used by executor to retrieve the Plugin human oriented description. It will be published on the IS instance created by the executor- Specified by:
getDescriptionin interfacePluginDefinition- Returns:
- the plugin description.
-
getSupportedCapabilities
Description copied from interface:PluginDefinitionThis method is used by the Executor to get a key-valueMapto be published on IS , so a client which want to launch a Plugin only under certain condition can query the IS to obtain its own filtered list.- Specified by:
getSupportedCapabilitiesin interfacePluginDefinition- Returns:
- the
Mapwith the supported capabilities
-
setPercentageSetter
- Parameters:
percentageSetter- the percentageSetter to set
-
setPercentageEvolution
Sets the percentage evolution for the current plugin execution.- Parameters:
integer- the completion percentage (0-100)
-
getUUID
- Returns:
- the uuid
-
setUUID
- Parameters:
uuid- the uuid to set
-
getIterationNumber
public int getIterationNumber()- Returns:
- the Iteration Number
-
setIterationNumber
public void setIterationNumber(int iterationNumber) - Parameters:
iterationNumber- the iterationNumner to set
-
launch
Launch the plugin with the provided input.- Parameters:
inputs- the input parameters for the plugin execution- Throws:
Exception- if the launch fails
-
onStop
This function is used to correctly stop the plugin- Throws:
Exception- if the stop operation fails
-
stop
Invoke onStop() function to allow the plugin to safely stop the execution- Throws:
Exception- if the stop operation fails
-