static class ExternalProgramExecutor.ResponseWrapper extends java.lang.Object implements Response
Response.Status
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.Throwable> |
errors |
private boolean |
hasError |
private java.lang.String |
message |
Constructor and Description |
---|
ResponseWrapper() |
Modifier and Type | Method and Description |
---|---|
(package private) java.util.List<java.lang.Throwable> |
getErrors() |
(package private) java.lang.String |
getMessage() |
(package private) java.lang.String |
getMessage(java.lang.String defaultMessage) |
(package private) boolean |
hasError() |
void |
setClearState()
This can be used in the configuration phase of a plug-in
to clear the stored state and nextCommand information.
|
void |
setContinue(java.lang.String nextCommand)
This method will continue the configuration or execution of the
job with a new command to the plugin.
|
void |
setContinue(java.lang.String nextCommand,
java.io.Serializable state)
Can be used by an executing job to also store state information
that will be restored when the job is starting up again.
|
void |
setDone(java.lang.String message)
This will end the job execution and report it as a success.
|
void |
setDone(java.lang.String message,
Job.ExecutionTime estimatedExecutionTime)
This will end the configuration of a job and set the estimated
execution time for it.
|
void |
setDownloadImmediately(java.lang.String message,
Job.ExecutionTime estimatedExecutionTime,
boolean failIfDenied)
This will end the configuration of a export job, and start to execute it
for immediate download.
|
void |
setDryRun(boolean dryRun)
A plug-in may call this method in it's configuration phase or
after it has been executed to indicate that the job should be
or was executed as a dry-run job.
|
void |
setError(java.lang.String message,
java.util.List<? extends java.lang.Throwable> errorList)
This will end the job execution or configuration and report it as a
failure.
|
void |
setExecuteImmediately(java.lang.String message,
Job.ExecutionTime estimatedExecutionTime,
boolean failIfDenied)
This will end the configuration of a job, and start to execute it
immediately if the plugin is permitted to do so.
|
void |
setPause(java.lang.String message,
java.lang.String nextCommand,
java.io.Serializable state)
A plug-in can call this method to notify the core that it has been
paused.
|
void |
setSuggestedJobName(java.lang.String jobName)
A plug-in may call this method on it's job configuration phase
to suggest a name for the job.
|
private java.lang.String message
private java.util.List<java.lang.Throwable> errors
private boolean hasError
boolean hasError()
java.util.List<java.lang.Throwable> getErrors()
java.lang.String getMessage()
java.lang.String getMessage(java.lang.String defaultMessage)
public void setContinue(java.lang.String nextCommand) throws PermissionDeniedException
Response
Signal.SHUTDOWN
signal.setContinue
in interface Response
nextCommand
- The next command to the pluginPermissionDeniedException
- If another command isn't allowedpublic void setContinue(java.lang.String nextCommand, java.io.Serializable state) throws PermissionDeniedException
Response
setContinue
in interface Response
nextCommand
- The next command to the pluginstate
- State information that will be restored when resumingPermissionDeniedException
Response.setPause(String, String, Serializable)
public void setPause(java.lang.String message, java.lang.String nextCommand, java.io.Serializable state)
Response
public void setDone(java.lang.String message, Job.ExecutionTime estimatedExecutionTime)
Response
public void setDone(java.lang.String message)
Response
public void setDownloadImmediately(java.lang.String message, Job.ExecutionTime estimatedExecutionTime, boolean failIfDenied) throws PermissionDeniedException
Response
Response.setExecuteImmediately(String, Job.ExecutionTime, boolean)
but:
ImmediateDownloadExporter
interface.
ImmediateDownloadExporter.doExport(ExportOutputStream, ProgressReporter)
instead of the Plugin.run(Request, Response, ProgressReporter)
method.
setDownloadImmediately
in interface Response
message
- An optional messageestimatedExecutionTime
- An estimated execution time for the job,
null is the same as ExecutionTime.LONG
. This value is only used
if immediate execution isn't possible and the job has to be added to the
job queue.failIfDenied
- TRUE if a PermissionDeniedException should be thrown if
immediate exection isn't possible, FALSE to add the job to the job queue
for later exectionPermissionDeniedException
- If the logged in user doesn't have write permission to the job.public void setDryRun(boolean dryRun)
Response
NOTE! Setting this value to true doesn't change the behaviour
of the core. It is the responsibility of the plug-in to check
this value(eg. Job.isDryRun()
and take appropriate action.
public void setSuggestedJobName(java.lang.String jobName)
Response
setSuggestedJobName
in interface Response
public void setError(java.lang.String message, java.util.List<? extends java.lang.Throwable> errorList)
Response
public void setExecuteImmediately(java.lang.String message, Job.ExecutionTime estimatedExecutionTime, boolean failIfDenied) throws PermissionDeniedException
Response
failIfDenied
flag is set to true,
in which case an exception will be thrown.
If immediate execution is possible the client application must continue to use the same instance of the plugin object. This means that immediate execution always happens in the same virtual machine. Plugins should be aware of this and avoid excessive use of resources such as memory and CPU time.
The client application may execute the job in another thread.
setExecuteImmediately
in interface Response
message
- An optional messageestimatedExecutionTime
- An estimated execution time for the job,
null is the same as ExecutionTime.LONG
. This value is only used
if immediate execution isn't possible and the job has to be added to the
job queue.failIfDenied
- TRUE if a PermissionDeniedException should be thrown if
immediate exection isn't possible, FALSE to add the job to the job queue
for later exectionPermissionDeniedException
- If logged in user doesn't have write permission on the job.public void setClearState()
Response
setClearState
in interface Response