public abstract class

BaseSalesforceConnector

extends Object
implements MuleContextAware
java.lang.Object
   ↳ org.mule.modules.salesforce.BaseSalesforceConnector
Known Direct Subclasses
Known Indirect Subclasses

Summary

Fields
private static final Logger LOGGER
private Boolean allowFieldTruncationSupport If true, truncate field values that are too long, which is the behavior in API versions 14.0 and earlier.
private String assignmentRuleId The ID of a specific assignment rule to run for the Case or Lead.
private SalesforceBayeuxClient bc Bayeux client
private String clientId Client ID for partners
private ObjectStoreHelper objectStoreHelper
private ObjectStoreManager objectStoreManager Object store manager to obtain a store to support this#getUpdatedObjects
private Registry registry
private ObjectStore timeObjectStore A ObjectStore instance to use in this#getUpdatedObjects
private Boolean useDefaultRule If true for a Case or Lead, uses the default (active) assignment rule for a Case or Lead.
Public Constructors
BaseSalesforceConnector()
Public Methods
JobInfo abortJob(String jobId)
Aborts an open Job given its ID.
BatchInfo batchInfo(BatchInfo batchInfo)
Access latest BatchInfo of a submitted BatchInfo.
BatchResult batchResult(BatchInfo batchInfo)
Access BatchResult of a submitted BatchInfo.
InputStream batchResultStream(BatchInfo batchInfo)
Access BatchResult of a submitted BatchInfo.
JobInfo closeJob(String jobId)
Closes an open Job given its ID.
LeadConvertResult convertLead(String leadId, String contactId, String accountId, Boolean overWriteLeadSource, Boolean doNotCreateOpportunity, String opportunityName, String convertedStatus, Boolean sendEmailToOwner)
Converts a Lead into an Account, Contact, or (optionally) an Opportunity.
List<SaveResult> create(String type, List<Map<String, Object>> objects)
Adds one or more new records to your organization's data.
BatchInfo createBatch(JobInfo jobInfo, List<Map<String, Object>> objects)
Creates a Batch using the given objects within the specified Job.
BatchInfo createBatchForQuery(JobInfo jobInfo, String query)
Creates a Batch using the given query.
BatchInfo createBatchStream(JobInfo jobInfo, InputStream stream)
Creates a Batch using the given stream within the specified Job.
BatchInfo createBulk(String type, List<Map<String, Object>> objects)
Adds one or more new records to your organization's data.
JobInfo createJob(OperationEnum operation, String type, String externalIdFieldName, ContentType contentType, ConcurrencyMode concurrencyMode)
Creates a Job in order to perform one or more batches through Bulk API Operations.
SaveResult createSingle(String type, Map<String, Object> object)
Adds one new records to your organization's data.
List<DeleteResult> delete(List<String> ids)
Deletes one or more records from your organization's data.
DescribeGlobalResult describeGlobal()
Retrieves a list of available objects for your organization's data.
DescribeSObjectResult describeSObject(String type)
Describes metadata (field list and object properties) for the specified object.
List<EmptyRecycleBinResult> emptyRecycleBin(List<String> ids)
The recycle bin lets you view and restore recently deleted records for 30 days before they are permanently deleted.
Boolean getAllowFieldTruncationSupport()
String getAssignmentRuleId()
String getClientId()
GetDeletedResult getDeleted(String type, int duration)
Retrieves the list of individual records that have been deleted between the range of now to the duration before now.
GetDeletedResult getDeletedRange(String type, Calendar startTime, Calendar endTime)
Retrieves the list of individual records that have been deleted within the given timespan for the specified object.
ObjectStore getTimeObjectStore()
GetUpdatedResult getUpdated(String type, int duration)
Retrieves the list of individual records that have been updated between the range of now to the duration before now.
List<Map<String, Object>> getUpdatedObjects(String type, int initialTimeWindow, List<String> fields)
Retrieves the list of records that have been updated between the last time this method was called and now.
GetUpdatedResult getUpdatedRange(String type, Calendar startTime, Calendar endTime)
Retrieves the list of individual records that have been created/updated within the given timespan for the specified object.
Boolean getUseDefaultRule()
GetUserInfoResult getUserInfo()
Retrieves personal information for the user associated with the current session.
BatchInfo hardDeleteBulk(String type, List<Map<String, Object>> objects)
Deletes one or more records from your organization's data.
QueryResultObject paginatedQuery(String query, QueryResultObject queryResultObject, Boolean withDeletedRecords)
Executes a paginated query against the specified object and returns data that matches the specified criteria.
void publishTopic(String topicName, String query, String description)
Creates a topic which represents a query that is the basis for notifying listeners of changes to records in an organization.
List<Map<String, Object>> query(String query)
Executes a query against the specified object and returns data that matches the specified criteria.
List<Map<String, Object>> queryAll(String query)
Retrieves data from specified objects, whether or not they have been deleted.
InputStream queryResultStream(BatchInfo batchInfo)
Returns an InputStream with the query results of a submitted BatchInfo

