public abstract class AbstractClientBase extends Object implements SalesforceSession.SalesforceSessionListener, org.apache.camel.Service, HttpClientHolder
Modifier and Type | Class and Description |
---|---|
protected static interface |
AbstractClientBase.ClientResponseCallback |
Modifier and Type | Field and 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 SalesforceSession |
session |
protected String |
version |
Constructor and Description |
---|
AbstractClientBase(String version,
SalesforceSession session,
SalesforceHttpClient httpClient) |
Modifier and Type | Method and Description |
---|---|
protected abstract SalesforceException |
createRestException(org.eclipse.jetty.client.api.Response response,
InputStream responseContent) |
protected void |
doHttpRequest(org.eclipse.jetty.client.api.Request request,
AbstractClientBase.ClientResponseCallback callback) |
org.eclipse.jetty.client.HttpClient |
getHttpClient() |
protected org.eclipse.jetty.client.api.Request |
getRequest(org.eclipse.jetty.http.HttpMethod method,
String url,
Map<String,List<String>> headers) |
protected org.eclipse.jetty.client.api.Request |
getRequest(String method,
String url,
Map<String,List<String>> headers) |
void |
onLogin(String accessToken,
String instanceUrl) |
void |
onLogout() |
protected abstract void |
setAccessToken(org.eclipse.jetty.client.api.Request request) |
void |
setAccessToken(String accessToken) |
void |
setInstanceUrl(String instanceUrl) |
void |
start() |
void |
stop() |
protected static final String APPLICATION_JSON_UTF8
protected static final String APPLICATION_XML_UTF8
protected final org.slf4j.Logger log
protected final SalesforceHttpClient httpClient
protected final SalesforceSession session
protected final String version
protected String accessToken
protected String instanceUrl
public AbstractClientBase(String version, SalesforceSession session, SalesforceHttpClient httpClient) throws SalesforceException
SalesforceException
public void start() throws Exception
start
in interface org.apache.camel.Service
Exception
public void stop() throws Exception
stop
in interface org.apache.camel.Service
Exception
public void onLogin(String accessToken, String instanceUrl)
onLogin
in interface SalesforceSession.SalesforceSessionListener
public void onLogout()
onLogout
in interface SalesforceSession.SalesforceSessionListener
protected org.eclipse.jetty.client.api.Request getRequest(org.eclipse.jetty.http.HttpMethod method, String url, Map<String,List<String>> headers)
protected org.eclipse.jetty.client.api.Request getRequest(String method, String url, Map<String,List<String>> headers)
protected void doHttpRequest(org.eclipse.jetty.client.api.Request request, AbstractClientBase.ClientResponseCallback callback)
public void setAccessToken(String accessToken)
public void setInstanceUrl(String instanceUrl)
public org.eclipse.jetty.client.HttpClient getHttpClient()
getHttpClient
in interface HttpClientHolder
protected abstract void setAccessToken(org.eclipse.jetty.client.api.Request request)
protected abstract SalesforceException createRestException(org.eclipse.jetty.client.api.Response response, InputStream responseContent)
Apache Camel