Class AsyncOperationAdapter
- java.lang.Object
-
- org.nuxeo.ecm.webengine.model.impl.AbstractResource<ResourceTypeImpl>
-
- org.nuxeo.ecm.webengine.model.impl.DefaultAdapter
-
- org.nuxeo.ecm.automation.server.jaxrs.adapters.AsyncOperationAdapter
-
- All Implemented Interfaces:
AdapterResource,Resource,Adaptable
public class AsyncOperationAdapter extends DefaultAdapter
Adapter that allows asynchronous execution of operations.- Since:
- 10.3
-
-
Field Summary
Fields Modifier and Type Field Description protected static com.fasterxml.jackson.databind.ObjectMapperMAPPERstatic StringNAMEprotected javax.servlet.http.HttpServletRequestrequestprotected javax.servlet.http.HttpServletResponseresponseprotected static StringRESULT_URL_KEYprotected static StringRUNNING_STATUSprotected AutomationServiceserviceprotected CoreSessionsessionprotected AutomationServersrvprotected static StringSTATUS_PATHprotected static StringSTATUS_STORE_NAMEprotected static StringTRANSIENT_STORE_ERRORprotected static StringTRANSIENT_STORE_ERROR_STATUSprotected static StringTRANSIENT_STORE_OUTPUTprotected static StringTRANSIENT_STORE_OUTPUT_BLOBprotected static StringTRANSIENT_STORE_SERVICEprotected static StringTRANSIENT_STORE_TASK_ID
-
Constructor Summary
Constructors Constructor Description AsyncOperationAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectabort(String executionId)protected voidattach(DocumentModel doc)protected voidcleanup(String executionId)protected voiddetach(DocumentModel doc)ObjectdoPost(ExecutionRequest xreq)protected voidenterMethod(String executionId, InvokableMethod method)protected booleanexists(String executionId)protected AsyncService<Serializable,?,?>getAsyncService(String executionId)protected SerializablegetAsyncTaskId(String executionId)StringgetError(String executionId)intgetErrorStatus(String executionId)protected ObjectgetResult(String executionId)protected TransientStoregetTransientStore()protected booleanisAsync(String executionId)protected booleanisCompleted(String executionId)Objectresult(String executionId)protected voidsetCompleted(String executionId)protected voidsetError(String executionId, Throwable t)protected voidsetOutput(String executionId, Serializable output)Objectstatus(String executionId)-
Methods inherited from class org.nuxeo.ecm.webengine.model.impl.DefaultAdapter
disptachAdapter, getTarget, isAdapter
-
Methods inherited from class org.nuxeo.ecm.webengine.model.impl.AbstractResource
checkGuard, dispose, getActiveAdapter, getAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, initialize, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Adaptable
getAdapter
-
Methods inherited from interface org.nuxeo.ecm.webengine.model.Resource
checkGuard, dispose, getActiveAdapter, getContext, getFacets, getLinks, getModule, getName, getNext, getNextSegment, getPath, getPrevious, getTemplate, getTrailingPath, getType, getURL, getView, hasFacet, initialize, isInstanceOf, isRoot, newAdapter, newObject, redirect, setNext, setPrevious, setRoot
-
-
-
-
Field Detail
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
STATUS_STORE_NAME
protected static final String STATUS_STORE_NAME
- See Also:
- Constant Field Values
-
TRANSIENT_STORE_SERVICE
protected static final String TRANSIENT_STORE_SERVICE
- See Also:
- Constant Field Values
-
TRANSIENT_STORE_TASK_ID
protected static final String TRANSIENT_STORE_TASK_ID
- See Also:
- Constant Field Values
-
TRANSIENT_STORE_ERROR_STATUS
protected static final String TRANSIENT_STORE_ERROR_STATUS
- See Also:
- Constant Field Values
-
TRANSIENT_STORE_ERROR
protected static final String TRANSIENT_STORE_ERROR
- See Also:
- Constant Field Values
-
TRANSIENT_STORE_OUTPUT
protected static final String TRANSIENT_STORE_OUTPUT
- See Also:
- Constant Field Values
-
TRANSIENT_STORE_OUTPUT_BLOB
protected static final String TRANSIENT_STORE_OUTPUT_BLOB
- See Also:
- Constant Field Values
-
STATUS_PATH
protected static final String STATUS_PATH
- See Also:
- Constant Field Values
-
RUNNING_STATUS
protected static final String RUNNING_STATUS
- See Also:
- Constant Field Values
-
RESULT_URL_KEY
protected static final String RESULT_URL_KEY
- See Also:
- Constant Field Values
-
MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper MAPPER
-
service
@Context protected AutomationService service
-
request
@Context protected javax.servlet.http.HttpServletRequest request
-
response
@Context protected javax.servlet.http.HttpServletResponse response
-
session
@Context protected CoreSession session
-
srv
@Context protected AutomationServer srv
-
-
Method Detail
-
doPost
public Object doPost(ExecutionRequest xreq)
-
status
public Object status(String executionId) throws IOException, javax.mail.MessagingException
- Throws:
IOExceptionjavax.mail.MessagingException
-
result
public Object result(String executionId) throws IOException, javax.mail.MessagingException
- Throws:
IOExceptionjavax.mail.MessagingException
-
abort
public Object abort(String executionId) throws IOException, javax.mail.MessagingException
- Throws:
IOExceptionjavax.mail.MessagingException
-
getTransientStore
protected TransientStore getTransientStore()
-
enterMethod
protected void enterMethod(String executionId, InvokableMethod method)
-
getErrorStatus
public int getErrorStatus(String executionId)
-
setOutput
protected void setOutput(String executionId, Serializable output)
-
attach
protected void attach(DocumentModel doc)
-
detach
protected void detach(DocumentModel doc)
-
isAsync
protected boolean isAsync(String executionId)
-
getAsyncTaskId
protected Serializable getAsyncTaskId(String executionId)
-
getAsyncService
protected AsyncService<Serializable,?,?> getAsyncService(String executionId)
-
setCompleted
protected void setCompleted(String executionId)
-
isCompleted
protected boolean isCompleted(String executionId)
-
exists
protected boolean exists(String executionId)
-
cleanup
protected void cleanup(String executionId)
-
-