Map<String, Object> querySingle(String query)
Executes a query against the specified object and returns the first record that matches the specified criteria.
void resetUpdatedObjectsTimestamp(String type)
Resets the timestamp of the last updated object.
List<Map<String, Object>> retrieve(String type, List<String> ids, List<String> fields)
Retrieves one or more records based on the specified IDs.
List<Map<String, Object>> search(String query)
Search for objects using Salesforce Object Search Language

void setAllowFieldTruncationSupport(Boolean allowFieldTruncationSupport)
void setAssignmentRuleId(String assignmentRuleId)
void setClientId(String clientId)
void setMuleContext(MuleContext context)
void setObjectStoreManager(ObjectStoreManager objectStoreManager)
void setPassword(String userId, String newPassword)
Change the password of a User or SelfServiceUser to a value that you specify.
void setRegistry(Registry registry)
void setTimeObjectStore(ObjectStore timeObjectStore)
void setUseDefaultRule(Boolean useDefaultRule)
StopSourceCallback subscribeTopic(String topic, SourceCallback callback)
Subscribe to a topic.
List<SaveResult> update(String type, List<Map<String, Object>> objects)
Updates one or more existing records in your organization's data.
BatchInfo updateBulk(String type, List<Map<String, Object>> objects)
Updates one or more existing records in your organization's data.
SaveResult updateSingle(String type, Map<String, Object> object)
Updates one or more existing records in your organization's data.
List<UpsertResult> upsert(String externalIdFieldName, String type, List<Map<String, Object>> objects)
Upserts an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records.
BatchInfo upsertBulk(String type, String externalIdFieldName, List<Map<String, Object>> objects)
Upserts an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records.
Protected Methods
SalesforceBayeuxClient getBayeuxClient()
abstract BulkConnection getBulkConnection()
abstract PartnerConnection getConnection()
abstract String getSessionId()
boolean isInitializedBayeuxClient()
void setBayeuxClient(SalesforceBayeuxClient bc)
void setConnectionOptions(PartnerConnection connection)
void setObjectStoreHelper(ObjectStoreHelper objectStoreHelper)
SObject[] toAsyncSObjectList(List<Map<String, Object>> objects)
SObject[] toSObjectList(String type, List<Map<String, Object>> objects)
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.mule.api.context.MuleContextAware

Fields

private static final Logger LOGGER

private Boolean allowFieldTruncationSupport

If true, truncate field values that are too long, which is the behavior in API versions 14.0 and earlier. Default is false: no change in behavior. If a string or textarea value is too large, the operation fails and the fault code STRING_TOO_LONG is returned.

private String assignmentRuleId

The ID of a specific assignment rule to run for the Case or Lead. The assignment rule can be active or inactive. The ID can be retrieved by querying the AssignmentRule object. If specified, do not specify useDefaultRule. This element is ignored for accounts, because all territory assignment rules are applied. If the value is not in correct ID format (15-character or 18-character Salesforce ID), the call fails and a MALFORMED_ID exception is returned.

private SalesforceBayeuxClient bc

