public interface RuntimeService
Modifier and Type | Interface and Description |
---|---|
static class |
RuntimeService.QueryField
Field names to be used when querying the Runtime Store.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_ASYNC_REQUEST_TIMEOUT
The default timeout in minutes for an asynchronous request.
|
static boolean |
DEFAULT_EXECUTE_PAST
The default setting for EXECUTE_PAST.
|
static int |
DEFAULT_PRIORITY
The default system priority associated with a request.
|
static int |
DEFAULT_REPROCESS_DELAY
The default period, in minutes, in which processing must be
postponed by a callout handler.
|
static int |
DEFAULT_REQUEST_EXPIRATION
The default expiration, in minutes, for a request.
|
static int |
DEFAULT_RETRIES
The default number of times a failed request will be retried.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelRequest(RuntimeServiceHandle handle,
long requestId)
Cancels the processing of a request that is not in a terminal state.
|
Map |
checkDetailedPermissions(RuntimeServiceHandle handle,
long[] requestIds,
RuntimeDataPermission.Action[] privileges)
Check whether the current user has privilegs on the input requests
identified by a list of request ids.
|
Map |
checkRequestPrivilege(RuntimeServiceHandle handle,
long[] requestIds,
RuntimeDataPermission.Action[] privileges)
Check whether the current user has privilegs on the input requests
identified by a list of request ids.
|
void |
close(RuntimeServiceHandle handle)
Closes the runtime handle.
|
void |
close(RuntimeServiceHandle handle,
boolean abort)
Closes the runtime handle.
|
void |
closeContent(RuntimeServiceHandle handle,
ContentHandle contentHandle)
Closes the previously opened log or output content and releases
the handle.
|
void |
deleteOutputContent(RequestExecutionContext context,
List contentNames)
Deletes the list of request output content from the content store,
if it exists.
|
void |
deleteRequest(RuntimeServiceHandle handle,
long requestId)
Marks a submitted request as deleted.
|
ApplicationConfig |
getApplicationConfig(RuntimeServiceHandle handle)
Gets the configuration for this application as specified in
ess-config.xml and customizations thereof, including default values.
|
byte[] |
getBinaryContent(RuntimeServiceHandle handle,
ContentHandle contentHandle,
int maxBytes)
Gets at most
maxBytes bytes from the binary content. |
ExternalJobStatus |
getExternalJobStatus(RuntimeServiceHandle handle,
long requestId)
Determines the general status of the external job for a request.
|
FailedExecutionResult |
getFailedExecutionResult(RuntimeServiceHandle handle,
long requestId)
Retrieves the result of the last failed execution attempt for the
specified request which has been retried at least once.
|
Locale |
getLocale(RuntimeServiceHandle handle)
Get the locale associated with this session.
|
ContentDetail |
getLogContentDetail(RuntimeServiceHandle handle,
long requestId)
Gets the log content detail for the request.
|
Set |
getLogicalApplicationNames(RuntimeServiceHandle handle)
Get a list of all logical application names for ESS hosted
applications currently deployed.
|
String[] |
getLogLines(RuntimeServiceHandle handle,
ContentHandle contentHandle,
int maxLines)
Gets at most
maxLines lines from the request log,
continuing from the last call to this method. |
List |
getOutputContentDetail(RuntimeServiceHandle handle,
long requestId)
Gets details for all output content for the request.
|
ContentDetail |
getOutputContentDetail(RuntimeServiceHandle handle,
long requestId,
String contentName)
Gets details for the specified output content for the request.
|
RequestDetail |
getRequestDetail(RuntimeServiceHandle handle,
long requestId)
Retrieves runtime details of the specified request.
|
RequestDetail |
getRequestDetail(RuntimeServiceHandle handle,
long requestId,
boolean includeTranslation)
Retrieves runtime details of the specified request.
|
RequestDetail |
getRequestDetailBasic(RuntimeServiceHandle handle,
long requestId)
Retrieves basic runtime details of the specified request.
|
RequestDetail[] |
getRequestDetails(RuntimeServiceHandle handle,
long[] requestIds)
Retrieves basic runtime details of the specified requests.
|
RequestDetail[] |
getRequestDetails(RuntimeServiceHandle handle,
long[] requestIds,
boolean includeTranslation)
Retrieves basic runtime details of the specified requests.
|
Object |
getRequestParameter(RuntimeServiceHandle handle,
long requestId,
String name)
Retrieves the value of a request parameter.
|
Enumeration |
getRequests(RuntimeServiceHandle handle,
long requestId)
Gets an enumeration of the request identifiers for those requests
that have the specified request as their immediate parent and are
associated with the current execution attempt of that parent request.
|
State |
getRequestState(RuntimeServiceHandle handle,
long requestId)
Retrieves the current state of the specified request.
|
char[] |
getTextContent(RuntimeServiceHandle handle,
ContentHandle contentHandle,
int maxChars)
Gets at most
maxChars lines from the log or output text content. |
void |
holdRequest(RuntimeServiceHandle handle,
long requestId)
Withholds further processing of a request that is in
WAIT
or READY state. |
boolean |
isHandleRollbackOnly(RuntimeServiceHandle handle)
Determine if this handle has been marked such that the associated
transaction can only be rolled back.
|
boolean |
isStandaloneEnv(RuntimeServiceHandle handle)
Indicates whether the environment is standalone or fusion.
|
void |
lockRequest(RuntimeServiceHandle handle,
long requestId)
Acquires a lock for the given request.
|
void |
logContent(RequestExecutionContext context,
Level level,
String message)
Logs a message to the request log in the content store
during job execution.
|
RuntimeServiceHandle |
open()
Allocates system resources for performing subsequent runtime
operations.
|
RuntimeServiceHandle |
open(Locale locale)
Allocates system resources for performing subsequent runtime
operations.
|
ContentHandle |
openLogContent(RuntimeServiceHandle handle,
long requestId)
Opens the request log to retrieve the log data.
|
ContentHandle |
openOutputContent(RuntimeServiceHandle handle,
long requestId,
String contentName)
Opens the specified request output to retrieve the output data.
|
ContentHandle |
openOutputContent(RuntimeServiceHandle handle,
RequestExecutionContext context,
String contentName,
ContentType contentType,
EnumSet options)
Opens the named request output during job execution.
|
boolean |
outputContentExists(RequestExecutionContext context,
String contentName)
Determines if the output content exists for the request.
|
Enumeration |
queryRequests(RuntimeServiceHandle handle,
Filter filter,
RuntimeService.QueryField orderBy,
boolean ascending)
Retrieves an enumeration of the request identifers for all requests
whose attribute and system properties match those specified by the
query parameters
|
void |
releaseRequest(RuntimeServiceHandle handle,
long requestId)
Releases a request from the
HOLD state. |
void |
replaceSchedule(RuntimeServiceHandle handle,
long requestId,
MetadataObjectId scheduleId)
Replace the current schedule for a request that has already been
submitted.
|
void |
replaceSchedule(RuntimeServiceHandle handle,
long requestId,
MetadataObjectId scheduleId,
Schedule schedule,
Calendar start,
Calendar end)
Replace the current schedule for a request that has already been
submitted with a schedule.
|
void |
replaceSchedule(RuntimeServiceHandle handle,
long requestId,
Schedule schedule)
Replace the current schedule for a request that has already been
submitted.
|
void |
setHandleRollbackOnly(RuntimeServiceHandle handle)
Modify the transaction associated with this handle such that the
only possible outcome of the transaction is to roll back the
transaction.
|
void |
setRequestParameter(RuntimeServiceHandle handle,
long requestId,
String name,
Object value)
Sets the value of a request parameter for a specified request.
|
long |
submitRequest(RuntimeServiceHandle handle,
RequestExecutionContext context,
String description,
MetadataObjectId definition,
RequestParameters parameters)
Submits a sub-request.
|
long |
submitRequest(RuntimeServiceHandle handle,
String description,
JobType.ExecutionType type,
Schedule schedule,
oracle.as.scheduler.Trigger trigger,
Calendar start,
Calendar end,
RequestParameters parameters)
Adhoc job request submission using specified Schedule.
|
long |
submitRequest(RuntimeServiceHandle handle,
String description,
MetadataObjectId definition,
Calendar start,
RequestParameters parameters)
Creates a new job request using metadata definition of the job
to run once on a specific time.
|
long |
submitRequest(RuntimeServiceHandle handle,
String description,
MetadataObjectId definition,
MetadataObjectId schedule,
MetadataObjectId trigger,
Calendar start,
Calendar end,
RequestParameters parameters)
Creates a new job request using metadata definitions of the job,
and schedule.
|
long |
submitRequest(RuntimeServiceHandle handle,
String description,
MetadataObjectId definition,
Schedule schedule,
oracle.as.scheduler.Trigger trigger,
Calendar start,
Calendar end,
RequestParameters parameters)
Adhoc job request submission using job definition from metadata.
|
void |
updateRequestParameter(RuntimeServiceHandle handle,
long requestId,
String name,
Object value)
Updates the value of a request parameter for a specified request.
|
void |
updateRequestStartEnd(RuntimeServiceHandle handle,
long requestId,
Calendar start,
Calendar end)
Replace the start and end time for a request that has already
been submitted.
|
void |
writeContent(ContentHandle contentHandle,
byte[] bytes)
Appends the bytes to the output content during job execution.
|
void |
writeContent(ContentHandle contentHandle,
char[] chars)
Appends the characters to the output content during job execution.
|
void |
writeContent(ContentHandle contentHandle,
String message)
Appends the string to the output content during job execution.
|
void |
writelnContent(ContentHandle contentHandle,
String message)
Appends the string followed by a line feed character to the
output content during job execution.
|
static final int DEFAULT_REPROCESS_DELAY
static final int DEFAULT_PRIORITY
static final int DEFAULT_REQUEST_EXPIRATION
static final int DEFAULT_RETRIES
static final boolean DEFAULT_EXECUTE_PAST
static final long DEFAULT_ASYNC_REQUEST_TIMEOUT
RuntimeServiceHandle open() throws RuntimeServiceException
The handle returned by this method will associated with the
allocated resources and can be used for multiple runtime operations.
The close
operation closes the handle and that handle
instance cannot be used for subsequent operations.
If this method is called in a non-transactional context, then the
close
operation will attempt to save (commit) or discard
(rollback) the runtime store changes associated with that handle.
If this method is called within a transactional context, then it
is the responsibility of the transaction manager to commit or
rollback the changes.
RuntimeServiceException
- if runtime service sub-system error.RuntimeServiceHandle open(Locale locale) throws RuntimeServiceException
The handle returned by this method will associated with the
allocated resources and can be used for multiple runtime operations.
The close
operation closes the handle and that handle
instance cannot be used for subsequent operations.
If this method is called in a non-transactional context, then the
close
operation will attempt to save (commit) or discard
(rollback) the runtime store changes associated with that handle.
If this method is called within a transactional context, then it
is the responsibility of the transaction manager to commit or
rollback the changes.
locale
- Client locale object used for accessing appropriate
metadata resource bundles.RuntimeServiceException
- if runtime service sub-system error.void close(RuntimeServiceHandle handle) throws RuntimeServiceException
This method only commits changes, and only if the open
operation that returned the handle was done in a non-transactional
context. If it was a transactional context, then it is the
responsibility of the transaction manager to commit or rollback
the changes.
Once a close
operation is performed on a handle instance,
that handle cannot be used any subsequent operations.
handle
- the resources associated with the
RuntimeServiceHandle
instance to be de-allocated.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.void close(RuntimeServiceHandle handle, boolean abort) throws RuntimeServiceException
This method can commit (save) or rollback (discard) changes.
It can only do so if the open
operation that returned
the handle was done in a non-transactional context. If it was a
transactional context, then it is the responsibility of the
transaction manager to commit or rollback the changes.
Once a close
operation is performed on a handle instance,
that handle cannot be used any subsequent operations.
handle
- the resources associated with the
RuntimeServiceHandle
instance to be de-allocated.abort
- true
to discard any runtime store changes
associated with this handle, or false
to retain changes.
This parameter has no effect if the open
was done in a
transactional context.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.long submitRequest(RuntimeServiceHandle handle, String description, MetadataObjectId definition, Calendar start, RequestParameters parameters) throws MetadataNotFoundException, ValidationException, RuntimeServiceException
A submitted request might be singleton or it might yield one or more child requests for a job set. In the later case, the single identifier returned by this method is the parent of all ensuing child requests.
handle
- the runtime handle instance returned from a prior
open
call.description
- an optional search description for the request.
This is primarily a search tag specific to this request.
See RuntimeService.QueryField.NAME
. This value cannot be
defined in the job definition and is not required to be a human
readable value.definition
- the metadata identifier of a Job definition or
JobSet definition for the request being submitted.start
- the requested start time for the request. The request
will not run prior to this time. If null
, the current
time will be used. If the request is meant to begin
immediately, null
should be specified.parameters
- parameters specified as part of the request.MetadataNotFoundException
- if any metadata specified for
this operation was not found in the metadata repository.ValidationException
- if the request validation failed.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.long submitRequest(RuntimeServiceHandle handle, String description, MetadataObjectId definition, MetadataObjectId schedule, MetadataObjectId trigger, Calendar start, Calendar end, RequestParameters parameters) throws MetadataNotFoundException, ValidationException, RuntimeServiceException
A submitted request might be singleton or it might yield one or more child requests viz. recurring schedules and job sets. In the later cases, the single identifier returned is the parent of all ensuing child requests.
handle
- the runtime handle instance returned from a prior
open
call.description
- an optional search description for the request.
This is primarily a search tag specific to this request.
See RuntimeService.QueryField.NAME
. This value cannot be
defined in the job definition and is not required to be a human
readable value.definition
- the metadata identifier of a job definition or
job set to use from metadata.schedule
- the metadata identifier of the job schedule to use
from metadata.trigger
- the value of this parameter must be null
.start
- the requested start time for the request. The
request will not run prior to this time. The value may also, in
some cases, be used to fill in missing recurrence fields for a
recurring schedule. If null
, the current time will be
used. If the request is meant to begin immediately, null
should be specified.
The start time applies to both Schedule, if present.end
- the time past which this request or its child
requests will not be dispatched for execution. If null
,
no end time is in effect.
The end time applies to the Schedule, if present.parameters
- request parameters specified as part of the request.MetadataNotFoundException
- if any metadata specified for
this operation was not found in the metadata repository.ValidationException
- if the request validation failed.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.long submitRequest(RuntimeServiceHandle handle, String description, JobType.ExecutionType type, Schedule schedule, oracle.as.scheduler.Trigger trigger, Calendar start, Calendar end, RequestParameters parameters) throws ValidationException, RuntimeServiceException
A submitted request might be singleton or it might yield one or more child requests viz. recurring schedules, and job sets. In the later cases, the single identifier returned is the parent of all ensuing child requests.
handle
- the runtime handle instance returned from a prior
open
call.description
- an optional search description for the request.
This is primarily a search tag specific to this request.
See RuntimeService.QueryField.NAME
. This value is not
required to be a human readable value.type
- must be one of the base types values viz.
JAVA_TYPE
, SQL_TYPE
and PROCESS_TYPE
specified
by JobType.ExecutionType
enum.schedule
- the instance of Schedule object, or null if none.trigger
- the value of this parameter must be null
.start
- the requested start time for the request. The
request will not run prior to this time. The value may also, in
some cases, be used to fill in missing recurrence fields for a
recurring schedule. If null
, the current time will be
used. If the request is meant to begin immediately, null
should be specified.
The start time applies to the Schedule if present.end
- the time past which this request or its child
requests will not be dispatched for execution. If null
,
no end time is in effect. The end time applies to both the
Schedule, if specified.parameters
- request parameters specified as part of the request.ValidationException
- if the request validation failed.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.long submitRequest(RuntimeServiceHandle handle, String description, MetadataObjectId definition, Schedule schedule, oracle.as.scheduler.Trigger trigger, Calendar start, Calendar end, RequestParameters parameters) throws MetadataNotFoundException, ValidationException, RuntimeServiceException
A submitted request might be singleton or it might yield one or more child requests viz. recurring schedules, and job sets. In the later cases, the single identifier returned is the parent of all ensuing child requests.
handle
- the runtime handle instance returned from a prior
open
call.description
- an optional search description for the request.
This is primarily a search tag specific to this request.
See RuntimeService.QueryField.NAME
. This value cannot be
defined in the job definition and is not required to be a human
readable value.definition
- the metadata identifier of the job definition
or job set stored in metadata.schedule
- instance of schedule object.trigger
- the value of this parameter must be null
.start
- the requested start time for the request. The
request will not run prior to this time. The value may also, in
some cases, be used to fill in missing recurrence fields for a
recurring schedule. If null
, the current time will be
used. If the request is meant to begin immediately, null
should be specified.
The start time applies to the Schedule, if present.end
- the time past which this request or its child
requests will not be dispatched for execution. If null
,
no end time is in effect.
The end time applies to the Schedule, if present.parameters
- request parameters specified as part of the request.MetadataNotFoundException
- if any metadata specified for
this operation was not found in the metadata repository.ValidationException
- if the request validation failed.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.long submitRequest(RuntimeServiceHandle handle, RequestExecutionContext context, String description, MetadataObjectId definition, RequestParameters parameters) throws MetadataNotFoundException, ValidationException, RuntimeServiceException
Passing the execution context ties the sub-request being submitted
to the currently running request. After submitting the sub-request,
the submitting (parent) request must pause before Enterprise
Scheduler will execute the sub-request. For example, a Java job
should throw an ExecutionPausedException
. Upon completion
of the sub-request, the parent request will be resumed.
handle
- the runtime handle instance returned from a prior
open
call.context
- the execution context of the running request that is
submitting the sub-request.description
- an optional search description for the request.
This is primarily a search tag specific to this request.
See RuntimeService.QueryField.NAME
. This value cannot be
defined in the job definition and is not required to be a human
readable value.definition
- the metadata identifier of the job definition
for the sub-request.parameters
- request parameters specified a part of the request.MetadataNotFoundException
- if any metadata specified for
this operation was not found in the metadata repository.ValidationException
- if the request validation failed.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.Object getRequestParameter(RuntimeServiceHandle handle, long requestId, String name) throws RequestNotFoundException, ValidationException, RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the request.name
- the name of the System property or user request parameter
to retrieve.RequestNotFoundException
- if the request was not foundValidationException
- if the name
parameter does not
exist, or name
does not represent a valid system property.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.void lockRequest(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
close
operation is subsequently
invoked or the encompassing transaction is committed.
If an application tries to invoke this operation while the lock is being held by another thread, this method will block until the lock is released.
The method can be used to ensure data consistency when updating request parameters or system properties.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the request.RequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.void updateRequestParameter(RuntimeServiceHandle handle, long requestId, String name, Object value) throws RequestNotFoundException, ValidationException, RuntimeServiceException
This operation fails if the request parameter does not already exist.
This operation is subject to any read-only constraint on the parameter being updated and an error occurs if the parameter is read-only.
This operation applies to only the target request. It does not cascade to any other requests that may be associated with the request.
This operation acquires a lock for the given request.
The lock is released when close
operation is subsequently
invoked or the encompassing transaction is committed.
If an application tries to invoke this operation while the lock is
being held by another thread, this method will block until the
lock is released.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the request.name
- the name of the parameter to modify.value
- the new value of the parameter.RequestNotFoundException
- if the request was not foundValidationException
- if parameter validation fails.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.void setRequestParameter(RuntimeServiceHandle handle, long requestId, String name, Object value) throws RequestNotFoundException, ValidationException, RuntimeServiceException
The parameter will be added if it does not already exist, otherwise the value of the parameter will be updated.
This operation is subject to any read-only constraint on the parameter being set and an error occurs if the parameter already exists and is read-only.
This operation applies to only the target request. It does not cascade to any other requests that may be associated with the request.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the request.name
- the name of the parameter to set.value
- the new value of the parameter.RequestNotFoundException
- if the request was not foundValidationException
- if parameter validation fails.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.State getRequestState(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the request.State
of the requestRequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error,
or handle
is null.FailedExecutionResult getFailedExecutionResult(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
handle
- runtime handle instance returned from a prior
open
call.requestId
- request identifier of the request.FailedExecutionResult
of the last failed execution
attempt for the request.RequestNotFoundException
- if no failed execution history
was found for the request, meaning the request has not been retriedRuntimeServiceException
- if runtime service sub-system error,
or handle
is null.Enumeration getRequests(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the target request.Enumeration<Long>
of request identifiers which have
requestId
as the immediate parent.RequestNotFoundException
- if the request was not found.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RequestDetail getRequestDetail(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, MetadataNotFoundException, RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the requestRequestNotFoundException
- if the request was not found.MetadataNotFoundException
- if any metadata referenced for
this operation was not found in the metadata repository.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RequestDetail getRequestDetail(RuntimeServiceHandle handle, long requestId, boolean includeTranslation) throws RequestNotFoundException, MetadataNotFoundException, RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the requestincludeTranslation
- true
for getting info in localized
form, or false
for default values.RequestNotFoundException
- if the request was not found.MetadataNotFoundException
- if any metadata referenced for
this operation was not found in the metadata repository.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RequestDetail getRequestDetailBasic(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
RequestDetail
returned by this method includes most
of the information as getRequestDetail
, but
some less commonly used information is omitted for performance reasons.
Specifically, the information returned by the following
RequestDetail
methods is not meaningful:
getSchedule
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request identifier of the requestRequestNotFoundException
- if the request was not found.MetadataNotFoundException
- if any metadata referenced for
this operation was not found in the metadata repository.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RequestDetail[] getRequestDetails(RuntimeServiceHandle handle, long[] requestIds) throws RequestNotFoundException, RuntimeServiceException
RequestDetail
s returned by this method includes most
of the information as getRequestDetail
, but
some less commonly used information is omitted for performance reasons.
Specifically, the information returned by the following
RequestDetail
methods is not meaningful:
getSchedule
handle
- the runtime handle instance returned from a prior
open
call.requestIds
- the request identifier of the requestRequestNotFoundException
- if the request was not found.MetadataNotFoundException
- if any metadata referenced for
this operation was not found in the metadata repository.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RequestDetail[] getRequestDetails(RuntimeServiceHandle handle, long[] requestIds, boolean includeTranslation) throws RequestNotFoundException, RuntimeServiceException
RequestDetail
s returned by this method includes most
of the information as getRequestDetail
, but
some less commonly used information is omitted for performance reasons.
Specifically, the information returned by the following
RequestDetail
methods is not meaningful:
getSchedule
handle
- the runtime handle instance returned from a prior
open
call.requestIds
- the request identifier of the requestincludeTranslation
- flag for retrieving information in
localized form.RequestNotFoundException
- if the request was not found.MetadataNotFoundException
- if any metadata referenced for
this operation was not found in the metadata repository.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.Enumeration queryRequests(RuntimeServiceHandle handle, Filter filter, RuntimeService.QueryField orderBy, boolean ascending) throws ValidationException, RuntimeServiceException
If no filter is specifed, a default filter equivalent to the following is used:
new Filter(RuntimeService.QueryField.REQUESTID.fieldName(), Filter.Comparator.NOT_EQUALS, null);
handle
- the runtime handle instance returned from a prior
open
call.filter
- specifies field/comparator/value combinations used as
parameters for retrieving query results. If null
, a default
filter is used (see above).orderBy
- the field to sort the results by.ascending
- true
if the ordering based on the given
field should be ascending, or false
for descending.Enumeration<Long>
of request identifiers of the
requests that satisfy the query parameters.ValidationException
- if filter parameter validation fails.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.Map checkRequestPrivilege(RuntimeServiceHandle handle, long[] requestIds, RuntimeDataPermission.Action[] privileges) throws ValidationException, RuntimeServiceException
handle
- runtime handle instance returned from a prior
open
call.requestIds
- the request ids to be checked.privileges
- the ESS request data security privileges to be
checked. If multiple privileges are provided, a permission check
for a request id passes only if the user has all the privileges on
that request.Map(Long,Boolean)
of the results where the key
is the request id and value is the check result. The result will
be true
if the permission check passed and false
if
permission is denied. Each request id will have one entry in the Map.ValidationException
- if validation error occurs.RuntimeServiceException
- if runtime service sub-system error.Map checkDetailedPermissions(RuntimeServiceHandle handle, long[] requestIds, RuntimeDataPermission.Action[] privileges) throws RuntimeServiceException, ValidationException
RuntimePermission.Action
and value as the Boolean result of its permission check.handle
- runtime handle instance returned from a prior
open
call.requestIds
- the request ids to be checked.privileges
- the ESS request data security privileges to be
checked.ValidationException
- if validation error occurs.RuntimeServiceException
- if runtime service sub-system error.void holdRequest(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, IllegalStateException, NotAllowedException, RuntimeServiceException
WAIT
or READY
state. For parent requests, this operation will
cascade to all eligible child requests.handle
- the runtime handle instance returned from a prior
open
call.requestId
- the identifier of the request to hold.RequestNotFoundException
- if the request was not found.IllegalStateException
- if request is not in a compatible state.NotAllowedException
- if this operation is not allowed on the
specified request.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.void releaseRequest(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, IllegalStateException, NotAllowedException, RuntimeServiceException
HOLD
state. For parent requests,
this operation will cascade to all eligible child requests.handle
- the runtime handle instance returned from a prior
open
call.requestId
- the identifier of the request to release.RequestNotFoundException
- if the request was not found.IllegalStateException
- if request is not in a compatible state.NotAllowedException
- if this operation is not allowed on the
specified request.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.void cancelRequest(RuntimeServiceHandle handle, long requestId) throws IllegalStateException, RequestNotFoundException, RuntimeServiceException
For a singleton and child request in WAIT
, READY
,
BLOCKED
or HOLD
state, this operation will cause
them to go to CANCELLED
state.
For a singleton and child request in RUNNING
or
COMPLETED
state, cancellation is best effort and the
state will go to a transitory CANCELLING
state which will
persist until the request has been cancelled and transitions to
CANCELLED
or some other terminal state.
For parent requests, this operation cascades to all its children.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the identifier of the request to cancel.RequestNotFoundException
- if the request was not found.IllegalStateException
- if request is already in a terminal state.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.void deleteRequest(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, IllegalStateException, NotAllowedException, RuntimeServiceException
The target request must be a submitted request that has finished and is in a terminal state. An error occurs if the target request is not in a terminal state, or if it is a child request of some kind, for example, a JobSet step, a sub-request, or a Schedule instance request.
This does not physically remove request data, although the request will no longer be accessible (visible) for most operations.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the identifier of the request to delete.RequestNotFoundException
- if the request was not found.IllegalStateException
- if the operation cannot be performed
due to the current state of the request.NotAllowedException
- the this operation is not supported for
the request.RuntimeServiceException
- if runtime service sub-system error,
or handle
is null.RollbackException
- if handle
has been marked for
rollback only.boolean isHandleRollbackOnly(RuntimeServiceHandle handle)
handle
- the runtime handle being checked.true
if this handle as been marked as rollback
only, or false
otherwise.void setHandleRollbackOnly(RuntimeServiceHandle handle)
handle
- the runtime handle.Locale getLocale(RuntimeServiceHandle handle)
handle
- the runtime handle.void replaceSchedule(RuntimeServiceHandle handle, long requestId, Schedule schedule) throws RequestNotFoundException, ValidationException, RuntimeServiceException
The new schedule is an adhoc schedule. The old schedule could have been a metadata schedule or an adhoc schedule. This operation cannot be invoked on a singleton request with only a start time and no other schedule specified.
This can be used to replace the schedule for a request that is in
WAIT
or HOLD
state.
All previously scheduled instances of this request that have not started running will be canceled. The new schedule will be effective immediately for scheduling new instances.
This operation acquires a lock for the given request.
The lock is released when close
operation is subsequently
invoked or the encompassing transaction is committed.
If an application tries to invoke this operation while the lock is
being held by another thread, this method will block until the
lock is released.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request whose schedule is to be replaced.
This request must be a submitted request, not a generated request.schedule
- the new schedule to use for this requestValidationException
- if the schedule is not valid or if
requestId
is not for a submitted request or represents a
request in an unsupported state for the operation.RequestNotFoundException
- if requestId
was not found.RuntimeServiceException
- if runtime service sub-system error.void replaceSchedule(RuntimeServiceHandle handle, long requestId, MetadataObjectId scheduleId) throws RequestNotFoundException, MetadataNotFoundException, ValidationException, RuntimeServiceException
The new schedule will be a schedule obtained from the metadata of the application that submitted the request. The old schedule could have been a metadata schedule or an adhoc schedule. This operation cannot be invoked on a singleton request with only a start time and no other schedule specified.
This can be used to replace the schedule for a request that is in
WAIT
or HOLD
state.
All previously scheduled instances of this request that have not started running will be canceled. The new schedule will be effective immediately for scheduling new instances.
This operation acquires a lock for the given request.
The lock is released when close
operation is subsequently
invoked or the encompassing transaction is committed.
If an application tries to invoke this operation while the lock is
being held by another thread, this method will block until the
lock is released.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request whose schedule is to be replaced.
This request must be a submitted request, not a generated request.scheduleId
- a MetadataObjectId
representing the new
schedule to use for this requestValidationException
- if the schedule is not valid or if
requestId
is not for a submitted request or represents a
request in an unsupported state for the operation.RequestNotFoundException
- if requestId
was not found.RuntimeServiceException
- if runtime service sub-system error.MetadataNotFoundException
- if the schedule metadata specified
for this operation was not found in the metadata repository.void replaceSchedule(RuntimeServiceHandle handle, long requestId, MetadataObjectId scheduleId, Schedule schedule, Calendar start, Calendar end) throws RequestNotFoundException, MetadataNotFoundException, ValidationException, RuntimeServiceException
The new schedule will be a schedule obtained from the metadata of the application that submitted the request or an adhoc schedule. The old schedule could have been a metadata schedule or an adhoc schedule. This operation cannot be invoked on a singleton request that only had a start time and no other schedule.
Either scheduleId
or schedule
must be specified.
See updateRequestStartEnd
.
This can be used to replace the schedule for a request that is in
WAIT
or HOLD
state.
All previously scheduled instances of this request that have not started running will be canceled. The new schedule will be effective immediately for scheduling new instances.
This operation acquires a lock for the given request.
The lock is released when close
operation is subsequently
invoked or the encompassing transaction is committed.
If an application tries to invoke this operation while the lock is
being held by another thread, this method will block until the
lock is released.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request whose schedule is to be replaced.
This request must be a submitted request, not a generated request.scheduleId
- a MetadataObjectId
representing the new
schedule to use for this requestschedule
- the new schedule to use for this requeststart
- the new requested start time for the request. The request
will not run prior to this time. If null
, the current
time will be used. If the request is meant to begin
immediately, null
should be specified.end
- the time past which this request or its child
requests will not be dispatched for execution. If null
,
no end time is in effect.ValidationException
- if both scheduleId
and
schedule
are null
, the schedule is not valid or
if requestId
is not for a submitted request or
represents a request in an unsupported state for the operation.RequestNotFoundException
- if requestId
was not found.RuntimeServiceException
- if runtime service sub-system error.MetadataNotFoundException
- if the schedule metadata specified
for this operation was not found in the metadata repository.void updateRequestStartEnd(RuntimeServiceHandle handle, long requestId, Calendar start, Calendar end) throws RequestNotFoundException, RuntimeServiceException, ValidationException
This method may be invoked for submitted requests
whether or not they not have an associated schedule. If a schedule
is associated with the request and it is to be changed, see
replaceSchedule
. If no schedule is associated
with the request the end
parameter has very little meaning.
It is only used in validation to ensure that it does not come
before start
.
This operation acquires a lock for the given request.
The lock is released when close
operation is subsequently
invoked or the encompassing transaction is committed.
If an application tries to invoke this operation while the lock is
being held by another thread, this method will block until the
lock is released.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request whose schedule is to be replaced.
This request must be a submitted request, not a generated request.start
- the new requested start time for the request. The request
will not run prior to this time. If null
, the current
time will be used. If the request is meant to begin
immediately, null
should be specified.end
- the time past which this request or its child
requests will not be dispatched for execution. If null
,
no end time is in effect.ValidationException
- if requestId
is not for a
submitted request or represents a request in an unsupported state
for the operation.RequestNotFoundException
- if requestId
was not found.RuntimeServiceException
- if runtime service sub-system error.Set getLogicalApplicationNames(RuntimeServiceHandle handle) throws RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.Set<String>
of hosted applications for the
current isolation groupRuntimeServiceException
- if runtime service sub-system error.ContentDetail getLogContentDetail(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request id.null
if the log
does not exist.RequestNotFoundException
- if the request was not found.RuntimeServiceException
- if runtime service sub-system error.ContentDetail getOutputContentDetail(RuntimeServiceHandle handle, long requestId, String contentName) throws RuntimeServiceException, RequestNotFoundException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request id.contentName
- name of output content.null
if the content does not exist.RuntimeServiceException
- if runtime service sub-system error.RequestNotFoundException
- if the request was not foundList getOutputContentDetail(RuntimeServiceHandle handle, long requestId) throws RuntimeServiceException, RequestNotFoundException
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request id.List<ContentDetail>
of details for all output content
for the request. The list will be empty if there is no output content.RuntimeServiceException
- if runtime service sub-system error.RequestNotFoundException
- if the request was not foundContentHandle openLogContent(RuntimeServiceHandle handle, long requestId) throws NotFoundException, RuntimeServiceException
When done accessing the log content, the caller must release the
ContentHandle
by calling closeContent
.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- request id.RuntimeServiceException
- if runtime service sub-system error.NotFoundException
- if the log does not exist.void logContent(RequestExecutionContext context, Level level, String message) throws RequestNotFoundException, RuntimeServiceException
The request log level is defined by the
SystemProperty.REQUEST_LOG_LEVEL
system property
defaults to Level.INFO
if not defined.
The message will be logged if the given level is the same or
higher than the current value of the request log level.
Note that this can only be called from the job executable while
the job is executing.
To log in the pre- or post-processor or the request listener,
use ContentFactory
.
context
- request execution context passed to the job executable.level
- log level for the message.message
- message to append to the request log.RequestNotFoundException
- if the request does not exist.RuntimeServiceException
- if runtime service sub-system error.Level
ContentHandle openOutputContent(RuntimeServiceHandle handle, RequestExecutionContext context, String contentName, ContentType contentType, EnumSet options) throws NotFoundException, RequestNotFoundException, RuntimeServiceException, ValidationException
The output content may be opened for read or write, but not both. If opened for write, the content will be created if it does not already exist.
The RuntimeServiceHandle
passed by the caller will be cached
and used by the write content methods to write to the output content.
When done accessing the output content, the caller must release the
ContentHandle
by calling closeContent
.
The caller is responsible to commit or rollback the
RuntimeServiceHandle
after closing the ContentHandle
.
handle
- the runtime handle instance returned from a prior
open
call.context
- request execution context passed to the job executable.contentName
- name of the output content to open.contentType
- type of the output content to open for write if
the content must be created. For read, this parameter is ignored
ContentType.Unknow
can be passed.options
- an EnumSet<ContentOpenOptions>
of options
specifying how to open the request output; may open for read or write,
but not both.NotFoundException
- if the output does not exist, for a read.RequestNotFoundException
- if the request does not exist.RuntimeServiceException
- if runtime service sub-system error.ValidationException
- if the options are invalid.void writelnContent(ContentHandle contentHandle, String message) throws IllegalArgumentException, NotFoundException, RuntimeServiceException, ValidationException
The content must be open for write, and the runtime service
handle that was passed to openOutputContent
must be valid.
contentHandle
- content handle from previous call to
openOutputContent
.message
- string to write to the output content, followed by
line feed character.IllegalArgumentException
- if the content handle is invalid.NotFoundException
- if the content does not exist.RuntimeServiceException
- if error accessing runtime store.ValidationException
- if it is invalid to write to the content,
meaning the content type is binary or the content was created
from an import.void writeContent(ContentHandle contentHandle, String message) throws IllegalArgumentException, NotFoundException, RuntimeServiceException, ValidationException
The content must be open for write, and the runtime service
handle that was passed to openOutputContent
must be valid.
contentHandle
- content handle from previous call to
openOutputContent
.message
- string to write to the output content.IllegalArgumentException
- if content handle is invalid.NotFoundException
- if content does not exist.RuntimeServiceException
- if runtime service sub-system error.ValidationException
- if it is invalid to write to the content,
meaning the content type is binary or the content was created
from an import.void writeContent(ContentHandle contentHandle, char[] chars) throws IllegalArgumentException, NotFoundException, RuntimeServiceException, ValidationException
The content must be open for write, and the runtime service
handle that was passed to openOutputContent
must be valid.
contentHandle
- content handle from previous call to
openOutputContent
.chars
- characters to append.IllegalArgumentException
- if content handle is invalid.NotFoundException
- if content does not exist.RuntimeServiceException
- if runtime service sub-system error.ValidationException
- if it is invalid to write to the content,
meaning the content type is binary or the content was created
from an import.void writeContent(ContentHandle contentHandle, byte[] bytes) throws IllegalArgumentException, NotFoundException, RuntimeServiceException, ValidationException
The content must be open for write, and the runtime service
handle that was passed to openOutputContent
must be valid.
contentHandle
- content handle from previous call to
openOutputContent
.bytes
- bytes to append.IllegalArgumentException
- if content handle is invalid.NotFoundException
- if content does not exist.RuntimeServiceException
- if runtime service sub-system error.ValidationException
- if it is invalid to write to the content,
meaning the content type is binary or the content was created
from an import.ContentHandle openOutputContent(RuntimeServiceHandle handle, long requestId, String contentName) throws NotFoundException, RuntimeServiceException
When done accessing the log content, the caller must release the
ContentHandle
by calling closeContent
.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the request id.contentName
- name of the output content to open.RuntimeServiceException
- if runtime service sub-system error.NotFoundException
- if the output content does not exist.String[] getLogLines(RuntimeServiceHandle handle, ContentHandle contentHandle, int maxLines) throws IllegalArgumentException, RuntimeServiceException, RequestNotFoundException
maxLines
lines from the request log,
continuing from the last call to this method.handle
- runtime service handle.contentHandle
- content handle from previous call to
openLogContent
or openOutputContent
.maxLines
- maximum number of lines to get.IllegalArgumentException
- if handle is invalid.RuntimeServiceException
- if runtime service sub-system error.RequestNotFoundException
- if the request was not foundchar[] getTextContent(RuntimeServiceHandle handle, ContentHandle contentHandle, int maxChars) throws IllegalArgumentException, RuntimeServiceException, RequestNotFoundException
maxChars
lines from the log or output text content.handle
- runtime service handle.contentHandle
- content handle from previous call to
openLogContent
or openOutputContent
.maxChars
- maximum number of characters to get.IllegalArgumentException
- if handle is invalid.RuntimeServiceException
- if runtime service sub-system error.RequestNotFoundException
- if the request was not foundbyte[] getBinaryContent(RuntimeServiceHandle handle, ContentHandle contentHandle, int maxBytes) throws IllegalArgumentException, RuntimeServiceException, RequestNotFoundException
maxBytes
bytes from the binary content.handle
- runtime service handle.contentHandle
- content handle from previous open call.maxBytes
- maximum number of bytes to get.IllegalArgumentException
- if handle is invalid.RequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error.void closeContent(RuntimeServiceHandle handle, ContentHandle contentHandle) throws IllegalArgumentException, RuntimeServiceException, RequestNotFoundException
handle
- runtime service handle.contentHandle
- content handle from previous call to
openLogContent
or
openOutputContent
.IllegalArgumentException
- if handle is invalid.RequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error.boolean outputContentExists(RequestExecutionContext context, String contentName) throws RuntimeServiceException, RequestNotFoundException
context
- request execution context passed to the job executable.contentName
- name of output content.true
if the content exists;
false
if the content does not exist.RequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error.void deleteOutputContent(RequestExecutionContext context, List contentNames) throws RuntimeServiceException, RequestNotFoundException
context
- request execution context passed to the job executable.contentNames
- a List<String>
of names of output content.RequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error.boolean isStandaloneEnv(RuntimeServiceHandle handle) throws RuntimeServiceException
handle
- the runtime handle instance returned from a prior
open
call.true
if the environment is standalone;
false
if Fusion.RuntimeServiceException
- if runtime service sub-system error.ApplicationConfig getApplicationConfig(RuntimeServiceHandle handle) throws RuntimeServiceException
The configuration parameters specified have not been run through the substitution engine.
The returned object does not differentiate between properties set directly for this application and ones which have default values as specified in the ESSAPP configuration.
All authenticated users have permission to read the application configuration, but an anonymous user does not.
handle
- the runtime handle instance returned from a prior
open
call.RuntimeServiceAccessControlException
- if a non-authenticated user
invokes this operation.RuntimeServiceException
- if runtime service sub-system error.ExternalJobStatus getExternalJobStatus(RuntimeServiceHandle handle, long requestId) throws RequestNotFoundException, RuntimeServiceException
At present, support is provided for SQL requests that are currently in RUNNING or CANCELLING state. Nothing is returned for other request states or execution types.
handle
- the runtime handle instance returned from a prior
open
call.requestId
- the id of the requestRequestNotFoundException
- if the request was not foundRuntimeServiceException
- if runtime service sub-system error.