org.apache.camel.component.salesforce.internal.client
Class AbstractClientBase

java.lang.Object
  extended by org.apache.camel.component.salesforce.internal.client.AbstractClientBase
All Implemented Interfaces:
SalesforceSession.SalesforceSessionListener, org.apache.camel.Service
Direct Known Subclasses:
DefaultBulkApiClient, DefaultRestClient

public abstract class AbstractClientBase
extends Object
implements SalesforceSession.SalesforceSessionListener, org.apache.camel.Service


Nested Class Summary
protected static interface AbstractClientBase.ClientResponseCallback
           
 
Field Summary
protected  String accessToken
           
protected static String APPLICATION_JSON_UTF8
           
protected static String APPLICATION_XML_UTF8
           
protected  org.eclipse.jetty.client.HttpClient httpClient
           
protected  String instanceUrl
           
protected  org.slf4j.Logger log
           
protected  SalesforceSession session
           
protected  String version
           
 
Constructor Summary
AbstractClientBase(String version, SalesforceSession session, org.eclipse.jetty.client.HttpClient httpClient)
           
 
Method Summary
protected abstract  SalesforceException createRestException(org.eclipse.jetty.client.ContentExchange httpExchange)
           
protected  void doHttpRequest(org.eclipse.jetty.client.ContentExchange request, AbstractClientBase.ClientResponseCallback callback)
           
protected  SalesforceExchange getContentExchange(String method, String url)
           
 void onLogin(String accessToken, String instanceUrl)
           
 void onLogout()
           
protected abstract  void setAccessToken(org.eclipse.jetty.client.HttpExchange httpExchange)
           
 void setAccessToken(String accessToken)
           
 void setInstanceUrl(String instanceUrl)
           
 void start()
           
 void stop()
           
 
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 org.eclipse.jetty.client.HttpClient httpClient

session

protected final SalesforceSession session

version

protected final String version

accessToken

protected String accessToken

instanceUrl

protected String instanceUrl
Constructor Detail

AbstractClientBase

public AbstractClientBase(String version,
                          SalesforceSession session,
                          org.eclipse.jetty.client.HttpClient httpClient)
                   throws SalesforceException
Throws:
SalesforceException
Method Detail

start

public void start()
           throws Exception
Specified by:
start in interface org.apache.camel.Service
Throws:
Exception

stop

public void stop()
          throws Exception
Specified by:
stop in interface org.apache.camel.Service
Throws:
Exception

onLogin

public void onLogin(String accessToken,
                    String instanceUrl)
Specified by:
onLogin in interface SalesforceSession.SalesforceSessionListener

onLogout

public void onLogout()
Specified by:
onLogout in interface SalesforceSession.SalesforceSessionListener

getContentExchange

protected SalesforceExchange getContentExchange(String method,
                                                String url)

doHttpRequest

protected void doHttpRequest(org.eclipse.jetty.client.ContentExchange request,
                             AbstractClientBase.ClientResponseCallback callback)

setAccessToken

public void setAccessToken(String accessToken)

setInstanceUrl

public void setInstanceUrl(String instanceUrl)

setAccessToken

protected abstract void setAccessToken(org.eclipse.jetty.client.HttpExchange httpExchange)

createRestException

protected abstract SalesforceException createRestException(org.eclipse.jetty.client.ContentExchange httpExchange)


Apache Camel