Bayeux client

private String clientId

Client ID for partners

private ObjectStoreHelper objectStoreHelper

private ObjectStoreManager objectStoreManager

Object store manager to obtain a store to support this#getUpdatedObjects

private Registry registry

private ObjectStore timeObjectStore

A ObjectStore instance to use in this#getUpdatedObjects

private Boolean useDefaultRule

If true for a Case or Lead, uses the default (active) assignment rule for a Case or Lead. If specified, do not specify an assignmentRuleId. If true for an Account, all territory assignment rules are applied, and if false, no territory assignment rules are applied.

Public Constructors

public BaseSalesforceConnector ()

Public Methods

public JobInfo abortJob (String jobId)

Aborts an open Job given its ID.

Parameters
jobId The Job ID identifying the Job to be aborted.
Returns
  • A JobInfo that identifies the aborted Job.
Throws
Exception ConnectionException when there is an error

public BatchInfo batchInfo (BatchInfo batchInfo)

Access latest BatchInfo of a submitted BatchInfo. Allows to track execution status.

Parameters
batchInfo The BatchInfo being monitored
Returns
  • Latest BatchInfo representing status of the batch job result.
Throws
Exception ConnectionException when there is an error

public BatchResult batchResult (BatchInfo batchInfo)

Access BatchResult of a submitted BatchInfo.

Parameters
batchInfo The BatchInfo being monitored
Returns
  • BatchResult representing result of the batch job result.
Throws
Exception ConnectionException when there is an error

public InputStream batchResultStream (BatchInfo batchInfo)

Access BatchResult of a submitted BatchInfo.

Parameters
batchInfo The BatchInfo being monitored
Returns
  • java.io.InputStream representing result of the batch job result.
Throws
Exception ConnectionException when there is an error

public JobInfo closeJob (String jobId)

Closes an open Job given its ID.

Parameters
jobId The Job ID identifying the Job to be closed.
Returns
  • A JobInfo that identifies the closed Job.
Throws
Exception ConnectionException when there is an error

public LeadConvertResult convertLead (String leadId, String contactId, String accountId, Boolean overWriteLeadSource, Boolean doNotCreateOpportunity, String opportunityName, String convertedStatus, Boolean sendEmailToOwner)

Converts a Lead into an Account, Contact, or (optionally) an Opportunity.

Parameters
leadId ID of the Lead to convert. Required. For information on IDs, see ID Field Type.
contactId ID of the Contact into which the lead will be merged (this contact must be associated with the specified accountId, and an accountId must be specified). Required only when updating an existing contact.IMPORTANT if you are converting a lead into a person account, do not specify the contactId or an error will result. Specify only the accountId of the person account. If no contactID is specified, then the API creates a new contact that is implicitly associated with the Account. To create a new contact, the client application must be logged in with sufficient access rights. To merge a lead into an existing contact, the client application must be logged in with read/write access to the specified contact. The contact name and other existing data are not overwritten (unless overwriteLeadSource is set to true, in which case only the LeadSource field is overwritten). For information on IDs, see ID Field Type.
accountId ID of the Account into which the lead will be merged. Required only when updating an existing account, including person accounts. If no accountID is specified, then the API creates a new account. To create a new account, the client application must be logged in with sufficient access rights. To merge a lead into an existing account, the client application must be logged in with read/write access to the specified account. The account name and other existing data are not overwritten. For information on IDs, see ID Field Type.
overWriteLeadSource Specifies whether to overwrite the LeadSource field on the target Contact object with the contents of the LeadSource field in the source Lead object (true), or not (false, the default). To set this field to true, the client application must specify a contactId for the target contact.
doNotCreateOpportunity Specifies whether to create an Opportunity during lead conversion (false, the default) or not (true). Set this flag to true only if you do not want to create an opportunity from the lead. An opportunity is created by default.
opportunityName Name of the opportunity to create. If no name is specified, then this value defaults to the company name of the lead. The maximum length of this field is 80 characters. If doNotCreateOpportunity argument is true, then no Opportunity is created and this field must be left blank; otherwise, an error is returned.
convertedStatus Valid LeadStatus value for a converted lead. Required. To obtain the list of possible values, the client application queries the LeadStatus object, as in: Select Id, MasterLabel from LeadStatus where IsConverted=true
sendEmailToOwner Specifies whether to send a notification email to the owner specified in the ownerId (true) or not (false, the default).
Returns
Throws
Exception ConnectionException when there is an error

