Package net.sf.basedb.core
Class PluginResponse
- java.lang.Object
-
- net.sf.basedb.core.PluginResponse
-
public final class PluginResponse extends Object
Get the response from a configuration step or execution of a plugin. UsegetStatus()
to find out the status of the last invokation. SeePluginRequest
for more information.- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date$
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
PluginResponse.ResponseImpl
An implementation of the Response interface used by the plugin to return information to the client.
-
Field Summary
Fields Modifier and Type Field Description private boolean
allowImmediateDownload
private boolean
allowImmediateExecution
private boolean
clearState
private boolean
dryRun
private List<? extends Throwable>
errorList
private Job.ExecutionTime
estimatedExecutionTime
private String
message
private String
nextCommand
private PluginConfigurationRequest
request
private Response
response
private Serializable
state
private Response.Status
status
private String
suggestedJobName
-
Constructor Summary
Constructors Constructor Description PluginResponse(PluginConfigurationRequest request, boolean allowImmediateExection, boolean allowImmediateDownload, boolean dryRun)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
downloadImmediately(ExportOutputStream out, ProgressReporter progress)
boolean
getClearState()
If set after a job configuration sequence, the saved state should be cleared before starting the job.List<? extends Throwable>
getErrorList()
Get a list containing detailed error messages if the status isResponse.Status.ERROR
.Job.ExecutionTime
getEstimatedExecutionTime()
Get the estimated execution time of the job.PluginExecutionRequest
getExecutionRequest(ProgressReporter progress)
String
getMessage()
Get the return message from the plugin.String
getNextCommand()
Get the next command sent viaResponse.Status.CONTINUE
.PluginConfigurationRequest
getNextRequest()
Get aPluginRequest
object that handles the next request, if status isResponse.Status.CONTINUE
.(package private) Response
getResponseImpl()
Get a new reponse object.Serializable
getState()
Get the state information that the plug-in wants to save until it is restarted again.Response.Status
getStatus()
Get the status of the response.String
getSuggestedJobName()
Get the job name that was suggested by the job.boolean
isDryRun()
Check if the job should be executed or was executed in dry-run mode.private void
reset(Response.Status status)
void
saveParameters(DbControl dc)
Save all parameters that has been configured during the configuration sequence to the database.(package private) void
setError(String message, Throwable t)
Set a singe error message.
-
-
-
Field Detail
-
request
private final PluginConfigurationRequest request
-
response
private final Response response
-
allowImmediateExecution
private final boolean allowImmediateExecution
-
allowImmediateDownload
private final boolean allowImmediateDownload
-
status
private Response.Status status
-
estimatedExecutionTime
private Job.ExecutionTime estimatedExecutionTime
-
message
private String message
-
dryRun
private boolean dryRun
-
suggestedJobName
private String suggestedJobName
-
clearState
private boolean clearState
-
nextCommand
private String nextCommand
-
state
private Serializable state
-
-
Constructor Detail
-
PluginResponse
PluginResponse(PluginConfigurationRequest request, boolean allowImmediateExection, boolean allowImmediateDownload, boolean dryRun)
-
-
Method Detail
-
getStatus
public Response.Status getStatus()
Get the status of the response.
-
isDryRun
public boolean isDryRun()
Check if the job should be executed or was executed in dry-run mode.- Since:
- 2.8
-
getSuggestedJobName
public String getSuggestedJobName()
Get the job name that was suggested by the job.- Returns:
- A job name or null if no name has been suggested
- Since:
- 2.17
-
getMessage
public String getMessage()
Get the return message from the plugin.
-
getEstimatedExecutionTime
public Job.ExecutionTime getEstimatedExecutionTime()
Get the estimated execution time of the job. This value is only meaningful after a successful configuration sequence for a job.
-
getErrorList
public List<? extends Throwable> getErrorList()
Get a list containing detailed error messages if the status isResponse.Status.ERROR
.- See Also:
getMessage()
-
getNextCommand
public String getNextCommand()
Get the next command sent viaResponse.Status.CONTINUE
.- Returns:
- The next command or null
- Since:
- 2.16
-
getState
public Serializable getState()
Get the state information that the plug-in wants to save until it is restarted again.- Since:
- 3.11
-
getClearState
public boolean getClearState()
If set after a job configuration sequence, the saved state should be cleared before starting the job.- Since:
- 3.11
-
getNextRequest
public PluginConfigurationRequest getNextRequest()
Get aPluginRequest
object that handles the next request, if status isResponse.Status.CONTINUE
.
-
getExecutionRequest
public PluginExecutionRequest getExecutionRequest(ProgressReporter progress) throws PermissionDeniedException
- Throws:
PermissionDeniedException
-
saveParameters
public void saveParameters(DbControl dc)
Save all parameters that has been configured during the configuration sequence to the database.- Parameters:
dc
- An open DbControl to use when accessing the database.
-
downloadImmediately
public void downloadImmediately(ExportOutputStream out, ProgressReporter progress) throws IOException
- Throws:
IOException
-
getResponseImpl
Response getResponseImpl()
Get a new reponse object. Used by thePluginRequest.invoke()
method.
-
reset
private void reset(Response.Status status)
-
-