Interface Launch
-
public interface Launch
Describes a launch, which is the execution of a service on the server. A launch provides information on its state and on the result of the execution.This interface is not intended to be implemented by clients.
- See Also:
LaunchManager.getLaunch(String)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
cancel()
Requests to cancel the launch execution.List<Argument>
getArguments()
Returns the launch arguments.long
getEndTime()
Returns the time at which the service execution terminated.String
getId()
Returns the unique launch identifier.List<LogEntry>
getLogEntries()
Returns the messages logged during the service execution.int
getRequestNumber()
Returns the number associated with this launch.long
getRequestTime()
Returns the time at which the service execution was requested.LaunchResult
getResult()
Returns the result of the service execution, which notably describes the generated files.String
getServiceId()
Returns the identifier of the executed service.long
getStartTime()
Returns the time at which the service execution started.LaunchState
getState()
Returns the execution state of this launch.PropertySet
getStatusProperties()
Returns the properties associated with the launch status, as given by the service developer.
-
-
-
Method Detail
-
getId
String getId()
Returns the unique launch identifier.- Returns:
- the unique launch identifier.
- See Also:
LaunchManager.getLaunch(String)
-
getServiceId
String getServiceId()
Returns the identifier of the executed service.- Returns:
- the identifier of the executed service.
- See Also:
ServicesManager.getService(String)
-
getState
LaunchState getState()
Returns the execution state of this launch.- Returns:
- the execution state of this launch.
-
getArguments
List<Argument> getArguments()
Returns the launch arguments. Each argument must match an expected service parameter.- Returns:
- the launch arguments.
-
getStatusProperties
PropertySet getStatusProperties()
Returns the properties associated with the launch status, as given by the service developer.When the service execution is performed from a custom integration, it might be useful that the service sends some custom information back to the integration while the launch is executed. Sending from an execution custom information to the requestor of a launch can be achieved using the following code:
PropertySet launchStatus = (PropertySet) ScriptContainer.context.getProperty(LaunchManager.OPTION_STATUS); launchStatus.setProperty("myProperty", "myPropertyValue");
This custom status information is serialized within the launch REST service response, so that an integration can provide additional feedback to the end-user about the current state of the execution.
- Returns:
- a set of properties describing the launch status.
-
getLogEntries
List<LogEntry> getLogEntries()
Returns the messages logged during the service execution.- Returns:
- the messages logged during the service execution.
-
getResult
LaunchResult getResult()
Returns the result of the service execution, which notably describes the generated files.- Returns:
- the result of the service execution.
-
getRequestTime
long getRequestTime()
Returns the time at which the service execution was requested. The request time differs from the actual execution start time, as the launch might be enqueued before its execution is started. Time is expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.- Returns:
- the time at which the service execution was requested.
- Since:
- 2.2.0
-
getRequestNumber
int getRequestNumber()
Returns the number associated with this launch.Each time a new launch is requested, a global counter is incremented and a number is associated to the created launch.
This number is intended to facilitate the visual identification of a launch by an administrator. It is not guaranteed to be unique for the lifetime of the web application. It is not meant to be used for any programmatic identification nor to be used in web services.
- Returns:
- the number associated with this launch.
- Since:
- 2.2.0
-
getStartTime
long getStartTime()
Returns the time at which the service execution started. Time is expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.- Returns:
- the start time of the service execution.
-
getEndTime
long getEndTime()
Returns the time at which the service execution terminated. Time is expressed as the number of milliseconds since January 1, 1970, 00:00:00 GMT.- Returns:
- the termination time of the service execution.
-
cancel
void cancel()
Requests to cancel the launch execution. This method will notify the progress monitor a cancellation is requested. It is up to the service developer to regularly check the execution progress monitor for cancellation and to perform the necessary steps to abort safely the execution.
-
-