@Connector(name="sfdc-composite", schemaVersion="6.0", friendlyName="Salesforce Composite", minMuleVersion="3.5") @ReconnectOn(exceptions=InvalidSessionException.class) @RequiresEnterpriseLicense(allowEval=true) public class SalesforceCompositeConnector extends Object
Constructor and Description |
---|
SalesforceCompositeConnector() |
Modifier and Type | Method and Description |
---|---|
Map<String,Object> |
createSobjectTree(String type,
List<Map<String,Object>> sObjects)
Sends a list of SObject trees to Salesforce to be created.
|
List<Map<String,Object>> |
executeCompositeBatch(List<Map<String,Object>> subRequests,
org.mule.api.MuleEvent event)
Sends all the sub-requests in one batch for execution to server.
|
ApplicationContext |
getApplicationContext() |
Config |
getConnectorConfig()
Get composite config.
|
String |
getSubRequestCorrelationId(org.mule.api.MuleEvent muleEvent) |
Map<String,Object> |
postCreate(Map<String,Object> createResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for the result of create.
|
void |
postDelete(Map<String,Object> deleteResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for the result of delete.
|
Map<String,Object> |
postGetLimits(Map<String,Object> getLimitsResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for the result of create.
|
org.mule.streaming.ProviderAwarePagingDelegate<Map<String,Object>,SalesforceCompositeConnector> |
postQuery(String query,
Map<String,Object> queryResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent,
org.mule.streaming.PagingConfiguration pagingConfiguration)
The purpose of this method is to provide metadata for the result of query.
|
org.mule.streaming.ProviderAwarePagingDelegate<Map<String,Object>,SalesforceCompositeConnector> |
postQueryAll(String query,
Map<String,Object> queryResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent,
org.mule.streaming.PagingConfiguration pagingConfiguration)
The purpose of this method is to provide metadata for the result of create.
|
Map<String,Object> |
postRetrieve(String type,
Map<String,Object> retrieveData,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for the result of retrieve.
|
List<Map<String,Object>> |
postSearch(Map<String,Object> searchResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for the result of search.
|
void |
postUpdate(Map<String,Object> updateResult,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for the result of update.
|
void |
preConfig() |
Map<String,Object> |
preCreate(String type,
Map<String,Object> sObject,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for create based on object that is going to be created and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
Map<String,Object> |
preDelete(String type,
Map<String,Object> sObject,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for delete based on object that is going to be deleted and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
Map<String,Object> |
preGetLimits(String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for getLimits and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
Map<String,Object> |
preQuery(String query,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for query based on object that is going to be queried and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
Map<String,Object> |
preQueryAll(String query,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for query based on object that is going to be queried and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
Map<String,Object> |
preRetrieve(Map<String,Object> retrieveData,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for retrieve based on object that is going to be retrieved and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
Map<String,Object> |
preSearch(String search,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide the user a way to input a SOSL String and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(java.util.List).
|
Map<String,Object> |
preUpdate(String type,
Map<String,Object> sObject,
String subRequestCorrelationId,
org.mule.api.MuleEvent muleEvent)
The purpose of this method is to provide metadata for update based on object that is going to be updated and generates a sub-request to be given for execution to
org.mule.modules.salesforce.composite.SalesforceCompositeConnector#executeCompositeBatch(String, java.util.List).
|
List<Map<String,Object>> |
processDefaultMessageCollectionResult(List<Map<String,Object>> listOfResults,
org.mule.DefaultMessageCollection muleMessage) |
void |
setConnectorConfig(Config connectorConfig)
Set composite config.
|
void |
setSubRequestCorrelationId(org.mule.api.MuleEvent muleEvent,
String subRequestCorrelationId) |
String |
toNativeQuery(org.mule.common.query.DsqlQuery query) |
void |
validateThatTheResponseIsAddressedToMe(org.mule.api.MuleEvent muleEvent,
String subRequestCorrelationId) |
@Start public void preConfig()
@Processor @MetaDataScope(value=PreCreateMetadataCategory.class) public Map<String,Object> preCreate(@MetaDataKeyParam(affects=BOTH) String type, @RefOnly@Default(value="#[payload]") Map<String,Object> sObject, String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws ValidationException
type
- - type of object that is going to be createdsObject
- - object that is going to be created as a map that sticks to metadata for selected typesubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultValidationException
- - in case that input data is not validpublic void setSubRequestCorrelationId(org.mule.api.MuleEvent muleEvent, String subRequestCorrelationId)
@Processor @MetaDataScope(value=PostCreateMetadataCategory.class) public Map<String,Object> postCreate(@RefOnly@Default(value="#[payload]") Map<String,Object> createResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PostOperationException
createResult
- - the result of create sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case that it was unable to execute post create actionspublic void validateThatTheResponseIsAddressedToMe(@NotNull org.mule.api.MuleEvent muleEvent, @Nullable String subRequestCorrelationId) throws PostOperationException
PostOperationException
public String getSubRequestCorrelationId(org.mule.api.MuleEvent muleEvent)
@Processor @MetaDataScope(value=PreUpdateMetadataCategory.class) public Map<String,Object> preUpdate(@MetaDataKeyParam(affects=BOTH) String type, @RefOnly@Default(value="#[payload]") Map<String,Object> sObject, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws ValidationException
type
- - type of object that is going to be updatedsObject
- - object that is going to be updated as a map that sticks to metadata for selected typesubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultexecuteCompositeBatch(List, MuleEvent)
ValidationException
- - in case that input data is not valid@Processor public void postUpdate(@RefOnly@Default(value="#[payload]") Map<String,Object> updateResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PostOperationException
updateResult
- - the result of update sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case that it was unable to execute post update actions@Processor @MetaDataScope(value=PreDeleteMetadataCategory.class) public Map<String,Object> preDelete(@MetaDataKeyParam(affects=BOTH) String type, @RefOnly@Default(value="#[payload]") Map<String,Object> sObject, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws ValidationException
type
- - type of object that is going to be deletedsObject
- - map with the id of the object that is going to be deleted mapped to "Id" keysubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultValidationException
- - in case that input data is not valid@Processor public void postDelete(@RefOnly@Default(value="#[payload]") Map<String,Object> deleteResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PostOperationException
deleteResult
- - the result of delete sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case that it was unable to execute post delete actions@Processor @MetaDataScope(value=PreGetLimitsMetadataCategory.class) public Map<String,Object> preGetLimits(@NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent)
subRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the result@Processor @MetaDataScope(value=PostGetLimitsMetadataCategory.class) public Map<String,Object> postGetLimits(@RefOnly@Default(value="#[payload]") Map<String,Object> getLimitsResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PostOperationException
getLimitsResult
- - the result of create sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case the result from Salesforce is an error message@Processor @MetaDataScope(value=PreQueryMetadataCategory.class) public Map<String,Object> preQuery(@Query@Placement(group="Query") String query, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PreOperationException, ValidationException
query
- - the query that is going to be ran in executeCompositeBatchsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPreOperationException
- - thrown when the query given as input could not be encoded in the URLValidationException
- - in case that input data is not valid@Processor @MetaDataScope(value=PreQueryMetadataCategory.class) public Map<String,Object> preQueryAll(@Query@Placement(group="Query") String query, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PreOperationException, ValidationException
query
- - the query that is going to be ran in executeCompositeBatchsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPreOperationException
- - thrown when the query given as input could not be encoded in the URLValidationException
- - in case that input data is not valid@Processor @Paged @MetaDataScope(value=PostQueryMetadataCategory.class) public org.mule.streaming.ProviderAwarePagingDelegate<Map<String,Object>,SalesforceCompositeConnector> postQuery(@Query@Placement(group="Query") String query, @RefOnly@Default(value="#[payload]") Map<String,Object> queryResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent, org.mule.streaming.PagingConfiguration pagingConfiguration) throws PostOperationException
query
- - the query ran in executeCompositeBatch - needed for datasense, to bring the output metadataqueryResult
- - the result of query sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case the result from Salesforce is an error message@Processor @Paged @MetaDataScope(value=PostQueryMetadataCategory.class) public org.mule.streaming.ProviderAwarePagingDelegate<Map<String,Object>,SalesforceCompositeConnector> postQueryAll(@Query@Placement(group="Query") String query, @RefOnly@Default(value="#[payload]") Map<String,Object> queryResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent, org.mule.streaming.PagingConfiguration pagingConfiguration) throws PostOperationException
query
- - the query ran in executeCompositeBatch - needed for datasense, to bring the output metadataqueryResult
- - the result of create sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case the result from Salesforce is an error message@Processor @MetaDataScope(value=PreSearchMetadataCategory.class) public Map<String,Object> preSearch(@Default(value="#[payload]")@Placement(group="Search") String search, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PreOperationException, ValidationException
search
- - the SOSL string that is going to be ran in executeCompositeBatchsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPreOperationException
- - thrown when the search string given as input could not be encoded in the URLValidationException
- - in case that input data is not valid@Processor public List<Map<String,Object>> postSearch(@RefOnly@Default(value="#[payload]") Map<String,Object> searchResult, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PostOperationException
searchResult
- - the result of search sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case the result from Salesforce is an error message@QueryTranslator public String toNativeQuery(org.mule.common.query.DsqlQuery query)
@Processor @MetaDataScope(value=ExecuteMetadataCategory.class) public List<Map<String,Object>> executeCompositeBatch(@RefOnly@Default(value="#[payload]") List<Map<String,Object>> subRequests, org.mule.api.MuleEvent event) throws BatchExecutionException, ValidationException
subRequests
- - sub-requests to be sent to serverBatchExecutionException
- in case that it was unable to execute sub requestsValidationException
- - in case that input data is not valid@Processor @MetaDataScope(value=SObjectTreeMetadataCategory.class) public Map<String,Object> createSobjectTree(@MetaDataKeyParam(affects=BOTH)@FriendlyName(value="SObject Root Type") String type, @RefOnly@FriendlyName(value="SObject Tree")@Default(value="#[payload]") List<Map<String,Object>> sObjects) throws ExecuteBatchException
type
- - the sObject type of the root of the treessObjects
- - a list of maps containing representing the list of trees that need to be createdExecuteBatchException
- in case that it was unable to execute the requestpublic List<Map<String,Object>> processDefaultMessageCollectionResult(List<Map<String,Object>> listOfResults, org.mule.DefaultMessageCollection muleMessage)
@Processor @MetaDataScope(value=PreRetrieveMetadataCategory.class) public Map<String,Object> preRetrieve(@RefOnly@Default(value="#[payload]") Map<String,Object> retrieveData, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PreOperationException, ValidationException
retrieveData
- - object that is going to be retrieved as a map that sticks to metadata for selected typesubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPreOperationException
- in case that something went wrong while preparing sub-requestValidationException
- - in case that input data is not valid@Processor @MetaDataScope(value=PostRetrieveMetadataCategory.class) @NotNull public Map<String,Object> postRetrieve(@MetaDataKeyParam(affects=OUTPUT) String type, @NotNull@RefOnly@Default(value="#[payload]") Map<String,Object> retrieveData, @NotNull String subRequestCorrelationId, org.mule.api.MuleEvent muleEvent) throws PostOperationException
type
- - type of object that is going to be retrievedretrieveData
- - the result of retrieve sub-requestsubRequestCorrelationId
- - this is the identifier provided by user for the sub-request. It will be used to by post operation to correlate the resultPostOperationException
- in case the result from Salesforce is an error messagepublic Config getConnectorConfig()
Config
public void setConnectorConfig(Config connectorConfig)
connectorConfig
- composite's config (@link Config)public ApplicationContext getApplicationContext()
Copyright © 2010–2016. All rights reserved.