public List<SaveResult> create (String type, List<Map<String, Object>> objects)

Adds one or more new records to your organization's data.

IMPORTANT: When you map your objects to the input of this message processor keep in mind that they need to match the expected type of the object at Salesforce.

Take the CloseDate of an Opportunity as an example, if you set that field to a string of value "2011-12-13" it will be sent to Salesforce as a string and operation will be rejected on the basis that CloseDate is not of the expected type.

The proper way to actually map it is to generate a Java Date object, you can do so using Groovy expression evaluator as #[groovy:Date.parse("yyyy-MM-dd", "2011-12-13")].

Parameters
type Type of object to create
objects An array of one or more sObjects objects.
Returns
Throws
Exception ConnectionException when there is an error

public BatchInfo createBatch (JobInfo jobInfo, List<Map<String, Object>> objects)

Creates a Batch using the given objects within the specified Job.

This call uses the Bulk API. The operation will be done in asynchronous fashion.

Parameters
jobInfo The JobInfo in which the batch will be created.
objects A list of one or more sObjects objects. This parameter defaults to payload content.
Returns
Throws
Exception ConnectionException when there is an error

public BatchInfo createBatchForQuery (JobInfo jobInfo, String query)

Creates a Batch using the given query.

This call uses the Bulk API. The operation will be done in asynchronous fashion.

Parameters
jobInfo The JobInfo in which the batch will be created.
query The query to be executed.
Returns
Throws
Exception ConnectionException when there is an error

public BatchInfo createBatchStream (JobInfo jobInfo, InputStream stream)

Creates a Batch using the given stream within the specified Job.

This call uses the Bulk API. The operation will be done in asynchronous fashion.

Parameters
jobInfo The JobInfo in which the batch will be created.
stream A stream containing the data. This parameter defaults to payload content.
Returns
Throws
Exception ConnectionException when there is an error

public BatchInfo createBulk (String type, List<Map<String, Object>> objects)

Adds one or more new records to your organization's data.

This call uses the Bulk API. The creation will be done in asynchronous fashion.

Parameters
type Type of object to create
objects An array of one or more sObjects objects.
Returns
Throws
Exception ConnectionException when there is an error

public JobInfo createJob (OperationEnum operation, String type, String externalIdFieldName, ContentType contentType, ConcurrencyMode concurrencyMode)

Creates a Job in order to perform one or more batches through Bulk API Operations.

Parameters
operation The OperationEnum that will be executed by the job.
type The type of Salesforce object that the job will process.
externalIdFieldName Contains the name of the field on this object with the external ID field attribute for custom objects or the idLookup field property for standard objects (only required for Upsert Operations).
contentType The Content Type for this Job results. When specifying a content type different from XML for a query type use queryResultStream(com.sforce.async.BatchInfo) batchResultStream} method to retrieve results.
concurrencyMode The concurrency mode of the job, either Parallel or Serial.
Returns
  • A JobInfo that identifies the created Job.
Throws
Exception ConnectionException when there is an error

public SaveResult createSingle (String type, Map<String, Object> object)

Adds one new records to your organization's data.

Java Sample
INCLUDE_ERROR

Parameters
type Type of object to create
object SObject to create
Returns
Throws
Exception ConnectionException when there is an error

public List<DeleteResult> delete (List<String> ids)

Deletes one or more records from your organization's data.

Parameters
ids Array of one or more IDs associated with the objects to delete.
Returns
Throws
Exception ConnectionException when there is an error

public DescribeGlobalResult describeGlobal ()

Retrieves a list of available objects for your organization's data.

Throws
Exception ConnectionException when there is an error

