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.ObjectMapper
MAPPER
static String
NAME
protected javax.servlet.http.HttpServletRequest
request
protected javax.servlet.http.HttpServletResponse
response
protected static String
RESULT_URL_KEY
protected static String
RUNNING_STATUS
protected AutomationService
service
protected CoreSession
session
protected AutomationServer
srv
protected static String
STATUS_PATH
protected static String
STATUS_STORE_NAME
protected static String
TRANSIENT_STORE_ERROR
protected static String
TRANSIENT_STORE_ERROR_STATUS
protected static String
TRANSIENT_STORE_OUTPUT
protected static String
TRANSIENT_STORE_OUTPUT_BLOB
protected static String
TRANSIENT_STORE_SERVICE
protected static String
TRANSIENT_STORE_TASK_ID
-
Constructor Summary
Constructors Constructor Description AsyncOperationAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
abort(String executionId)
protected void
attach(DocumentModel doc)
protected void
cleanup(String executionId)
protected void
detach(DocumentModel doc)
Object
doPost(ExecutionRequest xreq)
protected void
enterMethod(String executionId, InvokableMethod method)
protected boolean
exists(String executionId)
protected AsyncService<Serializable,?,?>
getAsyncService(String executionId)
protected Serializable
getAsyncTaskId(String executionId)
String
getError(String executionId)
int
getErrorStatus(String executionId)
protected Object
getResult(String executionId)
protected TransientStore
getTransientStore()
protected boolean
isAsync(String executionId)
protected boolean
isCompleted(String executionId)
Object
result(String executionId)
protected void
setCompleted(String executionId)
protected void
setError(String executionId, Throwable t)
protected void
setOutput(String executionId, Serializable output)
Object
status(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:
IOException
javax.mail.MessagingException
-
result
public Object result(String executionId) throws IOException, javax.mail.MessagingException
- Throws:
IOException
javax.mail.MessagingException
-
abort
public Object abort(String executionId) throws IOException, javax.mail.MessagingException
- Throws:
IOException
javax.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)
-
-