Package com.adaptris.rest
Class WorkflowServicesConsumer
- java.lang.Object
-
- com.adaptris.rest.WorkflowServicesConsumer
-
- All Implemented Interfaces:
ComponentLifecycle,ComponentLifecycleExtension
- Direct Known Subclasses:
HttpRestWorkflowServicesConsumer
public abstract class WorkflowServicesConsumer extends java.lang.Object implements ComponentLifecycle, ComponentLifecycleExtension
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONTENT_TYPE_DEFAULTstatic java.lang.StringCONTENT_TYPE_JSONstatic intERROR_BAD_REQUESTstatic intERROR_DEFAULTstatic intERROR_NOT_READYstatic intOK_200
-
Constructor Summary
Constructors Constructor Description WorkflowServicesConsumer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract StandaloneConsumerconfigureConsumer(AdaptrisMessageListener messageListener, java.lang.String consumedUrlPath, java.lang.String acceptedHttpMethods)protected abstract voiddoErrorResponse(AdaptrisMessage message, java.lang.Exception e, int httpStatus)protected voiddoResponse(AdaptrisMessage original, AdaptrisMessage processed)protected voiddoResponse(AdaptrisMessage orig, AdaptrisMessage proc, java.lang.String contentType)protected abstract voiddoResponse(AdaptrisMessage orig, AdaptrisMessage proc, java.lang.String contentType, int httpResponse)java.lang.StringgetAcceptedHttpMethods()A comma separated list of accepted http request methods; GET, POST, PATCH etc etc And example might be "GET,POST".java.lang.StringgetConsumedUrlPath()This is the url that this consumer will listen for requests.AdaptrisMessageListenergetMessageListener()StandaloneConsumergetStandaloneConsumer()voidinit()voidprepare()voidsetAcceptedHttpMethods(java.lang.String acceptedHttpMethods)A comma separated list of accepted http request methods; GET, POST, PATCH etc etc And example might be "GET,POST".voidsetConsumedUrlPath(java.lang.String consumedUrlPath)This is the url that this consumer will listen for requests.voidsetMessageListener(AdaptrisMessageListener messageListener)voidsetStandaloneConsumer(StandaloneConsumer standaloneConsumer)voidstart()voidstop()
-
-
-
Field Detail
-
OK_200
public static final int OK_200
- See Also:
- Constant Field Values
-
ERROR_BAD_REQUEST
public static final int ERROR_BAD_REQUEST
- See Also:
- Constant Field Values
-
ERROR_DEFAULT
public static final int ERROR_DEFAULT
- See Also:
- Constant Field Values
-
ERROR_NOT_READY
public static final int ERROR_NOT_READY
- See Also:
- Constant Field Values
-
CONTENT_TYPE_DEFAULT
public static final java.lang.String CONTENT_TYPE_DEFAULT
- See Also:
- Constant Field Values
-
CONTENT_TYPE_JSON
public static final java.lang.String CONTENT_TYPE_JSON
- See Also:
- Constant Field Values
-
-
Method Detail
-
configureConsumer
protected abstract StandaloneConsumer configureConsumer(AdaptrisMessageListener messageListener, java.lang.String consumedUrlPath, java.lang.String acceptedHttpMethods)
-
doResponse
protected void doResponse(AdaptrisMessage original, AdaptrisMessage processed) throws ServiceException
- Throws:
ServiceException
-
doResponse
protected void doResponse(AdaptrisMessage orig, AdaptrisMessage proc, java.lang.String contentType) throws ServiceException
- Throws:
ServiceException
-
doResponse
protected abstract void doResponse(AdaptrisMessage orig, AdaptrisMessage proc, java.lang.String contentType, int httpResponse)
-
doErrorResponse
protected abstract void doErrorResponse(AdaptrisMessage message, java.lang.Exception e, int httpStatus)
-
prepare
public void prepare() throws CoreException- Specified by:
preparein interfaceComponentLifecycleExtension- Throws:
CoreException
-
init
public void init() throws CoreException- Specified by:
initin interfaceComponentLifecycle- Throws:
CoreException
-
start
public void start() throws CoreException- Specified by:
startin interfaceComponentLifecycle- Throws:
CoreException
-
stop
public void stop()
- Specified by:
stopin interfaceComponentLifecycle
-
close
public void close()
- Specified by:
closein interfaceComponentLifecycle
-
getStandaloneConsumer
public StandaloneConsumer getStandaloneConsumer()
-
setStandaloneConsumer
public void setStandaloneConsumer(StandaloneConsumer standaloneConsumer)
-
getMessageListener
public AdaptrisMessageListener getMessageListener()
-
setMessageListener
public void setMessageListener(AdaptrisMessageListener messageListener)
-
getConsumedUrlPath
public java.lang.String getConsumedUrlPath()
This is the url that this consumer will listen for requests. For example "/workflow-services/*"; will trigger this consumer for any requests on "http://host:port/workflow-services/...".
-
setConsumedUrlPath
public void setConsumedUrlPath(java.lang.String consumedUrlPath)
This is the url that this consumer will listen for requests. For example "/workflow-services/*"; will trigger this consumer for any requests on "http://host:port/workflow-services/...".
-
getAcceptedHttpMethods
public java.lang.String getAcceptedHttpMethods()
A comma separated list of accepted http request methods; GET, POST, PATCH etc etc And example might be "GET,POST".
-
setAcceptedHttpMethods
public void setAcceptedHttpMethods(java.lang.String acceptedHttpMethods)
A comma separated list of accepted http request methods; GET, POST, PATCH etc etc And example might be "GET,POST".
-
-