public class Job extends CommonItem implements Transactional, Subtypable
getJobType()
method. Many of the methods
in this class only apply to jobs of one of the types. The following methods can
only be used on jobs that are executed by a plugin:
configure(GuiContext)
: Starts the configuration sequence of the job
execute(ProgressReporter, String)
: Starts executing the job
start(String, String, JobAgent)
: Tell the core that job has started
setProgress(int, String)
: Update the progress status of the job
doneOk(String)
: Tell the core that the job finished successfully
doneError(String)
: Thell the core that the job finished with an error
Modifier and Type | Class and Description |
---|---|
static class |
Job.ExecutionTime
A rough estimate of the execution time of a job.
|
private class |
Job.JobSignalTransporter
Wrapper for the signal transporter that intercepts the ABORT signal
and changes the job's status to ABORTING.
|
(package private) static class |
Job.ProgressReporterImpl
Implements the ProgressReporter interface and
stores the percentage completed for the current job.
|
(package private) static class |
Job.SignalKeyring
Our own keyring containing the permissions signal handlers may need
to update job status, eq.
|
static class |
Job.Status
The status of a job.
|
static class |
Job.Type
The type of job.
|
Transactional.Action
Modifier and Type | Field and Description |
---|---|
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum allowed length of the external ID.
|
static int |
MAX_SERVER_LENGTH
The maximum allowed length of the server name.
|
static int |
MAX_STACK_TRACE_LENGTH
The maximum allowed length of the stack trace message.
|
static int |
MAX_STATUS_MESSAGE_LENGTH
The maximum allowed length of the status message.
|
private Job.JobSignalTransporter |
signalTransporter |
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Modifier and Type | Method and Description |
---|---|
void |
clearExecuteCommand()
Reset the currently stored execution command to force a
plug-in to restart from the beginning instead of at the
stored breakpoint.
|
PluginConfigurationRequest |
configure(GuiContext context)
Start the configuration sequence for a job.
|
(package private) void |
continueLater(String executeCommand,
boolean isShuttingDown,
Serializable state)
This method is used to indicate that a job had to be aborted due
to a system shutdown.
|
void |
copyParametersFrom(Job copyFrom)
Copy all parameter values from another job.
|
void |
doneError(String statusMessage)
Register the job as completed with an error.
|
void |
doneError(String statusMessage,
Collection<? extends Throwable> errors)
Register the job as completed with an error.
|
void |
doneError(String statusMessage,
Collection<? extends Throwable> errors,
Date endTime)
Register the job as completed with an error.
|
void |
doneOk(String statusMessage)
Register the job as successfully completed.
|
void |
doneOk(String statusMessage,
Date endTime)
Register the job as successfully completed.
|
PluginExecutionRequest |
execute(ProgressReporter progress,
String server)
Start the execution sequence for a job.
|
PluginExecutionRequest |
execute(ProgressReporter progress,
String server,
JobAgentSettings settings) |
PluginExecutionRequest |
execute(ProgressReporter progress,
String server,
String node,
JobAgentSettings settings)
Start the execution sequence for a job.
|
int |
getActiveProjectId()
The ID of the project that should be made the active project while running
this job.
|
static Job |
getById(DbControl dc,
int id)
Get a
Job item when you know the id. |
Date |
getCreated()
Get the date and time the job was registered in the database.
|
(package private) JobData |
getData()
Get the
BasicData object that holds all data for this item. |
Date |
getEnded()
Get the date and time the job ended.
|
Job.ExecutionTime |
getEstimatedExecutionTime()
Get the estimated execution time of the job.
|
String |
getExecuteCommand()
The command to send to the plug-in when starting to
execute it.
|
Experiment |
getExperiment()
Get the experiment this job is a part of.
|
String |
getExternalId()
Get the external ID of a job running on an external server.
|
ItemSubtype |
getItemSubtype()
Get the subtype of the item.
|
JobAgent |
getJobAgent()
Get the job agent this job should run on, is running on or
was running on.
|
Job.Type |
getJobType()
Get the type of job, ie. if it is a job executed by a plugin
or not.
|
GuiContext |
getLastGuiContext()
Get the gui-context that was active when this job was created.
|
static Job |
getNew(DbControl dc,
PluginDefinition plugin,
PluginConfiguration config,
Experiment experiment)
Create a new
Job item. |
String |
getNode()
Get the name of the node where the job is executing.
|
ParameterInfo |
getParameterInfo(String name)
Get extra information about a parameter.
|
Set<String> |
getParameterNames()
Get the names of all parameters for the job.
|
Object |
getParameterValue(String name)
Get the value of a named parameter.
|
ParameterValues |
getParameterValues()
Get the configuration parameters as a
ParameterValues object. |
List<?> |
getParameterValues(String name)
Get the values of a named parameter.
|
(package private) ParameterValuesImpl |
getParameterValuesImpl()
Get a write-protected ParameterValuesImpl object.
|
int |
getParameterVersion()
Get the version number of the configuration parameters used for this job.
|
int |
getPercentComplete()
An estimate of the percentage of the work currently completed by
an executing job.
|
PluginConfiguration |
getPluginConfiguration()
Get the
PluginConfiguration defining the plugin this job should execute. |
PluginDefinition |
getPluginDefinition()
Get the
PluginConfiguration defining the plugin this job should execute. |
String |
getPluginVersion()
Get the version of the plugin used to execute this job at the time the
job was executed or registered.
|
int |
getPriority()
Get the priority of the job.
|
ProgressReporter |
getProgressReporter(ProgressReporter chained)
Get a progress reporter that reports progress by updating the information
in the database.
|
static ItemQuery<Job> |
getQuery()
Get a query configured to retrieve jobs.
|
boolean |
getRemoveJobWhenFinished()
If the job should flagged for deletion after it's done successfully.
|
Date |
getScheduled()
Get the date and time the job was scheduled to the job queue.
|
boolean |
getSendMessage()
If a message should be sent to the owner once the job has finished
or not.
|
String |
getServer()
Get the name of the server where the job is executing.
|
String |
getServerAndNode()
Utility method for getting both the server and node as a single string
(for display purposes).
|
SignalTransporter |
getSignalTransporter()
Create and initialise a signal transporter object that can be used
to send signal to the plug-in running this job.
|
String |
getStackTrace()
Get the stack trace in case the job ended with an error
|
Date |
getStarted()
Get the date and time the job was started.
|
Job.Status |
getStatus()
Get the status of the job.
|
String |
getStatusMessage()
Get a message about the current status of the job.
|
Item |
getType()
Get the type of item represented by the object.
|
Set<ItemProxy> |
getUsingItems()
Get the transformation and raw bioassays using this job.
|
boolean |
hasContext()
Checks if this job has saved information about the context that was active
when this job was created.
|
boolean |
hasSignalTransporter()
Checks if a signal transporter has been registered for this job or not.
|
(package private) void |
initPermissions(int granted,
int denied)
Grant read permission if the logged in user has read permission to the
experiment the job belongs to.
|
boolean |
isDryRun()
Check if the job should be/was executed as a dry-run job.
|
boolean |
isUsed()
Return TRUE if the status is EXECUTING or:
a transformation is linked to this job
a raw bioassay is linked to this job
an array design is linked to this job
FALSE otherwise.
|
(package private) Serializable |
loadState(ClassLoader loader)
Load the saved state from the cache.
|
(package private) void |
onAfterCommit(Transactional.Action action)
If the
Signal.ABORT signal is waiting to be sent send it. |
(package private) void |
onBeforeCommit(Transactional.Action action)
Set's the project id to the currently active project.
|
(package private) void |
pause(String message,
String executeCommand,
Serializable state)
This method is used to indicate that a job has been paused, either
by manual interaction or by some other trigger.
|
(package private) void |
removeState()
Remove the saved state from the cache.
|
boolean |
requestStatusUpdate()
Request that the underlying job updates the status information about
itself.
|
void |
retry(boolean useLatestConfiguration,
boolean clearDryRun)
Retry a job which finished with an error or a successful dry-run job.
|
(package private) void |
saveState(Serializable state)
Save the job state to the static cache.
|
private void |
sendMessage()
Send a message to the owner of the job when the job has finished
|
(package private) void |
setExperiment(Experiment experiment)
Set the experiment this job is part of.
|
void |
setExternalId(String externalId)
Set the external ID.
|
void |
setItemSubtype(ItemSubtype subtype)
Set the subtype on the item.
|
void |
setJobAgent(JobAgent agent)
Set the job agent this job should run on.
|
void |
setParameterValue(String name,
ParameterType<?> parameterType,
Object value)
Set the value of a configuration parameter.
|
void |
setParameterValue(String name,
String label,
String description,
ParameterType<?> parameterType,
Object value)
Set the value of a configuration parameter.
|
void |
setParameterValues(String name,
ParameterType<?> parameterType,
List<?> values)
Set the value of a configuration parameter.
|
void |
setParameterValues(String name,
String label,
String description,
ParameterType<?> parameterType,
List<?> values)
Set the value of a configuration parameter.
|
(package private) void |
setParameterValuesInternal(String name,
String label,
String description,
ParameterType<?> parameterType,
List<?> values,
boolean validate)
Set the values of a configuration parameter.
|
private void |
setPluginConfiguration(PluginConfiguration pluginConfiguration)
Set the plugin configuration of this job.
|
private void |
setPluginDefinition(PluginDefinition plugin)
Set the plugin configuration of this job.
|
void |
setPluginVersion(String pluginVersion)
Set the version of the plugin that executes the job.
|
void |
setPrepared(String server,
JobAgent agent)
Set the job's status to
Job.Status.PREPARED . |
void |
setPriority(int priority)
Set the priority of the job.
|
void |
setProgress(int percentComplete,
String statusMessage)
Set the progress of the job.
|
void |
setRemoveJobWhenFinished(boolean removeJobWhenFinished)
Set if the job should be deleted after it has finished successfully.
|
void |
setScheduled(String server,
JobAgent agent)
Set the job's status to
Job.Status.WAITING . |
void |
setSendMessage(boolean sendMessage)
Set if a message should be sent to owner when the job finishes.
|
void |
setSignalTransporter(Class<? extends SignalTransporter> clazz,
String initParams)
Set information needed to create a signal transporter object that can be used
to send signals to the plug-in that is currently executing this job.
|
void |
start(String statusMessage,
String server,
JobAgent agent)
Register the job as started.
|
void |
start(String statusMessage,
String server,
JobAgent agent,
Date startTime) |
void |
start(String statusMessage,
String server,
String node,
JobAgent agent,
Date startTime)
Register the job as started.
|
getDescription, getName, getRemovedBy, isRemoved, setDescription, setName, setRemoved
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey
getOwner, isOwner, setOwner, takeOwnership
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
private Job.JobSignalTransporter signalTransporter
public static final int MAX_EXTERNAL_ID_LENGTH
public static final int MAX_STATUS_MESSAGE_LENGTH
public static final int MAX_STACK_TRACE_LENGTH
public static final int MAX_SERVER_LENGTH
Job(JobData jobData)
public static Job getNew(DbControl dc, PluginDefinition plugin, PluginConfiguration config, Experiment experiment) throws InvalidDataException, BaseException
Job
item.dc
- The DbControl
which will be used for
permission checking and database access.plugin
- The plugin this job should use.config
- The plugin configuration this job should use
or null if the job is executed by an external programexperiment
- The experiment the job is a part of, or null
if the job is not part of an experimentJob
itemInvalidDataException
- If the specified plugin requires a configuration but the
config parameter is nullBaseException
- If there is an errorpublic static Job getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Job
item when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadJob
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static ItemQuery<Job> getQuery()
ItemQuery
objectJobData getData()
BasicItem
BasicData
object that holds all data for this item.getData
in class CommonItem
public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public boolean isUsed() throws BaseException
isUsed
in class BasicItem
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
getUsingItems
in class BasicItem
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void onBeforeCommit(Transactional.Action action) throws NotLoggedInException, BaseException
onBeforeCommit
in class SharedItem
NotLoggedInException
- If no user is logged inBaseException
- If there is another errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classesvoid onAfterCommit(Transactional.Action action)
Signal.ABORT
signal is waiting to be sent send it.onAfterCommit
in class BasicItem
Transactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classesvoid initPermissions(int granted, int denied)
initPermissions
in class SharedItem
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclasspublic String getExternalId()
public void setExternalId(String externalId)
public Job.Type getJobType()
public ItemSubtype getItemSubtype()
Subtypable
getItemSubtype
in interface Subtypable
SubtypableRelatedItems
public void setItemSubtype(ItemSubtype subtype)
Subtypable
setItemSubtype
in interface Subtypable
subtype
- A subtype or nullItemSubtype.setOnItem(Subtypable)
public PluginDefinition getPluginDefinition() throws PermissionDeniedException, BaseException
PluginConfiguration
defining the plugin this job should execute.PluginConfiguration
item, or null if this job
isn't executed by a pluginPermissionDeniedException
- If the logged in user doesn't have
read permission for the plugin configurationBaseException
- If there is another errorprivate void setPluginDefinition(PluginDefinition plugin) throws PermissionDeniedException
PermissionDeniedException
- If the logged in user
doesn't have use permission for the plugin configurationpublic PluginConfiguration getPluginConfiguration() throws PermissionDeniedException, BaseException
PluginConfiguration
defining the plugin this job should execute.PluginConfiguration
item, or null if this job
isn't executed by a pluginPermissionDeniedException
- If the logged in user doesn't have
read permission for the plugin configurationBaseException
- If there is another errorprivate void setPluginConfiguration(PluginConfiguration pluginConfiguration) throws PermissionDeniedException
PermissionDeniedException
- If the logged in user
doesn't have use permission for the plugin configurationpublic Experiment getExperiment()
Experiment
item, or null if this job
isn't part of an experimentvoid setExperiment(Experiment experiment)
public String getPluginVersion()
public void setPluginVersion(String pluginVersion)
public int getParameterVersion()
public boolean getSendMessage()
public void setSendMessage(boolean sendMessage) throws PermissionDeniedException
sendMessage
- TRUE if a message should be sent, FALSE otherwise.PermissionDeniedException
- If the logged in user doesn't have
write permissionpublic boolean getRemoveJobWhenFinished()
public void setRemoveJobWhenFinished(boolean removeJobWhenFinished)
removeJobWhenFinished
- TRUE if the job should be
flagged for deletion when finished, FALSE otherwise.PermissionDeniedException
- If the logged in user doesn't have
write permissionpublic Job.ExecutionTime getEstimatedExecutionTime()
ExecutionTime
objectpublic Job.Status getStatus()
public boolean isDryRun()
public String getStatusMessage()
public String getStackTrace()
public int getPercentComplete()
public int getPriority()
public void setPriority(int priority) throws PermissionDeniedException, InvalidDataException
priority
- The priority to set.PermissionDeniedException
- If the logged in user doesn't have
write permission or the job's status isn't WAITING
or
UNCONFIGURED
InvalidDataException
- If the priority isn't between 1 and 10public int getActiveProjectId()
public Date getCreated()
public Date getScheduled()
public Date getStarted()
start(String, String, JobAgent)
public String getServer()
public String getNode()
public String getServerAndNode()
public boolean hasContext()
configure(GuiContext)
,
getLastGuiContext()
public GuiContext getLastGuiContext()
public JobAgent getJobAgent()
public void setJobAgent(JobAgent agent)
NOTE! This method doesn't check that the specified job agent has actually been configured to run the plug-in used by this job. Setting this parameter to an incorrect value may result in the job never being executed.
agent
- The job agent, or null to let any job agent run
the jobPermissionDeniedException
- If the logged in user doesn't
have write permission on this job, or use permission on the
job agent or is lacking the Permission.SELECT_JOBAGENT
permissionpublic void setSignalTransporter(Class<? extends SignalTransporter> clazz, String initParams)
clazz
- The signal transporter classinitParams
- Initialisation parameters that will be passed
to SignalTransporter.init(String)
PermissionDeniedException
- If the user doesn't have write
permission for the jobpublic boolean hasSignalTransporter()
public SignalTransporter getSignalTransporter()
Note 1! Depending on the transport mechanism used, it is not certain that the created transporter can actually send the signal. For example, some transporters only work if the plug-in is running in the same virtual machine, while others supports sending signals to other JVM:s on the same or a different computer.
Note 2! The returned transporter will delay the Signal.ABORT
signal
until DbControl.commit()
is called and will only send the signal if
the transaction is completed succesfully. If the transaction fails or is rolled
back the signal is not sent. Other signals are sent immediately.
Note 3! This method always returns the same transporter instance if it is called multiple times.
Note 4! If the signal transporter is a ExtensionSignalTransporter
the extension point is "net.sf.basedb.core.signal.job". The client
context is populated with a SessionControl
and the current item
is this Job
. The information in the job should be considered read-only,
if the signal handler wants to update information it must create a new
DbControl
from the session control and re-load the job.
public boolean requestStatusUpdate()
Signal.STATUS
signal to the
SignalTransporter
that has been registered for the job.
If there is no signal transporter this method does nothing.
The signal transporter should deliver the signal as quickly as possible
and then return. The actual progress update may take place at a later
time when it is convenient to do so for the job.Signal.STATUS
could be sent, FALSE if notpublic Date getEnded()
public String getExecuteCommand()
public void clearExecuteCommand()
public void setScheduled(String server, JobAgent agent) throws PermissionDeniedException
Job.Status.WAITING
. This status is
used to signal that a job has been fully configured and is ready
for execution.server
- Name of the server which this job will executed onagent
- The job agent that is going to execute the
job or null if it is executed by something else, eg. the
internal job queuePermissionDeniedException
- If the logged in user doesn't have write permission.public void setPrepared(String server, JobAgent agent) throws PermissionDeniedException
Job.Status.PREPARED
. This status is
used to signal that a job is about to be executed, but the actual execution
hasn't started yet. This status prevents two job agents from trying to
start the same job twice.server
- Name of the server which this job will executed onagent
- The job agent that is going to execute the
job or null if it is executed by something else, eg. the
internal job queuePermissionDeniedException
- If the logged in user doesn't have write permission.public void start(String statusMessage, String server, JobAgent agent) throws PermissionDeniedException, InvalidDataException
statusMessage
- A messageserver
- The name of the server where the job is startedagent
- The job agent that is going to execute the
job or null if it is executed by something else, eg. the
internal job queuePermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic void start(String statusMessage, String server, JobAgent agent, Date startTime) throws PermissionDeniedException, InvalidDataException
PermissionDeniedException
InvalidDataException
#start(String, String, String, JobAgent, Date)}
public void start(String statusMessage, String server, String node, JobAgent agent, Date startTime) throws PermissionDeniedException, InvalidDataException
statusMessage
- A messageserver
- The name of the server where the job is startednode
- The name of the node in a cluster that is actually running the jobagent
- The job agent that is going to execute the
job or null if it is executed by something else, eg. the
internal job queuestartTime
- The actual start time for the job or null to use the
current system timePermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic ProgressReporter getProgressReporter(ProgressReporter chained)
chained
- An optional chained progress reporter to which all
updates will be forwardedpublic void setProgress(int percentComplete, String statusMessage) throws PermissionDeniedException, InvalidDataException
Job.Status.EXECUTING
or
Job.Status.PREPARED
status. -1 can be used as a special value to indicate that
it is not known how far the job has progressed.percentComplete
- The number of percent completedstatusMessage
- A messagePermissionDeniedException
- If the logged in user doesn't have
write permission of the job isn't in the EXECUTING
statusInvalidDataException
- If the status message is too long or the
percentage value isn't between -1 and 100public void doneOk(String statusMessage) throws PermissionDeniedException, InvalidDataException
statusMessage
- A messagePermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic void doneOk(String statusMessage, Date endTime) throws PermissionDeniedException, InvalidDataException
statusMessage
- A messageendTime
- The actual end time for the job or null to use the
current system timePermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic void doneError(String statusMessage) throws PermissionDeniedException, InvalidDataException
statusMessage
- A messagePermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic void doneError(String statusMessage, Collection<? extends Throwable> errors)
statusMessage
- A short message describing the errorerrors
- A list of one or more errors that caused the job to fail, the
complete stack trace for those errors are stored in the getStackTrace()
propertyPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic void doneError(String statusMessage, Collection<? extends Throwable> errors, Date endTime)
statusMessage
- A short message describing the errorerrors
- A list of one or more errors that caused the job to fail, the
complete stack trace for those errors are stored in the getStackTrace()
propertyendTime
- The actual end time for the job or null to use the
current system timePermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the status message is too longpublic void retry(boolean useLatestConfiguration, boolean clearDryRun) throws PermissionDeniedException
useLatestConfiguration
- If the job should use the latest configuration
parameters in case these has changed since the job was createdclearDryRun
- If the job was a dry-run job, clear the dry-run flag
to indicate that it should be executed for real the next timePermissionDeniedException
- If the logged in user doesn't have write permissionvoid continueLater(String executeCommand, boolean isShuttingDown, Serializable state)
This method will reset the job status to WAITING. The execute command parameter can be set to allow the plug-in to tell the difference between a first-time execution and resuming after a system shutdown.
executeCommand
- The command to send the next time the
job is started, if not given Request.COMMAND_EXECUTE
is usedisShuttingDown
- TRUE if the system is currently shutting down
(which means that the 'scheduled' data is not reset to allow the
job to be started first once the system is up and running)void pause(String message, String executeCommand, Serializable state)
This method will reset the job status to PAUSED. The execute command parameter can be set to allow the plug-in to know where to resume if it is restarted. The state parameter can be any information that the plug-in need to be able to restore itself to a similar state as before the pause.
executeCommand
- The command to send the next time the
job is started, if not given Request.COMMAND_EXECUTE
is usedstate
- The state information will be saved and made
available to the plug-in when the job is resumedvoid saveState(Serializable state)
Serializable loadState(ClassLoader loader)
void removeState()
public PluginConfigurationRequest configure(GuiContext context) throws PermissionDeniedException, BaseException
DbControl.commit()
until the configuration sequence
is done. See PluginRequest
for more information. This method changes
the status of the job to Job.Status.WAITING
.context
- GUI context from where the configuration is called.PluginRequest
objectPermissionDeniedException
- If the logged in user doesn't have
write permissionBaseException
- If there is another errorpublic PluginExecutionRequest execute(ProgressReporter progress, String server) throws PermissionDeniedException, InvalidDataException, BaseException
DbControl.commit()
before calling PluginRequest.invoke()
.
See PluginRequest
for more information.progress
- The ProgressReporter
where the plugin can report its progress. If
null
Job.ProgressReporterImpl
is usedserver
- The name of the server executing the pluginPlugin.Request
objectPermissionDeniedException
- If the logged in user doesn't have
write permission or the job isn't in the Job.Status.WAITING
statusInvalidDataException
- If the server name is too longBaseException
- If there is another errorpublic PluginExecutionRequest execute(ProgressReporter progress, String server, JobAgentSettings settings) throws PermissionDeniedException, InvalidDataException, BaseException
PermissionDeniedException
InvalidDataException
BaseException
#execute(ProgressReporter, String, String, JobAgentSettings)}
public PluginExecutionRequest execute(ProgressReporter progress, String server, String node, JobAgentSettings settings) throws PermissionDeniedException, InvalidDataException, BaseException
DbControl.commit()
before calling PluginRequest.invoke()
.
See PluginRequest
for more information.progress
- The ProgressReporter
where the plugin can report its progress. If
null
Job.ProgressReporterImpl
is usedserver
- The name of the server executing the pluginnode
- The name of the node in a cluster that is actually running the jobsettings
- The job agent settings to use or null to use default settingsPlugin.Request
objectPermissionDeniedException
- If the logged in user doesn't have
write permission or the job isn't in the Job.Status.WAITING
statusInvalidDataException
- If the server name is too longBaseException
- If there is another errorpublic ParameterValues getParameterValues()
ParameterValues
object.
The parameters are write protected.getParameterVersion()
public Set<String> getParameterNames()
Set
containing the names of the parameters or an
empty set if no parameters has been definedpublic Object getParameterValue(String name) throws PermissionDeniedException, BaseException
name
- The name of the parameterPermissionDeniedException
- If the parameter contain values that
the logged in user doesn't have read permission forBaseException
- If there is another errorpublic List<?> getParameterValues(String name) throws PermissionDeniedException, BaseException
name
- The name of the parameterPermissionDeniedException
- If the parameter contain values that
the logged in user doesn't have read permission forBaseException
- If there is another errorpublic ParameterInfo getParameterInfo(String name) throws PermissionDeniedException, BaseException
name
- The name of the parameterPermissionDeniedException
- If the parameter contain values that
the logged in user doesn't have read permission forBaseException
- If there is another errorpublic void setParameterValue(String name, ParameterType<?> parameterType, Object value) throws InvalidDataException, PermissionDeniedException, BaseException
Job.Status.WAITING
.name
- The name of the parameterparameterType
- The type of the parametervalue
- The value of the parameterPermissionDeniedException
- If the logged in user doesn't
have write permission or if the job is executingInvalidDataException
- If name is null or the new value doesn't
validate against the parameter typeBaseException
- If there is another errorpublic void setParameterValue(String name, String label, String description, ParameterType<?> parameterType, Object value) throws InvalidDataException, PermissionDeniedException, BaseException
Job.Status.WAITING
.name
- The name of the parameterlabel
- The label of the parameter (optional)description
- A description of the parameter (optional)parameterType
- The type of the parametervalue
- The value of the parameterPermissionDeniedException
- If the logged in user doesn't
have write permission or if the job is executingInvalidDataException
- If name is null or the new value doesn't
validate against the parameter typeBaseException
- If there is another errorpublic void setParameterValues(String name, ParameterType<?> parameterType, List<?> values) throws InvalidDataException, PermissionDeniedException, BaseException
Job.Status.WAITING
.name
- The name of the parameterparameterType
- The type of the parametervalues
- A list containing the valuesPermissionDeniedException
- If the logged in user doesn't
have write permission or if the job is
executingInvalidDataException
- If name is null or the new value doesn't
validate against the parameter typeBaseException
- If there is another errorpublic void setParameterValues(String name, String label, String description, ParameterType<?> parameterType, List<?> values) throws InvalidDataException, PermissionDeniedException, BaseException
Job.Status.WAITING
.name
- The name of the parameterlabel
- The label of the parameter (optional)description
- A description of the parameter (optional)parameterType
- The type of the parametervalues
- A list containing the valuesPermissionDeniedException
- If the logged in user doesn't
have write permission or if the job is
executingInvalidDataException
- If name is null or the new value doesn't
validate against the parameter typeBaseException
- If there is another errorpublic void copyParametersFrom(Job copyFrom) throws InvalidDataException, PermissionDeniedException, BaseException
copyFrom
- The job to copy parameters fromInvalidDataException
- If the copyFrom parameter is nullPermissionDeniedException
- If the logged in user doesn't have write
permission for this configurationBaseException
- If there is another errorvoid setParameterValuesInternal(String name, String label, String description, ParameterType<?> parameterType, List<?> values, boolean validate) throws InvalidDataException, PermissionDeniedException, BaseException
name
- The name of the configuration parameterlabel
- The label of the parameter (optional)description
- A description of the parameter (optional)parameterType
- The type of the parametervalues
- A list containing the new values, null or empty to remove the
configuration valuesvalidate
- If validation by ParameterType.validate(String, List)
is needed or notPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If name is null or the new value doesn't
validate against the parameter typeBaseException
- If there is another errorParameterValuesImpl getParameterValuesImpl() throws BaseException
BaseException
private void sendMessage()