public DescribeSObjectResult describeSObject (String type)

Describes metadata (field list and object properties) for the specified object.

Parameters
type Object. The specified value must be a valid object for your organization. For a complete list of objects, see Standard Objects
Throws
Exception ConnectionException when there is an error

public List<EmptyRecycleBinResult> emptyRecycleBin (List<String> ids)

The recycle bin lets you view and restore recently deleted records for 30 days before they are permanently deleted. Your organization can have up to 5000 records per license in the Recycle Bin at any one time. For example, if your organization has five user licenses, 25,000 records can be stored in the Recycle Bin. If your organization reaches its Recycle Bin limit, Salesforce.com automatically removes the oldest records, as long as they have been in the recycle bin for at least two hours.

Parameters
ids Array of one or more IDs associated with the records to delete from the recycle bin. Maximum number of records is 200.
Returns
Throws
Exception ConnectionException when there is an error

public Boolean getAllowFieldTruncationSupport ()

public String getAssignmentRuleId ()

public String getClientId ()

public GetDeletedResult getDeleted (String type, int duration)

Retrieves the list of individual records that have been deleted between the range of now to the duration before now.

Parameters
type Object type. The specified value must be a valid object for your organization.
duration The amount of time in minutes before now for which to return records from.
Throws
Exception ConnectionException when there is an error

public GetDeletedResult getDeletedRange (String type, Calendar startTime, Calendar endTime)

Retrieves the list of individual records that have been deleted within the given timespan for the specified object.

Java Sample
INCLUDE_ERROR

Parameters
type Object type. The specified value must be a valid object for your organization.
startTime Starting date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for which to retrieve the data. The API ignores the seconds portion of the specified dateTime value ' (for example, 12:30:15 is interpreted as 12:30:00 UTC).
endTime Ending date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for which to retrieve the data. The API ignores the seconds portion of the specified dateTime value (for example, 12:35:15 is interpreted as 12:35:00 UTC). If not specific, the current server time will be used.
Throws
Exception ConnectionException when there is an error

public ObjectStore getTimeObjectStore ()

public GetUpdatedResult getUpdated (String type, int duration)

Retrieves the list of individual records that have been updated between the range of now to the duration before now.

Parameters
type Object type. The specified value must be a valid object for your organization.
duration The amount of time in minutes before now for which to return records from.
Returns
  • GetUpdatedResult object containing an array of GetUpdatedResult objects containing the ID of each created or updated object and the date/time (Coordinated Universal Time (UTC) time zone) on which it was created or updated, respectively
Throws
Exception ConnectionException when there is an error

public List<Map<String, Object>> getUpdatedObjects (String type, int initialTimeWindow, List<String> fields)

Retrieves the list of records that have been updated between the last time this method was called and now. This method will save the timestamp of the latest date covered by Salesforce represented by latestDateCovered. IMPORTANT: In order to use this method in a reliable way user must ensure that right after this method returns the result is stored in a persistent way since the timestamp of the latest . In order to reset the latest update time use resetUpdatedObjectsTimestamp

Parameters
type Object type. The specified value must be a valid object for your organization.
initialTimeWindow Time window (in minutes) used to calculate the start time (in time range) the first time this operation is called. E.g: if initialTimeWindow equals 2, the start time will be the current time (now) minus 2 minutes, then the range to retrieve the updated object will be (now - 2 minutes; now). After first call the start time will be calculated from the object store getting the last time this operation was exec
fields The fields to retrieve for the updated objects
Returns
  • List with the updated objects in the calculated time range
Throws
Exception ConnectionException when there is an error

public GetUpdatedResult getUpdatedRange (String type, Calendar startTime, Calendar endTime)

Retrieves the list of individual records that have been created/updated within the given timespan for the specified object.

