public abstract class AbstractExecutableService extends Object implements ExecutableService
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
LOG |
protected org.apache.cxf.jaxrs.ext.MessageContext |
messageContext |
protected static String |
OPTIONS_ALLOW |
protected SearchCondVisitor |
searchCondVisitor |
protected org.apache.cxf.jaxrs.ext.search.SearchContext |
searchContext |
protected javax.ws.rs.core.UriInfo |
uriInfo |
CRLF, DOUBLE_DASH, PARAM_ANYTYPE_KIND, PARAM_ANYTYPEKEY, PARAM_CONNID_PAGED_RESULTS_COOKIE, PARAM_DETAILS, PARAM_ENTITY_KEY, PARAM_FIQL, PARAM_MAX, PARAM_NOTIFICATION, PARAM_ORDERBY, PARAM_PAGE, PARAM_REALM, PARAM_RESOURCE, PARAM_SIZE, PARAM_USER
Constructor and Description |
---|
AbstractExecutableService() |
Modifier and Type | Method and Description |
---|---|
void |
actionJob(String key,
JobAction action)
Executes an action on an existing executable's job.
|
protected javax.ws.rs.core.Response.ResponseBuilder |
applyPreference(ProvisioningResult<?> provisioningResult,
javax.ws.rs.core.Response.ResponseBuilder builder) |
protected <T extends BaseBean> |
buildPagedResult(List<T> list,
int page,
int size,
int totalCount)
Builds a paged result out of a list of items and additional information.
|
protected void |
checkETag(String etag) |
protected javax.ws.rs.core.Response |
createResponse(ProvisioningResult<?> provisioningResult)
Builds response to successful
create request, taking into account any Prefer header. |
void |
deleteExecution(String executionKey)
Deletes the executable execution matching the provided key.
|
javax.ws.rs.core.Response |
deleteExecutions(ExecQuery query)
Deletes the executions belonging matching the given query.
|
ExecTO |
execute(ExecSpecs query)
Executes the executable matching the given query.
|
protected String |
getActualKey(AnyDAO<?> dao,
String pretendingKey) |
protected abstract AbstractExecutableLogic<?> |
getExecutableLogic() |
JobTO |
getJob(String key)
Returns job (running or scheduled) for the executable matching the given key.
|
protected List<OrderByClause> |
getOrderByClauses(String orderBy) |
protected Preference |
getPreference()
Reads
Prefer header from request and parses into a Preference instance. |
protected SearchCond |
getSearchCond(String fiql,
String realm) |
protected boolean |
isNullPriorityAsync() |
PagedResult<ExecTO> |
listExecutions(ExecQuery query)
Returns a paged list of executions matching the given query.
|
List<JobTO> |
listJobs()
List jobs (running and / or scheduled).
|
List<ExecTO> |
listRecentExecutions(int max)
Returns the list of recently completed executions, ordered by end date descendent.
|
protected javax.ws.rs.core.Response |
modificationResponse(Object entity)
Builds response to successful modification request, taking into account any
Prefer header. |
protected static final org.slf4j.Logger LOG
protected static final String OPTIONS_ALLOW
@Context protected javax.ws.rs.core.UriInfo uriInfo
@Context protected org.apache.cxf.jaxrs.ext.MessageContext messageContext
@Context protected org.apache.cxf.jaxrs.ext.search.SearchContext searchContext
@Autowired protected SearchCondVisitor searchCondVisitor
protected abstract AbstractExecutableLogic<?> getExecutableLogic()
public PagedResult<ExecTO> listExecutions(ExecQuery query)
ExecutableService
listExecutions
in interface ExecutableService
query
- query conditionspublic List<ExecTO> listRecentExecutions(int max)
ExecutableService
listRecentExecutions
in interface ExecutableService
max
- the maximum number of executions to returnpublic void deleteExecution(String executionKey)
ExecutableService
deleteExecution
in interface ExecutableService
executionKey
- key of executable execution to be deletedpublic javax.ws.rs.core.Response deleteExecutions(ExecQuery query)
ExecutableService
deleteExecutions
in interface ExecutableService
query
- query conditionspublic ExecTO execute(ExecSpecs query)
ExecutableService
execute
in interface ExecutableService
query
- query conditionspublic JobTO getJob(String key)
ExecutableService
getJob
in interface ExecutableService
key
- executable keypublic List<JobTO> listJobs()
ExecutableService
listJobs
in interface ExecutableService
public void actionJob(String key, JobAction action)
ExecutableService
actionJob
in interface ExecutableService
key
- executable keyaction
- action to executeprotected boolean isNullPriorityAsync()
protected Preference getPreference()
Prefer
header from request and parses into a Preference
instance.Preference
instance matching the passed Prefer
header,
or Preference.NONE
if missing.protected javax.ws.rs.core.Response.ResponseBuilder applyPreference(ProvisioningResult<?> provisioningResult, javax.ws.rs.core.Response.ResponseBuilder builder)
protected javax.ws.rs.core.Response createResponse(ProvisioningResult<?> provisioningResult)
create
request, taking into account any Prefer
header.provisioningResult
- the entity just createdcreate
requestprotected javax.ws.rs.core.Response modificationResponse(Object entity)
Prefer
header.entity
- the entity just modifiedprotected void checkETag(String etag)
protected SearchCond getSearchCond(String fiql, String realm)
protected List<OrderByClause> getOrderByClauses(String orderBy)
protected <T extends BaseBean> PagedResult<T> buildPagedResult(List<T> list, int page, int size, int totalCount)
T
- result typelist
- bare list of items to be returnedpage
- current pagesize
- requested sizetotalCount
- total result size (not considering pagination)Copyright © 2010–2023 The Apache Software Foundation. All rights reserved.