Class AbstractRestProcessor
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.component.salesforce.internal.processor.AbstractSalesforceProcessor
-
- org.apache.camel.component.salesforce.internal.processor.AbstractRestProcessor
-
- All Implemented Interfaces:
AutoCloseable
,SalesforceProcessor
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
JsonRestProcessor
public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
RESPONSE_CLASS
protected static String
RESPONSE_CLASS_DEFERRED
protected static String
RESPONSE_CLASS_PREFIX
protected static String
RESPONSE_TYPE
protected RestClient
restClient
-
Fields inherited from class org.apache.camel.component.salesforce.internal.processor.AbstractSalesforceProcessor
classMap, endpoint, endpointConfigMap, httpClient, IGNORE_BODY, IS_OPTIONAL, log, loginConfig, NOT_OPTIONAL, operationName, rawPayload, session, USE_BODY
-
-
Constructor Summary
Constructors Constructor Description AbstractRestProcessor(SalesforceEndpoint endpoint)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
doStart()
protected void
doStop()
protected abstract InputStream
getRequestStream(org.apache.camel.Exchange exchange)
protected abstract InputStream
getRequestStream(org.apache.camel.Message in, Object object)
ReturnsInputStream
to serialized form of the given object.boolean
process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
protected abstract void
processRequest(org.apache.camel.Exchange exchange)
protected abstract void
processResponse(org.apache.camel.Exchange exchange, InputStream responseEntity, Map<String,String> headers, SalesforceException ex, org.apache.camel.AsyncCallback callback)
protected abstract void
processStreamResultResponse(org.apache.camel.Exchange exchange, InputStream responseEntity, Map<String,String> headers, SalesforceException ex, org.apache.camel.AsyncCallback callback)
protected void
setResponseClass(org.apache.camel.Exchange exchange)
-
Methods inherited from class org.apache.camel.component.salesforce.internal.processor.AbstractSalesforceProcessor
getListParameter, getParameter, getParameter, getSObjectClass, getSObjectClass
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doInit, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.camel.component.salesforce.internal.processor.SalesforceProcessor
determineHeaders
-
-
-
-
Field Detail
-
RESPONSE_CLASS
protected static final String RESPONSE_CLASS
-
RESPONSE_CLASS_DEFERRED
protected static final String RESPONSE_CLASS_DEFERRED
-
RESPONSE_CLASS_PREFIX
protected static final String RESPONSE_CLASS_PREFIX
-
RESPONSE_TYPE
protected static final String RESPONSE_TYPE
-
restClient
protected RestClient restClient
-
-
Constructor Detail
-
AbstractRestProcessor
public AbstractRestProcessor(SalesforceEndpoint endpoint)
-
-
Method Detail
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classAbstractSalesforceProcessor
- Throws:
Exception
-
doStop
protected void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
process
public final boolean process(org.apache.camel.Exchange exchange, org.apache.camel.AsyncCallback callback)
- Specified by:
process
in interfaceSalesforceProcessor
- Specified by:
process
in classAbstractSalesforceProcessor
-
processRequest
protected abstract void processRequest(org.apache.camel.Exchange exchange) throws SalesforceException
- Throws:
SalesforceException
-
getRequestStream
protected abstract InputStream getRequestStream(org.apache.camel.Exchange exchange) throws SalesforceException
- Throws:
SalesforceException
-
getRequestStream
protected abstract InputStream getRequestStream(org.apache.camel.Message in, Object object) throws SalesforceException
ReturnsInputStream
to serialized form of the given object.- Parameters:
object
- object to serialize- Returns:
- stream to read serialized object from
- Throws:
SalesforceException
-
setResponseClass
protected void setResponseClass(org.apache.camel.Exchange exchange) throws SalesforceException
- Throws:
SalesforceException
-
processResponse
protected abstract void processResponse(org.apache.camel.Exchange exchange, InputStream responseEntity, Map<String,String> headers, SalesforceException ex, org.apache.camel.AsyncCallback callback)
-
processStreamResultResponse
protected abstract void processStreamResultResponse(org.apache.camel.Exchange exchange, InputStream responseEntity, Map<String,String> headers, SalesforceException ex, org.apache.camel.AsyncCallback callback)
-
-