Parameters
type Object type. The specified value must be a valid object for your organization.
startTime Starting date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for which to retrieve the data. The API ignores the seconds portion of the specified dateTime value ' (for example, 12:30:15 is interpreted as 12:30:00 UTC).
endTime Ending date/time (Coordinated Universal Time (UTC)not local timezone) of the timespan for which to retrieve the data. The API ignores the seconds portion of the specified dateTime value (for example, 12:35:15 is interpreted as 12:35:00 UTC). If it is not provided, the current server time will be used.
Throws
Exception ConnectionException when there is an error

public Boolean getUseDefaultRule ()

public GetUserInfoResult getUserInfo ()

Retrieves personal information for the user associated with the current session.

Throws
Exception ConnectionException when there is an error

public BatchInfo hardDeleteBulk (String type, List<Map<String, Object>> objects)

Deletes one or more records from your organization's data. The deleted records are not stored in the Recycle Bin. Instead, they become immediately eligible for deletion.

This call uses the Bulk API. The creation will be done in asynchronous fashion.

Parameters
type Type of object to update
objects An array of one or more sObjects objects.
Returns
Throws
Exception ConnectionException when there is an error

public QueryResultObject paginatedQuery (String query, QueryResultObject queryResultObject, Boolean withDeletedRecords)

Executes a paginated query against the specified object and returns data that matches the specified criteria. The returned class QueryResultObject provides the methods getData() to retrieve the results in a List and hasMore() to check if there are more pages to retrieve from the server. The query result object contains up to 500 rows of data by default and can be increased up to 2,000 rows.

Parameters
query Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Query Language (SOQL).
queryResultObject QueryResultObject returned by a previous call to this operation. If this is set the other parameter will be ignored.
withDeletedRecords Flag that specifies whether or not to retrieve records that have been deleted.
Returns
Throws
Exception ConnectionException when there is an error

public void publishTopic (String topicName, String query, String description)

Creates a topic which represents a query that is the basis for notifying listeners of changes to records in an organization.

Parameters
topicName Descriptive name of the push topic, such as MyNewCases or TeamUpdatedContacts. The maximum length is 25 characters. This value identifies the channel.
query The SOQL query statement that determines which records' changes trigger events to be sent to the channel. Maximum length: 1200 characters
description Description of what kinds of records are returned by the query. Limit: 400 characters
Throws
Exception ConnectionException when there is an error

public List<Map<String, Object>> query (String query)

Executes a query against the specified object and returns data that matches the specified criteria.

Parameters
query Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Query Language (SOQL).
Returns
Throws
Exception ConnectionException when there is an error

public List<Map<String, Object>> queryAll (String query)

Retrieves data from specified objects, whether or not they have been deleted.

Parameters
query Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Query Language (SOQL).
Returns
Throws
Exception ConnectionException when there is an error

public InputStream queryResultStream (BatchInfo batchInfo)

Returns an InputStream with the query results of a submitted BatchInfo

Parameters
batchInfo The BatchInfo being monitored
Returns
  • InputStream with the results of the Batch.
Throws
Exception ConnectionException when there is an error

public Map<String, Object> querySingle (String query)

Executes a query against the specified object and returns the first record that matches the specified criteria.

Parameters
query Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Query Language (SOQL).
Returns
Throws
Exception ConnectionException when there is an error

public void resetUpdatedObjectsTimestamp (String type)

Resets the timestamp of the last updated object. After resetting this, a call to this#getUpdatedObjects will use the initialTimeWindow to get the updated objects. If no timeObjectStore has been explicitly specified and this#getUpdatedObjects has not been called then calling this method has no effect.

Parameters
type The object type for which the timestamp should be reset.
Throws
ObjectStoreException ConnectionException when there is an error

public List<Map<String, Object>> retrieve (String type, List<String> ids, List<String> fields)

Retrieves one or more records based on the specified IDs.

Parameters
type Object type. The sp ecified value must be a valid object for your organization.
ids The ids of the objects to retrieve
fields The fields to return for the matching objects
Returns
Throws
Exception ConnectionException when there is an error

public List<Map<String, Object>> search (String query)

Search for objects using Salesforce Object Search Language

Parameters
query Query string that specifies the object to query, the fields to return, and any conditions for including a specific object in the query. For more information, see Salesforce Object Search Language (SOSL).
Returns
Throws
Exception ConnectionException when there is an error

