public class DefaultRestClient extends AbstractClientBase implements RestClient
AbstractClientBase.ClientResponseCallbackRestClient.ResponseCallbackaccessToken, APPLICATION_JSON_UTF8, APPLICATION_XML_UTF8, httpClient, instanceUrl, log, loginConfig, session, version| Constructor and Description |
|---|
DefaultRestClient(SalesforceHttpClient httpClient,
String version,
SalesforceSession session,
SalesforceLoginConfig loginConfig) |
| Modifier and Type | Method and Description |
|---|---|
void |
apexCall(String httpMethod,
String apexUrl,
Map<String,Object> queryParams,
InputStream requestDto,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Executes a user defined APEX REST API call.
|
void |
approval(InputStream request,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Submits, approves or rejects particular record.
|
void |
approvals(Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Returns a list of all approval processes.
|
protected SalesforceException |
createRestException(org.eclipse.jetty.client.api.Response response,
InputStream responseContent) |
void |
createSObject(String sObjectName,
InputStream sObject,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Creates a record for the specified object.
|
void |
deleteSObject(String sObjectName,
String id,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Deletes a record for the specified object ID.
|
void |
deleteSObjectWithId(String sObjectName,
String fieldName,
String fieldValue,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Deletes a record based on the value of a specified external ID field.
|
protected void |
doHttpRequest(org.eclipse.jetty.client.api.Request request,
AbstractClientBase.ClientResponseCallback callback) |
void |
getBasicInfo(String sObjectName,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Describes the individual metadata for the specified object.
|
void |
getBlobField(String sObjectName,
String id,
String blobFieldName,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Retrieves the specified blob field from an individual record.
|
void |
getDescription(String sObjectName,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Completely describes the individual metadata at all levels for the specified object.
|
void |
getGlobalObjects(Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Lists the available objects and their metadata for your organization's data.
|
void |
getResources(Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Lists available resources for the specified API version, including resource name and URI.
|
void |
getSObject(String sObjectName,
String id,
String[] fields,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Retrieves a record for the specified object ID.
|
void |
getSObjectWithId(String sObjectName,
String fieldName,
String fieldValue,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Retrieves a record for the specified external ID.
|
void |
getVersions(Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Lists summary information about each API version currently available, including the version, label, and a link to
each version's root.
|
void |
limits(Map<String,List<String>> headers,
RestClient.ResponseCallback responseCallback)
Fetches Organization Limits.
|
void |
query(String soqlQuery,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Executes the specified SOQL query.
|
void |
queryAll(String soqlQuery,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Executes the specified SOQL query including deleted records.
|
void |
queryMore(String nextRecordsUrl,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Get SOQL query results using nextRecordsUrl.
|
void |
recent(Integer limit,
Map<String,List<String>> headers,
RestClient.ResponseCallback responseCallback)
Fetches recently viewed records.
|
void |
search(String soslQuery,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Executes the specified SOSL search.
|
protected void |
setAccessToken(org.eclipse.jetty.client.api.Request request) |
void |
updateSObject(String sObjectName,
String id,
InputStream sObject,
Map<String,List<String>> headers,
RestClient.ResponseCallback callback)
Updates a record for the specified object ID.
|
void |
upsertSObject(String sObjectName,
String fieldName,
String fieldValue,
Map<String,List<String>> headers,
InputStream sObject,
RestClient.ResponseCallback callback)
Creates or updates a record based on the value of a specified external ID field.
|
doStart, doStop, getHttpClient, getRequest, getRequest, onLogin, onLogout, setAccessToken, setInstanceUrlbuild, 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, suspendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitpublic DefaultRestClient(SalesforceHttpClient httpClient, String version, SalesforceSession session, SalesforceLoginConfig loginConfig) throws SalesforceException
SalesforceExceptionprotected void doHttpRequest(org.eclipse.jetty.client.api.Request request,
AbstractClientBase.ClientResponseCallback callback)
doHttpRequest in class AbstractClientBaseprotected SalesforceException createRestException(org.eclipse.jetty.client.api.Response response, InputStream responseContent)
createRestException in class AbstractClientBasepublic void approval(InputStream request, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientapproval in interface RestClientheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void approvals(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientapprovals in interface RestClientheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getVersions(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetVersions in interface RestClientheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getResources(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetResources in interface RestClientheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getGlobalObjects(Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetGlobalObjects in interface RestClientheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getBasicInfo(String sObjectName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetBasicInfo in interface RestClientsObjectName - specified object nameheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getDescription(String sObjectName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetDescription in interface RestClientsObjectName - specified object nameheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getSObject(String sObjectName, String id, String[] fields, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetSObject in interface RestClientsObjectName - specified object nameid - object idheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void createSObject(String sObjectName, InputStream sObject, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientcreateSObject in interface RestClientsObjectName - specified object namesObject - request entityheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void updateSObject(String sObjectName, String id, InputStream sObject, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientupdateSObject in interface RestClientsObjectName - specified object nameid - object idsObject - request entityheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void deleteSObject(String sObjectName, String id, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientdeleteSObject in interface RestClientsObjectName - specified object nameid - object idheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetSObjectWithId in interface RestClientsObjectName - specified object namefieldName - external field namefieldValue - external field valueheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void upsertSObject(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, InputStream sObject, RestClient.ResponseCallback callback)
RestClientupsertSObject in interface RestClientsObjectName - specified object namefieldName - external field namefieldValue - external field valueheaders - additional HTTP headers to sendsObject - input object to insert or updatecallback - RestClient.ResponseCallback to handle response or exceptionpublic void deleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientdeleteSObjectWithId in interface RestClientsObjectName - specified object namefieldName - external field namefieldValue - external field valueheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void getBlobField(String sObjectName, String id, String blobFieldName, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientgetBlobField in interface RestClientsObjectName - specified object nameid - identifier of the objectblobFieldName - name of the field holding the blobheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void query(String soqlQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientquery in interface RestClientsoqlQuery - SOQL queryheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void queryMore(String nextRecordsUrl, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientqueryMore in interface RestClientnextRecordsUrl - URL for next records to fetch, returned by query()headers - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void queryAll(String soqlQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientqueryAll in interface RestClientsoqlQuery - SOQL queryheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void search(String soslQuery, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientsearch in interface RestClientsoslQuery - SOSL queryheaders - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void apexCall(String httpMethod, String apexUrl, Map<String,Object> queryParams, InputStream requestDto, Map<String,List<String>> headers, RestClient.ResponseCallback callback)
RestClientapexCall in interface RestClienthttpMethod - HTTP method to execute.apexUrl - APEX api url.queryParams - optional query parameters for GET methods, may be empty.requestDto - optional input DTO for POST, etc. may be null.headers - additional HTTP headers to sendcallback - RestClient.ResponseCallback to handle response or exceptionpublic void recent(Integer limit, Map<String,List<String>> headers, RestClient.ResponseCallback responseCallback)
RestClientrecent in interface RestClientlimit - optional limit that specifies the maximum number of records to be returned. If this
parameter is not specified, the default maximum number of records returned is the maximum
number of entries in RecentlyViewed, which is 200 records per object.headers - additional HTTP headers to sendresponseCallback - RestClient.ResponseCallback to handle response or exceptionpublic void limits(Map<String,List<String>> headers, RestClient.ResponseCallback responseCallback)
RestClientlimits in interface RestClientheaders - additional HTTP headers to sendresponseCallback - RestClient.ResponseCallback to handle response or exceptionprotected void setAccessToken(org.eclipse.jetty.client.api.Request request)
setAccessToken in class AbstractClientBaseApache Camel