Class AbstractClientBase
- java.lang.Object
-
- org.apache.camel.support.service.BaseService
-
- org.apache.camel.support.service.ServiceSupport
-
- org.apache.camel.component.salesforce.internal.client.AbstractClientBase
-
- All Implemented Interfaces:
AutoCloseable
,HttpClientHolder
,SalesforceSession.SalesforceSessionListener
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
- Direct Known Subclasses:
DefaultAnalyticsApiClient
,DefaultBulkApiClient
,DefaultBulkApiV2Client
,DefaultCompositeApiClient
,DefaultCompositeSObjectCollectionsApiClient
,DefaultRawClient
,DefaultRestClient
public abstract class AbstractClientBase extends org.apache.camel.support.service.ServiceSupport implements SalesforceSession.SalesforceSessionListener, HttpClientHolder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interface
AbstractClientBase.ClientResponseCallback
-
Field Summary
Fields Modifier and Type Field Description protected String
accessToken
protected static String
APPLICATION_JSON_UTF8
protected static String
APPLICATION_XML_UTF8
protected SalesforceHttpClient
httpClient
protected String
instanceUrl
protected org.slf4j.Logger
log
protected SalesforceLoginConfig
loginConfig
protected SalesforceSession
session
protected String
version
-
Constructor Summary
Constructors Constructor Description AbstractClientBase(String version, SalesforceSession session, SalesforceHttpClient httpClient, SalesforceLoginConfig loginConfig)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected SalesforceException
createRestException(org.eclipse.jetty.client.api.Response response, InputStream responseContent)
protected void
doHttpRequest(org.eclipse.jetty.client.api.Request request, AbstractClientBase.ClientResponseCallback callback)
protected void
doStart()
void
doStop()
org.eclipse.jetty.client.HttpClient
getHttpClient()
protected org.eclipse.jetty.client.api.Request
getRequest(String method, String url, Map<String,List<String>> headers)
protected org.eclipse.jetty.client.api.Request
getRequest(org.eclipse.jetty.http.HttpMethod method, String url, Map<String,List<String>> headers)
void
onLogin(String accessToken, String instanceUrl)
void
onLogout()
void
setAccessToken(String accessToken)
protected abstract void
setAccessToken(org.eclipse.jetty.client.api.Request request)
void
setInstanceUrl(String instanceUrl)
-
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
-
-
-
-
Field Detail
-
APPLICATION_JSON_UTF8
protected static final String APPLICATION_JSON_UTF8
- See Also:
- Constant Field Values
-
APPLICATION_XML_UTF8
protected static final String APPLICATION_XML_UTF8
- See Also:
- Constant Field Values
-
log
protected final org.slf4j.Logger log
-
httpClient
protected final SalesforceHttpClient httpClient
-
session
protected final SalesforceSession session
-
loginConfig
protected final SalesforceLoginConfig loginConfig
-
version
protected final String version
-
accessToken
protected String accessToken
-
instanceUrl
protected String instanceUrl
-
-
Constructor Detail
-
AbstractClientBase
public AbstractClientBase(String version, SalesforceSession session, SalesforceHttpClient httpClient, SalesforceLoginConfig loginConfig)
-
-
Method Detail
-
doStart
protected void doStart() throws Exception
- Overrides:
doStart
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
doStop
public void doStop() throws Exception
- Overrides:
doStop
in classorg.apache.camel.support.service.BaseService
- Throws:
Exception
-
onLogin
public void onLogin(String accessToken, String instanceUrl)
- Specified by:
onLogin
in interfaceSalesforceSession.SalesforceSessionListener
-
onLogout
public void onLogout()
- Specified by:
onLogout
in interfaceSalesforceSession.SalesforceSessionListener
-
getRequest
protected org.eclipse.jetty.client.api.Request getRequest(org.eclipse.jetty.http.HttpMethod method, String url, Map<String,List<String>> headers)
-
getRequest
protected org.eclipse.jetty.client.api.Request getRequest(String method, String url, Map<String,List<String>> headers)
-
doHttpRequest
protected void doHttpRequest(org.eclipse.jetty.client.api.Request request, AbstractClientBase.ClientResponseCallback callback)
-
setAccessToken
public void setAccessToken(String accessToken)
-
setInstanceUrl
public void setInstanceUrl(String instanceUrl)
-
getHttpClient
public org.eclipse.jetty.client.HttpClient getHttpClient()
- Specified by:
getHttpClient
in interfaceHttpClientHolder
-
setAccessToken
protected abstract void setAccessToken(org.eclipse.jetty.client.api.Request request)
-
createRestException
protected SalesforceException createRestException(org.eclipse.jetty.client.api.Response response, InputStream responseContent)
-
-