public void setAllowFieldTruncationSupport (Boolean allowFieldTruncationSupport)

Parameters
allowFieldTruncationSupport

public void setAssignmentRuleId (String assignmentRuleId)

Parameters
assignmentRuleId

public void setClientId (String clientId)

Parameters
clientId

public void setMuleContext (MuleContext context)

Parameters
context

public void setObjectStoreManager (ObjectStoreManager objectStoreManager)

Parameters
objectStoreManager

public void setPassword (String userId, String newPassword)

Change the password of a User or SelfServiceUser to a value that you specify.

Parameters
userId The user to set the password for.
newPassword The new password for the user.
Throws
Exception ConnectionException when there is an error

public void setRegistry (Registry registry)

Parameters
registry

public void setTimeObjectStore (ObjectStore timeObjectStore)

Parameters
timeObjectStore

public void setUseDefaultRule (Boolean useDefaultRule)

Parameters
useDefaultRule

public StopSourceCallback subscribeTopic (String topic, SourceCallback callback)

Subscribe to a topic.

Parameters
topic The name of the topic to subscribe to
callback The callback to be called when a message is received
Returns
  • org.mule.api.callback.StopSourceCallback

public List<SaveResult> update (String type, List<Map<String, Object>> objects)

Updates one or more existing records in your organization's data.

Parameters
type Type of object to update
objects An array of one or more sObjects objects.
Returns
Throws
Exception ConnectionException when there is an error

public BatchInfo updateBulk (String type, List<Map<String, Object>> objects)

Updates one or more existing records in your organization's data.

This call uses the Bulk API. The creation will be done in asynchronous fashion.

Parameters
type Type of object to update
objects An array of one or more sObjects objects.
Returns
Throws
Exception ConnectionException when there is an error

public SaveResult updateSingle (String type, Map<String, Object> object)

Updates one or more existing records in your organization's data.

Parameters
type Type of object to update
object The object to be updated.
Returns
Throws
Exception ConnectionException when there is an error

public List<UpsertResult> upsert (String externalIdFieldName, String type, List<Map<String, Object>> objects)

Upserts an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records. In most cases, prefer upsert(String, String, List) over create(String, List), to avoid creating unwanted duplicate records.

Parameters
externalIdFieldName Contains the name of the field on this object with the external ID field attribute for custom objects or the idLookup field property for standard objects.
type The type of the given objects. The list of objects to upsert must be homogeneous
objects The objects to upsert
Returns
Throws
Exception ConnectionException when there is an error if a connection error occurs

public BatchInfo upsertBulk (String type, String externalIdFieldName, List<Map<String, Object>> objects)

Upserts an homogeneous list of objects: creates new records and updates existing records, using a custom field to determine the presence of existing records. In most cases, prefer upsert(String, String, List) over create(String, List), to avoid creating unwanted duplicate records.

This call uses the Bulk API. The creation will be done in asynchronous fashion.

Parameters
type The type of the given objects. The list of objects to upsert must be homogeneous
externalIdFieldName Contains the name of the field on this object with the external ID field attribute for custom objects or the idLookup field property for standard objects.
objects The objects to upsert
Returns
Throws
Exception ConnectionException when there is an error

Protected Methods

protected SalesforceBayeuxClient getBayeuxClient ()

protected abstract BulkConnection getBulkConnection ()

protected abstract PartnerConnection getConnection ()

protected abstract String getSessionId ()

protected boolean isInitializedBayeuxClient ()

protected void setBayeuxClient (SalesforceBayeuxClient bc)

Parameters
bc

protected void setConnectionOptions (PartnerConnection connection)

Parameters
connection

protected void setObjectStoreHelper (ObjectStoreHelper objectStoreHelper)

Parameters
objectStoreHelper

protected SObject[] toAsyncSObjectList (List<Map<String, Object>> objects)

Parameters
objects

protected SObject[] toSObjectList (String type, List<Map<String, Object>> objects)

Parameters
type
objects