You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2019/08/20 06:16:18 UTC
[camel] branch master updated: Fixed CS for Camel-Salesforce
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new 092f8bf Fixed CS for Camel-Salesforce
092f8bf is described below
commit 092f8bfe5904bb6f5c2d9413267ba610ce9d33d4
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Aug 20 08:14:56 2019 +0200
Fixed CS for Camel-Salesforce
---
.../salesforce/SalesforceClientTemplate.java | 13 +-
.../component/salesforce/SalesforceComponent.java | 163 ++++++-------
.../SalesforceComponentVerifierExtension.java | 27 +--
.../component/salesforce/SalesforceConsumer.java | 9 +-
.../component/salesforce/SalesforceEndpoint.java | 35 +--
.../salesforce/SalesforceEndpointConfig.java | 63 +++--
.../component/salesforce/SalesforceHttpClient.java | 3 +-
.../salesforce/SalesforceLoginConfig.java | 44 ++--
.../salesforce/SalesforceMetaDataExtension.java | 5 +-
.../component/salesforce/SalesforceProducer.java | 5 +-
.../api/MultiSelectPicklistConverter.java | 16 +-
.../api/MultiSelectPicklistDeserializer.java | 8 +-
.../api/MultiSelectPicklistSerializer.java | 9 +-
.../salesforce/api/PicklistEnumConverter.java | 10 +-
.../SalesforceReportResultsToListConverter.java | 110 ++++-----
.../api/StringMultiSelectPicklistConverter.java | 13 +-
.../api/StringMultiSelectPicklistDeserializer.java | 6 +-
.../api/StringMultiSelectPicklistSerializer.java | 9 +-
.../component/salesforce/api/TypeReferences.java | 3 +-
.../api/dto/AbstractDescribedSObjectBase.java | 21 +-
.../api/dto/AbstractQueryRecordsBase.java | 24 +-
.../salesforce/api/dto/AbstractSObjectBase.java | 9 +-
.../api/dto/AnnotationFieldKeySorter.java | 3 +-
.../component/salesforce/api/dto/Attributes.java | 8 +-
.../camel/component/salesforce/api/dto/Limits.java | 59 ++---
.../salesforce/api/dto/PlatformEvent.java | 6 +-
.../component/salesforce/api/dto/RestError.java | 3 +-
.../salesforce/api/dto/SObjectDescription.java | 4 +-
.../api/dto/analytics/reports/AsyncAttributes.java | 1 -
.../api/dto/analytics/reports/SummaryValue.java | 1 +
.../api/dto/approval/ApprovalRequest.java | 29 ++-
.../api/dto/approval/ApprovalRequests.java | 2 +-
.../api/dto/approval/ApprovalResult.java | 17 +-
.../salesforce/api/dto/approval/Approvals.java | 23 +-
.../salesforce/api/dto/bulk/BatchInfo.java | 76 +++---
.../salesforce/api/dto/bulk/BatchInfoList.java | 28 +--
.../salesforce/api/dto/bulk/BatchResult.java | 27 +--
.../salesforce/api/dto/bulk/BatchStateEnum.java | 21 +-
.../api/dto/bulk/ConcurrencyModeEnum.java | 12 +-
.../salesforce/api/dto/bulk/ContentType.java | 16 +-
.../component/salesforce/api/dto/bulk/Error.java | 25 +-
.../component/salesforce/api/dto/bulk/JobInfo.java | 168 +++++---------
.../salesforce/api/dto/bulk/JobStateEnum.java | 18 +-
.../salesforce/api/dto/bulk/ObjectFactory.java | 50 ++--
.../salesforce/api/dto/bulk/OperationEnum.java | 24 +-
.../salesforce/api/dto/bulk/QueryResult.java | 27 +--
.../salesforce/api/dto/bulk/QueryResultList.java | 27 +--
.../component/salesforce/api/dto/bulk/Result.java | 33 ++-
.../salesforce/api/dto/bulk/ResultError.java | 40 ++--
.../component/salesforce/api/dto/bulk/SObject.java | 41 ++--
.../salesforce/api/dto/bulk/StatusCode.java | 223 ++++--------------
.../salesforce/api/dto/bulk/package-info.java | 3 +-
.../salesforce/api/dto/composite/Counter.java | 3 +-
.../api/dto/composite/ReferenceGenerator.java | 20 +-
.../salesforce/api/dto/composite/ReferenceId.java | 11 +-
.../api/dto/composite/RichInputConverter.java | 2 +-
.../salesforce/api/dto/composite/SObjectBatch.java | 221 ++++++++----------
.../api/dto/composite/SObjectBatchResponse.java | 11 +-
.../api/dto/composite/SObjectBatchResult.java | 57 +++--
.../api/dto/composite/SObjectComposite.java | 68 ++----
.../dto/composite/SObjectCompositeResponse.java | 3 +-
.../api/dto/composite/SObjectCompositeResult.java | 12 +-
.../salesforce/api/dto/composite/SObjectNode.java | 95 ++++----
.../dto/composite/SObjectNodeXStreamConverter.java | 2 +-
.../salesforce/api/dto/composite/SObjectTree.java | 64 +++---
.../api/dto/composite/SObjectTreeResponse.java | 11 +-
.../salesforce/api/utils/InstantConverter.java | 5 +-
.../salesforce/api/utils/InstantSerializer.java | 3 +-
.../component/salesforce/api/utils/JsonUtils.java | 89 +++-----
.../api/utils/LocalDateTimeConverter.java | 5 +-
.../api/utils/LocalDateTimeDeserializer.java | 3 +-
.../api/utils/LocalDateTimeSerializer.java | 3 +-
.../api/utils/OffsetDateTimeConverter.java | 5 +-
.../api/utils/OffsetDateTimeDeserializer.java | 3 +-
.../api/utils/OffsetDateTimeSerializer.java | 3 +-
.../salesforce/api/utils/OffsetTimeConverter.java | 5 +-
.../salesforce/api/utils/OffsetTimeSerializer.java | 3 +-
.../salesforce/api/utils/QueryHelper.java | 12 +-
.../component/salesforce/api/utils/TimeModule.java | 9 +-
.../component/salesforce/api/utils/Version.java | 9 +-
.../salesforce/api/utils/XStreamUtils.java | 3 +-
.../api/utils/ZonedDateTimeConverter.java | 5 +-
.../salesforce/internal/OperationName.java | 55 +----
.../salesforce/internal/PayloadFormat.java | 3 +-
.../salesforce/internal/SalesforceSession.java | 40 ++--
.../internal/client/AbstractClientBase.java | 47 ++--
.../internal/client/AnalyticsApiClient.java | 15 +-
.../salesforce/internal/client/BulkApiClient.java | 41 ++--
.../internal/client/CompositeApiClient.java | 9 +-
.../internal/client/DefaultAnalyticsApiClient.java | 67 ++----
.../internal/client/DefaultBulkApiClient.java | 47 ++--
.../internal/client/DefaultCompositeApiClient.java | 54 ++---
.../internal/client/DefaultRestClient.java | 57 ++---
.../salesforce/internal/client/RestClient.java | 159 +++++++------
.../internal/client/SalesforceSecurityHandler.java | 58 ++---
.../internal/client/SyncResponseCallback.java | 3 +-
.../internal/dto/NotifyForFieldsEnum.java | 2 +-
.../internal/dto/NotifyForOperationsEnum.java | 2 +-
.../internal/processor/AbstractRestProcessor.java | 196 ++++++----------
.../processor/AbstractSalesforceProcessor.java | 50 ++--
.../internal/processor/AnalyticsApiProcessor.java | 70 +++---
.../internal/processor/BulkApiProcessor.java | 203 ++++++++--------
.../internal/processor/CompositeApiProcessor.java | 40 ++--
.../internal/processor/JsonRestProcessor.java | 6 +-
.../internal/processor/SalesforceProcessor.java | 6 +-
.../internal/processor/XmlRestProcessor.java | 62 ++---
.../internal/streaming/PushTopicHelper.java | 100 +++-----
.../internal/streaming/SubscriptionHelper.java | 55 ++---
.../AbstractApprovalIntegrationTest.java | 12 +-
.../salesforce/AbstractBulkApiTestBase.java | 37 ++-
.../salesforce/AbstractSalesforceTestBase.java | 4 +-
.../salesforce/AnalyticsApiIntegrationTest.java | 82 +++----
.../ApprovalExamplesIntegrationTest.java | 18 +-
.../salesforce/ApprovalIntegrationTest.java | 42 ++--
.../salesforce/BulkApiBatchIntegrationTest.java | 9 +-
.../salesforce/BulkApiIntegrationTest.java | 2 +-
.../salesforce/BulkApiJobIntegrationTest.java | 5 +-
.../salesforce/BulkApiQueryIntegrationTest.java | 10 +-
.../CompositeApiBatchIntegrationTest.java | 96 ++++----
.../salesforce/CompositeApiIntegrationTest.java | 8 +-
.../CompositeApiTreeIntegrationTest.java | 3 +-
.../salesforce/CompoundTypesIntegrationTest.java | 36 ++-
.../salesforce/HttpProxyIntegrationTest.java | 20 +-
.../salesforce/LimitsIntegrationTest.java | 3 +-
.../component/salesforce/LoginConfigHelper.java | 6 +-
.../salesforce/NotFoundIntegrationTest.java | 11 +-
.../camel/component/salesforce/RawPayloadTest.java | 55 ++---
.../salesforce/RecentIntegrationTest.java | 29 +--
.../salesforce/RestApiIntegrationTest.java | 170 +++++---------
...eComponentVerifierExtensionIntegrationTest.java | 38 ++-
.../salesforce/SalesforceConsumerTest.java | 6 +-
.../salesforce/SalesforceEndpointTest.java | 14 +-
.../SalesforceHeadersIntegrationTest.java | 2 +-
.../SalesforceMetaDataExtensionTest.java | 27 +--
.../camel/component/salesforce/Standalone.java | 3 +-
.../salesforce/StreamingApiIntegrationTest.java | 42 ++--
.../api/MultiSelectPicklistJsonTest.java | 2 +-
.../salesforce/api/MultiSelectPicklistXmlTest.java | 6 +-
.../component/salesforce/api/dto/LimitsTest.java | 17 +-
.../salesforce/api/dto/PlatformEventTest.java | 13 +-
.../salesforce/api/dto/RecentItemTest.java | 27 +--
.../salesforce/api/dto/RestErrorTest.java | 14 +-
.../api/dto/approval/ApprovalRequestTest.java | 35 ++-
.../api/dto/approval/ApprovalRequestsTest.java | 74 +++---
.../api/dto/approval/ApprovalResultTest.java | 40 ++--
.../salesforce/api/dto/approval/ApprovalsTest.java | 28 ++-
.../api/dto/composite/MapOfMapsConverterTest.java | 30 ++-
.../dto/composite/SObjectBatchResponseTest.java | 110 +++++----
.../api/dto/composite/SObjectBatchTest.java | 254 ++++++++-------------
.../composite/SObjectCompositeResponseTest.java | 71 +++---
.../api/dto/composite/SObjectCompositeTest.java | 9 +-
.../api/dto/composite/SObjectTreeResponseTest.java | 136 ++++++-----
.../api/dto/composite/SObjectTreeTest.java | 122 ++++------
.../salesforce/api/utils/JsonUtilsTest.java | 2 +-
.../salesforce/api/utils/QueryHelperTest.java | 31 ++-
.../api/utils/SalesforceTimeFormatsTest.java | 45 ++--
.../salesforce/dto/generated/Account.java | 23 +-
.../dto/generated/Account_IndustryEnum.java | 2 +-
.../salesforce/dto/generated/Contact.java | 20 +-
.../salesforce/dto/generated/Document.java | 12 +-
.../salesforce/dto/generated/Line_Item__c.java | 4 -
.../salesforce/dto/generated/Merchandise__c.java | 7 +-
.../dto/generated/QueryRecordsLine_Item__c.java | 1 +
.../salesforce/internal/LoginTokenTest.java | 22 +-
.../salesforce/internal/SalesforceSessionTest.java | 15 +-
.../internal/SessionIntegrationTest.java | 3 +-
.../internal/client/AbstractClientBaseTest.java | 15 +-
.../AbstractRestProcessorApprovalTest.java | 27 +--
.../internal/processor/JsonRestProcessorTest.java | 23 +-
.../internal/streaming/SubscriptionHelperTest.java | 34 ++-
.../apache/camel/maven/AbstractSalesforceMojo.java | 16 +-
.../java/org/apache/camel/maven/GenerateMojo.java | 121 +++++-----
.../org/apache/camel/maven/ObjectDescriptions.java | 25 +-
.../java/org/apache/camel/maven/SchemaMojo.java | 15 +-
.../AbstractSalesforceMojoIntegrationTest.java | 6 +-
.../camel/maven/CamelSalesforceMojoOutputTest.java | 86 +++----
.../org/apache/camel/maven/GenerateMojoTest.java | 24 +-
.../camel/maven/HttpProxyMojoIntegrationTest.java | 23 +-
.../camel/maven/SchemaMojoIntegrationTest.java | 3 +-
179 files changed, 2598 insertions(+), 3597 deletions(-)
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceClientTemplate.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceClientTemplate.java
index 2b8400a..1a28019 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceClientTemplate.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceClientTemplate.java
@@ -35,23 +35,20 @@ final class SalesforceClientTemplate {
T invoke(RestClient client);
}
- static RestClientSupplier restClientSupplier = (camelContext, parameters) -> SalesforceComponent
- .createRestClient(camelContext, parameters);
+ static RestClientSupplier restClientSupplier = (camelContext, parameters) -> SalesforceComponent.createRestClient(camelContext, parameters);
private SalesforceClientTemplate() {
// utility class
}
- static <T> T invoke(final CamelContext camelContext, final Map<String, Object> parameters,
- final WithClient<T> performer) throws Exception {
+ static <T> T invoke(final CamelContext camelContext, final Map<String, Object> parameters, final WithClient<T> performer) throws Exception {
final RestClient client = restClientSupplier.restClientWith(camelContext, parameters);
return invokeInternal(client, performer);
}
- static <T> T invoke(final SalesforceComponent component, final Map<String, Object> parameters,
- final WithClient<T> performer) throws Exception {
+ static <T> T invoke(final SalesforceComponent component, final Map<String, Object> parameters, final WithClient<T> performer) throws Exception {
final RestClient client = component.createRestClient(parameters);
@@ -65,7 +62,7 @@ final class SalesforceClientTemplate {
// SalesforceComponent could mean logging out any running endpoints also
final boolean isHttpClientHolder = client instanceof HttpClientHolder;
if (isHttpClientHolder) {
- ((HttpClientHolder) client).getHttpClient().start();
+ ((HttpClientHolder)client).getHttpClient().start();
}
ServiceHelper.startService(client);
@@ -76,7 +73,7 @@ final class SalesforceClientTemplate {
ServiceHelper.stopService(client);
if (isHttpClientHolder) {
- ((HttpClientHolder) client).getHttpClient().stop();
+ ((HttpClientHolder)client).getHttpClient().stop();
}
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
index c042be7..bde2318 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java
@@ -85,88 +85,75 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
static final String APEX_CALL_PREFIX = OperationName.APEX_CALL.value() + "/";
@Metadata(description = "All authentication configuration in one nested bean, all properties set there can be set"
- + " directly on the component as well", label = "common,security")
+ + " directly on the component as well", label = "common,security")
private SalesforceLoginConfig loginConfig;
@Metadata(description = "URL of the Salesforce instance used after authentication, by default received from"
- + " Salesforce on successful authentication", label = "common,security")
+ + " Salesforce on successful authentication", label = "common,security")
private String instanceUrl;
// allow fine grained login as well
@Metadata(description = "URL of the Salesforce instance used for authentication, by default set to "
- + DEFAULT_LOGIN_URL, label = "common,security", defaultValue = DEFAULT_LOGIN_URL, required = true)
+ + DEFAULT_LOGIN_URL, label = "common,security", defaultValue = DEFAULT_LOGIN_URL, required = true)
private String loginUrl;
@Metadata(description = "OAuth Consumer Key of the connected app configured in the Salesforce instance setup."
- + " Typically a connected app needs to be configured but one can be provided by installing a package.",
- label = "common,security", required = true)
+ + " Typically a connected app needs to be configured but one can be provided by installing a package.", label = "common,security", required = true)
private String clientId;
- @Metadata(description = "OAuth Consumer Secret of the connected app configured in the Salesforce instance setup.",
- label = "common,security", secret = true)
+ @Metadata(description = "OAuth Consumer Secret of the connected app configured in the Salesforce instance setup.", label = "common,security", secret = true)
private String clientSecret;
@Metadata(description = "Refresh token already obtained in the refresh token OAuth flow. One needs to setup a web"
- + " application and configure a callback URL to receive the refresh token, or configure using the builtin"
- + " callback at https://login.salesforce.com/services/oauth2/success or "
- + " https://test.salesforce.com/services/oauth2/success and then retrive the refresh_token from the URL at the"
- + " end of the flow. Note that in development organizations Salesforce allows hosting the callback web "
- + " application at localhost.",
- label = "common,security", secret = true)
+ + " application and configure a callback URL to receive the refresh token, or configure using the builtin"
+ + " callback at https://login.salesforce.com/services/oauth2/success or "
+ + " https://test.salesforce.com/services/oauth2/success and then retrive the refresh_token from the URL at the"
+ + " end of the flow. Note that in development organizations Salesforce allows hosting the callback web "
+ + " application at localhost.", label = "common,security", secret = true)
private String refreshToken;
@Metadata(description = "Username used in OAuth flow to gain access to access token. It's easy to get started with"
- + " password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows.",
- label = "common,security")
+ + " password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows.", label = "common,security")
private String userName;
@Metadata(description = "Password used in OAuth flow to gain access to access token. It's easy to get started with"
- + " password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows."
- + " Make sure that you append security token to the end of the password if using one.",
- label = "common,security", secret = true)
+ + " password OAuth flow, but in general one should avoid it as it is deemed less secure than other flows."
+ + " Make sure that you append security token to the end of the password if using one.", label = "common,security", secret = true)
private String password;
@Metadata(description = "KeyStore parameters to use in OAuth JWT flow. The KeyStore should contain only one entry"
- + " with private key and certificate. Salesforce does not verify the certificate chain, so this can easily be"
- + " a selfsigned certificate. Make sure that you upload the certificate to the corresponding connected app.",
- label = "common,security", secret = true)
+ + " with private key and certificate. Salesforce does not verify the certificate chain, so this can easily be"
+ + " a selfsigned certificate. Make sure that you upload the certificate to the corresponding connected app.", label = "common,security", secret = true)
private KeyStoreParameters keystore;
@Metadata(description = "Explicit authentication method to be used, one of USERNAME_PASSWORD, REFRESH_TOKEN or JWT."
- + " Salesforce component can auto-determine the authentication method to use from the properties set, set this "
- + " property to eliminate any ambiguity.",
- label = "common,security", enums = "USERNAME_PASSWORD,REFRESH_TOKEN,JWT")
+ + " Salesforce component can auto-determine the authentication method to use from the properties set, set this "
+ + " property to eliminate any ambiguity.", label = "common,security", enums = "USERNAME_PASSWORD,REFRESH_TOKEN,JWT")
private AuthenticationType authenticationType;
@Metadata(description = "If set to true prevents the component from authenticating to Salesforce with the start of"
- + " the component. You would generally set this to the (default) false and authenticate early and be immediately"
- + " aware of any authentication issues.", defaultValue = "false", label = "common,security")
+ + " the component. You would generally set this to the (default) false and authenticate early and be immediately"
+ + " aware of any authentication issues.", defaultValue = "false", label = "common,security")
private boolean lazyLogin;
- @Metadata(description = "Global endpoint configuration - use to set values that are common to all endpoints",
- label = "common,advanced")
+ @Metadata(description = "Global endpoint configuration - use to set values that are common to all endpoints", label = "common,advanced")
private SalesforceEndpointConfig config;
- @Metadata(description = "Timeout used by the HttpClient when waiting for response from the Salesforce server.",
- label = "common", defaultValue = "" + IDLE_TIMEOUT)
+ @Metadata(description = "Timeout used by the HttpClient when waiting for response from the Salesforce server.", label = "common", defaultValue = "" + IDLE_TIMEOUT)
private long httpClientIdleTimeout = IDLE_TIMEOUT;
- @Metadata(description = "Connection timeout used by the HttpClient when connecting to the Salesforce server.",
- label = "common", defaultValue = "" + CONNECTION_TIMEOUT)
+ @Metadata(description = "Connection timeout used by the HttpClient when connecting to the Salesforce server.", label = "common", defaultValue = "" + CONNECTION_TIMEOUT)
private long httpClientConnectionTimeout = CONNECTION_TIMEOUT;
@Metadata(description = "Used to set any properties that can be configured on the underlying HTTP client. Have a"
- + " look at properties of SalesforceHttpClient and the Jetty HttpClient for all available options.",
- label = "common,advanced")
+ + " look at properties of SalesforceHttpClient and the Jetty HttpClient for all available options.", label = "common,advanced")
private Map<String, Object> httpClientProperties;
@Metadata(description = "Used to set any properties that can be configured on the LongPollingTransport used by the"
- + " BayeuxClient (CometD) used by the streaming api",
- label = "common,advanced")
+ + " BayeuxClient (CometD) used by the streaming api", label = "common,advanced")
private Map<String, Object> longPollingTransportProperties;
- @Metadata(description = "SSL parameters to use, see SSLContextParameters class for all available options.",
- label = "common,security")
+ @Metadata(description = "SSL parameters to use, see SSLContextParameters class for all available options.", label = "common,security")
private SSLContextParameters sslContextParameters;
@Metadata(description = "Enable usage of global SSL context parameters", label = "security", defaultValue = "false")
private boolean useGlobalSslContextParameters;
@@ -178,46 +165,40 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
@Metadata(description = "Port number of the HTTP proxy server to use.", label = "common,proxy")
private Integer httpProxyPort;
- @Metadata(description = "If set to true the configures the HTTP proxy to use as a SOCKS4 proxy.",
- defaultValue = "false", label = "common,proxy")
+ @Metadata(description = "If set to true the configures the HTTP proxy to use as a SOCKS4 proxy.", defaultValue = "false", label = "common,proxy")
private boolean isHttpProxySocks4;
- @Metadata(description = "If set to false disables the use of TLS when accessing the HTTP proxy.",
- defaultValue = "true", label = "common,proxy,security")
+ @Metadata(description = "If set to false disables the use of TLS when accessing the HTTP proxy.", defaultValue = "true", label = "common,proxy,security")
private boolean isHttpProxySecure = true;
@Metadata(description = "A list of addresses for which HTTP proxy server should be used.", label = "common,proxy")
private Set<String> httpProxyIncludedAddresses;
- @Metadata(description = "A list of addresses for which HTTP proxy server should not be used.",
- label = "common,proxy")
+ @Metadata(description = "A list of addresses for which HTTP proxy server should not be used.", label = "common,proxy")
private Set<String> httpProxyExcludedAddresses;
// Proxy basic authentication
- @Metadata(description = "Username to use to authenticate against the HTTP proxy server.",
- label = "common,proxy,security")
+ @Metadata(description = "Username to use to authenticate against the HTTP proxy server.", label = "common,proxy,security")
private String httpProxyUsername;
- @Metadata(description = "Password to use to authenticate against the HTTP proxy server.",
- label = "common,proxy,security", secret = true)
+ @Metadata(description = "Password to use to authenticate against the HTTP proxy server.", label = "common,proxy,security", secret = true)
private String httpProxyPassword;
@Metadata(description = "Used in authentication against the HTTP proxy server, needs to match the URI of the proxy"
- + " server in order for the httpProxyUsername and httpProxyPassword to be used for authentication.",
- label = "common,proxy,security")
+ + " server in order for the httpProxyUsername and httpProxyPassword to be used for authentication.", label = "common,proxy,security")
private String httpProxyAuthUri;
@Metadata(description = "Realm of the proxy server, used in preemptive Basic/Digest authentication methods against"
- + " the HTTP proxy server.", label = "common,proxy,security")
+ + " the HTTP proxy server.", label = "common,proxy,security")
private String httpProxyRealm;
@Metadata(description = "If set to true Digest authentication will be used when authenticating to the HTTP proxy,"
- + "otherwise Basic authorization method will be used", defaultValue = "false", label = "common,proxy,security")
+ + "otherwise Basic authorization method will be used", defaultValue = "false", label = "common,proxy,security")
private boolean httpProxyUseDigestAuth;
@Metadata(description = "In what packages are the generated DTO classes. Typically the classes would be generated"
- + " using camel-salesforce-maven-plugin. Set it if using the generated DTOs to gain the benefit of using short "
- + " SObject names in parameters/header values.", label = "common")
+ + " using camel-salesforce-maven-plugin. Set it if using the generated DTOs to gain the benefit of using short "
+ + " SObject names in parameters/header values.", label = "common")
private String[] packages;
// component state
@@ -256,7 +237,8 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
}
operationName = OperationName.fromValue(remaining);
} catch (IllegalArgumentException ex) {
- // if its not an operation name, treat is as topic name for consumer endpoints
+ // if its not an operation name, treat is as topic name for consumer
+ // endpoints
topicName = remaining;
}
@@ -278,8 +260,7 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
copy.setApexUrl(apexUrl);
}
- final SalesforceEndpoint endpoint = new SalesforceEndpoint(uri, this, copy,
- operationName, topicName);
+ final SalesforceEndpoint endpoint = new SalesforceEndpoint(uri, this, copy, operationName, topicName);
// map remaining parameters to endpoint (specifically, synchronous)
setProperties(endpoint, parameters);
@@ -300,10 +281,10 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
private Map<String, Class<?>> parsePackages() {
Map<String, Class<?>> result = new HashMap<>();
- Set<Class<?>> classes = getCamelContext().adapt(ExtendedCamelContext.class).getPackageScanClassResolver().
- findImplementations(AbstractSObjectBase.class, packages);
+ Set<Class<?>> classes = getCamelContext().adapt(ExtendedCamelContext.class).getPackageScanClassResolver().findImplementations(AbstractSObjectBase.class, packages);
for (Class<?> aClass : classes) {
- // findImplementations also returns AbstractSObjectBase for some reason!!!
+ // findImplementations also returns AbstractSObjectBase for some
+ // reason!!!
if (AbstractSObjectBase.class != aClass) {
result.put(aClass.getSimpleName(), aClass);
}
@@ -337,8 +318,7 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
// create a Jetty HttpClient if not already set
if (httpClient == null) {
final SSLContextParameters contextParameters = Optional.ofNullable(sslContextParameters)
- .orElseGet(() -> Optional.ofNullable(retrieveGlobalSslContextParameters())
- .orElseGet(() -> new SSLContextParameters()));
+ .orElseGet(() -> Optional.ofNullable(retrieveGlobalSslContextParameters()).orElseGet(() -> new SSLContextParameters()));
final SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setSslContext(contextParameters.createSSLContext(getCamelContext()));
@@ -689,8 +669,7 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
}
RestClient createRestClient(final Map<String, Object> properties) throws Exception {
- final SalesforceEndpointConfig modifiedConfig = Optional.ofNullable(config).map(SalesforceEndpointConfig::copy)
- .orElseGet(() -> new SalesforceEndpointConfig());
+ final SalesforceEndpointConfig modifiedConfig = Optional.ofNullable(config).map(SalesforceEndpointConfig::copy).orElseGet(() -> new SalesforceEndpointConfig());
final CamelContext camelContext = getCamelContext();
PropertyBindingSupport.bindProperties(camelContext, modifiedConfig, properties);
@@ -698,20 +677,21 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
return createRestClientFor(modifiedConfig);
}
- static RestClient createRestClient(final CamelContext camelContext, final Map<String, Object> properties)
- throws Exception {
+ static RestClient createRestClient(final CamelContext camelContext, final Map<String, Object> properties) throws Exception {
final SalesforceEndpointConfig config = new SalesforceEndpointConfig();
- // let's work with a copy for IntrospectionSupport so original properties are intact
+ // let's work with a copy for IntrospectionSupport so original
+ // properties are intact
PropertyBindingSupport.bindProperties(camelContext, config, new HashMap<>(properties));
final SalesforceLoginConfig loginConfig = new SalesforceLoginConfig();
- // let's work with a copy for IntrospectionSupport so original properties are intact
+ // let's work with a copy for IntrospectionSupport so original
+ // properties are intact
PropertyBindingSupport.bindProperties(camelContext, loginConfig, new HashMap<>(properties));
- final SSLContextParameters sslContextParameters = Optional.ofNullable(camelContext.getSSLContextParameters())
- .orElseGet(() -> new SSLContextParameters());
- // let's work with a copy for IntrospectionSupport so original properties are intact
+ final SSLContextParameters sslContextParameters = Optional.ofNullable(camelContext.getSSLContextParameters()).orElseGet(() -> new SSLContextParameters());
+ // let's work with a copy for IntrospectionSupport so original
+ // properties are intact
PropertyBindingSupport.bindProperties(camelContext, sslContextParameters, new HashMap<>(properties));
final SslContextFactory sslContextFactory = new SslContextFactory();
@@ -720,8 +700,7 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
final SalesforceHttpClient httpClient = createHttpClient(sslContextFactory);
setupHttpClient(httpClient, camelContext, properties);
- final SalesforceSession session = new SalesforceSession(camelContext, httpClient, httpClient.getTimeout(),
- loginConfig);
+ final SalesforceSession session = new SalesforceSession(camelContext, httpClient, httpClient.getTimeout(), loginConfig);
httpClient.setSession(session);
return new DefaultRestClient(httpClient, config.getApiVersion(), config.getFormat(), session);
@@ -737,8 +716,8 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
return httpClient;
}
- static SalesforceHttpClient setupHttpClient(final SalesforceHttpClient httpClient, final CamelContext camelContext,
- final Map<String, Object> httpClientProperties) throws Exception {
+ static SalesforceHttpClient setupHttpClient(final SalesforceHttpClient httpClient, final CamelContext camelContext, final Map<String, Object> httpClientProperties)
+ throws Exception {
if (httpClientProperties == null || httpClientProperties.isEmpty()) {
return httpClient;
@@ -746,31 +725,24 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
// set HTTP client parameters
final TypeConverter typeConverter = camelContext.getTypeConverter();
- PropertyBindingSupport.bindProperties(camelContext, httpClient,
- new HashMap<>(httpClientProperties));
+ PropertyBindingSupport.bindProperties(camelContext, httpClient, new HashMap<>(httpClientProperties));
final Long httpConnectionTimeout = typeConverter.convertTo(Long.class, httpClientProperties.get(HTTP_CONNECTION_TIMEOUT));
final Long httpIdleTimeout = typeConverter.convertTo(Long.class, httpClientProperties.get(HTTP_IDLE_TIMEOUT));
final String httpProxyHost = typeConverter.convertTo(String.class, httpClientProperties.get(HTTP_PROXY_HOST));
final Integer httpProxyPort = typeConverter.convertTo(Integer.class, httpClientProperties.get(HTTP_PROXY_PORT));
- final boolean isHttpProxySocks4 = typeConverter.convertTo(boolean.class,
- httpClientProperties.get(HTTP_PROXY_IS_SOCKS4));
- final boolean isHttpProxySecure = typeConverter.convertTo(boolean.class,
- httpClientProperties.get(HTTP_PROXY_IS_SECURE));
+ final boolean isHttpProxySocks4 = typeConverter.convertTo(boolean.class, httpClientProperties.get(HTTP_PROXY_IS_SOCKS4));
+ final boolean isHttpProxySecure = typeConverter.convertTo(boolean.class, httpClientProperties.get(HTTP_PROXY_IS_SECURE));
@SuppressWarnings("unchecked")
- final Set<String> httpProxyIncludedAddresses = (Set<String>) httpClientProperties.get(HTTP_PROXY_INCLUDE);
+ final Set<String> httpProxyIncludedAddresses = (Set<String>)httpClientProperties.get(HTTP_PROXY_INCLUDE);
@SuppressWarnings("unchecked")
- final Set<String> httpProxyExcludedAddresses = (Set<String>) httpClientProperties.get(HTTP_PROXY_EXCLUDE);
- final String httpProxyUsername = typeConverter.convertTo(String.class,
- httpClientProperties.get(HTTP_PROXY_USERNAME));
- final String httpProxyPassword = typeConverter.convertTo(String.class,
- httpClientProperties.get(HTTP_PROXY_PASSWORD));
- final String httpProxyAuthUri = typeConverter.convertTo(String.class,
- httpClientProperties.get(HTTP_PROXY_AUTH_URI));
+ final Set<String> httpProxyExcludedAddresses = (Set<String>)httpClientProperties.get(HTTP_PROXY_EXCLUDE);
+ final String httpProxyUsername = typeConverter.convertTo(String.class, httpClientProperties.get(HTTP_PROXY_USERNAME));
+ final String httpProxyPassword = typeConverter.convertTo(String.class, httpClientProperties.get(HTTP_PROXY_PASSWORD));
+ final String httpProxyAuthUri = typeConverter.convertTo(String.class, httpClientProperties.get(HTTP_PROXY_AUTH_URI));
final String httpProxyRealm = typeConverter.convertTo(String.class, httpClientProperties.get(HTTP_PROXY_REALM));
- final boolean httpProxyUseDigestAuth = typeConverter.convertTo(boolean.class,
- httpClientProperties.get(HTTP_PROXY_USE_DIGEST_AUTH));
+ final boolean httpProxyUseDigestAuth = typeConverter.convertTo(boolean.class, httpClientProperties.get(HTTP_PROXY_USE_DIGEST_AUTH));
// set HTTP timeout settings
if (httpIdleTimeout != null) {
@@ -803,11 +775,9 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
final Authentication authentication;
if (httpProxyUseDigestAuth) {
- authentication = new DigestAuthentication(new URI(httpProxyAuthUri), httpProxyRealm, httpProxyUsername,
- httpProxyPassword);
+ authentication = new DigestAuthentication(new URI(httpProxyAuthUri), httpProxyRealm, httpProxyUsername, httpProxyPassword);
} else {
- authentication = new BasicAuthentication(new URI(httpProxyAuthUri), httpProxyRealm, httpProxyUsername,
- httpProxyPassword);
+ authentication = new BasicAuthentication(new URI(httpProxyAuthUri), httpProxyRealm, httpProxyUsername, httpProxyPassword);
}
httpClient.getAuthenticationStore().addAuthentication(authentication);
}
@@ -829,7 +799,8 @@ public class SalesforceComponent extends DefaultComponent implements SSLContextP
putValueIfGivenTo(httpClientProperties, HTTP_PROXY_AUTH_URI, salesforce::getHttpProxyAuthUri);
if (ObjectHelper.isNotEmpty(salesforce.getHttpProxyHost())) {
- // let's not put `false` values in client properties if no proxy is used
+ // let's not put `false` values in client properties if no proxy is
+ // used
putValueIfGivenTo(httpClientProperties, HTTP_PROXY_IS_SOCKS4, salesforce::isHttpProxySocks4);
putValueIfGivenTo(httpClientProperties, HTTP_PROXY_IS_SECURE, salesforce::isHttpProxySecure);
putValueIfGivenTo(httpClientProperties, HTTP_PROXY_USE_DIGEST_AUTH, salesforce::isHttpProxyUseDigestAuth);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java
index cce1658..85a1b32 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponentVerifierExtension.java
@@ -52,13 +52,11 @@ public class SalesforceComponentVerifierExtension extends DefaultComponentVerifi
// - OAuth JWT Flow
//
ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS)
- .errors(ResultErrorHelper.requiresAny(parameters,
- OptionsGroup.withName(AuthenticationType.USERNAME_PASSWORD)
- .options("clientId", "clientSecret", "userName", "password", "!refreshToken", "!keystore"),
- OptionsGroup.withName(AuthenticationType.REFRESH_TOKEN)
- .options("clientId", "clientSecret", "refreshToken", "!password", "!keystore"),
- OptionsGroup.withName(AuthenticationType.JWT)
- .options("clientId", "userName", "keystore", "!password", "!refreshToken")));
+ .errors(ResultErrorHelper
+ .requiresAny(parameters,
+ OptionsGroup.withName(AuthenticationType.USERNAME_PASSWORD).options("clientId", "clientSecret", "userName", "password", "!refreshToken", "!keystore"),
+ OptionsGroup.withName(AuthenticationType.REFRESH_TOKEN).options("clientId", "clientSecret", "refreshToken", "!password", "!keystore"),
+ OptionsGroup.withName(AuthenticationType.JWT).options("clientId", "userName", "keystore", "!password", "!refreshToken")));
// Validate using the catalog
super.verifyParametersAgainstCatalog(builder, parameters);
@@ -99,20 +97,11 @@ public class SalesforceComponentVerifierExtension extends DefaultComponentVerifi
private static void processSalesforceException(ResultBuilder builder, Optional<SalesforceException> exception) {
exception.ifPresent(e -> {
- builder.error(
- ResultErrorBuilder.withException(e)
- .detail(VerificationError.HttpAttribute.HTTP_CODE, e.getStatusCode())
- .build()
- );
+ builder.error(ResultErrorBuilder.withException(e).detail(VerificationError.HttpAttribute.HTTP_CODE, e.getStatusCode()).build());
for (RestError error : e.getErrors()) {
- builder.error(
- ResultErrorBuilder.withCode(VerificationError.StandardCode.GENERIC)
- .description(error.getMessage())
- .parameterKeys(error.getFields())
- .detail("salesforce_code", error.getErrorCode())
- .build()
- );
+ builder.error(ResultErrorBuilder.withCode(VerificationError.StandardCode.GENERIC).description(error.getMessage()).parameterKeys(error.getFields())
+ .detail("salesforce_code", error.getErrorCode()).build());
}
});
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
index 3dac00f..be8656a 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java
@@ -157,8 +157,7 @@ public class SalesforceConsumer extends DefaultConsumer {
public void done(boolean doneSync) {
// noop
if (log.isTraceEnabled()) {
- log.trace("Done processing event: {} {}", channel.getId(),
- doneSync ? "synchronously" : "asynchronously");
+ log.trace("Done processing event: {} {}", channel.getId(), doneSync ? "synchronously" : "asynchronously");
}
}
});
@@ -216,7 +215,7 @@ public class SalesforceConsumer extends DefaultConsumer {
final Map<String, Object> data = message.getDataAsMap();
@SuppressWarnings("unchecked")
- final Map<String, Object> event = (Map<String, Object>) data.get(EVENT_PROPERTY);
+ final Map<String, Object> event = (Map<String, Object>)data.get(EVENT_PROPERTY);
final Object replayId = event.get(REPLAY_ID_PROPERTY);
if (replayId != null) {
@@ -245,7 +244,7 @@ public class SalesforceConsumer extends DefaultConsumer {
final Map<String, Object> data = message.getDataAsMap();
@SuppressWarnings("unchecked")
- final Map<String, Object> event = (Map<String, Object>) data.get(EVENT_PROPERTY);
+ final Map<String, Object> event = (Map<String, Object>)data.get(EVENT_PROPERTY);
final Object eventType = event.get(TYPE_PROPERTY);
final Object createdDate = event.get(CREATED_DATE_PROPERTY);
final Object replayId = event.get(REPLAY_ID_PROPERTY);
@@ -259,7 +258,7 @@ public class SalesforceConsumer extends DefaultConsumer {
// get SObject
@SuppressWarnings("unchecked")
- final Map<String, Object> sObject = (Map<String, Object>) data.get(SOBJECT_PROPERTY);
+ final Map<String, Object> sObject = (Map<String, Object>)data.get(SOBJECT_PROPERTY);
try {
final String sObjectString = objectMapper.writeValueAsString(sObject);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java
index d207a16..95e1a61 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpoint.java
@@ -29,18 +29,19 @@ import org.apache.camel.support.SynchronousDelegateProducer;
import org.eclipse.jetty.client.HttpClient;
/**
- * The salesforce component is used for integrating Camel with the massive Salesforce API.
+ * The salesforce component is used for integrating Camel with the massive
+ * Salesforce API.
*/
@UriEndpoint(firstVersion = "2.12.0", scheme = "salesforce", title = "Salesforce", syntax = "salesforce:operationName:topicName", label = "api,cloud,crm")
public class SalesforceEndpoint extends DefaultEndpoint {
@UriPath(label = "producer", description = "The operation to use", enums = "getVersions,getResources,"
- + "getGlobalObjects,getBasicInfo,getDescription,getSObject,createSObject,updateSObject,deleteSObject,"
- + "getSObjectWithId,upsertSObject,deleteSObjectWithId,getBlobField,query,queryMore,queryAll,search,apexCall,"
- + "recent,createJob,getJob,closeJob,abortJob,createBatch,getBatch,getAllBatches,getRequest,getResults,"
- + "createBatchQuery,getQueryResultIds,getQueryResult,getRecentReports,getReportDescription,executeSyncReport,"
- + "executeAsyncReport,getReportInstances,getReportResults,limits,approval,approvals,composite-tree,"
- + "composite-batch,composite")
+ + "getGlobalObjects,getBasicInfo,getDescription,getSObject,createSObject,updateSObject,deleteSObject,"
+ + "getSObjectWithId,upsertSObject,deleteSObjectWithId,getBlobField,query,queryMore,queryAll,search,apexCall,"
+ + "recent,createJob,getJob,closeJob,abortJob,createBatch,getBatch,getAllBatches,getRequest,getResults,"
+ + "createBatchQuery,getQueryResultIds,getQueryResult,getRecentReports,getReportDescription,executeSyncReport,"
+ + "executeAsyncReport,getReportInstances,getReportResults,limits,approval,approvals,composite-tree,"
+ + "composite-batch,composite")
private final OperationName operationName;
@UriPath(label = "consumer", description = "The name of the topic/channel to use")
private final String topicName;
@@ -50,8 +51,7 @@ public class SalesforceEndpoint extends DefaultEndpoint {
@UriParam(label = "consumer", description = "The replayId value to use when subscribing")
private Long replayId;
- public SalesforceEndpoint(String uri, SalesforceComponent salesforceComponent,
- SalesforceEndpointConfig config, OperationName operationName, String topicName) {
+ public SalesforceEndpoint(String uri, SalesforceComponent salesforceComponent, SalesforceEndpointConfig config, OperationName operationName, String topicName) {
super(uri, salesforceComponent);
this.config = config;
@@ -61,7 +61,8 @@ public class SalesforceEndpoint extends DefaultEndpoint {
@Override
public Producer createProducer() throws Exception {
- // producer requires an operation, topicName must be the invalid operation name
+ // producer requires an operation, topicName must be the invalid
+ // operation name
if (operationName == null) {
throw new IllegalArgumentException(String.format("Invalid Operation %s", topicName));
}
@@ -76,10 +77,10 @@ public class SalesforceEndpoint extends DefaultEndpoint {
@Override
public Consumer createConsumer(Processor processor) throws Exception {
- // consumer requires a topicName, operation name must be the invalid topic name
+ // consumer requires a topicName, operation name must be the invalid
+ // topic name
if (topicName == null) {
- throw new IllegalArgumentException(String.format("Invalid topic name %s, matches a producer operation name",
- operationName.value()));
+ throw new IllegalArgumentException(String.format("Invalid topic name %s, matches a producer operation name", operationName.value()));
}
final SubscriptionHelper subscriptionHelper = getComponent().getSubscriptionHelper();
@@ -90,7 +91,7 @@ public class SalesforceEndpoint extends DefaultEndpoint {
@Override
public SalesforceComponent getComponent() {
- return (SalesforceComponent) super.getComponent();
+ return (SalesforceComponent)super.getComponent();
}
@Override
@@ -125,7 +126,8 @@ public class SalesforceEndpoint extends DefaultEndpoint {
try {
super.doStart();
} finally {
- // check if this endpoint has its own http client that needs to be started
+ // check if this endpoint has its own http client that needs to be
+ // started
final HttpClient httpClient = getConfiguration().getHttpClient();
if (httpClient != null && getComponent().getConfig().getHttpClient() != httpClient) {
final String endpointUri = getEndpointUri();
@@ -141,7 +143,8 @@ public class SalesforceEndpoint extends DefaultEndpoint {
try {
super.doStop();
} finally {
- // check if this endpoint has its own http client that needs to be stopped
+ // check if this endpoint has its own http client that needs to be
+ // stopped
final HttpClient httpClient = getConfiguration().getHttpClient();
if (httpClient != null && getComponent().getConfig().getHttpClient() != httpClient) {
final String endpointUri = getEndpointUri();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
index 996d701..74b310e 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java
@@ -86,7 +86,8 @@ public class SalesforceEndpointConfig implements Cloneable {
// parameters for Approval API
public static final String APPROVAL = "approval";
- // default maximum authentication retries on failed authentication or expired session
+ // default maximum authentication retries on failed authentication or
+ // expired session
public static final int DEFAULT_MAX_AUTHENTICATION_RETRIES = 4;
// default increment and limit for Streaming connection restart attempts
@@ -202,8 +203,9 @@ public class SalesforceEndpointConfig implements Cloneable {
public SalesforceEndpointConfig copy() {
try {
- final SalesforceEndpointConfig copy = (SalesforceEndpointConfig) super.clone();
- // nothing to deep copy, getApexQueryParams() is readonly, so no need to deep copy
+ final SalesforceEndpointConfig copy = (SalesforceEndpointConfig)super.clone();
+ // nothing to deep copy, getApexQueryParams() is readonly, so no
+ // need to deep copy
return copy;
} catch (CloneNotSupportedException ex) {
throw new RuntimeCamelException(ex);
@@ -215,7 +217,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Payload format to use for Salesforce API calls, either JSON or XML, defaults to JSON
+ * Payload format to use for Salesforce API calls, either JSON or XML,
+ * defaults to JSON
*/
public void setFormat(PayloadFormat format) {
this.format = format;
@@ -226,8 +229,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Use raw payload {@link String} for request and response (either JSON or XML depending on {@code format}),
- * instead of DTOs, false by default
+ * Use raw payload {@link String} for request and response (either JSON or
+ * XML depending on {@code format}), instead of DTOs, false by default
*/
public void setRawPayload(boolean rawPayload) {
this.rawPayload = rawPayload;
@@ -238,7 +241,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Salesforce API version, defaults to SalesforceEndpointConfig.DEFAULT_VERSION
+ * Salesforce API version, defaults to
+ * SalesforceEndpointConfig.DEFAULT_VERSION
*/
public void setApiVersion(String apiVersion) {
this.apiVersion = apiVersion;
@@ -315,7 +319,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Fully qualified SObject class name, usually generated using camel-salesforce-maven-plugin
+ * Fully qualified SObject class name, usually generated using
+ * camel-salesforce-maven-plugin
*/
public void setSObjectClass(String sObjectClass) {
this.sObjectClass = sObjectClass;
@@ -344,8 +349,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Should the NULL values of given DTO be serialized with
- * empty (NULL) values. This affects only JSON data format.
+ * Should the NULL values of given DTO be serialized with empty (NULL)
+ * values. This affects only JSON data format.
*/
public void setSerializeNulls(boolean serializeNulls) {
this.serializeNulls = serializeNulls;
@@ -452,7 +457,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Whether to update an existing Push Topic when using the Streaming API, defaults to false
+ * Whether to update an existing Push Topic when using the Streaming API,
+ * defaults to false
*/
public void setUpdateTopic(boolean updateTopic) {
this.updateTopic = updateTopic;
@@ -474,7 +480,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Notify for operations, options are ALL, CREATE, EXTENDED, UPDATE (API version < 29.0)
+ * Notify for operations, options are ALL, CREATE, EXTENDED, UPDATE (API
+ * version < 29.0)
*/
public void setNotifyForOperations(NotifyForOperationsEnum notifyForOperations) {
this.notifyForOperations = notifyForOperations;
@@ -588,7 +595,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Backoff interval increment for Streaming connection restart attempts for failures beyond CometD auto-reconnect.
+ * Backoff interval increment for Streaming connection restart attempts for
+ * failures beyond CometD auto-reconnect.
*/
public void setBackoffIncrement(long backoffIncrement) {
this.backoffIncrement = backoffIncrement;
@@ -599,14 +607,16 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Maximum backoff interval for Streaming connection restart attempts for failures beyond CometD auto-reconnect.
+ * Maximum backoff interval for Streaming connection restart attempts for
+ * failures beyond CometD auto-reconnect.
*/
public void setMaxBackoff(long maxBackoff) {
this.maxBackoff = maxBackoff;
}
/**
- * Custom Jackson ObjectMapper to use when serializing/deserializing Salesforce objects.
+ * Custom Jackson ObjectMapper to use when serializing/deserializing
+ * Salesforce objects.
*/
public void setObjectMapper(ObjectMapper objectMapper) {
this.objectMapper = objectMapper;
@@ -662,7 +672,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Default replayId setting if no value is found in {@link #initialReplayIdMap}
+ * Default replayId setting if no value is found in
+ * {@link #initialReplayIdMap}
*
* @param defaultReplayId
*/
@@ -686,7 +697,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Limit on number of returned records. Applicable to some of the API, check the Salesforce documentation.
+ * Limit on number of returned records. Applicable to some of the API, check
+ * the Salesforce documentation.
*
* @param limit
*/
@@ -777,7 +789,7 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * The ID of the submitter who’s requesting the approval record.
+ * The ID of the submitter who’s requesting the approval record.
*
* @param contextActorId
*/
@@ -803,7 +815,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * If the process requires specification of the next approval, the ID of the user to be assigned the next request.
+ * If the process requires specification of the next approval, the ID of the
+ * user to be assigned the next request.
*
* @param nextApproverIds
*/
@@ -816,7 +829,8 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * If the process requires specification of the next approval, the ID of the user to be assigned the next request.
+ * If the process requires specification of the next approval, the ID of the
+ * user to be assigned the next request.
*
* @param nextApproverIds
*/
@@ -842,10 +856,11 @@ public class SalesforceEndpointConfig implements Cloneable {
}
/**
- * Determines whether to evaluate the entry criteria for the process (true) or not (false) if the process definition
- * name or ID isn’t null. If the process definition name or ID isn’t specified, this argument is ignored, and
- * standard evaluation is followed based on process order. By default, the entry criteria isn’t skipped if it’s not
- * set by this request.
+ * Determines whether to evaluate the entry criteria for the process (true)
+ * or not (false) if the process definition name or ID isn’t null. If the
+ * process definition name or ID isn’t specified, this argument is ignored,
+ * and standard evaluation is followed based on process order. By default,
+ * the entry criteria isn’t skipped if it’s not set by this request.
*
* @param skipEntryCriteria
*/
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
index 5a5a19d9..f7c8caa 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceHttpClient.java
@@ -36,7 +36,8 @@ import org.eclipse.jetty.client.http.HttpClientTransportOverHTTP;
import org.eclipse.jetty.util.ssl.SslContextFactory;
/**
- * Custom Salesforce HTTP Client that creates {@link SalesforceHttpRequest} requests.
+ * Custom Salesforce HTTP Client that creates {@link SalesforceHttpRequest}
+ * requests.
*/
public class SalesforceHttpClient extends HttpClient {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceLoginConfig.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceLoginConfig.java
index d7657ff..3ecfbc4 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceLoginConfig.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceLoginConfig.java
@@ -35,7 +35,8 @@ public class SalesforceLoginConfig {
private String userName;
private String password;
// allow lazy login into Salesforce
- // note that login issues may not surface until a message needs to be processed
+ // note that login issues may not surface until a message needs to be
+ // processed
private boolean lazyLogin;
private KeyStoreParameters keystore;
@@ -45,8 +46,8 @@ public class SalesforceLoginConfig {
lazyLogin = false;
}
- private SalesforceLoginConfig(AuthenticationType type, String loginUrl, String clientId, String clientSecret, String refreshToken,
- String userName, String password, boolean lazyLogin, KeyStoreParameters keystore) {
+ private SalesforceLoginConfig(AuthenticationType type, String loginUrl, String clientId, String clientSecret, String refreshToken, String userName, String password,
+ boolean lazyLogin, KeyStoreParameters keystore) {
this.type = type;
this.loginUrl = loginUrl;
this.clientId = clientId;
@@ -58,13 +59,11 @@ public class SalesforceLoginConfig {
this.keystore = keystore;
}
- public SalesforceLoginConfig(String loginUrl, String clientId, String clientSecret, String userName,
- String password, boolean lazyLogin) {
+ public SalesforceLoginConfig(String loginUrl, String clientId, String clientSecret, String userName, String password, boolean lazyLogin) {
this(AuthenticationType.USERNAME_PASSWORD, loginUrl, clientId, clientSecret, null, userName, password, lazyLogin, null);
}
- public SalesforceLoginConfig(String loginUrl, String clientId, String clientSecret, String refreshToken,
- boolean lazyLogin) {
+ public SalesforceLoginConfig(String loginUrl, String clientId, String clientSecret, String refreshToken, boolean lazyLogin) {
this(AuthenticationType.REFRESH_TOKEN, loginUrl, clientId, clientSecret, refreshToken, null, null, lazyLogin, null);
}
@@ -114,8 +113,8 @@ public class SalesforceLoginConfig {
}
/**
- * Keystore parameters for keystore containing certificate and private key needed for OAuth 2.0 JWT Bearer Token
- * Flow.
+ * Keystore parameters for keystore containing certificate and private key
+ * needed for OAuth 2.0 JWT Bearer Token Flow.
*/
public void setKeystore(final KeyStoreParameters keystore) {
this.keystore = keystore;
@@ -160,16 +159,14 @@ public class SalesforceLoginConfig {
if (hasPassword && hasRefreshToken || hasPassword && hasKeystore || hasRefreshToken && hasKeystore) {
throw new IllegalArgumentException("The provided authentication configuration can be used in multiple ways"
- + " for instance both with username/password and refresh_token. Either remove some of the configuration"
- + " options, so that authentication method can be auto-determined or explicitly set the authentication"
- + " type.");
+ + " for instance both with username/password and refresh_token. Either remove some of the configuration"
+ + " options, so that authentication method can be auto-determined or explicitly set the authentication" + " type.");
}
- throw new IllegalArgumentException(
- "You must specify parameters aligned with one of the supported authentication methods:"
- + " for username and password authentication: userName, password, clientSecret;"
- + " for refresh token authentication: refreshToken, clientSecret;"
- + " for JWT: userName, keystore. And for every one of those loginUrl and clientId must be specified also.");
+ throw new IllegalArgumentException("You must specify parameters aligned with one of the supported authentication methods:"
+ + " for username and password authentication: userName, password, clientSecret;"
+ + " for refresh token authentication: refreshToken, clientSecret;"
+ + " for JWT: userName, keystore. And for every one of those loginUrl and clientId must be specified also.");
}
public void setType(AuthenticationType type) {
@@ -203,8 +200,8 @@ public class SalesforceLoginConfig {
}
/**
- * Flag to enable/disable lazy OAuth, default is false. When enabled, OAuth token retrieval or generation is not
- * done until the first API call
+ * Flag to enable/disable lazy OAuth, default is false. When enabled, OAuth
+ * token retrieval or generation is not done until the first API call
*/
public void setLazyLogin(boolean lazyLogin) {
this.lazyLogin = lazyLogin;
@@ -214,7 +211,7 @@ public class SalesforceLoginConfig {
ObjectHelper.notNull(loginUrl, "loginUrl");
ObjectHelper.notNull(clientId, "clientId");
- final AuthenticationType type = getType();
+ final AuthenticationType type = getType();
switch (type) {
case USERNAME_PASSWORD:
@@ -237,9 +234,8 @@ public class SalesforceLoginConfig {
@Override
public String toString() {
- return "SalesforceLoginConfig[" + "instanceUrl= '" + instanceUrl + "', loginUrl='" + loginUrl + '\'' + ","
- + "clientId='" + clientId + '\'' + ", clientSecret='********'" + ", refreshToken='" + refreshToken + '\''
- + ", userName='" + userName + '\'' + ", password=********'" + password + '\'' + ", keystore=********'"
- + keystore + '\'' + ", lazyLogin=" + lazyLogin + ']';
+ return "SalesforceLoginConfig[" + "instanceUrl= '" + instanceUrl + "', loginUrl='" + loginUrl + '\'' + "," + "clientId='" + clientId + '\'' + ", clientSecret='********'"
+ + ", refreshToken='" + refreshToken + '\'' + ", userName='" + userName + '\'' + ", password=********'" + password + '\'' + ", keystore=********'" + keystore + '\''
+ + ", lazyLogin=" + lazyLogin + ']';
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceMetaDataExtension.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceMetaDataExtension.java
index 797ea11..13334ea 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceMetaDataExtension.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceMetaDataExtension.java
@@ -78,7 +78,7 @@ public class SalesforceMetaDataExtension extends AbstractMetaDataExtension {
JsonSchema singleObjectSchema(final Map<String, Object> parameters) throws Exception {
return SalesforceClientTemplate.invoke(getCamelContext(), parameters,
- client -> fetchSingleObjectSchema(client, (String) parameters.get(SalesforceEndpointConfig.SOBJECT_NAME)));
+ client -> fetchSingleObjectSchema(client, (String)parameters.get(SalesforceEndpointConfig.SOBJECT_NAME)));
}
static JsonSchema fetch(final Consumer<ResponseCallback> restMethod, final SchemaMapper callback) {
@@ -108,8 +108,7 @@ public class SalesforceMetaDataExtension extends AbstractMetaDataExtension {
}
static JsonSchema fetchSingleObjectSchema(final RestClient client, final String objectName) {
- return fetch(callback -> client.getDescription(objectName, Collections.emptyMap(), callback),
- SalesforceMetaDataExtension::mapSingleObjectSchema);
+ return fetch(callback -> client.getDescription(objectName, Collections.emptyMap(), callback), SalesforceMetaDataExtension::mapSingleObjectSchema);
}
static JsonSchema mapAllObjectsSchema(final InputStream stream) throws IOException {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceProducer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceProducer.java
index a767b8c..a821b91 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceProducer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceProducer.java
@@ -96,7 +96,7 @@ public class SalesforceProducer extends DefaultAsyncProducer {
}
}
- private static boolean isCompositeOperation(OperationName operationName) {
+ private static boolean isCompositeOperation(OperationName operationName) {
switch (operationName) {
case COMPOSITE_TREE:
case COMPOSITE_BATCH:
@@ -109,8 +109,7 @@ public class SalesforceProducer extends DefaultAsyncProducer {
@Override
public boolean process(Exchange exchange, AsyncCallback callback) {
- log.debug("Processing {}",
- ((SalesforceEndpoint) getEndpoint()).getOperationName());
+ log.debug("Processing {}", ((SalesforceEndpoint)getEndpoint()).getOperationName());
return processor.process(exchange, callback);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistConverter.java
index 26333e0..4899be9 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistConverter.java
@@ -46,16 +46,14 @@ public class MultiSelectPicklistConverter implements Converter {
// construct a string of form value1;value2;...
final StringBuilder buffer = new StringBuilder();
for (int i = 0; i < length; i++) {
- buffer.append((String) getterMethod.invoke(Array.get(o, i)));
+ buffer.append((String)getterMethod.invoke(Array.get(o, i)));
if (i < (length - 1)) {
buffer.append(';');
}
}
writer.setValue(buffer.toString());
} catch (Exception e) {
- throw new ConversionException(
- String.format("Exception writing pick list value %s of type %s: %s",
- o, o.getClass().getName(), e.getMessage()), e);
+ throw new ConversionException(String.format("Exception writing pick list value %s of type %s: %s", o, o.getClass().getName(), e.getMessage()), e);
}
}
@@ -79,9 +77,7 @@ public class MultiSelectPicklistConverter implements Converter {
}
return resultArray;
} catch (Exception e) {
- throw new ConversionException(
- String.format("Exception reading pick list value %s of type %s: %s",
- listValue, requiredArrayType.getName(), e.getMessage()), e);
+ throw new ConversionException(String.format("Exception reading pick list value %s of type %s: %s", listValue, requiredArrayType.getName(), e.getMessage()), e);
}
}
@@ -89,10 +85,10 @@ public class MultiSelectPicklistConverter implements Converter {
@SuppressWarnings("unchecked")
public boolean canConvert(Class aClass) {
try {
- // check whether the Class is an array, and whether the array elment is a Picklist enum class
+ // check whether the Class is an array, and whether the array elment
+ // is a Picklist enum class
final Class componentType = aClass.getComponentType();
- return componentType != null && Enum.class.isAssignableFrom(componentType)
- && componentType.getMethod(FACTORY_METHOD, String.class) != null;
+ return componentType != null && Enum.class.isAssignableFrom(componentType) && componentType.getMethod(FACTORY_METHOD, String.class) != null;
} catch (NoSuchMethodException e) {
return false;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistDeserializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistDeserializer.java
index 993afaa..4f52222 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistDeserializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistDeserializer.java
@@ -30,10 +30,10 @@ import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
/**
- * Jackson deserializer base class for reading ';' separated strings for MultiSelect pick-lists.
+ * Jackson deserializer base class for reading ';' separated strings for
+ * MultiSelect pick-lists.
*/
-public class MultiSelectPicklistDeserializer
- extends StdDeserializer<Object> implements ContextualDeserializer {
+public class MultiSelectPicklistDeserializer extends StdDeserializer<Object> implements ContextualDeserializer {
private static final long serialVersionUID = -4568286926393043366L;
@@ -92,6 +92,6 @@ public class MultiSelectPicklistDeserializer
if (componentType == null || !componentType.isEnum()) {
throw new JsonMappingException(context.getParser(), "Pick list Enum array expected for " + rawClass);
}
- return new MultiSelectPicklistDeserializer(context.getParser(), (Class<? extends Enum<?>>) componentType);
+ return new MultiSelectPicklistDeserializer(context.getParser(), (Class<? extends Enum<?>>)componentType);
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistSerializer.java
index b9d85d3..5aa9617 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistSerializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/MultiSelectPicklistSerializer.java
@@ -26,7 +26,8 @@ import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
/**
- * Jackson Serializer for generating ';' separated strings for MultiSelect pick-lists.
+ * Jackson Serializer for generating ';' separated strings for MultiSelect
+ * pick-lists.
*/
public class MultiSelectPicklistSerializer extends StdSerializer<Object> {
@@ -51,7 +52,7 @@ public class MultiSelectPicklistSerializer extends StdSerializer<Object> {
// construct a string of form value1;value2;...
final StringBuilder buffer = new StringBuilder();
for (int i = 0; i < length; i++) {
- buffer.append((String) getterMethod.invoke(Array.get(value, i)));
+ buffer.append((String)getterMethod.invoke(Array.get(value, i)));
if (i < (length - 1)) {
buffer.append(';');
}
@@ -60,9 +61,7 @@ public class MultiSelectPicklistSerializer extends StdSerializer<Object> {
jgen.writeString(buffer.toString());
} catch (Exception e) {
- throw new JsonGenerationException(
- String.format("Exception writing pick list value %s of type %s: %s",
- value, value.getClass().getName(), e.getMessage()), jgen);
+ throw new JsonGenerationException(String.format("Exception writing pick list value %s of type %s: %s", value, value.getClass().getName(), e.getMessage()), jgen);
}
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/PicklistEnumConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/PicklistEnumConverter.java
index 047b99a..dbc321f 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/PicklistEnumConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/PicklistEnumConverter.java
@@ -37,11 +37,9 @@ public class PicklistEnumConverter implements Converter {
Class<?> aClass = o.getClass();
try {
Method getterMethod = aClass.getMethod("value");
- writer.setValue((String) getterMethod.invoke(o));
+ writer.setValue((String)getterMethod.invoke(o));
} catch (Exception e) {
- throw new ConversionException(
- String.format("Exception writing pick list value %s of type %s: %s",
- o, o.getClass().getName(), e.getMessage()), e);
+ throw new ConversionException(String.format("Exception writing pick list value %s of type %s: %s", o, o.getClass().getName(), e.getMessage()), e);
}
}
@@ -54,9 +52,7 @@ public class PicklistEnumConverter implements Converter {
// use factory method to create object
return factoryMethod.invoke(null, value);
} catch (Exception e) {
- throw new ConversionException(
- String.format("Exception reading pick list value %s of type %s: %s",
- value, context.getRequiredType().getName(), e.getMessage()), e);
+ throw new ConversionException(String.format("Exception reading pick list value %s of type %s: %s", value, context.getRequiredType().getName(), e.getMessage()), e);
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/SalesforceReportResultsToListConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/SalesforceReportResultsToListConverter.java
index 6121f83..1d729d3 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/SalesforceReportResultsToListConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/SalesforceReportResultsToListConverter.java
@@ -38,7 +38,8 @@ import org.apache.camel.component.salesforce.api.dto.analytics.reports.ReportSta
import org.apache.camel.component.salesforce.api.dto.analytics.reports.SummaryValue;
/**
- * Salesforce report results to <code>List<List<String>></code>converter.
+ * Salesforce report results to
+ * <code>List<List<String>></code>converter.
*/
@Converter(loader = true)
public final class SalesforceReportResultsToListConverter {
@@ -55,12 +56,11 @@ public final class SalesforceReportResultsToListConverter {
}
@Converter
- public static List<List<String>> convertToList(final AbstractReportResultsBase reportResults,
- final Exchange exchange) {
+ public static List<List<String>> convertToList(final AbstractReportResultsBase reportResults, final Exchange exchange) {
List<List<String>> results = null;
if (reportResults instanceof AsyncReportResults) {
- AsyncReportResults asyncReportResults = (AsyncReportResults) reportResults;
+ AsyncReportResults asyncReportResults = (AsyncReportResults)reportResults;
final ReportStatusEnum status = asyncReportResults.getAttributes().getStatus();
// only successfully completed async report results have data rows
if (status != ReportStatusEnum.Success) {
@@ -156,14 +156,12 @@ public final class SalesforceReportResultsToListConverter {
final ReportExtendedMetadata reportExtendedMetadata = reportResults.getReportExtendedMetadata();
final String[] aggregates = reportMetadata.getAggregates();
- final boolean includeDetails = reportResults.getHasDetailRows()
- && getOption(exchange, INCLUDE_DETAILS, Boolean.TRUE);
+ final boolean includeDetails = reportResults.getHasDetailRows() && getOption(exchange, INCLUDE_DETAILS, Boolean.TRUE);
final boolean includeSummary = aggregates.length > 0 && getOption(exchange, INCLUDE_SUMMARY, Boolean.TRUE);
// column list, including grouping columns and details if required
final ArrayList<DetailColumnInfo> columnInfos = new ArrayList<>();
- final String[] columnNames = getResultColumns(columnInfos, reportMetadata, reportExtendedMetadata,
- includeDetails, includeSummary);
+ final String[] columnNames = getResultColumns(columnInfos, reportMetadata, reportExtendedMetadata, includeDetails, includeSummary);
// include detail headers?
if (getOption(exchange, INCLUDE_HEADERS, Boolean.TRUE)) {
@@ -172,8 +170,7 @@ public final class SalesforceReportResultsToListConverter {
// process down groups
for (GroupingValue groupingValue : reportResults.getGroupingsDown().getGroupings()) {
- addSummaryGroupValues(result, reportResults, columnNames, groupingValue,
- EMPTY_STRING_LIST, includeDetails, includeSummary);
+ addSummaryGroupValues(result, reportResults, columnNames, groupingValue, EMPTY_STRING_LIST, includeDetails, includeSummary);
}
// add grand total
@@ -181,8 +178,7 @@ public final class SalesforceReportResultsToListConverter {
final ReportFactWithDetails grandTotal = reportResults.getFactMap().get("T!T");
- addSummaryValues(result, includeDetails, columnNames, EMPTY_STRING_LIST,
- aggregates, grandTotal.getAggregates());
+ addSummaryValues(result, includeDetails, columnNames, EMPTY_STRING_LIST, aggregates, grandTotal.getAggregates());
}
return result;
@@ -195,14 +191,12 @@ public final class SalesforceReportResultsToListConverter {
final ReportExtendedMetadata reportExtendedMetadata = reportResults.getReportExtendedMetadata();
final String[] aggregates = reportMetadata.getAggregates();
- final boolean includeDetails = reportResults.getHasDetailRows()
- && getOption(exchange, INCLUDE_DETAILS, Boolean.TRUE);
+ final boolean includeDetails = reportResults.getHasDetailRows() && getOption(exchange, INCLUDE_DETAILS, Boolean.TRUE);
final boolean includeSummary = aggregates.length > 0 && getOption(exchange, INCLUDE_SUMMARY, Boolean.TRUE);
// column list, including grouping columns and details if required
final ArrayList<DetailColumnInfo> columnInfos = new ArrayList<>();
- final String[] columnNames = getResultColumns(columnInfos, reportMetadata, reportExtendedMetadata,
- includeDetails, includeSummary);
+ final String[] columnNames = getResultColumns(columnInfos, reportMetadata, reportExtendedMetadata, includeDetails, includeSummary);
// include detail headers?
if (getOption(exchange, INCLUDE_HEADERS, Boolean.TRUE)) {
@@ -212,8 +206,7 @@ public final class SalesforceReportResultsToListConverter {
// process down groups
final GroupingValue[] groupingsDown = reportResults.getGroupingsDown().getGroupings();
for (GroupingValue groupingValue : groupingsDown) {
- addMatrixGroupValues(result, reportResults, columnNames, groupingValue,
- EMPTY_STRING_LIST, includeDetails, includeSummary, EMPTY_VALUE, true);
+ addMatrixGroupValues(result, reportResults, columnNames, groupingValue, EMPTY_STRING_LIST, includeDetails, includeSummary, EMPTY_VALUE, true);
}
// add grand total
@@ -222,45 +215,35 @@ public final class SalesforceReportResultsToListConverter {
final Map<String, ReportFactWithDetails> factMap = reportResults.getFactMap();
// first add summary for across groups
- final List<String> downGroupsPrefix = new ArrayList<>(
- Collections.nCopies(groupingsDown.length, EMPTY_VALUE));
+ final List<String> downGroupsPrefix = new ArrayList<>(Collections.nCopies(groupingsDown.length, EMPTY_VALUE));
for (GroupingValue acrossGrouping : reportResults.getGroupingsAcross().getGroupings()) {
- addAcrossGroupSummaryValues(result, reportMetadata,
- includeDetails, columnNames, factMap, downGroupsPrefix, acrossGrouping);
+ addAcrossGroupSummaryValues(result, reportMetadata, includeDetails, columnNames, factMap, downGroupsPrefix, acrossGrouping);
}
final ReportFactWithDetails grandTotal = factMap.get("T!T");
- addSummaryValues(result, includeDetails, columnNames, EMPTY_STRING_LIST,
- reportResults.getReportMetadata().getAggregates(), grandTotal.getAggregates());
+ addSummaryValues(result, includeDetails, columnNames, EMPTY_STRING_LIST, reportResults.getReportMetadata().getAggregates(), grandTotal.getAggregates());
}
return result;
}
- private static void addAcrossGroupSummaryValues(ArrayList<List<String>> result, ReportMetadata reportMetadata,
- boolean includeDetails, String[] columnNames,
- Map<String, ReportFactWithDetails> factMap,
- List<String> downGroupsPrefix, GroupingValue acrossGrouping) {
+ private static void addAcrossGroupSummaryValues(ArrayList<List<String>> result, ReportMetadata reportMetadata, boolean includeDetails, String[] columnNames,
+ Map<String, ReportFactWithDetails> factMap, List<String> downGroupsPrefix, GroupingValue acrossGrouping) {
final List<String> newDownGroupsPrefix = new ArrayList<>(downGroupsPrefix);
newDownGroupsPrefix.add(acrossGrouping.getLabel());
- addSummaryValues(result, includeDetails, columnNames, newDownGroupsPrefix,
- reportMetadata.getAggregates(),
- factMap.get("T!" + acrossGrouping.getKey()).getAggregates());
+ addSummaryValues(result, includeDetails, columnNames, newDownGroupsPrefix, reportMetadata.getAggregates(), factMap.get("T!" + acrossGrouping.getKey()).getAggregates());
// process across subgroups
for (GroupingValue subGroup : acrossGrouping.getGroupings()) {
- addAcrossGroupSummaryValues(result, reportMetadata, includeDetails, columnNames, factMap,
- newDownGroupsPrefix, subGroup);
+ addAcrossGroupSummaryValues(result, reportMetadata, includeDetails, columnNames, factMap, newDownGroupsPrefix, subGroup);
}
}
- private static void addMatrixGroupValues(ArrayList<List<String>> result, AbstractReportResultsBase reportResults,
- String[] columnNames, GroupingValue groupingValue,
- List<String> rowPrefix, boolean includeDetails, boolean includeSummary,
- String keyPrefix, boolean downGroup) {
+ private static void addMatrixGroupValues(ArrayList<List<String>> result, AbstractReportResultsBase reportResults, String[] columnNames, GroupingValue groupingValue,
+ List<String> rowPrefix, boolean includeDetails, boolean includeSummary, String keyPrefix, boolean downGroup) {
final String groupKey = groupingValue.getKey();
final String newKeyPrefix = keyPrefix + groupKey;
@@ -274,24 +257,22 @@ public final class SalesforceReportResultsToListConverter {
if (groupings.length > 0) {
for (GroupingValue subGroup : groupings) {
- addMatrixGroupValues(result, reportResults, columnNames, subGroup, newPrefix,
- includeDetails, includeSummary, newKeyPrefix + "_", downGroup);
+ addMatrixGroupValues(result, reportResults, columnNames, subGroup, newPrefix, includeDetails, includeSummary, newKeyPrefix + "_", downGroup);
}
- // process across groupings?
+ // process across groupings?
} else if (downGroup) {
for (GroupingValue acrossGroup : reportResults.getGroupingsAcross().getGroupings()) {
- addMatrixGroupValues(result, reportResults, columnNames, acrossGroup, newPrefix,
- includeDetails, includeSummary, newKeyPrefix + "!", false);
+ addMatrixGroupValues(result, reportResults, columnNames, acrossGroup, newPrefix, includeDetails, includeSummary, newKeyPrefix + "!", false);
}
- // add lowest level across group detail rows?
+ // add lowest level across group detail rows?
} else if (includeDetails) {
addDetailRows(result, newPrefix, reportResults.getFactMap().get(newKeyPrefix));
- // add group columns only at lowest across level?
+ // add group columns only at lowest across level?
} else if (!includeSummary) {
result.add(newPrefix);
@@ -303,9 +284,8 @@ public final class SalesforceReportResultsToListConverter {
final String summaryKey = getGroupTotalKey(keyPrefix, downGroup, groupKey);
- addSummaryValues(result, includeDetails, columnNames, newPrefix,
- reportResults.getReportMetadata().getAggregates(),
- reportResults.getFactMap().get(summaryKey).getAggregates());
+ addSummaryValues(result, includeDetails, columnNames, newPrefix, reportResults.getReportMetadata().getAggregates(),
+ reportResults.getFactMap().get(summaryKey).getAggregates());
}
}
@@ -319,8 +299,7 @@ public final class SalesforceReportResultsToListConverter {
}
}
- private static void addSummaryGroupValues(ArrayList<List<String>> result, AbstractReportResultsBase reportResults,
- String[] columnNames, GroupingValue groupingValue,
+ private static void addSummaryGroupValues(ArrayList<List<String>> result, AbstractReportResultsBase reportResults, String[] columnNames, GroupingValue groupingValue,
List<String> rowPrefix, boolean includeDetails, boolean includeSummary) {
// get fact map at this level
@@ -334,11 +313,10 @@ public final class SalesforceReportResultsToListConverter {
if (groupings.length > 0) {
for (GroupingValue subGroup : groupings) {
- addSummaryGroupValues(result, reportResults, columnNames, subGroup, newPrefix,
- includeDetails, includeSummary);
+ addSummaryGroupValues(result, reportResults, columnNames, subGroup, newPrefix, includeDetails, includeSummary);
}
- // add lowest level group detail rows?
+ // add lowest level group detail rows?
} else if (includeDetails) {
addDetailRows(result, newPrefix, factWithDetails);
@@ -366,9 +344,8 @@ public final class SalesforceReportResultsToListConverter {
}
}
- private static void addSummaryValues(ArrayList<List<String>> result, boolean includeDetails,
- String[] columnNames, List<String> newPrefix,
- String[] aggregates, SummaryValue[] summaryValues) {
+ private static void addSummaryValues(ArrayList<List<String>> result, boolean includeDetails, String[] columnNames, List<String> newPrefix, String[] aggregates,
+ SummaryValue[] summaryValues) {
// no summary values to add
if (summaryValues.length == 0) {
return;
@@ -376,8 +353,7 @@ public final class SalesforceReportResultsToListConverter {
if (includeDetails) {
// add summary rows for this group
- addSummaryRows(result, columnNames, newPrefix,
- aggregates, summaryValues);
+ addSummaryRows(result, columnNames, newPrefix, aggregates, summaryValues);
} else {
// add summary values as columns for this group
final ArrayList<String> summaryRow = new ArrayList<>(newPrefix);
@@ -391,9 +367,7 @@ public final class SalesforceReportResultsToListConverter {
}
}
- private static void addSummaryRows(List<List<String>> result,
- String[] detailColumns, List<String> rowPrefix,
- String[] aggregateColumns, SummaryValue[] summaryValues) {
+ private static void addSummaryRows(List<List<String>> result, String[] detailColumns, List<String> rowPrefix, String[] aggregateColumns, SummaryValue[] summaryValues) {
final ArrayList<List<String>> rows = new ArrayList<>(summaryValues.length + 1);
String rowCount = null;
@@ -406,8 +380,7 @@ public final class SalesforceReportResultsToListConverter {
rowCount = valueLabel;
} else {
- final List<String> summaryRow = rowPrefix == null
- ? new ArrayList<>() : new ArrayList<>(rowPrefix);
+ final List<String> summaryRow = rowPrefix == null ? new ArrayList<>() : new ArrayList<>(rowPrefix);
rows.add(summaryRow);
// skip rowPrefix columns if not null
@@ -437,7 +410,7 @@ public final class SalesforceReportResultsToListConverter {
result.add(grandTotal);
if (rowCount != null) {
- grandTotal.add("Grand Totals (" + rowCount + " records)");
+ grandTotal.add("Grand Totals (" + rowCount + " records)");
} else {
grandTotal.add("Grand Totals");
}
@@ -446,9 +419,8 @@ public final class SalesforceReportResultsToListConverter {
result.addAll(rows);
}
- private static String[] getResultColumns(List<DetailColumnInfo> result, ReportMetadata reportMetadata,
- ReportExtendedMetadata reportExtendedMetadata,
- boolean includeDetails, boolean includeSummary) {
+ private static String[] getResultColumns(List<DetailColumnInfo> result, ReportMetadata reportMetadata, ReportExtendedMetadata reportExtendedMetadata, boolean includeDetails,
+ boolean includeSummary) {
final List<String> columnNames = new ArrayList<>();
@@ -469,8 +441,7 @@ public final class SalesforceReportResultsToListConverter {
if (!includeDetails) {
// include summary columns?
if (includeSummary) {
- final Map<String, AggregateColumnInfo> aggregateColumnInfos =
- reportExtendedMetadata.getAggregateColumnInfo();
+ final Map<String, AggregateColumnInfo> aggregateColumnInfos = reportExtendedMetadata.getAggregateColumnInfo();
for (String aggregateColumnName : reportMetadata.getAggregates()) {
columnNames.add(aggregateColumnName);
result.add(aggregateColumnInfos.get(aggregateColumnName));
@@ -488,8 +459,7 @@ public final class SalesforceReportResultsToListConverter {
return columnNames.toArray(new String[columnNames.size()]);
}
- private static void addColumnHeaders(List<String> headers,
- Map<String, ? extends DetailColumnInfo> columnInfos, String[] columns) {
+ private static void addColumnHeaders(List<String> headers, Map<String, ? extends DetailColumnInfo> columnInfos, String[] columns) {
for (String columnName : columns) {
headers.add(columnInfos.get(columnName).getLabel());
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistConverter.java
index 50ce6fb..5552140 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistConverter.java
@@ -38,16 +38,14 @@ public class StringMultiSelectPicklistConverter implements Converter {
// construct a string of form value1;value2;...
final StringBuilder buffer = new StringBuilder();
for (int i = 0; i < length; i++) {
- buffer.append((String) o);
+ buffer.append((String)o);
if (i < (length - 1)) {
buffer.append(';');
}
}
writer.setValue(buffer.toString());
} catch (Exception e) {
- throw new ConversionException(
- String.format("Exception writing pick list value %s of type %s: %s",
- o, o.getClass().getName(), e.getMessage()), e);
+ throw new ConversionException(String.format("Exception writing pick list value %s of type %s: %s", o, o.getClass().getName(), e.getMessage()), e);
}
}
@@ -68,15 +66,14 @@ public class StringMultiSelectPicklistConverter implements Converter {
}
return resultArray;
} catch (Exception e) {
- throw new ConversionException(
- String.format("Exception reading pick list value %s of type %s: %s",
- listValue, requiredArrayType.getName(), e.getMessage()), e);
+ throw new ConversionException(String.format("Exception reading pick list value %s of type %s: %s", listValue, requiredArrayType.getName(), e.getMessage()), e);
}
}
@Override
public boolean canConvert(Class aClass) {
- // check whether the Class is an array, and whether the array element is a String
+ // check whether the Class is an array, and whether the array element is
+ // a String
final Class<?> componentType = aClass.getComponentType();
return componentType != null && String.class == componentType;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistDeserializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistDeserializer.java
index 4da74a8..93d5f2a 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistDeserializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistDeserializer.java
@@ -29,10 +29,10 @@ import com.fasterxml.jackson.databind.deser.ContextualDeserializer;
import com.fasterxml.jackson.databind.deser.std.StdDeserializer;
/**
- * Jackson deserializer base class for reading ';' separated strings for MultiSelect pick-lists.
+ * Jackson deserializer base class for reading ';' separated strings for
+ * MultiSelect pick-lists.
*/
-public class StringMultiSelectPicklistDeserializer
- extends StdDeserializer<Object> implements ContextualDeserializer {
+public class StringMultiSelectPicklistDeserializer extends StdDeserializer<Object> implements ContextualDeserializer {
private static final long serialVersionUID = 7380774744798254325L;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistSerializer.java
index 8f84f9d..5f3d584 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistSerializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/StringMultiSelectPicklistSerializer.java
@@ -24,7 +24,8 @@ import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.ser.std.StdSerializer;
/**
- * Jackson Serializer for generating ';' separated strings for MultiSelect pick-lists.
+ * Jackson Serializer for generating ';' separated strings for MultiSelect
+ * pick-lists.
*/
public class StringMultiSelectPicklistSerializer extends StdSerializer<Object> {
@@ -38,7 +39,7 @@ public class StringMultiSelectPicklistSerializer extends StdSerializer<Object> {
public void serialize(Object value, JsonGenerator jgen, SerializerProvider provider) throws IOException {
try {
- String[] a = (String[]) value;
+ String[] a = (String[])value;
final int length = a.length;
// construct a string of form value1;value2;...
@@ -53,9 +54,7 @@ public class StringMultiSelectPicklistSerializer extends StdSerializer<Object> {
jgen.writeString(buffer.toString());
} catch (Exception e) {
- throw new JsonGenerationException(
- String.format("Exception writing pick list value %s of type %s: %s",
- value, value.getClass().getName(), e.getMessage()), jgen);
+ throw new JsonGenerationException(String.format("Exception writing pick list value %s of type %s: %s", value, value.getClass().getName(), e.getMessage()), jgen);
}
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/TypeReferences.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/TypeReferences.java
index 79a339c..e82ae6c 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/TypeReferences.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/TypeReferences.java
@@ -30,7 +30,8 @@ import org.apache.camel.component.salesforce.api.dto.analytics.reports.RecentRep
import org.apache.camel.component.salesforce.api.dto.analytics.reports.ReportInstance;
/**
- * Class that holds {@link TypeReference} instances needed for Jackson mapper to support generics.
+ * Class that holds {@link TypeReference} instances needed for Jackson mapper to
+ * support generics.
*/
public final class TypeReferences {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDescribedSObjectBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDescribedSObjectBase.java
index 259153b..9ea7d72 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDescribedSObjectBase.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDescribedSObjectBase.java
@@ -17,26 +17,27 @@
package org.apache.camel.component.salesforce.api.dto;
/**
- * Subclass of {@link AbstractSObjectBase} that contains additional metadata about SObject. The
- * {@code camel-salesforce-maven-plugin} generates Data Transfer Objects (DTO) by subclassing this class and
- * implementing the {@link AbstractDescribedSObjectBase#description()} method from the metadata received from
- * Salesforce. Note that there are no guarantees about all fields in the {@link SObjectDescription} being set. This is
- * to prevent unnecessary memory usage, and to prevent running into Java method length limit.
+ * Subclass of {@link AbstractSObjectBase} that contains additional metadata
+ * about SObject. The {@code camel-salesforce-maven-plugin} generates Data
+ * Transfer Objects (DTO) by subclassing this class and implementing the
+ * {@link AbstractDescribedSObjectBase#description()} method from the metadata
+ * received from Salesforce. Note that there are no guarantees about all fields
+ * in the {@link SObjectDescription} being set. This is to prevent unnecessary
+ * memory usage, and to prevent running into Java method length limit.
*/
public abstract class AbstractDescribedSObjectBase extends AbstractSObjectBase {
/**
- * Additional metadata about this SObject. There are no guarantees that all of the fields of
- * {@link SObjectDescription} will be set.
+ * Additional metadata about this SObject. There are no guarantees that all
+ * of the fields of {@link SObjectDescription} will be set.
*
* @return metadata description of this SObject
*/
public abstract SObjectDescription description();
@SuppressWarnings("boxing")
- protected static SObjectField createField(String name, String label, String type, String soapType, int length,
- boolean unique, boolean nillable, boolean nameField, boolean externalId, boolean custom, boolean caseSensitive,
- boolean idLookup) {
+ protected static SObjectField createField(String name, String label, String type, String soapType, int length, boolean unique, boolean nillable, boolean nameField,
+ boolean externalId, boolean custom, boolean caseSensitive, boolean idLookup) {
final SObjectField field = new SObjectField();
field.setName(name);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractQueryRecordsBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractQueryRecordsBase.java
index 509656d..9de0715 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractQueryRecordsBase.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractQueryRecordsBase.java
@@ -21,21 +21,23 @@ package org.apache.camel.component.salesforce.api.dto;
* <p>
* Derived classes must follow the template below:
* </p>
+ *
* <pre>
- * {@code
- * public class QueryResultMySObject extends AbstractQueryRecordsBase {
- * @XStreamImplicit
- * private List<MySObject> records;
+ * {
+ * @code
+ * public class QueryResultMySObject extends AbstractQueryRecordsBase {
+ * @XStreamImplicit
+ * private List<MySObject> records;
*
- * public List<MySObject> getRecords() {
- * return records;
- * }
+ * public List<MySObject> getRecords() {
+ * return records;
+ * }
*
- * public void setRecords(List<MySObject> records) {
- * this.records = records;
- * }
+ * public void setRecords(List<MySObject> records) {
+ * this.records = records;
+ * }
*
- * }
+ * }
* }
* </pre>
*/
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java
index dc032e6..09cecd7 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java
@@ -48,8 +48,13 @@ public abstract class AbstractSObjectBase extends AbstractDTOBase {
/**
* Utility method to clear all system {@link AbstractSObjectBase} fields.
- * <p>Useful when reusing a DTO for a new record, or for update/upsert.</p>
- * <p>This method does not clear {@code Name} to allow updating it, so it must be explicitly set to {@code null} if needed.</p>
+ * <p>
+ * Useful when reusing a DTO for a new record, or for update/upsert.
+ * </p>
+ * <p>
+ * This method does not clear {@code Name} to allow updating it, so it must
+ * be explicitly set to {@code null} if needed.
+ * </p>
*/
public final void clearBaseFields() {
attributes = null;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AnnotationFieldKeySorter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AnnotationFieldKeySorter.java
index d90de8d..a5054e4 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AnnotationFieldKeySorter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AnnotationFieldKeySorter.java
@@ -60,8 +60,7 @@ public final class AnnotationFieldKeySorter implements FieldKeySorter {
}
final String[] fieldOrder = fieldOrderAnnotation.value();
- final TreeMap<FieldKey, Field> sorted = new TreeMap<>(
- new AnnotationFieldOrderComparator(fieldOrder, type.getDeclaredFields()));
+ final TreeMap<FieldKey, Field> sorted = new TreeMap<>(new AnnotationFieldOrderComparator(fieldOrder, type.getDeclaredFields()));
sorted.putAll(keyedByFieldKey);
return sorted;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Attributes.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Attributes.java
index b4f7fff..08a289c 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Attributes.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Attributes.java
@@ -19,16 +19,16 @@ package org.apache.camel.component.salesforce.api.dto;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
public class Attributes extends AbstractDTOBase {
-
+
+ @XStreamAsAttribute
+ String referenceId;
+
@XStreamAsAttribute
private String type;
@XStreamAsAttribute
private String url;
- @XStreamAsAttribute
- String referenceId;
-
public String getType() {
return type;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Limits.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Limits.java
index b102505..0c2b24f 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Limits.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/Limits.java
@@ -41,7 +41,8 @@ import org.apache.camel.component.salesforce.api.dto.Limits.LimitsDeserializer;
/**
* Data given by the `Limits` resource on Salesforce.
*
- * @see <a href= "https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm">
+ * @see <a href=
+ * "https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm">
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_limits.htm</a>
*/
@JsonDeserialize(using = LimitsDeserializer.class)
@@ -50,8 +51,7 @@ public final class Limits implements Serializable {
public static final class LimitsDeserializer extends JsonDeserializer {
@Override
- public Object deserialize(final JsonParser parser, final DeserializationContext context)
- throws IOException, JsonProcessingException {
+ public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException, JsonProcessingException {
final Map<String, Usage> usages = parser.readValueAs(TypeReferences.USAGES_TYPE);
@@ -61,30 +61,13 @@ public final class Limits implements Serializable {
}
public enum Operation {
- ConcurrentAsyncGetReportInstances,
- ConcurrentSyncReportRuns,
- DailyApiRequests,
- DailyAsyncApexExecutions,
- DailyBulkApiRequests,
- DailyDurableGenericStreamingApiEvents,
- DailyDurableStreamingApiEvents,
- DailyGenericStreamingApiEvents,
- DailyStreamingApiEvents,
- DailyWorkflowEmails,
- DataStorageMB,
- DurableStreamingApiConcurrentClients,
- FileStorageMB,
- HourlyAsyncReportRuns,
- HourlyDashboardRefreshes,
- HourlyDashboardResults,
- HourlyDashboardStatuses,
- HourlyODataCallout,
- HourlySyncReportRuns,
- HourlyTimeBasedWorkflow,
- MassEmail,
- PermissionSets,
- SingleEmail,
- StreamingApiConcurrentClients
+ ConcurrentAsyncGetReportInstances, ConcurrentSyncReportRuns, DailyApiRequests,
+ DailyAsyncApexExecutions, DailyBulkApiRequests, DailyDurableGenericStreamingApiEvents,
+ DailyDurableStreamingApiEvents, DailyGenericStreamingApiEvents, DailyStreamingApiEvents,
+ DailyWorkflowEmails, DataStorageMB, DurableStreamingApiConcurrentClients, FileStorageMB,
+ HourlyAsyncReportRuns, HourlyDashboardRefreshes, HourlyDashboardResults, HourlyDashboardStatuses,
+ HourlyODataCallout, HourlySyncReportRuns, HourlyTimeBasedWorkflow, MassEmail, PermissionSets,
+ SingleEmail, StreamingApiConcurrentClients
}
/**
@@ -105,7 +88,9 @@ public final class Limits implements Serializable {
private final Map<String, Usage> perApplication = new HashMap<>();
@JsonCreator
- Usage(@JsonProperty("Max") final int max, @JsonProperty("Remaining") final int remaining) {
+ Usage(@JsonProperty("Max")
+ final int max, @JsonProperty("Remaining")
+ final int remaining) {
this.max = max;
this.remaining = remaining;
}
@@ -202,21 +187,24 @@ public final class Limits implements Serializable {
}
/**
- * Daily durable generic streaming events (if generic streaming is enabled for your organization)
+ * Daily durable generic streaming events (if generic streaming is enabled
+ * for your organization)
*/
public Usage getDailyDurableGenericStreamingApiEvents() {
return forOperation(Operation.DailyDurableGenericStreamingApiEvents.name());
}
/**
- * Daily durable streaming events (if generic streaming is enabled for your organization)
+ * Daily durable streaming events (if generic streaming is enabled for your
+ * organization)
*/
public Usage getDailyDurableStreamingApiEvents() {
return forOperation(Operation.DailyDurableStreamingApiEvents.name());
}
/**
- * Daily generic streaming events (if generic streaming is enabled for your organization)
+ * Daily generic streaming events (if generic streaming is enabled for your
+ * organization)
*/
public Usage getDailyGenericStreamingApiEvents() {
return forOperation(Operation.DailyGenericStreamingApiEvents.name());
@@ -283,7 +271,8 @@ public final class Limits implements Serializable {
}
/**
- * Daily number of mass emails that are sent to external email addresses by using Apex or Force.com APIs
+ * Daily number of mass emails that are sent to external email addresses by
+ * using Apex or Force.com APIs
*/
public Usage getMassEmail() {
return forOperation(Operation.MassEmail.name());
@@ -297,7 +286,8 @@ public final class Limits implements Serializable {
}
/**
- * Daily number of single emails that are sent to external email addresses by using Apex or Force.com APIs
+ * Daily number of single emails that are sent to external email addresses
+ * by using Apex or Force.com APIs
*/
public Usage getSingleEmail() {
return forOperation(Operation.SingleEmail.name());
@@ -311,7 +301,6 @@ public final class Limits implements Serializable {
/** {@inheritDoc} */
@Override
public String toString() {
- return "Limits: " + usages.entrySet().stream().map(e -> e.getKey() + ": " + e.getValue())
- .collect(Collectors.joining(", "));
+ return "Limits: " + usages.entrySet().stream().map(e -> e.getKey() + ": " + e.getValue()).collect(Collectors.joining(", "));
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/PlatformEvent.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/PlatformEvent.java
index 94bc40e..4f7a9c9 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/PlatformEvent.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/PlatformEvent.java
@@ -37,7 +37,9 @@ public final class PlatformEvent implements Serializable {
private final Map<String, String> eventData = new HashMap<>();
@JsonCreator
- public PlatformEvent(@JsonProperty("CreatedDate") final ZonedDateTime created, @JsonProperty("CreatedById") final String createdById) {
+ public PlatformEvent(@JsonProperty("CreatedDate")
+ final ZonedDateTime created, @JsonProperty("CreatedById")
+ final String createdById) {
this.created = created;
this.createdById = createdById;
}
@@ -48,7 +50,7 @@ public final class PlatformEvent implements Serializable {
return false;
}
- final PlatformEvent other = (PlatformEvent) obj;
+ final PlatformEvent other = (PlatformEvent)obj;
return Objects.equals(created, other.created) && Objects.equals(createdById, other.createdById) && Objects.equals(eventData, other.eventData);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/RestError.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/RestError.java
index 986cfad..50d17b5 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/RestError.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/RestError.java
@@ -22,6 +22,7 @@ import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonSetter;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamImplicit;
+
//CHECKSTYLE:OFF
public class RestError extends AbstractDTOBase {
@@ -84,7 +85,7 @@ public class RestError extends AbstractDTOBase {
return false;
}
- final RestError other = (RestError) obj;
+ final RestError other = (RestError)obj;
return Objects.equals(errorCode, other.errorCode) && Objects.equals(message, other.message) && Objects.equals(fields, other.fields);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObjectDescription.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObjectDescription.java
index d8e1fde..e34fb04 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObjectDescription.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/SObjectDescription.java
@@ -84,8 +84,8 @@ public class SObjectDescription extends SObject {
}
/**
- * Removes some of the less used properties from this object. Useful to reduce serialized form or for code
- * generation that relies on reflection.
+ * Removes some of the less used properties from this object. Useful to
+ * reduce serialized form or for code generation that relies on reflection.
*/
public SObjectDescription prune() {
final SObjectDescription pruned = new SObjectDescription();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/AsyncAttributes.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/AsyncAttributes.java
index f56d58f..497103c 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/AsyncAttributes.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/AsyncAttributes.java
@@ -16,7 +16,6 @@
*/
package org.apache.camel.component.salesforce.api.dto.analytics.reports;
-
import java.time.ZonedDateTime;
/**
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/SummaryValue.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/SummaryValue.java
index 19e5b1a..0733d3e 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/SummaryValue.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/analytics/reports/SummaryValue.java
@@ -45,6 +45,7 @@ public class SummaryValue extends AbstractDTOBase {
/**
* Helper method for JSON un-marshaling.
+ *
* @param name field name, MUST be "value"
* @param value field value
* @throws java.lang.IllegalArgumentException if field name is not "value"
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequest.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequest.java
index 594f798..943d772 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequest.java
@@ -58,8 +58,7 @@ public final class ApprovalRequest implements Serializable {
public final List<Field> fields;
private FieldHolder() {
- fields = Arrays.stream(ApprovalRequest.class.getDeclaredFields())
- .filter(f -> !Modifier.isFinal(f.getModifiers())).collect(Collectors.toList());
+ fields = Arrays.stream(ApprovalRequest.class.getDeclaredFields()).filter(f -> !Modifier.isFinal(f.getModifiers())).collect(Collectors.toList());
}
}
@@ -101,13 +100,14 @@ public final class ApprovalRequest implements Serializable {
}
/**
- * Creates new {@link ApprovalRequest} by combining values from the given template with the values currently
- * present. If the value is not present and the template has the corresponding value, then the template value is
- * set. The net result is that all set values of an {@link ApprovalRequest} are preserved, while the values set on
- * template are used for undefined ( <code>null</code>) values.
+ * Creates new {@link ApprovalRequest} by combining values from the given
+ * template with the values currently present. If the value is not present
+ * and the template has the corresponding value, then the template value is
+ * set. The net result is that all set values of an {@link ApprovalRequest}
+ * are preserved, while the values set on template are used for undefined (
+ * <code>null</code>) values.
*
- * @param template
- * template to apply
+ * @param template template to apply
* @return newly created object with applied template
*/
public ApprovalRequest applyTemplate(final ApprovalRequest template) {
@@ -150,13 +150,11 @@ public final class ApprovalRequest implements Serializable {
return false;
}
- final ApprovalRequest other = (ApprovalRequest) obj;
+ final ApprovalRequest other = (ApprovalRequest)obj;
- return Objects.equals(actionType, other.actionType) && Objects.equals(contextActorId, other.contextActorId)
- && Objects.equals(contextId, other.contextId) && Objects.equals(comments, other.comments)
- && Objects.equals(nextApproverIds, other.nextApproverIds)
- && Objects.equals(processDefinitionNameOrId, other.processDefinitionNameOrId)
- && Objects.equals(skipEntryCriteria, other.skipEntryCriteria);
+ return Objects.equals(actionType, other.actionType) && Objects.equals(contextActorId, other.contextActorId) && Objects.equals(contextId, other.contextId)
+ && Objects.equals(comments, other.comments) && Objects.equals(nextApproverIds, other.nextApproverIds)
+ && Objects.equals(processDefinitionNameOrId, other.processDefinitionNameOrId) && Objects.equals(skipEntryCriteria, other.skipEntryCriteria);
}
public Action getActionType() {
@@ -185,8 +183,7 @@ public final class ApprovalRequest implements Serializable {
@Override
public int hashCode() {
- return Arrays.hashCode(new Object[] {actionType, contextActorId, contextId, comments, nextApproverIds,
- processDefinitionNameOrId, skipEntryCriteria});
+ return Arrays.hashCode(new Object[] {actionType, contextActorId, contextId, comments, nextApproverIds, processDefinitionNameOrId, skipEntryCriteria});
}
public boolean isSkipEntryCriteria() {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequests.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequests.java
index fec486c..b1b2871 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequests.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalRequests.java
@@ -49,7 +49,7 @@ public final class ApprovalRequests implements Serializable {
return false;
}
- return ((ApprovalRequests) obj).requests.equals(requests);
+ return ((ApprovalRequests)obj).requests.equals(requests);
}
public List<ApprovalRequest> getRequests() {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalResult.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalResult.java
index c69b399..985395f 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalResult.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/ApprovalResult.java
@@ -47,8 +47,7 @@ public final class ApprovalResult implements Serializable, Iterable<Result> {
};
@Override
- public Object deserialize(final JsonParser parser, final DeserializationContext context)
- throws IOException, JsonProcessingException {
+ public Object deserialize(final JsonParser parser, final DeserializationContext context) throws IOException, JsonProcessingException {
final List<Result> results = parser.readValueAs(RESULTS_TYPE);
return new ApprovalResult(results);
@@ -79,12 +78,14 @@ public final class ApprovalResult implements Serializable, Iterable<Result> {
private final boolean success;
@JsonCreator
- Result(@JsonProperty("actorIds") final List<String> actorIds, @JsonProperty("entityId") final String entityId,
- @JsonProperty("errors") final List<RestError> errors,
- @JsonProperty("instanceId") final String instanceId,
- @JsonProperty("instanceStatus") final String instanceStatus,
- @JsonProperty("newWorkitemIds") final List<String> newWorkitemIds,
- @JsonProperty("success") final boolean success) {
+ Result(@JsonProperty("actorIds")
+ final List<String> actorIds, @JsonProperty("entityId")
+ final String entityId, @JsonProperty("errors")
+ final List<RestError> errors, @JsonProperty("instanceId")
+ final String instanceId, @JsonProperty("instanceStatus")
+ final String instanceStatus, @JsonProperty("newWorkitemIds")
+ final List<String> newWorkitemIds, @JsonProperty("success")
+ final boolean success) {
this.actorIds = actorIds;
this.entityId = entityId;
this.errors = errors;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/Approvals.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/Approvals.java
index 94e9a47..951bce4 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/Approvals.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/approval/Approvals.java
@@ -28,7 +28,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Holds approvals resource data.
*
- * @see <a href="https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals.htm">
+ * @see <a href=
+ * "https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals.htm">
* https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/dome_process_approvals.htm</a>
*/
public final class Approvals implements Serializable {
@@ -51,9 +52,12 @@ public final class Approvals implements Serializable {
private final int sortOrder;
@JsonCreator
- Info(@JsonProperty("id") final String id, @JsonProperty("description") final String description,
- @JsonProperty("name") final String name, @JsonProperty("object") final String object,
- @JsonProperty("sortOrder") final int sortOrder) {
+ Info(@JsonProperty("id")
+ final String id, @JsonProperty("description")
+ final String description, @JsonProperty("name")
+ final String name, @JsonProperty("object")
+ final String object, @JsonProperty("sortOrder")
+ final int sortOrder) {
this.description = description;
this.id = id;
this.name = name;
@@ -104,15 +108,15 @@ public final class Approvals implements Serializable {
private final Map<String, List<Info>> approvals;
@JsonCreator
- Approvals(@JsonProperty("approvals") final Map<String, List<Info>> approvals) {
+ Approvals(@JsonProperty("approvals")
+ final Map<String, List<Info>> approvals) {
this.approvals = Optional.ofNullable(approvals).orElse(Collections.emptyMap());
}
/**
* Returns approvals for specific Salesforce object type.
*
- * @param object
- * type
+ * @param object type
* @return approvals of specified type
*/
public List<Info> approvalsFor(final String object) {
@@ -120,8 +124,9 @@ public final class Approvals implements Serializable {
};
/**
- * Returns approvals by Salesforce object type. You might have approvals for "Account" and "Case" Salesforce
- * objects, then the resulting map would hold a list of {@link Info} objects keyed by the object type, i.e.:
+ * Returns approvals by Salesforce object type. You might have approvals for
+ * "Account" and "Case" Salesforce objects, then the resulting map would
+ * hold a list of {@link Info} objects keyed by the object type, i.e.:
*
* <pre>
* Approvals approvals = ...;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfo.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfo.java
index 1c5faba..6233d84 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfo.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfo.java
@@ -23,12 +23,15 @@ import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
-
/**
- * <p>Java class for BatchInfo complex type.
+ * <p>
+ * Java class for BatchInfo complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="BatchInfo">
* <complexContent>
@@ -52,19 +55,8 @@ import javax.xml.datatype.XMLGregorianCalendar;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "BatchInfo", propOrder = {
- "id",
- "jobId",
- "state",
- "stateMessage",
- "createdDate",
- "systemModstamp",
- "numberRecordsProcessed",
- "numberRecordsFailed",
- "totalProcessingTime",
- "apiActiveProcessingTime",
- "apexProcessingTime"
- })
+@XmlType(name = "BatchInfo", propOrder = {"id", "jobId", "state", "stateMessage", "createdDate", "systemModstamp", "numberRecordsProcessed", "numberRecordsFailed",
+ "totalProcessingTime", "apiActiveProcessingTime", "apexProcessingTime"})
public class BatchInfo {
@XmlElement(required = true)
@@ -88,8 +80,7 @@ public class BatchInfo {
/**
* Gets the value of the id property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getId() {
return id;
@@ -98,8 +89,7 @@ public class BatchInfo {
/**
* Sets the value of the id property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setId(String value) {
this.id = value;
@@ -108,8 +98,7 @@ public class BatchInfo {
/**
* Gets the value of the jobId property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getJobId() {
return jobId;
@@ -118,8 +107,7 @@ public class BatchInfo {
/**
* Sets the value of the jobId property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setJobId(String value) {
this.jobId = value;
@@ -128,8 +116,7 @@ public class BatchInfo {
/**
* Gets the value of the state property.
*
- * @return possible object is
- * {@link BatchStateEnum }
+ * @return possible object is {@link BatchStateEnum }
*/
public BatchStateEnum getState() {
return state;
@@ -138,8 +125,7 @@ public class BatchInfo {
/**
* Sets the value of the state property.
*
- * @param value allowed object is
- * {@link BatchStateEnum }
+ * @param value allowed object is {@link BatchStateEnum }
*/
public void setState(BatchStateEnum value) {
this.state = value;
@@ -148,8 +134,7 @@ public class BatchInfo {
/**
* Gets the value of the stateMessage property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getStateMessage() {
return stateMessage;
@@ -158,8 +143,7 @@ public class BatchInfo {
/**
* Sets the value of the stateMessage property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setStateMessage(String value) {
this.stateMessage = value;
@@ -179,7 +163,7 @@ public class BatchInfo {
* Sets the value of the createdDate property.
*
* @param value allowed object is
- * {@link javax.xml.datatype.XMLGregorianCalendar }
+ * {@link javax.xml.datatype.XMLGregorianCalendar }
*/
public void setCreatedDate(XMLGregorianCalendar value) {
this.createdDate = value;
@@ -199,7 +183,7 @@ public class BatchInfo {
* Sets the value of the systemModstamp property.
*
* @param value allowed object is
- * {@link javax.xml.datatype.XMLGregorianCalendar }
+ * {@link javax.xml.datatype.XMLGregorianCalendar }
*/
public void setSystemModstamp(XMLGregorianCalendar value) {
this.systemModstamp = value;
@@ -222,8 +206,7 @@ public class BatchInfo {
/**
* Gets the value of the numberRecordsFailed property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberRecordsFailed() {
return numberRecordsFailed;
@@ -232,8 +215,7 @@ public class BatchInfo {
/**
* Sets the value of the numberRecordsFailed property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberRecordsFailed(Integer value) {
this.numberRecordsFailed = value;
@@ -242,8 +224,7 @@ public class BatchInfo {
/**
* Gets the value of the totalProcessingTime property.
*
- * @return possible object is
- * {@link Long }
+ * @return possible object is {@link Long }
*/
public Long getTotalProcessingTime() {
return totalProcessingTime;
@@ -252,8 +233,7 @@ public class BatchInfo {
/**
* Sets the value of the totalProcessingTime property.
*
- * @param value allowed object is
- * {@link Long }
+ * @param value allowed object is {@link Long }
*/
public void setTotalProcessingTime(Long value) {
this.totalProcessingTime = value;
@@ -262,8 +242,7 @@ public class BatchInfo {
/**
* Gets the value of the apiActiveProcessingTime property.
*
- * @return possible object is
- * {@link Long }
+ * @return possible object is {@link Long }
*/
public Long getApiActiveProcessingTime() {
return apiActiveProcessingTime;
@@ -272,8 +251,7 @@ public class BatchInfo {
/**
* Sets the value of the apiActiveProcessingTime property.
*
- * @param value allowed object is
- * {@link Long }
+ * @param value allowed object is {@link Long }
*/
public void setApiActiveProcessingTime(Long value) {
this.apiActiveProcessingTime = value;
@@ -282,8 +260,7 @@ public class BatchInfo {
/**
* Gets the value of the apexProcessingTime property.
*
- * @return possible object is
- * {@link Long }
+ * @return possible object is {@link Long }
*/
public Long getApexProcessingTime() {
return apexProcessingTime;
@@ -292,8 +269,7 @@ public class BatchInfo {
/**
* Sets the value of the apexProcessingTime property.
*
- * @param value allowed object is
- * {@link Long }
+ * @param value allowed object is {@link Long }
*/
public void setApexProcessingTime(Long value) {
this.apexProcessingTime = value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfoList.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfoList.java
index 5aa1a8a..69ea9e5 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfoList.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchInfoList.java
@@ -22,12 +22,15 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for BatchInfoList complex type.
+ * <p>
+ * Java class for BatchInfoList complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="BatchInfoList">
* <complexContent>
@@ -41,9 +44,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "BatchInfoList", propOrder = {
- "batchInfo"
- })
+@XmlType(name = "BatchInfoList", propOrder = {"batchInfo"})
public class BatchInfoList {
protected List<BatchInfo> batchInfo;
@@ -52,21 +53,22 @@ public class BatchInfoList {
* Gets the value of the batchInfo property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the batchInfo property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the batchInfo property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getBatchInfo().add(newItem);
+ * getBatchInfo().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link BatchInfo }
+ * Objects of the following type(s) are allowed in the list {@link BatchInfo
+ * }
*/
public List<BatchInfo> getBatchInfo() {
if (batchInfo == null) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchResult.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchResult.java
index 3a9b854..3ecc2e4 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchResult.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchResult.java
@@ -22,12 +22,15 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for BatchResult complex type.
+ * <p>
+ * Java class for BatchResult complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="BatchResult">
* <complexContent>
@@ -41,9 +44,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "BatchResult", propOrder = {
- "result"
- })
+@XmlType(name = "BatchResult", propOrder = {"result"})
public class BatchResult {
protected List<Result> result;
@@ -52,21 +53,21 @@ public class BatchResult {
* Gets the value of the result property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the result property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the result property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getResult().add(newItem);
+ * getResult().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link Result }
+ * Objects of the following type(s) are allowed in the list {@link Result }
*/
public List<Result> getResult() {
if (result == null) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchStateEnum.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchStateEnum.java
index 516cf9b..bebdca2 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchStateEnum.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/BatchStateEnum.java
@@ -20,12 +20,15 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for BatchStateEnum.
+ * <p>
+ * Java class for BatchStateEnum.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <simpleType name="BatchStateEnum">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -43,14 +46,10 @@ import javax.xml.bind.annotation.XmlType;
public enum BatchStateEnum {
@XmlEnumValue("Queued")
- QUEUED("Queued"),
- @XmlEnumValue("InProgress")
- IN_PROGRESS("InProgress"),
- @XmlEnumValue("Completed")
- COMPLETED("Completed"),
- @XmlEnumValue("Failed")
- FAILED("Failed"),
- @XmlEnumValue("NotProcessed")
+ QUEUED("Queued"), @XmlEnumValue("InProgress")
+ IN_PROGRESS("InProgress"), @XmlEnumValue("Completed")
+ COMPLETED("Completed"), @XmlEnumValue("Failed")
+ FAILED("Failed"), @XmlEnumValue("NotProcessed")
NOT_PROCESSED("NotProcessed");
private final String value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ConcurrencyModeEnum.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ConcurrencyModeEnum.java
index 657a32c..8f3dafc 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ConcurrencyModeEnum.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ConcurrencyModeEnum.java
@@ -20,12 +20,15 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for ConcurrencyModeEnum.
+ * <p>
+ * Java class for ConcurrencyModeEnum.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <simpleType name="ConcurrencyModeEnum">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -40,8 +43,7 @@ import javax.xml.bind.annotation.XmlType;
public enum ConcurrencyModeEnum {
@XmlEnumValue("Parallel")
- PARALLEL("Parallel"),
- @XmlEnumValue("Serial")
+ PARALLEL("Parallel"), @XmlEnumValue("Serial")
SERIAL("Serial");
private final String value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ContentType.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ContentType.java
index e1a9e27..160a9c6 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ContentType.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ContentType.java
@@ -19,12 +19,15 @@ package org.apache.camel.component.salesforce.api.dto.bulk;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for ContentType.
+ * <p>
+ * Java class for ContentType.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <simpleType name="ContentType">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -42,12 +45,7 @@ import javax.xml.bind.annotation.XmlType;
@XmlEnum
public enum ContentType {
- XML,
- CSV,
- JSON,
- ZIP_XML,
- ZIP_CSV,
- ZIP_JSON;
+ XML, CSV, JSON, ZIP_XML, ZIP_CSV, ZIP_JSON;
public String value() {
return name();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Error.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Error.java
index aa44b8d..526a442 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Error.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Error.java
@@ -23,10 +23,14 @@ import javax.xml.bind.annotation.XmlType;
//CHECKSTYLE:OFF
/**
- * <p>Java class for Error complex type.
+ * <p>
+ * Java class for Error complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="Error">
* <complexContent>
@@ -41,10 +45,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "Error", propOrder = {
- "exceptionCode",
- "exceptionMessage"
- })
+@XmlType(name = "Error", propOrder = {"exceptionCode", "exceptionMessage"})
public class Error {
@XmlElement(required = true)
@@ -55,8 +56,7 @@ public class Error {
/**
* Gets the value of the exceptionCode property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getExceptionCode() {
return exceptionCode;
@@ -65,8 +65,7 @@ public class Error {
/**
* Sets the value of the exceptionCode property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setExceptionCode(String value) {
this.exceptionCode = value;
@@ -75,8 +74,7 @@ public class Error {
/**
* Gets the value of the exceptionMessage property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getExceptionMessage() {
return exceptionMessage;
@@ -85,8 +83,7 @@ public class Error {
/**
* Sets the value of the exceptionMessage property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setExceptionMessage(String value) {
this.exceptionMessage = value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobInfo.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobInfo.java
index 3a471a7..2e9eba6 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobInfo.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobInfo.java
@@ -22,12 +22,15 @@ import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
-
/**
- * <p>Java class for JobInfo complex type.
+ * <p>
+ * Java class for JobInfo complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="JobInfo">
* <complexContent>
@@ -63,31 +66,10 @@ import javax.xml.datatype.XMLGregorianCalendar;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "JobInfo", propOrder = {
- "id",
- "operation",
- "object",
- "createdById",
- "createdDate",
- "systemModstamp",
- "state",
- "externalIdFieldName",
- "concurrencyMode",
- "contentType",
- "numberBatchesQueued",
- "numberBatchesInProgress",
- "numberBatchesCompleted",
- "numberBatchesFailed",
- "numberBatchesTotal",
- "numberRecordsProcessed",
- "numberRetries",
- "apiVersion",
- "assignmentRuleId",
- "numberRecordsFailed",
- "totalProcessingTime",
- "apiActiveProcessingTime",
- "apexProcessingTime"
- })
+@XmlType(name = "JobInfo", propOrder = {"id", "operation", "object", "createdById", "createdDate", "systemModstamp", "state", "externalIdFieldName", "concurrencyMode",
+ "contentType", "numberBatchesQueued", "numberBatchesInProgress", "numberBatchesCompleted", "numberBatchesFailed", "numberBatchesTotal",
+ "numberRecordsProcessed", "numberRetries", "apiVersion", "assignmentRuleId", "numberRecordsFailed", "totalProcessingTime",
+ "apiActiveProcessingTime", "apexProcessingTime"})
public class JobInfo {
protected String id;
@@ -119,8 +101,7 @@ public class JobInfo {
/**
* Gets the value of the id property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getId() {
return id;
@@ -129,8 +110,7 @@ public class JobInfo {
/**
* Sets the value of the id property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setId(String value) {
this.id = value;
@@ -139,8 +119,7 @@ public class JobInfo {
/**
* Gets the value of the operation property.
*
- * @return possible object is
- * {@link OperationEnum }
+ * @return possible object is {@link OperationEnum }
*/
public OperationEnum getOperation() {
return operation;
@@ -149,8 +128,7 @@ public class JobInfo {
/**
* Sets the value of the operation property.
*
- * @param value allowed object is
- * {@link OperationEnum }
+ * @param value allowed object is {@link OperationEnum }
*/
public void setOperation(OperationEnum value) {
this.operation = value;
@@ -159,8 +137,7 @@ public class JobInfo {
/**
* Gets the value of the object property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getObject() {
return object;
@@ -169,8 +146,7 @@ public class JobInfo {
/**
* Sets the value of the object property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setObject(String value) {
this.object = value;
@@ -179,8 +155,7 @@ public class JobInfo {
/**
* Gets the value of the createdById property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getCreatedById() {
return createdById;
@@ -189,8 +164,7 @@ public class JobInfo {
/**
* Sets the value of the createdById property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setCreatedById(String value) {
this.createdById = value;
@@ -210,7 +184,7 @@ public class JobInfo {
* Sets the value of the createdDate property.
*
* @param value allowed object is
- * {@link javax.xml.datatype.XMLGregorianCalendar }
+ * {@link javax.xml.datatype.XMLGregorianCalendar }
*/
public void setCreatedDate(XMLGregorianCalendar value) {
this.createdDate = value;
@@ -230,7 +204,7 @@ public class JobInfo {
* Sets the value of the systemModstamp property.
*
* @param value allowed object is
- * {@link javax.xml.datatype.XMLGregorianCalendar }
+ * {@link javax.xml.datatype.XMLGregorianCalendar }
*/
public void setSystemModstamp(XMLGregorianCalendar value) {
this.systemModstamp = value;
@@ -239,8 +213,7 @@ public class JobInfo {
/**
* Gets the value of the state property.
*
- * @return possible object is
- * {@link JobStateEnum }
+ * @return possible object is {@link JobStateEnum }
*/
public JobStateEnum getState() {
return state;
@@ -249,8 +222,7 @@ public class JobInfo {
/**
* Sets the value of the state property.
*
- * @param value allowed object is
- * {@link JobStateEnum }
+ * @param value allowed object is {@link JobStateEnum }
*/
public void setState(JobStateEnum value) {
this.state = value;
@@ -259,8 +231,7 @@ public class JobInfo {
/**
* Gets the value of the externalIdFieldName property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getExternalIdFieldName() {
return externalIdFieldName;
@@ -269,8 +240,7 @@ public class JobInfo {
/**
* Sets the value of the externalIdFieldName property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setExternalIdFieldName(String value) {
this.externalIdFieldName = value;
@@ -279,8 +249,7 @@ public class JobInfo {
/**
* Gets the value of the concurrencyMode property.
*
- * @return possible object is
- * {@link ConcurrencyModeEnum }
+ * @return possible object is {@link ConcurrencyModeEnum }
*/
public ConcurrencyModeEnum getConcurrencyMode() {
return concurrencyMode;
@@ -289,8 +258,7 @@ public class JobInfo {
/**
* Sets the value of the concurrencyMode property.
*
- * @param value allowed object is
- * {@link ConcurrencyModeEnum }
+ * @param value allowed object is {@link ConcurrencyModeEnum }
*/
public void setConcurrencyMode(ConcurrencyModeEnum value) {
this.concurrencyMode = value;
@@ -299,8 +267,7 @@ public class JobInfo {
/**
* Gets the value of the contentType property.
*
- * @return possible object is
- * {@link ContentType }
+ * @return possible object is {@link ContentType }
*/
public ContentType getContentType() {
return contentType;
@@ -309,8 +276,7 @@ public class JobInfo {
/**
* Sets the value of the contentType property.
*
- * @param value allowed object is
- * {@link ContentType }
+ * @param value allowed object is {@link ContentType }
*/
public void setContentType(ContentType value) {
this.contentType = value;
@@ -319,8 +285,7 @@ public class JobInfo {
/**
* Gets the value of the numberBatchesQueued property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberBatchesQueued() {
return numberBatchesQueued;
@@ -329,8 +294,7 @@ public class JobInfo {
/**
* Sets the value of the numberBatchesQueued property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberBatchesQueued(Integer value) {
this.numberBatchesQueued = value;
@@ -339,8 +303,7 @@ public class JobInfo {
/**
* Gets the value of the numberBatchesInProgress property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberBatchesInProgress() {
return numberBatchesInProgress;
@@ -349,8 +312,7 @@ public class JobInfo {
/**
* Sets the value of the numberBatchesInProgress property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberBatchesInProgress(Integer value) {
this.numberBatchesInProgress = value;
@@ -359,8 +321,7 @@ public class JobInfo {
/**
* Gets the value of the numberBatchesCompleted property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberBatchesCompleted() {
return numberBatchesCompleted;
@@ -369,8 +330,7 @@ public class JobInfo {
/**
* Sets the value of the numberBatchesCompleted property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberBatchesCompleted(Integer value) {
this.numberBatchesCompleted = value;
@@ -379,8 +339,7 @@ public class JobInfo {
/**
* Gets the value of the numberBatchesFailed property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberBatchesFailed() {
return numberBatchesFailed;
@@ -389,8 +348,7 @@ public class JobInfo {
/**
* Sets the value of the numberBatchesFailed property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberBatchesFailed(Integer value) {
this.numberBatchesFailed = value;
@@ -399,8 +357,7 @@ public class JobInfo {
/**
* Gets the value of the numberBatchesTotal property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberBatchesTotal() {
return numberBatchesTotal;
@@ -409,8 +366,7 @@ public class JobInfo {
/**
* Sets the value of the numberBatchesTotal property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberBatchesTotal(Integer value) {
this.numberBatchesTotal = value;
@@ -419,8 +375,7 @@ public class JobInfo {
/**
* Gets the value of the numberRecordsProcessed property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberRecordsProcessed() {
return numberRecordsProcessed;
@@ -429,8 +384,7 @@ public class JobInfo {
/**
* Sets the value of the numberRecordsProcessed property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberRecordsProcessed(Integer value) {
this.numberRecordsProcessed = value;
@@ -439,8 +393,7 @@ public class JobInfo {
/**
* Gets the value of the numberRetries property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberRetries() {
return numberRetries;
@@ -449,8 +402,7 @@ public class JobInfo {
/**
* Sets the value of the numberRetries property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberRetries(Integer value) {
this.numberRetries = value;
@@ -459,8 +411,7 @@ public class JobInfo {
/**
* Gets the value of the apiVersion property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getApiVersion() {
return apiVersion;
@@ -469,8 +420,7 @@ public class JobInfo {
/**
* Sets the value of the apiVersion property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setApiVersion(String value) {
this.apiVersion = value;
@@ -479,8 +429,7 @@ public class JobInfo {
/**
* Gets the value of the assignmentRuleId property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getAssignmentRuleId() {
return assignmentRuleId;
@@ -489,8 +438,7 @@ public class JobInfo {
/**
* Sets the value of the assignmentRuleId property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setAssignmentRuleId(String value) {
this.assignmentRuleId = value;
@@ -499,8 +447,7 @@ public class JobInfo {
/**
* Gets the value of the numberRecordsFailed property.
*
- * @return possible object is
- * {@link Integer }
+ * @return possible object is {@link Integer }
*/
public Integer getNumberRecordsFailed() {
return numberRecordsFailed;
@@ -509,8 +456,7 @@ public class JobInfo {
/**
* Sets the value of the numberRecordsFailed property.
*
- * @param value allowed object is
- * {@link Integer }
+ * @param value allowed object is {@link Integer }
*/
public void setNumberRecordsFailed(Integer value) {
this.numberRecordsFailed = value;
@@ -519,8 +465,7 @@ public class JobInfo {
/**
* Gets the value of the totalProcessingTime property.
*
- * @return possible object is
- * {@link Long }
+ * @return possible object is {@link Long }
*/
public Long getTotalProcessingTime() {
return totalProcessingTime;
@@ -529,8 +474,7 @@ public class JobInfo {
/**
* Sets the value of the totalProcessingTime property.
*
- * @param value allowed object is
- * {@link Long }
+ * @param value allowed object is {@link Long }
*/
public void setTotalProcessingTime(Long value) {
this.totalProcessingTime = value;
@@ -539,8 +483,7 @@ public class JobInfo {
/**
* Gets the value of the apiActiveProcessingTime property.
*
- * @return possible object is
- * {@link Long }
+ * @return possible object is {@link Long }
*/
public Long getApiActiveProcessingTime() {
return apiActiveProcessingTime;
@@ -549,8 +492,7 @@ public class JobInfo {
/**
* Sets the value of the apiActiveProcessingTime property.
*
- * @param value allowed object is
- * {@link Long }
+ * @param value allowed object is {@link Long }
*/
public void setApiActiveProcessingTime(Long value) {
this.apiActiveProcessingTime = value;
@@ -559,8 +501,7 @@ public class JobInfo {
/**
* Gets the value of the apexProcessingTime property.
*
- * @return possible object is
- * {@link Long }
+ * @return possible object is {@link Long }
*/
public Long getApexProcessingTime() {
return apexProcessingTime;
@@ -569,8 +510,7 @@ public class JobInfo {
/**
* Sets the value of the apexProcessingTime property.
*
- * @param value allowed object is
- * {@link Long }
+ * @param value allowed object is {@link Long }
*/
public void setApexProcessingTime(Long value) {
this.apexProcessingTime = value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobStateEnum.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobStateEnum.java
index 87ccffc..5fd7a5e 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobStateEnum.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/JobStateEnum.java
@@ -20,12 +20,15 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for JobStateEnum.
+ * <p>
+ * Java class for JobStateEnum.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <simpleType name="JobStateEnum">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -42,12 +45,9 @@ import javax.xml.bind.annotation.XmlType;
public enum JobStateEnum {
@XmlEnumValue("Open")
- OPEN("Open"),
- @XmlEnumValue("Closed")
- CLOSED("Closed"),
- @XmlEnumValue("Aborted")
- ABORTED("Aborted"),
- @XmlEnumValue("Failed")
+ OPEN("Open"), @XmlEnumValue("Closed")
+ CLOSED("Closed"), @XmlEnumValue("Aborted")
+ ABORTED("Aborted"), @XmlEnumValue("Failed")
FAILED("Failed");
private final String value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ObjectFactory.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ObjectFactory.java
index 399498e..f8338aa 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ObjectFactory.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ObjectFactory.java
@@ -21,19 +21,16 @@ import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
-
/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * in the org.apache.camel.component.salesforce.api.dto.bulk package.
- * <p>An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
+ * This object contains factory methods for each Java content interface and Java
+ * element interface in the org.apache.camel.component.salesforce.api.dto.bulk
+ * package.
+ * <p>
+ * An ObjectFactory allows you to programatically construct new instances of the
+ * Java representation for XML content. The Java representation of XML content
+ * can consist of schema derived interfaces and classes representing the binding
+ * of schema type definitions, element declarations and model groups. Factory
+ * methods for each of these are provided in this class.
*/
@XmlRegistry
public class ObjectFactory {
@@ -47,7 +44,9 @@ public class ObjectFactory {
private static final QName QUERY_RESULT_QNAME = new QName("http://www.force.com/2009/06/asyncapi/dataload", "queryResult");
/**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: org.apache.camel.component.salesforce.api.dto.bulk
+ * Create a new ObjectFactory that can be used to create new instances of
+ * schema derived classes for package:
+ * org.apache.camel.component.salesforce.api.dto.bulk
*/
public ObjectFactory() {
}
@@ -123,7 +122,8 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link JobInfo }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link JobInfo }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "jobInfo")
public JAXBElement<JobInfo> createJobInfo(JobInfo value) {
@@ -131,7 +131,8 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link BatchInfo }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link BatchInfo }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "batchInfo")
public JAXBElement<BatchInfo> createBatchInfo(BatchInfo value) {
@@ -139,7 +140,8 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link Error }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link Error }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "error")
public JAXBElement<Error> createError(Error value) {
@@ -147,7 +149,9 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link BatchResult }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link BatchResult
+ * }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "results")
public JAXBElement<BatchResult> createResults(BatchResult value) {
@@ -155,7 +159,9 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link QueryResultList }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link QueryResultList
+ * }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "result-list")
public JAXBElement<QueryResultList> createResultList(QueryResultList value) {
@@ -163,7 +169,9 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link BatchInfoList }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link BatchInfoList
+ * }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "batchInfoList")
public JAXBElement<BatchInfoList> createBatchInfoList(BatchInfoList value) {
@@ -171,7 +179,9 @@ public class ObjectFactory {
}
/**
- * Create an instance of {@link javax.xml.bind.JAXBElement }{@code <}{@link QueryResult }{@code >}}
+ * Create an instance of
+ * {@link javax.xml.bind.JAXBElement }{@code <}{@link QueryResult
+ * }{@code >}}
*/
@XmlElementDecl(namespace = "http://www.force.com/2009/06/asyncapi/dataload", name = "queryResult")
public JAXBElement<QueryResult> createQueryResult(QueryResult value) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/OperationEnum.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/OperationEnum.java
index f12e285..2425a6d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/OperationEnum.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/OperationEnum.java
@@ -20,12 +20,15 @@ import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for OperationEnum.
+ * <p>
+ * Java class for OperationEnum.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <simpleType name="OperationEnum">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -44,16 +47,11 @@ import javax.xml.bind.annotation.XmlType;
public enum OperationEnum {
@XmlEnumValue("insert")
- INSERT("insert"),
- @XmlEnumValue("upsert")
- UPSERT("upsert"),
- @XmlEnumValue("update")
- UPDATE("update"),
- @XmlEnumValue("delete")
- DELETE("delete"),
- @XmlEnumValue("hardDelete")
- HARD_DELETE("hardDelete"),
- @XmlEnumValue("query")
+ INSERT("insert"), @XmlEnumValue("upsert")
+ UPSERT("upsert"), @XmlEnumValue("update")
+ UPDATE("update"), @XmlEnumValue("delete")
+ DELETE("delete"), @XmlEnumValue("hardDelete")
+ HARD_DELETE("hardDelete"), @XmlEnumValue("query")
QUERY("query");
private final String value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResult.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResult.java
index 72de5fd..48dbb09 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResult.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResult.java
@@ -23,12 +23,15 @@ import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for QueryResult complex type.
+ * <p>
+ * Java class for QueryResult complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="QueryResult">
* <complexContent>
@@ -42,9 +45,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "QueryResult", propOrder = {
- "records"
- })
+@XmlType(name = "QueryResult", propOrder = {"records"})
public class QueryResult {
@XmlElement(nillable = true)
@@ -54,21 +55,21 @@ public class QueryResult {
* Gets the value of the records property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the records property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the records property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getRecords().add(newItem);
+ * getRecords().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link SObject }
+ * Objects of the following type(s) are allowed in the list {@link SObject }
*/
public List<SObject> getRecords() {
if (records == null) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResultList.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResultList.java
index e08b779..3aa39cc 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResultList.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/QueryResultList.java
@@ -22,12 +22,15 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for QueryResultList complex type.
+ * <p>
+ * Java class for QueryResultList complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="QueryResultList">
* <complexContent>
@@ -41,9 +44,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "QueryResultList", propOrder = {
- "result"
- })
+@XmlType(name = "QueryResultList", propOrder = {"result"})
public class QueryResultList {
protected List<String> result;
@@ -52,21 +53,21 @@ public class QueryResultList {
* Gets the value of the result property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the result property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the result property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getResult().add(newItem);
+ * getResult().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link String }
+ * Objects of the following type(s) are allowed in the list {@link String }
*/
public List<String> getResult() {
if (result == null) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Result.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Result.java
index dd0b0bb..c33d124 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Result.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/Result.java
@@ -22,12 +22,15 @@ import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for Result complex type.
+ * <p>
+ * Java class for Result complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="Result">
* <complexContent>
@@ -44,12 +47,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "Result", propOrder = {
- "errors",
- "id",
- "success",
- "created"
- })
+@XmlType(name = "Result", propOrder = {"errors", "id", "success", "created"})
public class Result {
protected List<ResultError> errors;
@@ -61,15 +59,16 @@ public class Result {
* Gets the value of the errors property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the errors property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the errors property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getErrors().add(newItem);
+ * getErrors().add(newItem);
* </pre>
* <p/>
* <p/>
@@ -87,8 +86,7 @@ public class Result {
/**
* Gets the value of the id property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getId() {
return id;
@@ -97,8 +95,7 @@ public class Result {
/**
* Sets the value of the id property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setId(String value) {
this.id = value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ResultError.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ResultError.java
index 94aebd2..295c61d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ResultError.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/ResultError.java
@@ -25,10 +25,14 @@ import javax.xml.bind.annotation.XmlType;
//CHECKSTYLE:OFF
/**
- * <p>Java class for ResultError complex type.
+ * <p>
+ * Java class for ResultError complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="ResultError">
* <complexContent>
@@ -44,11 +48,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "ResultError", propOrder = {
- "fields",
- "message",
- "statusCode"
- })
+@XmlType(name = "ResultError", propOrder = {"fields", "message", "statusCode"})
public class ResultError {
@XmlElement(nillable = true)
@@ -62,21 +62,21 @@ public class ResultError {
* Gets the value of the fields property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the fields property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the fields property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getFields().add(newItem);
+ * getFields().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link String }
+ * Objects of the following type(s) are allowed in the list {@link String }
*/
public List<String> getFields() {
if (fields == null) {
@@ -88,8 +88,7 @@ public class ResultError {
/**
* Gets the value of the message property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getMessage() {
return message;
@@ -98,8 +97,7 @@ public class ResultError {
/**
* Sets the value of the message property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setMessage(String value) {
this.message = value;
@@ -108,8 +106,7 @@ public class ResultError {
/**
* Gets the value of the statusCode property.
*
- * @return possible object is
- * {@link StatusCode }
+ * @return possible object is {@link StatusCode }
*/
public StatusCode getStatusCode() {
return statusCode;
@@ -118,8 +115,7 @@ public class ResultError {
/**
* Sets the value of the statusCode property.
*
- * @param value allowed object is
- * {@link StatusCode }
+ * @param value allowed object is {@link StatusCode }
*/
public void setStatusCode(StatusCode value) {
this.statusCode = value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/SObject.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/SObject.java
index a402ce9..c6b0cf8 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/SObject.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/SObject.java
@@ -24,12 +24,15 @@ import javax.xml.bind.annotation.XmlAnyElement;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for sObject complex type.
+ * <p>
+ * Java class for sObject complex type.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <complexType name="sObject">
* <complexContent>
@@ -45,11 +48,7 @@ import javax.xml.bind.annotation.XmlType;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "sObject", propOrder = {
- "type",
- "id",
- "any"
- })
+@XmlType(name = "sObject", propOrder = {"type", "id", "any"})
public class SObject {
@XmlElement(required = true)
@@ -62,8 +61,7 @@ public class SObject {
/**
* Gets the value of the type property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getType() {
return type;
@@ -72,8 +70,7 @@ public class SObject {
/**
* Sets the value of the type property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setType(String value) {
this.type = value;
@@ -82,8 +79,7 @@ public class SObject {
/**
* Gets the value of the id property.
*
- * @return possible object is
- * {@link String }
+ * @return possible object is {@link String }
*/
public String getId() {
return id;
@@ -92,8 +88,7 @@ public class SObject {
/**
* Sets the value of the id property.
*
- * @param value allowed object is
- * {@link String }
+ * @param value allowed object is {@link String }
*/
public void setId(String value) {
this.id = value;
@@ -103,21 +98,21 @@ public class SObject {
* Gets the value of the any property.
* <p/>
* <p/>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
+ * This accessor method returns a reference to the live list, not a
+ * snapshot. Therefore any modification you make to the returned list will
+ * be present inside the JAXB object. This is why there is not a
+ * <CODE>set</CODE> method for the any property.
* <p/>
* <p/>
* For example, to add a new item, do as follows:
+ *
* <pre>
- * getAny().add(newItem);
+ * getAny().add(newItem);
* </pre>
* <p/>
* <p/>
* <p/>
- * Objects of the following type(s) are allowed in the list
- * {@link Object }
+ * Objects of the following type(s) are allowed in the list {@link Object }
* {@link org.w3c.dom.Element }
*/
public List<Object> getAny() {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/StatusCode.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/StatusCode.java
index b213fae..fb4df3a 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/StatusCode.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/StatusCode.java
@@ -19,12 +19,15 @@ package org.apache.camel.component.salesforce.api.dto.bulk;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
-
/**
- * <p>Java class for StatusCode.
+ * <p>
+ * Java class for StatusCode.
* <p/>
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * <p>
+ * The following schema fragment specifies the expected content contained within
+ * this class.
* <p/>
+ *
* <pre>
* <simpleType name="StatusCode">
* <restriction base="{http://www.w3.org/2001/XMLSchema}string">
@@ -209,179 +212,47 @@ import javax.xml.bind.annotation.XmlType;
@XmlEnum
public enum StatusCode {
- ALL_OR_NONE_OPERATION_ROLLED_BACK,
- ALREADY_IN_PROCESS,
- ASSIGNEE_TYPE_REQUIRED,
- BAD_CUSTOM_ENTITY_PARENT_DOMAIN,
- BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED,
- CANNOT_CASCADE_PRODUCT_ACTIVE,
- CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD,
- CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE,
- CANNOT_DEACTIVATE_DIVISION,
- CANNOT_DELETE_LAST_DATED_CONVERSION_RATE,
- CANNOT_DELETE_MANAGED_OBJECT,
- CANNOT_DISABLE_LAST_ADMIN,
- CANNOT_ENABLE_IP_RESTRICT_REQUESTS,
- CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY,
- CANNOT_MODIFY_MANAGED_OBJECT,
- CANNOT_RENAME_APEX_REFERENCED_FIELD,
- CANNOT_RENAME_APEX_REFERENCED_OBJECT,
- CANNOT_REPARENT_RECORD,
- CANNOT_UPDATE_CONVERTED_LEAD,
- CANT_DISABLE_CORP_CURRENCY,
- CANT_UNSET_CORP_CURRENCY,
- CHILD_SHARE_FAILS_PARENT,
- CIRCULAR_DEPENDENCY,
- COMMUNITY_NOT_ACCESSIBLE,
- CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED,
- CUSTOM_ENTITY_OR_FIELD_LIMIT,
- CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED,
- CUSTOM_INDEX_EXISTS,
- CUSTOM_LINK_LIMIT_EXCEEDED,
- CUSTOM_TAB_LIMIT_EXCEEDED,
- DELETE_FAILED,
- DELETE_OPERATION_TOO_LARGE,
- DELETE_REQUIRED_ON_CASCADE,
- DEPENDENCY_EXISTS,
- DUPLICATE_CASE_SOLUTION,
- DUPLICATE_COMM_NICKNAME,
- DUPLICATE_CUSTOM_ENTITY_DEFINITION,
- DUPLICATE_CUSTOM_TAB_MOTIF,
- DUPLICATE_DEVELOPER_NAME,
- DUPLICATE_EXTERNAL_ID,
- DUPLICATE_MASTER_LABEL,
- DUPLICATE_SENDER_DISPLAY_NAME,
- DUPLICATE_USERNAME,
- DUPLICATE_VALUE,
- EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR,
- EMPTY_SCONTROL_FILE_NAME,
- ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE,
- ENTITY_IS_ARCHIVED,
- ENTITY_IS_DELETED,
- ENTITY_IS_LOCKED,
- ERROR_IN_MAILER,
- EXTERNAL_OBJECT_AUTHENTICATION_EXCEPTION,
- EXTERNAL_OBJECT_CONNECTION_EXCEPTION,
- EXTERNAL_OBJECT_EXCEPTION,
- EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION,
- FAILED_ACTIVATION,
- FIELD_CUSTOM_VALIDATION_EXCEPTION,
- FIELD_FILTER_VALIDATION_EXCEPTION,
- FIELD_INTEGRITY_EXCEPTION,
- FILTERED_LOOKUP_LIMIT_EXCEEDED,
- HTML_FILE_UPLOAD_NOT_ALLOWED,
- IMAGE_TOO_LARGE,
- INACTIVE_OWNER_OR_USER,
- INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY,
- INSUFFICIENT_ACCESS_OR_READONLY,
- INVALID_ACCESS_LEVEL,
- INVALID_ARGUMENT_TYPE,
- INVALID_ASSIGNEE_TYPE,
- INVALID_ASSIGNMENT_RULE,
- INVALID_BATCH_OPERATION,
- INVALID_CONTENT_TYPE,
- INVALID_CREDIT_CARD_INFO,
- INVALID_CROSS_REFERENCE_KEY,
- INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD,
- INVALID_CURRENCY_CONV_RATE,
- INVALID_CURRENCY_CORP_RATE,
- INVALID_CURRENCY_ISO,
- INVALID_DATA_CATEGORY_GROUP_REFERENCE,
- INVALID_DATA_URI,
- INVALID_EMAIL_ADDRESS,
- INVALID_EMPTY_KEY_OWNER,
- INVALID_FIELD,
- INVALID_FIELD_FOR_INSERT_UPDATE,
- INVALID_FIELD_WHEN_USING_TEMPLATE,
- INVALID_FILTER_ACTION,
- INVALID_GOOGLE_DOCS_URL,
- INVALID_ID_FIELD,
- INVALID_INET_ADDRESS,
- INVALID_LINEITEM_CLONE_STATE,
- INVALID_MASTER_OR_TRANSLATED_SOLUTION,
- INVALID_MESSAGE_ID_REFERENCE,
- INVALID_OPERATION,
- INVALID_OPERATOR,
- INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST,
- INVALID_PACKAGE_VERSION,
- INVALID_PARTNER_NETWORK_STATUS,
- INVALID_PERSON_ACCOUNT_OPERATION,
- INVALID_QUERY_LOCATOR,
- INVALID_READ_ONLY_USER_DML,
- INVALID_SAVE_AS_ACTIVITY_FLAG,
- INVALID_SESSION_ID,
- INVALID_SETUP_OWNER,
- INVALID_STATUS,
- INVALID_TYPE,
- INVALID_TYPE_FOR_OPERATION,
- INVALID_TYPE_ON_FIELD_IN_RECORD,
- IP_RANGE_LIMIT_EXCEEDED,
- LICENSE_LIMIT_EXCEEDED,
- LIGHT_PORTAL_USER_EXCEPTION,
- LIMIT_EXCEEDED,
- MALFORMED_ID,
- MANAGER_NOT_DEFINED,
- MASSMAIL_RETRY_LIMIT_EXCEEDED,
- MASS_MAIL_LIMIT_EXCEEDED,
- MAXIMUM_CCEMAILS_EXCEEDED,
- MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED,
- MAXIMUM_HIERARCHY_LEVELS_REACHED,
- MAXIMUM_SIZE_OF_ATTACHMENT,
- MAXIMUM_SIZE_OF_DOCUMENT,
- MAX_ACTIONS_PER_RULE_EXCEEDED,
- MAX_ACTIVE_RULES_EXCEEDED,
- MAX_APPROVAL_STEPS_EXCEEDED,
- MAX_FORMULAS_PER_RULE_EXCEEDED,
- MAX_RULES_EXCEEDED,
- MAX_RULE_ENTRIES_EXCEEDED,
- MAX_TASK_DESCRIPTION_EXCEEEDED,
- MAX_TM_RULES_EXCEEDED,
- MAX_TM_RULE_ITEMS_EXCEEDED,
- MERGE_FAILED,
- MISSING_ARGUMENT,
- MIXED_DML_OPERATION,
- NONUNIQUE_SHIPPING_ADDRESS,
- NO_APPLICABLE_PROCESS,
- NO_ATTACHMENT_PERMISSION,
- NO_INACTIVE_DIVISION_MEMBERS,
- NO_MASS_MAIL_PERMISSION,
- NUMBER_OUTSIDE_VALID_RANGE,
- NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED,
- OPTED_OUT_OF_MASS_MAIL,
- OP_WITH_INVALID_USER_TYPE_EXCEPTION,
- PACKAGE_LICENSE_REQUIRED,
- PORTAL_NO_ACCESS,
- PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT,
- PRIVATE_CONTACT_ON_ASSET,
- QUERY_TIMEOUT,
- RECORD_IN_USE_BY_WORKFLOW,
- REQUEST_RUNNING_TOO_LONG,
- REQUIRED_FEATURE_MISSING,
- REQUIRED_FIELD_MISSING,
- SELF_REFERENCE_FROM_TRIGGER,
- SHARE_NEEDED_FOR_CHILD_OWNER,
- SINGLE_EMAIL_LIMIT_EXCEEDED,
- STANDARD_PRICE_NOT_DEFINED,
- STORAGE_LIMIT_EXCEEDED,
- STRING_TOO_LONG,
- TABSET_LIMIT_EXCEEDED,
- TEMPLATE_NOT_ACTIVE,
- TERRITORY_REALIGN_IN_PROGRESS,
- TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET,
- TOO_MANY_APEX_REQUESTS,
- TOO_MANY_ENUM_VALUE,
- TRANSFER_REQUIRES_READ,
- UNABLE_TO_LOCK_ROW,
- UNAVAILABLE_RECORDTYPE_EXCEPTION,
- UNDELETE_FAILED,
- UNKNOWN_EXCEPTION,
- UNSPECIFIED_EMAIL_ADDRESS,
- UNSUPPORTED_APEX_TRIGGER_OPERATON,
- UNVERIFIED_SENDER_ADDRESS,
- USER_OWNS_PORTAL_ACCOUNT_EXCEPTION,
- USER_WITH_APEX_SHARES_EXCEPTION,
- WEBLINK_SIZE_LIMIT_EXCEEDED,
- WRONG_CONTROLLER_TYPE;
+ ALL_OR_NONE_OPERATION_ROLLED_BACK, ALREADY_IN_PROCESS, ASSIGNEE_TYPE_REQUIRED, BAD_CUSTOM_ENTITY_PARENT_DOMAIN, BCC_NOT_ALLOWED_IF_BCC_COMPLIANCE_ENABLED, CANNOT_CASCADE_PRODUCT_ACTIVE,
+ CANNOT_CHANGE_FIELD_TYPE_OF_APEX_REFERENCED_FIELD, CANNOT_CREATE_ANOTHER_MANAGED_PACKAGE, CANNOT_DEACTIVATE_DIVISION, CANNOT_DELETE_LAST_DATED_CONVERSION_RATE, CANNOT_DELETE_MANAGED_OBJECT, CANNOT_DISABLE_LAST_ADMIN,
+ CANNOT_ENABLE_IP_RESTRICT_REQUESTS, CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CANNOT_MODIFY_MANAGED_OBJECT, CANNOT_RENAME_APEX_REFERENCED_FIELD,
+ CANNOT_RENAME_APEX_REFERENCED_OBJECT, CANNOT_REPARENT_RECORD, CANNOT_UPDATE_CONVERTED_LEAD, CANT_DISABLE_CORP_CURRENCY,
+ CANT_UNSET_CORP_CURRENCY, CHILD_SHARE_FAILS_PARENT, CIRCULAR_DEPENDENCY, COMMUNITY_NOT_ACCESSIBLE,
+ CUSTOM_CLOB_FIELD_LIMIT_EXCEEDED, CUSTOM_ENTITY_OR_FIELD_LIMIT, CUSTOM_FIELD_INDEX_LIMIT_EXCEEDED, CUSTOM_INDEX_EXISTS,
+ CUSTOM_LINK_LIMIT_EXCEEDED, CUSTOM_TAB_LIMIT_EXCEEDED, DELETE_FAILED, DELETE_OPERATION_TOO_LARGE, DELETE_REQUIRED_ON_CASCADE,
+ DEPENDENCY_EXISTS, DUPLICATE_CASE_SOLUTION, DUPLICATE_COMM_NICKNAME, DUPLICATE_CUSTOM_ENTITY_DEFINITION,
+ DUPLICATE_CUSTOM_TAB_MOTIF, DUPLICATE_DEVELOPER_NAME, DUPLICATE_EXTERNAL_ID, DUPLICATE_MASTER_LABEL,
+ DUPLICATE_SENDER_DISPLAY_NAME, DUPLICATE_USERNAME, DUPLICATE_VALUE, EMAIL_NOT_PROCESSED_DUE_TO_PRIOR_ERROR,
+ EMPTY_SCONTROL_FILE_NAME, ENTITY_FAILED_IFLASTMODIFIED_ON_UPDATE, ENTITY_IS_ARCHIVED, ENTITY_IS_DELETED,
+ ENTITY_IS_LOCKED, ERROR_IN_MAILER, EXTERNAL_OBJECT_AUTHENTICATION_EXCEPTION, EXTERNAL_OBJECT_CONNECTION_EXCEPTION,
+ EXTERNAL_OBJECT_EXCEPTION, EXTERNAL_OBJECT_UNSUPPORTED_EXCEPTION, FAILED_ACTIVATION, FIELD_CUSTOM_VALIDATION_EXCEPTION,
+ FIELD_FILTER_VALIDATION_EXCEPTION, FIELD_INTEGRITY_EXCEPTION, FILTERED_LOOKUP_LIMIT_EXCEEDED, HTML_FILE_UPLOAD_NOT_ALLOWED,
+ IMAGE_TOO_LARGE, INACTIVE_OWNER_OR_USER, INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, INSUFFICIENT_ACCESS_OR_READONLY,
+ INVALID_ACCESS_LEVEL, INVALID_ARGUMENT_TYPE, INVALID_ASSIGNEE_TYPE, INVALID_ASSIGNMENT_RULE, INVALID_BATCH_OPERATION,
+ INVALID_CONTENT_TYPE, INVALID_CREDIT_CARD_INFO, INVALID_CROSS_REFERENCE_KEY, INVALID_CROSS_REFERENCE_TYPE_FOR_FIELD,
+ INVALID_CURRENCY_CONV_RATE, INVALID_CURRENCY_CORP_RATE, INVALID_CURRENCY_ISO, INVALID_DATA_CATEGORY_GROUP_REFERENCE,
+ INVALID_DATA_URI, INVALID_EMAIL_ADDRESS, INVALID_EMPTY_KEY_OWNER, INVALID_FIELD, INVALID_FIELD_FOR_INSERT_UPDATE,
+ INVALID_FIELD_WHEN_USING_TEMPLATE, INVALID_FILTER_ACTION, INVALID_GOOGLE_DOCS_URL, INVALID_ID_FIELD, INVALID_INET_ADDRESS,
+ INVALID_LINEITEM_CLONE_STATE, INVALID_MASTER_OR_TRANSLATED_SOLUTION, INVALID_MESSAGE_ID_REFERENCE, INVALID_OPERATION,
+ INVALID_OPERATOR, INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST, INVALID_PACKAGE_VERSION, INVALID_PARTNER_NETWORK_STATUS,
+ INVALID_PERSON_ACCOUNT_OPERATION, INVALID_QUERY_LOCATOR, INVALID_READ_ONLY_USER_DML, INVALID_SAVE_AS_ACTIVITY_FLAG,
+ INVALID_SESSION_ID, INVALID_SETUP_OWNER, INVALID_STATUS, INVALID_TYPE, INVALID_TYPE_FOR_OPERATION,
+ INVALID_TYPE_ON_FIELD_IN_RECORD, IP_RANGE_LIMIT_EXCEEDED, LICENSE_LIMIT_EXCEEDED, LIGHT_PORTAL_USER_EXCEPTION,
+ LIMIT_EXCEEDED, MALFORMED_ID, MANAGER_NOT_DEFINED, MASSMAIL_RETRY_LIMIT_EXCEEDED, MASS_MAIL_LIMIT_EXCEEDED,
+ MAXIMUM_CCEMAILS_EXCEEDED, MAXIMUM_DASHBOARD_COMPONENTS_EXCEEDED, MAXIMUM_HIERARCHY_LEVELS_REACHED,
+ MAXIMUM_SIZE_OF_ATTACHMENT, MAXIMUM_SIZE_OF_DOCUMENT, MAX_ACTIONS_PER_RULE_EXCEEDED, MAX_ACTIVE_RULES_EXCEEDED,
+ MAX_APPROVAL_STEPS_EXCEEDED, MAX_FORMULAS_PER_RULE_EXCEEDED, MAX_RULES_EXCEEDED, MAX_RULE_ENTRIES_EXCEEDED,
+ MAX_TASK_DESCRIPTION_EXCEEEDED, MAX_TM_RULES_EXCEEDED, MAX_TM_RULE_ITEMS_EXCEEDED, MERGE_FAILED, MISSING_ARGUMENT,
+ MIXED_DML_OPERATION, NONUNIQUE_SHIPPING_ADDRESS, NO_APPLICABLE_PROCESS, NO_ATTACHMENT_PERMISSION,
+ NO_INACTIVE_DIVISION_MEMBERS, NO_MASS_MAIL_PERMISSION, NUMBER_OUTSIDE_VALID_RANGE, NUM_HISTORY_FIELDS_BY_SOBJECT_EXCEEDED,
+ OPTED_OUT_OF_MASS_MAIL, OP_WITH_INVALID_USER_TYPE_EXCEPTION, PACKAGE_LICENSE_REQUIRED, PORTAL_NO_ACCESS,
+ PORTAL_USER_ALREADY_EXISTS_FOR_CONTACT, PRIVATE_CONTACT_ON_ASSET, QUERY_TIMEOUT, RECORD_IN_USE_BY_WORKFLOW,
+ REQUEST_RUNNING_TOO_LONG, REQUIRED_FEATURE_MISSING, REQUIRED_FIELD_MISSING, SELF_REFERENCE_FROM_TRIGGER,
+ SHARE_NEEDED_FOR_CHILD_OWNER, SINGLE_EMAIL_LIMIT_EXCEEDED, STANDARD_PRICE_NOT_DEFINED, STORAGE_LIMIT_EXCEEDED,
+ STRING_TOO_LONG, TABSET_LIMIT_EXCEEDED, TEMPLATE_NOT_ACTIVE, TERRITORY_REALIGN_IN_PROGRESS, TEXT_DATA_OUTSIDE_SUPPORTED_CHARSET,
+ TOO_MANY_APEX_REQUESTS, TOO_MANY_ENUM_VALUE, TRANSFER_REQUIRES_READ, UNABLE_TO_LOCK_ROW,
+ UNAVAILABLE_RECORDTYPE_EXCEPTION, UNDELETE_FAILED, UNKNOWN_EXCEPTION, UNSPECIFIED_EMAIL_ADDRESS,
+ UNSUPPORTED_APEX_TRIGGER_OPERATON, UNVERIFIED_SENDER_ADDRESS, USER_OWNS_PORTAL_ACCOUNT_EXCEPTION,
+ USER_WITH_APEX_SHARES_EXCEPTION, WEBLINK_SIZE_LIMIT_EXCEEDED, WRONG_CONTROLLER_TYPE;
public String value() {
return name();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/package-info.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/package-info.java
index 8e330ed..90195cd 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/package-info.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/bulk/package-info.java
@@ -14,6 +14,5 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.force.com/2009/06/asyncapi/dataload",
- elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
+@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.force.com/2009/06/asyncapi/dataload", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package org.apache.camel.component.salesforce.api.dto.bulk;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/Counter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/Counter.java
index 479beae..a79c1da 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/Counter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/Counter.java
@@ -19,7 +19,8 @@ package org.apache.camel.component.salesforce.api.dto.composite;
import java.util.concurrent.atomic.AtomicInteger;
/**
- * Default {@link ReferenceGenerator} implementation that generates a counted sequence of references (ref1, ref2, ...).
+ * Default {@link ReferenceGenerator} implementation that generates a counted
+ * sequence of references (ref1, ref2, ...).
*/
public class Counter implements ReferenceGenerator {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceGenerator.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceGenerator.java
index bde0d24..ff32045 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceGenerator.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceGenerator.java
@@ -17,23 +17,25 @@
package org.apache.camel.component.salesforce.api.dto.composite;
/**
- * SObject tree Composite API interface for {@code referenceId} generation. For each object given to the
- * {@link ReferenceGenerator#nextReferenceFor(Object)} method, the implementation should generate reference identifiers.
- * Reference identifiers need to be unique within one SObject tree request and should start with alphanumeric character.
+ * SObject tree Composite API interface for {@code referenceId} generation. For
+ * each object given to the {@link ReferenceGenerator#nextReferenceFor(Object)}
+ * method, the implementation should generate reference identifiers. Reference
+ * identifiers need to be unique within one SObject tree request and should
+ * start with alphanumeric character.
* <p/>
- * For example you can provide your {@link ReferenceGenerator} implementation that uses identities within your own
- * system as references, i.e. primary keys of records in your database.
+ * For example you can provide your {@link ReferenceGenerator} implementation
+ * that uses identities within your own system as references, i.e. primary keys
+ * of records in your database.
*
* @see Counter
*/
public interface ReferenceGenerator {
/**
- * Generates unique, within a request, reference identifier for the given object. Reference identifier must start
- * with an alphanumeric.
+ * Generates unique, within a request, reference identifier for the given
+ * object. Reference identifier must start with an alphanumeric.
*
- * @param object
- * object to generate reference identifier for
+ * @param object object to generate reference identifier for
* @return generated reference identifier
*/
String nextReferenceFor(Object object);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceId.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceId.java
index 292459e..e5588c1 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceId.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/ReferenceId.java
@@ -43,8 +43,10 @@ public final class ReferenceId implements Serializable {
private final String referenceId;
@JsonCreator
- ReferenceId(@JsonProperty("referenceId") final String referenceId, @JsonProperty("id") final String id,
- @JsonProperty("errors") final List<RestError> errors) {
+ ReferenceId(@JsonProperty("referenceId")
+ final String referenceId, @JsonProperty("id")
+ final String id, @JsonProperty("errors")
+ final List<RestError> errors) {
this.referenceId = referenceId;
this.id = id;
this.errors = errors;
@@ -60,10 +62,9 @@ public final class ReferenceId implements Serializable {
return false;
}
- final ReferenceId other = (ReferenceId) obj;
+ final ReferenceId other = (ReferenceId)obj;
- return Objects.equals(id, other.id) && Objects.equals(referenceId, other.referenceId)
- && Objects.equals(getErrors(), other.getErrors());
+ return Objects.equals(id, other.id) && Objects.equals(referenceId, other.referenceId) && Objects.equals(getErrors(), other.getErrors());
}
public List<RestError> getErrors() {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/RichInputConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/RichInputConverter.java
index 66b9358..bf57ae7 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/RichInputConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/RichInputConverter.java
@@ -42,7 +42,7 @@ public final class RichInputConverter implements Converter {
public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) {
if (source instanceof Map) {
@SuppressWarnings("unchecked")
- final Map<String, String> map = (Map) source;
+ final Map<String, String> map = (Map)source;
for (final Map.Entry<String, String> e : map.entrySet()) {
writer.startNode(e.getKey());
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatch.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatch.java
index 52b461a..f1afc88 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatch.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatch.java
@@ -41,33 +41,35 @@ import static org.apache.camel.util.ObjectHelper.notNull;
import static org.apache.camel.util.StringHelper.notEmpty;
/**
- * Builder for Composite API batch request. Composite API is available from Salesforce API version 34.0 onwards its a
- * way to combine multiple requests in a batch and submit them in one HTTP request. This object help to build the
- * payload of the batch request. Most requests that are supported in the Composite batch API the helper builder methods
- * are provided. For batch requests that do not have their corresponding helper builder method, use
- * {@link #addGeneric(Method, String)} or {@link #addGeneric(Method, String, Object)} methods. To build the batch use:
+ * Builder for Composite API batch request. Composite API is available from
+ * Salesforce API version 34.0 onwards its a way to combine multiple requests in
+ * a batch and submit them in one HTTP request. This object help to build the
+ * payload of the batch request. Most requests that are supported in the
+ * Composite batch API the helper builder methods are provided. For batch
+ * requests that do not have their corresponding helper builder method, use
+ * {@link #addGeneric(Method, String)} or
+ * {@link #addGeneric(Method, String, Object)} methods. To build the batch use:
* <blockquote>
*
* <pre>
- * {@code
- * SObjectBatch batch = new SObjectBatch("37.0");
+ * {
+ * @code
+ * SObjectBatch batch = new SObjectBatch("37.0");
*
- * final Account account = new Account();
- * account.setName("NewAccountName");
- * account.setIndustry(Account_IndustryEnum.ENVIRONMENTAL);
- * batch.addCreate(account);
+ * final Account account = new Account();
+ * account.setName("NewAccountName");
+ * account.setIndustry(Account_IndustryEnum.ENVIRONMENTAL);
+ * batch.addCreate(account);
*
- * batch.addDelete("Account", "001D000000K0fXOIAZ");
+ * batch.addDelete("Account", "001D000000K0fXOIAZ");
*
- * batch.addGet("Account", "0010Y00000Arwt6QAB", "Name", "BillingPostalCode");
+ * batch.addGet("Account", "0010Y00000Arwt6QAB", "Name", "BillingPostalCode");
* }
*
* </pre>
*
- * </blockquote>
- *
- * This will build a batch of three operations, one to create new Account, one to delete an Account, and one to get two
- * fields from an Account.
+ * </blockquote> This will build a batch of three operations, one to create new
+ * Account, one to delete an Account, and one to get two fields from an Account.
*/
@XStreamAlias("batch")
public final class SObjectBatch implements Serializable {
@@ -91,13 +93,14 @@ public final class SObjectBatch implements Serializable {
private final Version version;
/**
- * Create new batch request. You must specify the API version of the batch request. The API version cannot be newer
- * than the version configured in the Salesforce Camel component. Some of the batched requests are available only
- * from certain Salesforce API versions, when this is the case it is noted in the documentation of the builder
- * method, if uncertain consult the Salesforce API documentation.
+ * Create new batch request. You must specify the API version of the batch
+ * request. The API version cannot be newer than the version configured in
+ * the Salesforce Camel component. Some of the batched requests are
+ * available only from certain Salesforce API versions, when this is the
+ * case it is noted in the documentation of the builder method, if uncertain
+ * consult the Salesforce API documentation.
*
- * @param apiVersion
- * API version for the batch request
+ * @param apiVersion API version for the batch request
*/
public SObjectBatch(final String apiVersion) {
final String givenApiVersion = Objects.requireNonNull(apiVersion, "apiVersion");
@@ -120,9 +123,7 @@ public final class SObjectBatch implements Serializable {
/**
* Add create SObject to the batch request.
*
- * @param data
- * object to create
- *
+ * @param data object to create
* @return this batch builder
*/
public SObjectBatch addCreate(final AbstractDescribedSObjectBase data) {
@@ -134,10 +135,8 @@ public final class SObjectBatch implements Serializable {
/**
* Add delete SObject with identifier to the batch request.
*
- * @param type
- * type of SObject
- * @param id
- * identifier of the object
+ * @param type type of SObject
+ * @param id identifier of the object
* @return this batch builder
*/
public SObjectBatch addDelete(final String type, final String id) {
@@ -147,14 +146,14 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Generic way to add requests to batch. Given URL starts from the version, so in order to retrieve SObject specify
- * just {@code /sobjects/Account/identifier} which results in
- * {@code /services/data/v37.0/sobjects/Account/identifier}. Note the leading slash.
+ * Generic way to add requests to batch. Given URL starts from the version,
+ * so in order to retrieve SObject specify just
+ * {@code /sobjects/Account/identifier} which results in
+ * {@code /services/data/v37.0/sobjects/Account/identifier}. Note the
+ * leading slash.
*
- * @param method
- * HTTP method
- * @param url
- * URL starting from the version
+ * @param method HTTP method
+ * @param url URL starting from the version
* @return this batch builder
*/
public SObjectBatch addGeneric(final Method method, final String url) {
@@ -164,16 +163,15 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Generic way to add requests to batch with {@code richInput} payload. Given URL starts from the version, so in
- * order to update SObject specify just {@code /sobjects/Account/identifier} which results in
- * {@code /services/data/v37.0/sobjects/Account/identifier}. Note the leading slash.
+ * Generic way to add requests to batch with {@code richInput} payload.
+ * Given URL starts from the version, so in order to update SObject specify
+ * just {@code /sobjects/Account/identifier} which results in
+ * {@code /services/data/v37.0/sobjects/Account/identifier}. Note the
+ * leading slash.
*
- * @param method
- * HTTP method
- * @param url
- * URL starting from the version
- * @param richInput
- * body of the request, to be placed in richInput
+ * @param method HTTP method
+ * @param url URL starting from the version
+ * @param richInput body of the request, to be placed in richInput
* @return this batch builder
*/
public SObjectBatch addGeneric(final Method method, final String url, final Object richInput) {
@@ -185,12 +183,9 @@ public final class SObjectBatch implements Serializable {
/**
* Add field retrieval of an SObject by identifier to the batch request.
*
- * @param type
- * type of SObject
- * @param id
- * identifier of SObject
- * @param fields
- * to return
+ * @param type type of SObject
+ * @param id identifier of SObject
+ * @param fields to return
* @return this batch builder
*/
public SObjectBatch addGet(final String type, final String id, final String... fields) {
@@ -202,16 +197,13 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Add field retrieval of an SObject by external identifier to the batch request.
+ * Add field retrieval of an SObject by external identifier to the batch
+ * request.
*
- * @param type
- * type of SObject
- * @param fieldName
- * external identifier field name
- * @param fieldValue
- * external identifier field value
- * @param fields
- * to return
+ * @param type type of SObject
+ * @param fieldName external identifier field name
+ * @param fieldValue external identifier field value
+ * @param fields to return
* @return this batch builder
*/
public SObjectBatch addGetByExternalId(final String type, final String fieldName, final String fieldValue) {
@@ -221,8 +213,9 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Add retrieval of related SObject fields by identifier. For example {@code Account} has a relation to
- * {@code CreatedBy}. To fetch fields from that related object ({@code User} SObject) use: <blockquote>
+ * Add retrieval of related SObject fields by identifier. For example
+ * {@code Account} has a relation to {@code CreatedBy}. To fetch fields from
+ * that related object ({@code User} SObject) use: <blockquote>
*
* <pre>
* {@code batch.addGetRelated("Account", identifier, "CreatedBy", "Name", "Id")}
@@ -230,24 +223,18 @@ public final class SObjectBatch implements Serializable {
*
* </blockquote>
*
- * @param type
- * type of SObject
- * @param id
- * identifier of SObject
- * @param relation
- * name of the related SObject field
- * @param fields
- * to return
+ * @param type type of SObject
+ * @param id identifier of SObject
+ * @param relation name of the related SObject field
+ * @param fields to return
* @return this batch builder
*/
- public SObjectBatch addGetRelated(final String type, final String id, final String relation,
- final String... fields) {
+ public SObjectBatch addGetRelated(final String type, final String id, final String relation, final String... fields) {
version.requireAtLeast(36, 0);
final String fieldsParameter = composeFieldsParameter(fields);
- addBatchRequest(new BatchRequest(Method.GET,
- rowBaseUrl(type, id) + "/" + notEmpty(relation, "relation") + fieldsParameter));
+ addBatchRequest(new BatchRequest(Method.GET, rowBaseUrl(type, id) + "/" + notEmpty(relation, "relation") + fieldsParameter));
return this;
}
@@ -266,8 +253,7 @@ public final class SObjectBatch implements Serializable {
/**
* Add retrieval of SObject records by query to the batch.
*
- * @param query
- * SOQL query to execute
+ * @param query SOQL query to execute
* @return this batch builder
*/
public SObjectBatch addQuery(final String query) {
@@ -279,8 +265,7 @@ public final class SObjectBatch implements Serializable {
/**
* Add retrieval of all SObject records by query to the batch.
*
- * @param query
- * SOQL query to execute
+ * @param query SOQL query to execute
* @return this batch builder
*/
public SObjectBatch addQueryAll(final String query) {
@@ -292,28 +277,24 @@ public final class SObjectBatch implements Serializable {
/**
* Add retrieval of SObject records by search to the batch.
*
- * @param query
- * SOSL search to execute
+ * @param query SOSL search to execute
* @return this batch builder
*/
public SObjectBatch addSearch(final String searchString) {
- addBatchRequest(
- new BatchRequest(Method.GET, apiPrefix + "/search/?q=" + notEmpty(searchString, "searchString")));
+ addBatchRequest(new BatchRequest(Method.GET, apiPrefix + "/search/?q=" + notEmpty(searchString, "searchString")));
return this;
}
/**
- * Add update of SObject record to the batch. The given {@code data} parameter must contain only the fields that
- * need updating and must not contain the {@code Id} field. So set any fields to {@code null} that you do not want
- * changed along with {@code Id} field.
+ * Add update of SObject record to the batch. The given {@code data}
+ * parameter must contain only the fields that need updating and must not
+ * contain the {@code Id} field. So set any fields to {@code null} that you
+ * do not want changed along with {@code Id} field.
*
- * @param type
- * type of SObject
- * @param id
- * identifier of SObject
- * @param data
- * SObject with fields to change
+ * @param type type of SObject
+ * @param id identifier of SObject
+ * @param data SObject with fields to change
* @return this batch builder
*/
public SObjectBatch addUpdate(final String type, final String id, final AbstractSObjectBase data) {
@@ -323,22 +304,18 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Add update of SObject record by external identifier to the batch. The given {@code data} parameter must contain
- * only the fields that need updating and must not contain the {@code Id} field. So set any fields to {@code null}
- * that you do not want changed along with {@code Id} field.
+ * Add update of SObject record by external identifier to the batch. The
+ * given {@code data} parameter must contain only the fields that need
+ * updating and must not contain the {@code Id} field. So set any fields to
+ * {@code null} that you do not want changed along with {@code Id} field.
*
- * @param type
- * type of SObject
- * @param fieldName
- * name of the field holding the external identifier
- * @param id
- * external identifier value
- * @param data
- * SObject with fields to change
+ * @param type type of SObject
+ * @param fieldName name of the field holding the external identifier
+ * @param id external identifier value
+ * @param data SObject with fields to change
* @return this batch builder
*/
- public SObjectBatch addUpdateByExternalId(final String type, final String fieldName, final String fieldValue,
- final AbstractSObjectBase data) {
+ public SObjectBatch addUpdateByExternalId(final String type, final String fieldName, final String fieldValue, final AbstractSObjectBase data) {
addBatchRequest(new BatchRequest(Method.PATCH, rowBaseUrl(type, fieldName, fieldValue), data));
@@ -346,22 +323,19 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Add insert or update of SObject record by external identifier to the batch. The given {@code data} parameter must
- * contain only the fields that need updating and must not contain the {@code Id} field. So set any fields to
- * {@code null} that you do not want changed along with {@code Id} field.
+ * Add insert or update of SObject record by external identifier to the
+ * batch. The given {@code data} parameter must contain only the fields that
+ * need updating and must not contain the {@code Id} field. So set any
+ * fields to {@code null} that you do not want changed along with {@code Id}
+ * field.
*
- * @param type
- * type of SObject
- * @param fieldName
- * name of the field holding the external identifier
- * @param id
- * external identifier value
- * @param data
- * SObject with fields to change
+ * @param type type of SObject
+ * @param fieldName name of the field holding the external identifier
+ * @param id external identifier value
+ * @param data SObject with fields to change
* @return this batch builder
*/
- public SObjectBatch addUpsertByExternalId(final String type, final String fieldName, final String fieldValue,
- final AbstractSObjectBase data) {
+ public SObjectBatch addUpsertByExternalId(final String type, final String fieldName, final String fieldValue, final AbstractSObjectBase data) {
return addUpdateByExternalId(type, fieldName, fieldValue, data);
}
@@ -386,14 +360,14 @@ public final class SObjectBatch implements Serializable {
}
/**
- * Returns all object types nested within this batch, needed for serialization.
+ * Returns all object types nested within this batch, needed for
+ * serialization.
*
* @return all object types in this batch
*/
public Class[] objectTypes() {
final Set<Class<?>> types = Stream
- .concat(Stream.of(SObjectBatch.class, BatchRequest.class),
- batchRequests.stream().map(BatchRequest::getRichInput).filter(Objects::nonNull).map(Object::getClass))
+ .concat(Stream.of(SObjectBatch.class, BatchRequest.class), batchRequests.stream().map(BatchRequest::getRichInput).filter(Objects::nonNull).map(Object::getClass))
.collect(Collectors.toSet());
return types.toArray(new Class[types.size()]);
@@ -401,8 +375,7 @@ public final class SObjectBatch implements Serializable {
void addBatchRequest(final BatchRequest batchRequest) {
if (batchRequests.size() >= MAX_BATCH) {
- throw new IllegalArgumentException("You can add up to " + MAX_BATCH
- + " requests in a single batch. Split your requests across multiple batches.");
+ throw new IllegalArgumentException("You can add up to " + MAX_BATCH + " requests in a single batch. Split your requests across multiple batches.");
}
batchRequests.add(batchRequest);
}
@@ -414,7 +387,7 @@ public final class SObjectBatch implements Serializable {
String rowBaseUrl(final String type, final String fieldName, final String fieldValue) {
try {
return apiPrefix + "/sobjects/" + notEmpty(type, SOBJECT_TYPE_PARAM) + "/" + notEmpty(fieldName, "fieldName") + "/"
- + URLEncoder.encode(notEmpty(fieldValue, "fieldValue"), StandardCharsets.UTF_8.name());
+ + URLEncoder.encode(notEmpty(fieldValue, "fieldValue"), StandardCharsets.UTF_8.name());
} catch (final UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResponse.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResponse.java
index c921a13..8b0cffb 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResponse.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResponse.java
@@ -24,8 +24,10 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.thoughtworks.xstream.annotations.XStreamAlias;
/**
- * The response of the batch request it contains individual results of each request submitted in a batch at the same
- * index. The flag {@link #hasErrors()} indicates if any of the requests in the batch has failed with status 400 or 500.
+ * The response of the batch request it contains individual results of each
+ * request submitted in a batch at the same index. The flag {@link #hasErrors()}
+ * indicates if any of the requests in the batch has failed with status 400 or
+ * 500.
*/
@XStreamAlias("batchResults")
public final class SObjectBatchResponse implements Serializable {
@@ -37,8 +39,9 @@ public final class SObjectBatchResponse implements Serializable {
private final List<SObjectBatchResult> results;
@JsonCreator
- public SObjectBatchResponse(@JsonProperty("hasErrors") final boolean hasErrors,
- @JsonProperty("results") final List<SObjectBatchResult> results) {
+ public SObjectBatchResponse(@JsonProperty("hasErrors")
+ final boolean hasErrors, @JsonProperty("results")
+ final List<SObjectBatchResult> results) {
this.hasErrors = hasErrors;
this.results = results;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResult.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResult.java
index 8830789..913510f 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResult.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectBatchResult.java
@@ -25,14 +25,19 @@ import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamConverter;
/**
- * Contains the individual result of Composite API batch request. As batch requests can partially succeed or fail make
- * sure you check the {@link #getStatusCode()} for status of the specific request. The result of the request can vary
- * from API to API so here it is given as {@link Object}, in most cases it will be a {@link Map} with string keys and
- * values or other {@link Map} as value. Requests made in JSON format hold some type information (i.e. it is known what
- * values are strings and what values are numbers), so in general those will be more type friendly. Note that the
- * responses will vary between XML and JSON, this is due to the responses from Salesforce API being different.
+ * Contains the individual result of Composite API batch request. As batch
+ * requests can partially succeed or fail make sure you check the
+ * {@link #getStatusCode()} for status of the specific request. The result of
+ * the request can vary from API to API so here it is given as {@link Object},
+ * in most cases it will be a {@link Map} with string keys and values or other
+ * {@link Map} as value. Requests made in JSON format hold some type information
+ * (i.e. it is known what values are strings and what values are numbers), so in
+ * general those will be more type friendly. Note that the responses will vary
+ * between XML and JSON, this is due to the responses from Salesforce API being
+ * different.
* <p>
- * For example response for SObject record creation in JSON will be: <blockquote>
+ * For example response for SObject record creation in JSON will be:
+ * <blockquote>
*
* <pre>
* {
@@ -47,14 +52,16 @@ import com.thoughtworks.xstream.annotations.XStreamConverter;
*
* </blockquote>
* <p>
- * Which will result in {@link #getResult()} returning {@link Map} created like: <blockquote>
+ * Which will result in {@link #getResult()} returning {@link Map} created like:
+ * <blockquote>
*
* <pre>
- * {@code
- * Map<String, Object> result = new HashMap<>();
- * result.put("id", "0010Y00000Ary91QAB");
- * result.put("success", Boolean.TRUE);
- * result.put("errors", Collections.emptyList());
+ * {
+ * @code
+ * Map<String, Object> result = new HashMap<>();
+ * result.put("id", "0010Y00000Ary91QAB");
+ * result.put("success", Boolean.TRUE);
+ * result.put("errors", Collections.emptyList());
* }
* </pre>
*
@@ -73,23 +80,26 @@ import com.thoughtworks.xstream.annotations.XStreamConverter;
*
* </blockquote>
* <p>
- * And that results in {@link #getResult()} returning {@link Map} created like: <blockquote>
+ * And that results in {@link #getResult()} returning {@link Map} created like:
+ * <blockquote>
*
* <pre>
- * {@code
- * Map<String, Object> result = new HashMap<>();
+ * {
+ * @code
+ * Map<String, Object> result = new HashMap<>();
*
- * Map<String, Object> nestedResult = new HashMap<>();
- * result.put("Result", nestedResult);
+ * Map<String, Object> nestedResult = new HashMap<>();
+ * result.put("Result", nestedResult);
*
- * nestedResult.put("id", "0010Y00000Ary91QAB");
- * nestedResult.put("success", "true");
+ * nestedResult.put("id", "0010Y00000Ary91QAB");
+ * nestedResult.put("success", "true");
* }
* </pre>
*
* </blockquote>
* <p>
- * Note the differences between type and nested {@link Map} one level deeper in the case of XML.
+ * Note the differences between type and nested {@link Map} one level deeper in
+ * the case of XML.
*/
@XStreamAlias("batchResult")
public final class SObjectBatchResult implements Serializable {
@@ -102,8 +112,9 @@ public final class SObjectBatchResult implements Serializable {
private final int statusCode;
@JsonCreator
- public SObjectBatchResult(@JsonProperty("statusCode") final int statusCode,
- @JsonProperty("result") final Object result) {
+ public SObjectBatchResult(@JsonProperty("statusCode")
+ final int statusCode, @JsonProperty("result")
+ final Object result) {
this.statusCode = statusCode;
this.result = result;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectComposite.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectComposite.java
index 5caf17a..dfbcd96 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectComposite.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectComposite.java
@@ -50,13 +50,12 @@ import static org.apache.camel.util.StringHelper.notEmpty;
* executed in the context of the same user. In a subrequest’s body, you specify
* a reference ID that maps to the subrequest’s response. You can then refer to
* the ID in the url or body fields of later subrequests by using a
- * JavaScript-like reference notation.
- *
- * Most requests that are supported in the Composite batch API the helper
- * builder methods are provided. For batch requests that do not have their
- * corresponding helper builder method, use {@link #addGeneric(Method, String)}
- * or {@link #addGeneric(Method, String, Object)} methods. To build the batch
- * use: <blockquote>
+ * JavaScript-like reference notation. Most requests that are supported in the
+ * Composite batch API the helper builder methods are provided. For batch
+ * requests that do not have their corresponding helper builder method, use
+ * {@link #addGeneric(Method, String)} or
+ * {@link #addGeneric(Method, String, Object)} methods. To build the batch use:
+ * <blockquote>
*
* <pre>
* {@code
@@ -72,12 +71,9 @@ import static org.apache.camel.util.StringHelper.notEmpty;
* composite.addCreate(payment, "NewPayment1");
* composite.addCreate(payment, "NewPayment2");
* }
- *
* </pre>
*
- * </blockquote>
- *
- * This will build a composite of two insert operations.
+ * </blockquote> This will build a composite of two insert operations.
*/
@XStreamAlias("batch")
public final class SObjectComposite implements Serializable {
@@ -127,12 +123,10 @@ public final class SObjectComposite implements Serializable {
* Add create SObject to the composite request.
*
* @param data object to create
- *
* @return this batch builder
*/
public SObjectComposite addCreate(final AbstractDescribedSObjectBase data, final String referenceId) {
- addCompositeRequest(
- new CompositeRequest(Method.POST, apiPrefix + "/sobjects/" + typeOf(data) + "/", data, referenceId));
+ addCompositeRequest(new CompositeRequest(Method.POST, apiPrefix + "/sobjects/" + typeOf(data) + "/", data, referenceId));
return this;
}
@@ -162,8 +156,7 @@ public final class SObjectComposite implements Serializable {
* @param richInput body of the request, to be placed in richInput
* @return this batch builder
*/
- public SObjectComposite addGeneric(final Method method, final String url, final Object richInput,
- final String referenceId) {
+ public SObjectComposite addGeneric(final Method method, final String url, final Object richInput, final String referenceId) {
addCompositeRequest(new CompositeRequest(method, apiPrefix + url, richInput, referenceId));
return this;
@@ -194,8 +187,7 @@ public final class SObjectComposite implements Serializable {
* @param fields to return
* @return this batch builder
*/
- public SObjectComposite addGet(final String type, final String id, final String referenceId,
- final String... fields) {
+ public SObjectComposite addGet(final String type, final String id, final String referenceId, final String... fields) {
final String fieldsParameter = composeFieldsParameter(fields);
addCompositeRequest(new CompositeRequest(Method.GET, rowBaseUrl(type, id) + fieldsParameter, referenceId));
@@ -213,8 +205,7 @@ public final class SObjectComposite implements Serializable {
* @param fields to return
* @return this batch builder
*/
- public SObjectComposite addGetByExternalId(final String type, final String fieldName, final String fieldValue,
- final String referenceId) {
+ public SObjectComposite addGetByExternalId(final String type, final String fieldName, final String fieldValue, final String referenceId) {
addCompositeRequest(new CompositeRequest(Method.GET, rowBaseUrl(type, fieldName, fieldValue), referenceId));
return this;
@@ -237,14 +228,12 @@ public final class SObjectComposite implements Serializable {
* @param fields to return
* @return this batch builder
*/
- public SObjectComposite addGetRelated(final String type, final String id, final String relation,
- final String referenceId, final String... fields) {
+ public SObjectComposite addGetRelated(final String type, final String id, final String relation, final String referenceId, final String... fields) {
version.requireAtLeast(36, 0);
final String fieldsParameter = composeFieldsParameter(fields);
- addCompositeRequest(new CompositeRequest(Method.GET,
- rowBaseUrl(type, id) + "/" + notEmpty(relation, "relation") + fieldsParameter, referenceId));
+ addCompositeRequest(new CompositeRequest(Method.GET, rowBaseUrl(type, id) + "/" + notEmpty(relation, "relation") + fieldsParameter, referenceId));
return this;
}
@@ -256,8 +245,7 @@ public final class SObjectComposite implements Serializable {
* @return this batch builder
*/
public SObjectComposite addQuery(final String query, final String referenceId) {
- addCompositeRequest(
- new CompositeRequest(Method.GET, apiPrefix + "/query/?q=" + notEmpty(query, "query"), referenceId));
+ addCompositeRequest(new CompositeRequest(Method.GET, apiPrefix + "/query/?q=" + notEmpty(query, "query"), referenceId));
return this;
}
@@ -269,8 +257,7 @@ public final class SObjectComposite implements Serializable {
* @return this batch builder
*/
public SObjectComposite addQueryAll(final String query, final String referenceId) {
- addCompositeRequest(
- new CompositeRequest(Method.GET, apiPrefix + "/queryAll/?q=" + notEmpty(query, "query"), referenceId));
+ addCompositeRequest(new CompositeRequest(Method.GET, apiPrefix + "/queryAll/?q=" + notEmpty(query, "query"), referenceId));
return this;
}
@@ -286,10 +273,8 @@ public final class SObjectComposite implements Serializable {
* @param data SObject with fields to change
* @return this batch builder
*/
- public SObjectComposite addUpdate(final String type, final String id, final AbstractSObjectBase data,
- final String referenceId) {
- addCompositeRequest(
- new CompositeRequest(Method.PATCH, rowBaseUrl(type, notEmpty(id, "data.Id")), data, referenceId));
+ public SObjectComposite addUpdate(final String type, final String id, final AbstractSObjectBase data, final String referenceId) {
+ addCompositeRequest(new CompositeRequest(Method.PATCH, rowBaseUrl(type, notEmpty(id, "data.Id")), data, referenceId));
return this;
}
@@ -306,11 +291,9 @@ public final class SObjectComposite implements Serializable {
* @param data SObject with fields to change
* @return this batch builder
*/
- public SObjectComposite addUpdateByExternalId(final String type, final String fieldName, final String fieldValue,
- final AbstractSObjectBase data, final String referenceId) {
+ public SObjectComposite addUpdateByExternalId(final String type, final String fieldName, final String fieldValue, final AbstractSObjectBase data, final String referenceId) {
- addCompositeRequest(
- new CompositeRequest(Method.PATCH, rowBaseUrl(type, fieldName, fieldValue), data, referenceId));
+ addCompositeRequest(new CompositeRequest(Method.PATCH, rowBaseUrl(type, fieldName, fieldValue), data, referenceId));
return this;
}
@@ -328,8 +311,7 @@ public final class SObjectComposite implements Serializable {
* @param data SObject with fields to change
* @return this batch builder
*/
- public SObjectComposite addUpsertByExternalId(final String type, final String fieldName, final String fieldValue,
- final AbstractSObjectBase data, final String referenceId) {
+ public SObjectComposite addUpsertByExternalId(final String type, final String fieldName, final String fieldValue, final AbstractSObjectBase data, final String referenceId) {
return addUpdateByExternalId(type, fieldName, fieldValue, data, referenceId);
}
@@ -367,8 +349,7 @@ public final class SObjectComposite implements Serializable {
@SuppressWarnings("rawtypes")
public Class[] objectTypes() {
final Set<Class<?>> types = Stream
- .concat(Stream.of(SObjectComposite.class, BatchRequest.class), compositeRequests.stream()
- .map(CompositeRequest::getBody).filter(Objects::nonNull).map(Object::getClass))
+ .concat(Stream.of(SObjectComposite.class, BatchRequest.class), compositeRequests.stream().map(CompositeRequest::getBody).filter(Objects::nonNull).map(Object::getClass))
.collect(Collectors.toSet());
return types.toArray(new Class[types.size()]);
@@ -377,7 +358,7 @@ public final class SObjectComposite implements Serializable {
void addCompositeRequest(final CompositeRequest compositeRequest) {
if (compositeRequests.size() >= MAX_COMPOSITE_OPERATIONS) {
throw new IllegalArgumentException("You can add up to " + MAX_COMPOSITE_OPERATIONS
- + " requests in a single composite request. Split your requests across multiple composite request.");
+ + " requests in a single composite request. Split your requests across multiple composite request.");
}
compositeRequests.add(compositeRequest);
}
@@ -388,9 +369,8 @@ public final class SObjectComposite implements Serializable {
String rowBaseUrl(final String type, final String fieldName, final String fieldValue) {
try {
- return apiPrefix + "/sobjects/" + notEmpty(type, SOBJECT_TYPE_PARAM) + "/"
- + notEmpty(fieldName, "fieldName") + "/"
- + URLEncoder.encode(notEmpty(fieldValue, "fieldValue"), StandardCharsets.UTF_8.name());
+ return apiPrefix + "/sobjects/" + notEmpty(type, SOBJECT_TYPE_PARAM) + "/" + notEmpty(fieldName, "fieldName") + "/"
+ + URLEncoder.encode(notEmpty(fieldValue, "fieldValue"), StandardCharsets.UTF_8.name());
} catch (final UnsupportedEncodingException e) {
throw new IllegalStateException(e);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResponse.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResponse.java
index d95411e..98d5529 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResponse.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResponse.java
@@ -35,7 +35,8 @@ public final class SObjectCompositeResponse implements Serializable {
private final List<SObjectCompositeResult> compositeResponse;
@JsonCreator
- public SObjectCompositeResponse(@JsonProperty("results") final List<SObjectCompositeResult> compositeResponse) {
+ public SObjectCompositeResponse(@JsonProperty("results")
+ final List<SObjectCompositeResult> compositeResponse) {
this.compositeResponse = compositeResponse;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResult.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResult.java
index ad0dc16..6456a97 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResult.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectCompositeResult.java
@@ -42,10 +42,11 @@ public final class SObjectCompositeResult implements Serializable {
private final String referenceId;
@JsonCreator
- public SObjectCompositeResult(@JsonProperty("body") final Object body,
- @JsonProperty("headers") final Map<String, String> headers,
- @JsonProperty("httpStatusCode") final int httpStatusCode,
- @JsonProperty("referenceID") final String referenceId) {
+ public SObjectCompositeResult(@JsonProperty("body")
+ final Object body, @JsonProperty("headers")
+ final Map<String, String> headers, @JsonProperty("httpStatusCode")
+ final int httpStatusCode, @JsonProperty("referenceID")
+ final String referenceId) {
this.body = body;
httpHeaders = headers;
this.httpStatusCode = httpStatusCode;
@@ -70,7 +71,6 @@ public final class SObjectCompositeResult implements Serializable {
@Override
public String toString() {
- return "SObjectCompositeResult [body=" + body + ", headers=" + httpHeaders + ", httpStatusCode="
- + httpStatusCode + ", referenceId=" + referenceId + "]";
+ return "SObjectCompositeResult [body=" + body + ", headers=" + httpHeaders + ", httpStatusCode=" + httpStatusCode + ", referenceId=" + referenceId + "]";
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNode.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNode.java
index 31bb809..d19ed05 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNode.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNode.java
@@ -44,17 +44,20 @@ import org.apache.camel.component.salesforce.api.dto.SObjectDescription;
import org.apache.camel.util.ObjectHelper;
/**
- * Represents one node in the SObject tree request. SObject trees ({@link SObjectTree}) are composed from instances of
- * {@link SObjectNode}s. Each {@link SObjectNode} contains the SObject ({@link AbstractSObjectBase})
- * and any child records linked to it. SObjects at root level are added to {@link SObjectTree} using
- * {@link SObjectTree#addObject(AbstractSObjectBase)}, then you can add child records on the {@link SObjectNode}
- * returned by using {@link #addChild(AbstractDescribedSObjectBase)},
- * {@link #addChildren(AbstractDescribedSObjectBase, AbstractDescribedSObjectBase...)} or
- * {@link #addChild(String, AbstractSObjectBase)} and
+ * Represents one node in the SObject tree request. SObject trees
+ * ({@link SObjectTree}) are composed from instances of {@link SObjectNode}s.
+ * Each {@link SObjectNode} contains the SObject ({@link AbstractSObjectBase})
+ * and any child records linked to it. SObjects at root level are added to
+ * {@link SObjectTree} using {@link SObjectTree#addObject(AbstractSObjectBase)},
+ * then you can add child records on the {@link SObjectNode} returned by using
+ * {@link #addChild(AbstractDescribedSObjectBase)},
+ * {@link #addChildren(AbstractDescribedSObjectBase, AbstractDescribedSObjectBase...)}
+ * or {@link #addChild(String, AbstractSObjectBase)} and
* {@link #addChildren(String, AbstractSObjectBase, AbstractSObjectBase...)}.
* <p/>
- * Upon submission to the Salesforce Composite API the {@link SObjectTree} and the {@link SObjectNode}s in it might
- * contain errors that you need to fetch using {@link #getErrors()} method.
+ * Upon submission to the Salesforce Composite API the {@link SObjectTree} and
+ * the {@link SObjectNode}s in it might contain errors that you need to fetch
+ * using {@link #getErrors()} method.
*
* @see SObjectTree
* @see RestError
@@ -83,8 +86,7 @@ public final class SObjectNode implements Serializable {
this(tree.referenceGenerator, typeOf(object), object);
}
- private SObjectNode(final ReferenceGenerator referenceGenerator, final String type,
- final AbstractSObjectBase object) {
+ private SObjectNode(final ReferenceGenerator referenceGenerator, final String type, final AbstractSObjectBase object) {
this.referenceGenerator = requireNonNull(referenceGenerator, "ReferenceGenerator cannot be null");
this.object = requireNonNull(object, "Root SObject cannot be null");
object.getAttributes().setReferenceId(referenceGenerator.nextReferenceFor(object));
@@ -106,11 +108,12 @@ public final class SObjectNode implements Serializable {
}
/**
- * Add a described child with the metadata needed already present within it to the this node.
+ * Add a described child with the metadata needed already present within it
+ * to the this node.
*
- * @param child
- * to add
- * @return the newly created node, used in builder fashion to add more child objects to it (on the next level)
+ * @param child to add
+ * @return the newly created node, used in builder fashion to add more child
+ * objects to it (on the next level)
*/
public SObjectNode addChild(final AbstractDescribedSObjectBase child) {
ObjectHelper.notNull(child, CHILD_PARAM);
@@ -119,14 +122,14 @@ public final class SObjectNode implements Serializable {
}
/**
- * Add a child that does not contain the required metadata to the this node. You need to specify the plural form of
- * the child (e.g. `Account` its `Accounts`).
+ * Add a child that does not contain the required metadata to the this node.
+ * You need to specify the plural form of the child (e.g. `Account` its
+ * `Accounts`).
*
- * @param labelPlural
- * plural form
- * @param child
- * to add
- * @return the newly created node, used in builder fashion to add more child objects to it (on the next level)
+ * @param labelPlural plural form
+ * @param child to add
+ * @return the newly created node, used in builder fashion to add more child
+ * objects to it (on the next level)
*/
public SObjectNode addChild(final String labelPlural, final AbstractSObjectBase child) {
ObjectHelper.notNull(labelPlural, "labelPlural");
@@ -138,12 +141,11 @@ public final class SObjectNode implements Serializable {
}
/**
- * Add multiple described children with the metadata needed already present within them to the this node..
+ * Add multiple described children with the metadata needed already present
+ * within them to the this node..
*
- * @param first
- * first child to add
- * @param others
- * any other children to add
+ * @param first first child to add
+ * @param others any other children to add
*/
public void addChildren(final AbstractDescribedSObjectBase first, final AbstractDescribedSObjectBase... others) {
ObjectHelper.notNull(first, "first");
@@ -155,18 +157,15 @@ public final class SObjectNode implements Serializable {
}
/**
- * Add a child that does not contain the required metadata to the this node. You need to specify the plural form of
- * the child (e.g. `Account` its `Accounts`).
+ * Add a child that does not contain the required metadata to the this node.
+ * You need to specify the plural form of the child (e.g. `Account` its
+ * `Accounts`).
*
- * @param labelPlural
- * plural form
- * @param first
- * first child to add
- * @param others
- * any other children to add
+ * @param labelPlural plural form
+ * @param first first child to add
+ * @param others any other children to add
*/
- public void addChildren(final String labelPlural, final AbstractSObjectBase first,
- final AbstractSObjectBase... others) {
+ public void addChildren(final String labelPlural, final AbstractSObjectBase first, final AbstractSObjectBase... others) {
ObjectHelper.notNull(labelPlural, "labelPlural");
ObjectHelper.notNull(first, "first");
ObjectHelper.notNull(others, "others");
@@ -187,10 +186,11 @@ public final class SObjectNode implements Serializable {
}
/**
- * Returns all children of this node (one level deep) of certain type (in plural form).
+ * Returns all children of this node (one level deep) of certain type (in
+ * plural form).
*
- * @param type
- * type of child requested in plural form (e.g for `Account` is `Accounts`)
+ * @param type type of child requested in plural form (e.g for `Account` is
+ * `Accounts`)
* @return children of this node of specified type
*/
public Stream<SObjectNode> getChildNodesOfType(final String type) {
@@ -210,10 +210,11 @@ public final class SObjectNode implements Serializable {
}
/**
- * Returns child SObjects of this node (one level deep) of certain type (in plural form)
+ * Returns child SObjects of this node (one level deep) of certain type (in
+ * plural form)
*
- * @param type
- * type of child requested in plural form (e.g for `Account` is `Accounts`)
+ * @param type type of child requested in plural form (e.g for `Account` is
+ * `Accounts`)
* @return child SObjects of this node
*/
public Stream<AbstractSObjectBase> getChildrenOfType(final String type) {
@@ -223,7 +224,8 @@ public final class SObjectNode implements Serializable {
}
/**
- * Errors reported against this this node received in response to the SObject tree being submitted.
+ * Errors reported against this this node received in response to the
+ * SObject tree being submitted.
*
* @return errors for this node
*/
@@ -279,8 +281,7 @@ public final class SObjectNode implements Serializable {
@JsonAnyGetter
Map<String, Map<String, List<SObjectNode>>> children() {
- return records.entrySet().stream()
- .collect(Collectors.toMap(Map.Entry::getKey, e -> Collections.singletonMap("records", e.getValue())));
+ return records.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, e -> Collections.singletonMap("records", e.getValue())));
}
@JsonIgnore
@@ -289,7 +290,7 @@ public final class SObjectNode implements Serializable {
}
Stream<Class> objectTypes() {
- return Stream.concat(Stream.of((Class) object.getClass()), getChildNodes().flatMap(SObjectNode::objectTypes));
+ return Stream.concat(Stream.of((Class)object.getClass()), getChildNodes().flatMap(SObjectNode::objectTypes));
}
void setErrors(final List<RestError> errors) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNodeXStreamConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNodeXStreamConverter.java
index 44faa59..71edd0d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNodeXStreamConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectNodeXStreamConverter.java
@@ -35,7 +35,7 @@ public final class SObjectNodeXStreamConverter implements Converter {
@Override
public void marshal(final Object source, final HierarchicalStreamWriter writer, final MarshallingContext context) {
- final SObjectNode node = (SObjectNode) source;
+ final SObjectNode node = (SObjectNode)source;
writer.addAttribute("type", node.object.getAttributes().getType());
writer.addAttribute("referenceId", node.object.getAttributes().getReferenceId());
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
index fa73d86..a65343d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTree.java
@@ -48,8 +48,9 @@ import org.apache.camel.component.salesforce.api.dto.RestError;
import org.apache.camel.util.ObjectHelper;
/**
- * Payload and response for the SObject tree Composite API. The main interface for specifying what to include in the
- * sumission to the API endpoint. To build the tree out use: <blockquote>
+ * Payload and response for the SObject tree Composite API. The main interface
+ * for specifying what to include in the sumission to the API endpoint. To build
+ * the tree out use: <blockquote>
*
* <pre>
* {@code
@@ -67,9 +68,7 @@ import org.apache.camel.util.ObjectHelper;
* }
* </pre>
*
- * </blockquote>
- *
- * This will generate a tree of SObjects resembling: <blockquote>
+ * </blockquote> This will generate a tree of SObjects resembling: <blockquote>
*
* <pre>
* .
@@ -81,11 +80,11 @@ import org.apache.camel.util.ObjectHelper;
* `-- someAsset
* </pre>
*
- * </blockquote>
- *
- * By default references that correlate between SObjects in the tree and returned identifiers and errors are handled
- * automatically, if you wish to customize the generation of the reference implement {@link ReferenceGenerator} and
- * supply it as constructor argument to {@link #SObjectTree(ReferenceGenerator)}.
+ * </blockquote> By default references that correlate between SObjects in the
+ * tree and returned identifiers and errors are handled automatically, if you
+ * wish to customize the generation of the reference implement
+ * {@link ReferenceGenerator} and supply it as constructor argument to
+ * {@link #SObjectTree(ReferenceGenerator)}.
* <p/>
* Note that the tree can hold single object type at the root of the tree.
*
@@ -120,15 +119,13 @@ public final class SObjectTree implements Serializable {
* Create new SObject tree with custom {@link ReferenceGenerator}.
*/
public SObjectTree(final ReferenceGenerator referenceGenerator) {
- this.referenceGenerator = requireNonNull(referenceGenerator,
- "You must specify the ReferenceGenerator implementation");
+ this.referenceGenerator = requireNonNull(referenceGenerator, "You must specify the ReferenceGenerator implementation");
}
/**
* Add SObject at the root of the tree.
*
- * @param object
- * SObject to add
+ * @param object SObject to add
* @return {@link SObjectNode} for the given SObject
*/
public SObjectNode addObject(final AbstractSObjectBase object) {
@@ -172,12 +169,11 @@ public final class SObjectTree implements Serializable {
}
/**
- * Sets errors for the given reference. Used when processing the response of API invocation.
+ * Sets errors for the given reference. Used when processing the response of
+ * API invocation.
*
- * @param referenceId
- * reference identifier
- * @param errors
- * list of {@link RestError}
+ * @param referenceId reference identifier
+ * @param errors list of {@link RestError}
*/
public void setErrorFor(final String referenceId, final List<RestError> errors) {
for (final SObjectNode node : records) {
@@ -188,12 +184,11 @@ public final class SObjectTree implements Serializable {
}
/**
- * Sets identifier of SObject for the given reference. Used when processing the response of API invocation.
+ * Sets identifier of SObject for the given reference. Used when processing
+ * the response of API invocation.
*
- * @param referenceId
- * reference identifier
- * @param id
- * SObject identifier
+ * @param referenceId reference identifier
+ * @param id SObject identifier
*/
public void setIdFor(final String referenceId, final String id) {
for (final SObjectNode node : records) {
@@ -216,8 +211,8 @@ public final class SObjectTree implements Serializable {
final String givenObjectType = node.getObjectType();
if (objectType != null && !objectType.equals(givenObjectType)) {
- throw new IllegalArgumentException("SObjectTree can hold only records of the same type, previously given: "
- + objectType + ", and now trying to add: " + givenObjectType);
+ throw new IllegalArgumentException("SObjectTree can hold only records of the same type, previously given: " + objectType + ", and now trying to add: "
+ + givenObjectType);
}
objectType = givenObjectType;
@@ -227,8 +222,7 @@ public final class SObjectTree implements Serializable {
}
boolean setErrorFor(final SObjectNode node, final String referenceId, final List<RestError> errors) {
- final Attributes attributes =
- node.getObject().getAttributes();
+ final Attributes attributes = node.getObject().getAttributes();
final String attributesReferenceId = attributes.getReferenceId();
@@ -237,13 +231,11 @@ public final class SObjectTree implements Serializable {
return true;
}
- return StreamSupport.stream(node.getChildNodes().spliterator(), false)
- .anyMatch(n -> setErrorFor(n, referenceId, errors));
+ return StreamSupport.stream(node.getChildNodes().spliterator(), false).anyMatch(n -> setErrorFor(n, referenceId, errors));
}
boolean setIdFor(final SObjectNode node, final String referenceId, final String id) {
- final Attributes attributes =
- node.getObject().getAttributes();
+ final Attributes attributes = node.getObject().getAttributes();
final String attributesReferenceId = attributes.getReferenceId();
@@ -251,14 +243,13 @@ public final class SObjectTree implements Serializable {
final Object object = node.getObject();
if (object != null) {
- return updateBaseObjectId(id, (AbstractSObjectBase) object);
+ return updateBaseObjectId(id, (AbstractSObjectBase)object);
} else {
return updateGeneralObjectId(id, object);
}
}
- return StreamSupport.stream(node.getChildNodes().spliterator(), false)
- .anyMatch(n -> setIdFor(n, referenceId, id));
+ return StreamSupport.stream(node.getChildNodes().spliterator(), false).anyMatch(n -> setIdFor(n, referenceId, id));
}
boolean updateBaseObjectId(final String id, final AbstractSObjectBase object) {
@@ -278,8 +269,7 @@ public final class SObjectTree implements Serializable {
final PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors();
- final Optional<PropertyDescriptor> maybeIdProperty = Arrays.stream(propertyDescriptors)
- .filter(pd -> "id".equals(pd.getName())).findFirst();
+ final Optional<PropertyDescriptor> maybeIdProperty = Arrays.stream(propertyDescriptors).filter(pd -> "id".equals(pd.getName())).findFirst();
if (maybeIdProperty.isPresent()) {
final Method readMethod = maybeIdProperty.get().getReadMethod();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTreeResponse.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTreeResponse.java
index 35e82ea..51aca17 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTreeResponse.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/composite/SObjectTreeResponse.java
@@ -32,8 +32,10 @@ import org.apache.camel.component.salesforce.api.dto.RestError;
/**
* Response from the SObject tree Composite API invocation.
*/
-@XStreamAlias("Result") // you might be wondering why `Result` and not `SObjectTreeResponse` as in documentation, well,
- // the difference between documentation and practice is usually found in practice, this depends
+@XStreamAlias("Result") // you might be wondering why `Result` and not
+ // `SObjectTreeResponse` as in documentation, well,
+ // the difference between documentation and practice is
+ // usually found in practice, this depends
// on the version of the API that's used
public final class SObjectTreeResponse implements Serializable {
@@ -45,8 +47,9 @@ public final class SObjectTreeResponse implements Serializable {
private final List<ReferenceId> results;
@JsonCreator
- public SObjectTreeResponse(@JsonProperty("hasErrors") final boolean hasErrors,
- @JsonProperty("results") final List<ReferenceId> results) {
+ public SObjectTreeResponse(@JsonProperty("hasErrors")
+ final boolean hasErrors, @JsonProperty("results")
+ final List<ReferenceId> results) {
this.hasErrors = hasErrors;
this.results = Optional.ofNullable(results).orElse(Collections.emptyList());
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantConverter.java
index 6162c79..b188d20 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantConverter.java
@@ -32,7 +32,8 @@ final class InstantConverter implements SingleValueConverter {
}
@Override
- public boolean canConvert(@SuppressWarnings("rawtypes") final Class type) {
+ public boolean canConvert(@SuppressWarnings("rawtypes")
+ final Class type) {
return Instant.class.equals(type);
}
@@ -47,7 +48,7 @@ final class InstantConverter implements SingleValueConverter {
return null;
}
- final Instant instant = (Instant) value;
+ final Instant instant = (Instant)value;
return ISO_OFFSET_DATE_TIME.format(instant.atZone(ZoneId.systemDefault()));
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantSerializer.java
index 6f7f3eb..d502e48 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantSerializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/InstantSerializer.java
@@ -37,8 +37,7 @@ final class InstantSerializer extends StdSerializer<Instant> {
}
@Override
- public void serialize(final Instant value, final JsonGenerator gen, final SerializerProvider serializers)
- throws IOException {
+ public void serialize(final Instant value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException {
final ZonedDateTime zonedDateTime = value.atZone(ZoneId.systemDefault());
serializers.defaultSerializeValue(zonedDateTime, gen);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/JsonUtils.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/JsonUtils.java
index f3768f3..9598a1b 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/JsonUtils.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/JsonUtils.java
@@ -64,7 +64,8 @@ import org.apache.camel.component.salesforce.api.dto.SObjectField;
import org.apache.camel.impl.engine.DefaultPackageScanClassResolver;
/**
- * Factory class for creating {@linkplain com.fasterxml.jackson.databind.ObjectMapper}
+ * Factory class for creating
+ * {@linkplain com.fasterxml.jackson.databind.ObjectMapper}
*/
public abstract class JsonUtils {
@@ -91,16 +92,12 @@ public abstract class JsonUtils {
Set<Class<?>> schemaClasses = new HashSet<>();
// get non-abstract extensions of AbstractDTOBase
- schemaClasses.addAll(packageScanClassResolver.findByFilter(
- type -> !Modifier.isAbstract(type.getModifiers())
- && AbstractDTOBase.class.isAssignableFrom(type),
- "org.apache.camel.component.salesforce.api.dto"));
+ schemaClasses.addAll(packageScanClassResolver.findByFilter(type -> !Modifier.isAbstract(type.getModifiers()) && AbstractDTOBase.class.isAssignableFrom(type),
+ "org.apache.camel.component.salesforce.api.dto"));
// get non-abstract extensions of AbstractDTOBase
- schemaClasses.addAll(packageScanClassResolver.findByFilter(
- type -> !Modifier.isAbstract(type.getModifiers())
- && AbstractDTOBase.class.isAssignableFrom(type),
- "org.apache.camel.component.salesforce.api.dto"));
+ schemaClasses.addAll(packageScanClassResolver.findByFilter(type -> !Modifier.isAbstract(type.getModifiers()) && AbstractDTOBase.class.isAssignableFrom(type),
+ "org.apache.camel.component.salesforce.api.dto"));
Set<JsonSchema> allSchemas = new HashSet<>();
for (Class<?> aClass : schemaClasses) {
@@ -122,7 +119,7 @@ public abstract class JsonUtils {
rootSchema.set$schema(SCHEMA4);
rootSchema.setId(id);
@SuppressWarnings({"unchecked", "rawtypes"})
- Set<Object> tmp = (Set) allSchemas;
+ Set<Object> tmp = (Set)allSchemas;
rootSchema.setOneOf(tmp);
return rootSchema;
@@ -146,7 +143,8 @@ public abstract class JsonUtils {
return getJsonSchemaAsSchema(getSObjectJsonSchema(schemaObjectMapper, description, DEFAULT_ID_PREFIX, addQuerySchema), DEFAULT_ID_PREFIX);
}
- public static Set<JsonSchema> getSObjectJsonSchema(ObjectMapper objectMapper, SObjectDescription description, String idPrefix, boolean addQuerySchema) throws JsonProcessingException {
+ public static Set<JsonSchema> getSObjectJsonSchema(ObjectMapper objectMapper, SObjectDescription description, String idPrefix, boolean addQuerySchema)
+ throws JsonProcessingException {
Set<JsonSchema> allSchemas = new HashSet<>();
// generate SObject schema from description
@@ -166,7 +164,8 @@ public abstract class JsonUtils {
case "ID": // mapping for tns:ID SOAP type
case "string":
case "base64Binary":
- // Salesforce maps any types like string, picklist, reference, etc. to string
+ // Salesforce maps any types like string, picklist, reference,
+ // etc. to string
case "anyType":
fieldSchema = new StringSchema();
break;
@@ -194,16 +193,16 @@ public abstract class JsonUtils {
case "date":
fieldSchema = new StringSchema();
- ((StringSchema) fieldSchema).setFormat(JsonValueFormat.DATE);
+ ((StringSchema)fieldSchema).setFormat(JsonValueFormat.DATE);
break;
- case "dateTime":
+ case "dateTime":
case "g":
fieldSchema = new StringSchema();
- ((StringSchema) fieldSchema).setFormat(JsonValueFormat.DATE_TIME);
+ ((StringSchema)fieldSchema).setFormat(JsonValueFormat.DATE_TIME);
break;
case "time":
fieldSchema = new StringSchema();
- ((StringSchema) fieldSchema).setFormat(JsonValueFormat.TIME);
+ ((StringSchema)fieldSchema).setFormat(JsonValueFormat.TIME);
break;
case "address":
@@ -227,19 +226,15 @@ public abstract class JsonUtils {
List<PickListValue> picklistValues = field.getPicklistValues();
switch (field.getType()) {
case "picklist":
- fieldSchema.asStringSchema().setEnums(
- picklistValues == null ? Collections.emptySet() : picklistValues.stream()
- .map(PickListValue::getValue)
- .distinct()
- .collect(Collectors.toSet()));
+ fieldSchema.asStringSchema()
+ .setEnums(picklistValues == null ? Collections.emptySet() : picklistValues.stream().map(PickListValue::getValue).distinct().collect(Collectors.toSet()));
break;
case "multipicklist":
- // TODO regex needs more work to not allow values not separated by ','
- fieldSchema.asStringSchema().setPattern(picklistValues == null ? "" : picklistValues.stream()
- .map(val -> "(,?(" + val.getValue() + "))")
- .distinct()
- .collect(joining("|", "(", ")")));
+ // TODO regex needs more work to not allow values not separated
+ // by ','
+ fieldSchema.asStringSchema()
+ .setPattern(picklistValues == null ? "" : picklistValues.stream().map(val -> "(,?(" + val.getValue() + "))").distinct().collect(joining("|", "(", ")")));
break;
default:
@@ -253,20 +248,12 @@ public abstract class JsonUtils {
fieldSchema.setReadonly(!field.isUpdateable());
}
- final String descriptionText = Arrays.asList(new Object[] {
- "unique",
- field.isUnique()
- }, new Object[] {
- "idLookup",
- field.isIdLookup()
- }, new Object[] {
- "autoNumber",
- field.isAutoNumber()
- }, new Object[] {
- "calculated",
- field.isCalculated()
- }).stream().filter(ary -> Boolean.TRUE.equals(ary[1])).map(ary -> String.valueOf(ary[0])).collect(Collectors.joining(","));
- // JSON schema currently does not support the above attributes so we'll store this information
+ final String descriptionText = Arrays
+ .asList(new Object[] {"unique", field.isUnique()}, new Object[] {"idLookup", field.isIdLookup()}, new Object[] {"autoNumber", field.isAutoNumber()},
+ new Object[] {"calculated", field.isCalculated()})
+ .stream().filter(ary -> Boolean.TRUE.equals(ary[1])).map(ary -> String.valueOf(ary[0])).collect(Collectors.joining(","));
+ // JSON schema currently does not support the above attributes so
+ // we'll store this information
// in the description
fieldSchema.setDescription(descriptionText);
@@ -326,20 +313,18 @@ public abstract class JsonUtils {
}
public static ObjectMapper withNullSerialization(final ObjectMapper objectMapper) {
- final SerializerFactory factory = BeanSerializerFactory.instance
- .withSerializerModifier(new BeanSerializerModifier() {
- @Override
- public JsonSerializer<?> modifySerializer(final SerializationConfig config,
- final BeanDescription beanDesc, final JsonSerializer<?> serializer) {
- for (final PropertyWriter writer : (Iterable<PropertyWriter>) serializer::properties) {
- if (writer instanceof BeanPropertyWriter) {
- ((BeanPropertyWriter) writer).assignNullSerializer(NullSerializer.instance);
- }
+ final SerializerFactory factory = BeanSerializerFactory.instance.withSerializerModifier(new BeanSerializerModifier() {
+ @Override
+ public JsonSerializer<?> modifySerializer(final SerializationConfig config, final BeanDescription beanDesc, final JsonSerializer<?> serializer) {
+ for (final PropertyWriter writer : (Iterable<PropertyWriter>)serializer::properties) {
+ if (writer instanceof BeanPropertyWriter) {
+ ((BeanPropertyWriter)writer).assignNullSerializer(NullSerializer.instance);
}
-
- return serializer;
}
- });
+
+ return serializer;
+ }
+ });
return objectMapper.copy().setSerializerFactory(factory);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeConverter.java
index 459aed6..034533a 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeConverter.java
@@ -32,7 +32,8 @@ final class LocalDateTimeConverter implements SingleValueConverter {
}
@Override
- public boolean canConvert(@SuppressWarnings("rawtypes") final Class type) {
+ public boolean canConvert(@SuppressWarnings("rawtypes")
+ final Class type) {
return LocalDateTime.class.equals(type);
}
@@ -47,7 +48,7 @@ final class LocalDateTimeConverter implements SingleValueConverter {
return null;
}
- final LocalDateTime localDateTime = (LocalDateTime) value;
+ final LocalDateTime localDateTime = (LocalDateTime)value;
return ISO_OFFSET_DATE_TIME.format(localDateTime.atZone(ZoneId.systemDefault()));
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeDeserializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeDeserializer.java
index f034a48..f5069be 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeDeserializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeDeserializer.java
@@ -37,8 +37,7 @@ final class LocalDateTimeDeserializer extends StdDeserializer<LocalDateTime> {
}
@Override
- public LocalDateTime deserialize(final JsonParser p, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
+ public LocalDateTime deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
final ZonedDateTime zonedDateTime = ctxt.readValue(p, ZonedDateTime.class);
return zonedDateTime.toLocalDateTime();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeSerializer.java
index 17f3498..8754a5b 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeSerializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/LocalDateTimeSerializer.java
@@ -38,8 +38,7 @@ final class LocalDateTimeSerializer extends StdSerializer<LocalDateTime> {
}
@Override
- public void serialize(final LocalDateTime value, final JsonGenerator gen, final SerializerProvider serializers)
- throws IOException, JsonProcessingException {
+ public void serialize(final LocalDateTime value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
final ZonedDateTime zonedDateTime = ZonedDateTime.of(value, ZoneId.systemDefault());
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeConverter.java
index 79ed96b..30a956e 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeConverter.java
@@ -31,7 +31,8 @@ final class OffsetDateTimeConverter implements SingleValueConverter {
}
@Override
- public boolean canConvert(@SuppressWarnings("rawtypes") final Class type) {
+ public boolean canConvert(@SuppressWarnings("rawtypes")
+ final Class type) {
return OffsetDateTime.class.equals(type);
}
@@ -46,7 +47,7 @@ final class OffsetDateTimeConverter implements SingleValueConverter {
return null;
}
- final OffsetDateTime offsetDateTime = (OffsetDateTime) value;
+ final OffsetDateTime offsetDateTime = (OffsetDateTime)value;
return ISO_OFFSET_DATE_TIME.format(offsetDateTime);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeDeserializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeDeserializer.java
index 7a56d9c..26ac5b7 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeDeserializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeDeserializer.java
@@ -33,8 +33,7 @@ final class OffsetDateTimeDeserializer extends JsonDeserializer<OffsetDateTime>
}
@Override
- public OffsetDateTime deserialize(final JsonParser p, final DeserializationContext ctxt)
- throws IOException, JsonProcessingException {
+ public OffsetDateTime deserialize(final JsonParser p, final DeserializationContext ctxt) throws IOException, JsonProcessingException {
final ZonedDateTime zonedDateTime = ctxt.readValue(p, ZonedDateTime.class);
return zonedDateTime.toOffsetDateTime();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeSerializer.java
index e6de344..4929810 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeSerializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetDateTimeSerializer.java
@@ -37,8 +37,7 @@ final class OffsetDateTimeSerializer extends StdSerializer<OffsetDateTime> {
}
@Override
- public void serialize(final OffsetDateTime value, final JsonGenerator gen, final SerializerProvider serializers)
- throws IOException, JsonProcessingException {
+ public void serialize(final OffsetDateTime value, final JsonGenerator gen, final SerializerProvider serializers) throws IOException, JsonProcessingException {
final ZonedDateTime zonedDateTime = value.toZonedDateTime();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeConverter.java
index a089f0f..ac60932 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeConverter.java
@@ -30,7 +30,8 @@ final class OffsetTimeConverter implements SingleValueConverter {
}
@Override
- public boolean canConvert(@SuppressWarnings("rawtypes") final Class type) {
+ public boolean canConvert(@SuppressWarnings("rawtypes")
+ final Class type) {
return OffsetTime.class.equals(type);
}
@@ -45,7 +46,7 @@ final class OffsetTimeConverter implements SingleValueConverter {
return null;
}
- final OffsetTime offsetTime = (OffsetTime) value;
+ final OffsetTime offsetTime = (OffsetTime)value;
return ISO_OFFSET_TIME.format(offsetTime);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeSerializer.java
index d229e6b..cb2cf4e 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeSerializer.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/OffsetTimeSerializer.java
@@ -27,8 +27,7 @@ final class OffsetTimeSerializer extends com.fasterxml.jackson.datatype.jsr310.s
private static final long serialVersionUID = 1L;
private OffsetTimeSerializer() {
- super(com.fasterxml.jackson.datatype.jsr310.ser.OffsetTimeSerializer.INSTANCE, null,
- DateTimeHandling.ISO_OFFSET_TIME);
+ super(com.fasterxml.jackson.datatype.jsr310.ser.OffsetTimeSerializer.INSTANCE, null, DateTimeHandling.ISO_OFFSET_TIME);
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/QueryHelper.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/QueryHelper.java
index 61cedb6..e1f9c12 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/QueryHelper.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/QueryHelper.java
@@ -43,8 +43,7 @@ public final class QueryHelper {
return fields.stream().map(SObjectField::getName).toArray(String[]::new);
}
- public static String[] filteredFieldNamesOf(final AbstractDescribedSObjectBase object,
- final Predicate<SObjectField> filter) {
+ public static String[] filteredFieldNamesOf(final AbstractDescribedSObjectBase object, final Predicate<SObjectField> filter) {
if (object == null) {
return NONE;
}
@@ -67,12 +66,10 @@ public final class QueryHelper {
final SObjectDescription description = object.description();
final List<SObjectField> fields = description.getFields();
- return fields.stream().map(SObjectField::getName)
- .collect(Collectors.joining(", ", "SELECT ", " FROM " + description.getName()));
+ return fields.stream().map(SObjectField::getName).collect(Collectors.joining(", ", "SELECT ", " FROM " + description.getName()));
}
- public static String queryToFetchFilteredFieldsOf(final AbstractDescribedSObjectBase object,
- final Predicate<SObjectField> filter) {
+ public static String queryToFetchFilteredFieldsOf(final AbstractDescribedSObjectBase object, final Predicate<SObjectField> filter) {
if (object == null) {
return null;
}
@@ -84,7 +81,6 @@ public final class QueryHelper {
final SObjectDescription description = object.description();
final List<SObjectField> fields = description.getFields();
- return fields.stream().filter(filter).map(SObjectField::getName)
- .collect(Collectors.joining(", ", "SELECT ", " FROM " + description.getName()));
+ return fields.stream().filter(filter).map(SObjectField::getName).collect(Collectors.joining(", ", "SELECT ", " FROM " + description.getName()));
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/TimeModule.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/TimeModule.java
index 0119d30..12c2c3e 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/TimeModule.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/TimeModule.java
@@ -34,16 +34,13 @@ import static org.apache.camel.component.salesforce.api.utils.DateTimeHandling.I
public class TimeModule extends SimpleModule {
- private static final LocalDateDeserializer LOCAL_DATE_DESERIALIZER = new LocalDateDeserializer(
- DateTimeFormatter.ISO_DATE);
+ private static final LocalDateDeserializer LOCAL_DATE_DESERIALIZER = new LocalDateDeserializer(DateTimeFormatter.ISO_DATE);
- private static final LocalDateSerializer LOCAL_DATE_SERIALIZER = new LocalDateSerializer(
- DateTimeFormatter.ISO_DATE);
+ private static final LocalDateSerializer LOCAL_DATE_SERIALIZER = new LocalDateSerializer(DateTimeFormatter.ISO_DATE);
private static final long serialVersionUID = 1L;
- private static final ZonedDateTimeSerializer ZONED_DATE_TIME_SERIALIZER = new ZonedDateTimeSerializer(
- ISO_OFFSET_DATE_TIME);
+ private static final ZonedDateTimeSerializer ZONED_DATE_TIME_SERIALIZER = new ZonedDateTimeSerializer(ISO_OFFSET_DATE_TIME);
private final JavaTimeModule delegate = new JavaTimeModule();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/Version.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/Version.java
index cf8e8af..0ffacb8 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/Version.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/Version.java
@@ -34,8 +34,7 @@ public final class Version implements Comparable<Version> {
public static Version create(final String version) {
final Matcher matcher = VERSION_PATTERN.matcher(version);
if (!matcher.matches()) {
- throw new IllegalArgumentException(
- "API version needs to be in <number>.<number> format, given: " + version);
+ throw new IllegalArgumentException("API version needs to be in <number>.<number> format, given: " + version);
}
final int major = Integer.parseInt(matcher.group(1));
@@ -65,7 +64,7 @@ public final class Version implements Comparable<Version> {
return false;
}
- final Version other = (Version) obj;
+ final Version other = (Version)obj;
return compareTo(other) == 0;
}
@@ -92,8 +91,8 @@ public final class Version implements Comparable<Version> {
final Version required = new Version(requiredMajor, requiredMinor);
if (this.compareTo(required) < 0) {
- throw new UnsupportedOperationException("This operation requires API version at least " + requiredMajor
- + "." + requiredMinor + ", currently configured for " + major + "." + minor);
+ throw new UnsupportedOperationException("This operation requires API version at least " + requiredMajor + "." + requiredMinor + ", currently configured for " + major
+ + "." + minor);
}
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/XStreamUtils.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/XStreamUtils.java
index fe64f0c..2318fe1 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/XStreamUtils.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/XStreamUtils.java
@@ -82,8 +82,7 @@ public final class XStreamUtils {
}
public static XStream createXStream(final Class<?>... additionalTypes) {
- final PureJavaReflectionProvider reflectionProvider = new PureJavaReflectionProvider(
- new FieldDictionary(new AnnotationFieldKeySorter()));
+ final PureJavaReflectionProvider reflectionProvider = new PureJavaReflectionProvider(new FieldDictionary(new AnnotationFieldKeySorter()));
// use NoNameCoder to avoid escaping __ in custom field names
// and CompactWriter to avoid pretty printing
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/ZonedDateTimeConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/ZonedDateTimeConverter.java
index e02bf82..2a76f30 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/ZonedDateTimeConverter.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/ZonedDateTimeConverter.java
@@ -30,7 +30,8 @@ final class ZonedDateTimeConverter implements SingleValueConverter {
}
@Override
- public boolean canConvert(@SuppressWarnings("rawtypes") final Class type) {
+ public boolean canConvert(@SuppressWarnings("rawtypes")
+ final Class type) {
return ZonedDateTime.class.equals(type);
}
@@ -45,7 +46,7 @@ final class ZonedDateTimeConverter implements SingleValueConverter {
return null;
}
- final ZonedDateTime zonedDateTime = (ZonedDateTime) value;
+ final ZonedDateTime zonedDateTime = (ZonedDateTime)value;
return ISO_OFFSET_DATE_TIME.format(zonedDateTime);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/OperationName.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/OperationName.java
index 21ec0bd..5e22a5b 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/OperationName.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/OperationName.java
@@ -19,59 +19,28 @@ package org.apache.camel.component.salesforce.internal;
public enum OperationName {
// rest API
- GET_VERSIONS("getVersions"),
- GET_RESOURCES("getResources"),
- GET_GLOBAL_OBJECTS("getGlobalObjects"),
- GET_BASIC_INFO("getBasicInfo"),
- GET_DESCRIPTION("getDescription"),
- GET_SOBJECT("getSObject"),
- CREATE_SOBJECT("createSObject"),
- UPDATE_SOBJECT("updateSObject"),
- DELETE_SOBJECT("deleteSObject"),
- GET_SOBJECT_WITH_ID("getSObjectWithId"),
- UPSERT_SOBJECT("upsertSObject"),
- DELETE_SOBJECT_WITH_ID("deleteSObjectWithId"),
- GET_BLOB_FIELD("getBlobField"),
- QUERY("query"),
- QUERY_MORE("queryMore"),
- QUERY_ALL("queryAll"),
- SEARCH("search"),
- APEX_CALL("apexCall"),
- RECENT("recent"),
+ GET_VERSIONS("getVersions"), GET_RESOURCES("getResources"), GET_GLOBAL_OBJECTS("getGlobalObjects"), GET_BASIC_INFO("getBasicInfo"), GET_DESCRIPTION(
+ "getDescription"), GET_SOBJECT("getSObject"), CREATE_SOBJECT("createSObject"), UPDATE_SOBJECT("updateSObject"), DELETE_SOBJECT("deleteSObject"), GET_SOBJECT_WITH_ID(
+ "getSObjectWithId"), UPSERT_SOBJECT("upsertSObject"), DELETE_SOBJECT_WITH_ID("deleteSObjectWithId"), GET_BLOB_FIELD(
+ "getBlobField"), QUERY("query"), QUERY_MORE("queryMore"), QUERY_ALL("queryAll"), SEARCH("search"), APEX_CALL("apexCall"), RECENT("recent"),
// bulk API
- CREATE_JOB("createJob"),
- GET_JOB("getJob"),
- CLOSE_JOB("closeJob"),
- ABORT_JOB("abortJob"),
- CREATE_BATCH("createBatch"),
- GET_BATCH("getBatch"),
- GET_ALL_BATCHES("getAllBatches"),
- GET_REQUEST("getRequest"),
- GET_RESULTS("getResults"),
- CREATE_BATCH_QUERY("createBatchQuery"),
- GET_QUERY_RESULT_IDS("getQueryResultIds"),
- GET_QUERY_RESULT("getQueryResult"),
-
+ CREATE_JOB("createJob"), GET_JOB("getJob"), CLOSE_JOB("closeJob"), ABORT_JOB("abortJob"), CREATE_BATCH("createBatch"), GET_BATCH("getBatch"), GET_ALL_BATCHES(
+ "getAllBatches"), GET_REQUEST(
+ "getRequest"), GET_RESULTS("getResults"), CREATE_BATCH_QUERY("createBatchQuery"), GET_QUERY_RESULT_IDS("getQueryResultIds"), GET_QUERY_RESULT("getQueryResult"),
+
// analytics API
- GET_RECENT_REPORTS("getRecentReports"),
- GET_REPORT_DESCRIPTION("getReportDescription"),
- EXECUTE_SYNCREPORT("executeSyncReport"),
- EXECUTE_ASYNCREPORT("executeAsyncReport"),
- GET_REPORT_INSTANCES("getReportInstances"),
- GET_REPORT_RESULTS("getReportResults"),
+ GET_RECENT_REPORTS("getRecentReports"), GET_REPORT_DESCRIPTION("getReportDescription"), EXECUTE_SYNCREPORT("executeSyncReport"), EXECUTE_ASYNCREPORT(
+ "executeAsyncReport"), GET_REPORT_INSTANCES("getReportInstances"), GET_REPORT_RESULTS("getReportResults"),
// limits API
LIMITS("limits"),
// Approval Processes and Process Rules API
- APPROVAL("approval"),
- APPROVALS("approvals"),
+ APPROVAL("approval"), APPROVALS("approvals"),
// Composite API
- COMPOSITE_TREE("composite-tree"),
- COMPOSITE_BATCH("composite-batch"),
- COMPOSITE("composite");
+ COMPOSITE_TREE("composite-tree"), COMPOSITE_BATCH("composite-batch"), COMPOSITE("composite");
private final String value;
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/PayloadFormat.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/PayloadFormat.java
index 4d1fa7c..298bce9 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/PayloadFormat.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/PayloadFormat.java
@@ -17,6 +17,5 @@
package org.apache.camel.component.salesforce.internal;
public enum PayloadFormat {
- JSON,
- XML
+ JSON, XML
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
index 8af3d8a..cd2d483 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/SalesforceSession.java
@@ -66,8 +66,7 @@ public class SalesforceSession implements Service {
private static final int JWT_CLAIM_WINDOW = 270; // 4.5 min
- private static final String JWT_HEADER = Base64.getUrlEncoder()
- .encodeToString("{\"alg\":\"RS256\"}".getBytes(StandardCharsets.UTF_8));
+ private static final String JWT_HEADER = Base64.getUrlEncoder().encodeToString("{\"alg\":\"RS256\"}".getBytes(StandardCharsets.UTF_8));
private static final String OAUTH2_REVOKE_PATH = "/services/oauth2/revoke?token=";
private static final String OAUTH2_TOKEN_PATH = "/services/oauth2/token";
@@ -143,8 +142,8 @@ public class SalesforceSession implements Service {
}
/**
- * Creates login request, allows SalesforceSecurityHandler to create a login request for a failed authentication
- * conversation
+ * Creates login request, allows SalesforceSecurityHandler to create a login
+ * request for a failed authentication conversation
*
* @return login POST request.
*/
@@ -190,12 +189,10 @@ public class SalesforceSession implements Service {
String generateJwtAssertion() {
final long utcPlusWindow = Clock.systemUTC().millis() / 1000 + JWT_CLAIM_WINDOW;
- final StringBuilder claim = new StringBuilder().append("{\"iss\":\"").append(config.getClientId())
- .append("\",\"sub\":\"").append(config.getUserName()).append("\",\"aud\":\"").append(config.getLoginUrl())
- .append("\",\"exp\":\"").append(utcPlusWindow).append("\"}");
+ final StringBuilder claim = new StringBuilder().append("{\"iss\":\"").append(config.getClientId()).append("\",\"sub\":\"").append(config.getUserName())
+ .append("\",\"aud\":\"").append(config.getLoginUrl()).append("\",\"exp\":\"").append(utcPlusWindow).append("\"}");
- final StringBuilder token = new StringBuilder(JWT_HEADER).append('.')
- .append(Base64.getUrlEncoder().encodeToString(claim.toString().getBytes(StandardCharsets.UTF_8)));
+ final StringBuilder token = new StringBuilder(JWT_HEADER).append('.').append(Base64.getUrlEncoder().encodeToString(claim.toString().getBytes(StandardCharsets.UTF_8)));
final KeyStoreParameters keyStoreParameters = config.getKeystore();
keyStoreParameters.setCamelContext(camelContext);
@@ -211,13 +208,12 @@ public class SalesforceSession implements Service {
if (alias == null) {
alias = tmp;
} else {
- throw new IllegalArgumentException("The given keystore `" + keyStoreParameters.getResource()
- + "` contains more than one key entry, expecting only one");
+ throw new IllegalArgumentException("The given keystore `" + keyStoreParameters.getResource() + "` contains more than one key entry, expecting only one");
}
}
}
- PrivateKey key = (PrivateKey) keystore.getKey(alias, keyStoreParameters.getPassword().toCharArray());
+ PrivateKey key = (PrivateKey)keystore.getKey(alias, keyStoreParameters.getPassword().toCharArray());
Signature signature = Signature.getInstance(JWT_SIGNATURE_ALGORITHM);
signature.initSign(key);
@@ -240,11 +236,10 @@ public class SalesforceSession implements Service {
}
/**
- * Parses login response, allows SalesforceSecurityHandler to parse a login request for a failed authentication
- * conversation.
+ * Parses login response, allows SalesforceSecurityHandler to parse a login
+ * request for a failed authentication conversation.
*/
- public synchronized void parseLoginResponse(ContentResponse loginResponse, String responseContent)
- throws SalesforceException {
+ public synchronized void parseLoginResponse(ContentResponse loginResponse, String responseContent) throws SalesforceException {
final int responseStatus = loginResponse.getStatus();
try {
@@ -278,16 +273,13 @@ public class SalesforceSession implements Service {
// parse the response to get error
final LoginError error = objectMapper.readValue(responseContent, LoginError.class);
final String errorCode = error.getError();
- final String msg = String.format("Login error code:[%s] description:[%s]", error.getError(),
- error.getErrorDescription());
+ final String msg = String.format("Login error code:[%s] description:[%s]", error.getError(), error.getErrorDescription());
final List<RestError> errors = new ArrayList<>();
errors.add(new RestError(errorCode, msg));
throw new SalesforceException(errors, HttpStatus.BAD_REQUEST_400);
default:
- throw new SalesforceException(
- String.format("Login error status:[%s] reason:[%s]", responseStatus, loginResponse.getReason()),
- responseStatus);
+ throw new SalesforceException(String.format("Login error status:[%s] reason:[%s]", responseStatus, loginResponse.getReason()), responseStatus);
}
} catch (IOException e) {
String msg = "Login error: response parse exception " + e.getMessage();
@@ -301,8 +293,7 @@ public class SalesforceSession implements Service {
}
try {
- String logoutUrl = (instanceUrl == null ? config.getLoginUrl() : instanceUrl) + OAUTH2_REVOKE_PATH
- + accessToken;
+ String logoutUrl = (instanceUrl == null ? config.getLoginUrl() : instanceUrl) + OAUTH2_REVOKE_PATH + accessToken;
final Request logoutGet = httpClient.newRequest(logoutUrl).timeout(timeout, TimeUnit.MILLISECONDS);
final ContentResponse logoutResponse = logoutGet.send();
@@ -312,8 +303,7 @@ public class SalesforceSession implements Service {
if (statusCode == HttpStatus.OK_200) {
LOG.info("Logout successful");
} else {
- throw new SalesforceException(
- String.format("Logout error, code: [%s] reason: [%s]", statusCode, reason), statusCode);
+ throw new SalesforceException(String.format("Logout error, code: [%s] reason: [%s]", statusCode, reason), statusCode);
}
} catch (InterruptedException e) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
index ae34240..4c85210 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AbstractClientBase.java
@@ -86,13 +86,11 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
private long terminationTimeout;
- public AbstractClientBase(String version, SalesforceSession session,
- SalesforceHttpClient httpClient) throws SalesforceException {
+ public AbstractClientBase(String version, SalesforceSession session, SalesforceHttpClient httpClient) throws SalesforceException {
this(version, session, httpClient, DEFAULT_TERMINATION_TIMEOUT);
}
- AbstractClientBase(String version, SalesforceSession session,
- SalesforceHttpClient httpClient, int terminationTimeout) throws SalesforceException {
+ AbstractClientBase(String version, SalesforceSession session, SalesforceHttpClient httpClient, int terminationTimeout) throws SalesforceException {
this.version = version;
this.session = session;
@@ -156,9 +154,7 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
}
protected Request getRequest(String method, String url, Map<String, List<String>> headers) {
- SalesforceHttpRequest request = (SalesforceHttpRequest) httpClient.newRequest(url)
- .method(method)
- .timeout(session.getTimeout(), TimeUnit.MILLISECONDS);
+ SalesforceHttpRequest request = (SalesforceHttpRequest)httpClient.newRequest(url).method(method).timeout(session.getTimeout(), TimeUnit.MILLISECONDS);
request.getConversation().setAttribute(SalesforceSecurityHandler.CLIENT_ATTRIBUTE, this);
addHeadersTo(request, headers);
@@ -171,7 +167,8 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
protected void doHttpRequest(final Request request, final ClientResponseCallback callback) {
// Highly memory inefficient,
- // but buffer the request content to allow it to be replayed for authentication retries
+ // but buffer the request content to allow it to be replayed for
+ // authentication retries
final ContentProvider content = request.getContent();
if (content instanceof InputStreamContentProvider) {
final List<ByteBuffer> buffers = new ArrayList<>();
@@ -194,21 +191,21 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
if (result.isFailed()) {
// Failure!!!
- // including Salesforce errors reported as exception from SalesforceSecurityHandler
+ // including Salesforce errors reported as exception
+ // from SalesforceSecurityHandler
Throwable failure = result.getFailure();
if (failure instanceof SalesforceException) {
- callback.onResponse(null, headers, (SalesforceException) failure);
+ callback.onResponse(null, headers, (SalesforceException)failure);
} else {
- final String msg = String.format("Unexpected error {%s:%s} executing {%s:%s}",
- response.getStatus(), response.getReason(), request.getMethod(), request.getURI());
+ final String msg = String.format("Unexpected error {%s:%s} executing {%s:%s}", response.getStatus(), response.getReason(), request.getMethod(),
+ request.getURI());
callback.onResponse(null, headers, new SalesforceException(msg, response.getStatus(), failure));
}
} else {
// HTTP error status
final int status = response.getStatus();
- SalesforceHttpRequest request = (SalesforceHttpRequest) ((SalesforceHttpRequest) result.getRequest())
- .getConversation()
+ SalesforceHttpRequest request = (SalesforceHttpRequest)((SalesforceHttpRequest)result.getRequest()).getConversation()
.getAttribute(SalesforceSecurityHandler.AUTHENTICATION_REQUEST_ATTRIBUTE);
if (status == HttpStatus.BAD_REQUEST_400 && request != null) {
@@ -217,14 +214,12 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
try {
session.parseLoginResponse(contentResponse, getContentAsString());
- final String msg = String.format("Unexpected Error {%s:%s} executing {%s:%s}",
- status, response.getReason(), request.getMethod(), request.getURI());
+ final String msg = String.format("Unexpected Error {%s:%s} executing {%s:%s}", status, response.getReason(), request.getMethod(), request.getURI());
callback.onResponse(null, headers, new SalesforceException(msg, null));
} catch (SalesforceException e) {
- final String msg = String.format("Error {%s:%s} executing {%s:%s}",
- status, response.getReason(), request.getMethod(), request.getURI());
+ final String msg = String.format("Error {%s:%s} executing {%s:%s}", status, response.getReason(), request.getMethod(), request.getURI());
callback.onResponse(null, headers, new SalesforceException(msg, response.getStatus(), e));
}
@@ -232,7 +227,8 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
// Salesforce HTTP failure!
final SalesforceException exception = createRestException(response, getContentAsInputStream());
- // for APIs that return body on status 400, such as Composite API we need content as well
+ // for APIs that return body on status 400, such as
+ // Composite API we need content as well
callback.onResponse(getContentAsInputStream(), headers, exception);
} else {
@@ -268,8 +264,7 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
return httpClient;
}
- final List<RestError> readErrorsFrom(final InputStream responseContent, final PayloadFormat format,
- final ObjectMapper objectMapper, final XStream xStream)
+ final List<RestError> readErrorsFrom(final InputStream responseContent, final PayloadFormat format, final ObjectMapper objectMapper, final XStream xStream)
throws IOException, JsonParseException, JsonMappingException {
final List<RestError> restErrors;
if (PayloadFormat.JSON.equals(format)) {
@@ -324,15 +319,13 @@ public abstract class AbstractClientBase implements SalesforceSession.Salesforce
final Object headerValue = inboundMessage.getHeader(headerName);
if (headerValue instanceof String) {
- answer.put(headerName, Collections.singletonList((String) headerValue));
+ answer.put(headerName, Collections.singletonList((String)headerValue));
} else if (headerValue instanceof String[]) {
- answer.put(headerName, Arrays.asList((String[]) headerValue));
+ answer.put(headerName, Arrays.asList((String[])headerValue));
} else if (headerValue instanceof Collection) {
- answer.put(headerName, ((Collection<?>) headerValue).stream().map(String::valueOf)
- .collect(Collectors.<String>toList()));
+ answer.put(headerName, ((Collection<?>)headerValue).stream().map(String::valueOf).collect(Collectors.<String> toList()));
} else {
- throw new IllegalArgumentException(
- "Given value for header `" + headerName + "`, is not String, String array or a Collection");
+ throw new IllegalArgumentException("Given value for header `" + headerName + "`, is not String, String array or a Collection");
}
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AnalyticsApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AnalyticsApiClient.java
index 006bfc6..12f723b 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AnalyticsApiClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/AnalyticsApiClient.java
@@ -55,18 +55,13 @@ public interface AnalyticsApiClient {
void getRecentReports(Map<String, List<String>> headers, RecentReportsResponseCallback callback);
- void getReportDescription(String reportId, Map<String, List<String>> headers,
- ReportDescriptionResponseCallback callback);
+ void getReportDescription(String reportId, Map<String, List<String>> headers, ReportDescriptionResponseCallback callback);
- void executeSyncReport(String reportId, Boolean includeDetails, ReportMetadata reportFilter,
- Map<String, List<String>> headers, ReportResultsResponseCallback callback);
+ void executeSyncReport(String reportId, Boolean includeDetails, ReportMetadata reportFilter, Map<String, List<String>> headers, ReportResultsResponseCallback callback);
- void executeAsyncReport(String reportId, Boolean includeDetails, ReportMetadata reportFilter,
- Map<String, List<String>> headers, ReportInstanceResponseCallback callback);
+ void executeAsyncReport(String reportId, Boolean includeDetails, ReportMetadata reportFilter, Map<String, List<String>> headers, ReportInstanceResponseCallback callback);
- void getReportInstances(String reportId, Map<String, List<String>> headers,
- ReportInstanceListResponseCallback callback);
+ void getReportInstances(String reportId, Map<String, List<String>> headers, ReportInstanceListResponseCallback callback);
- void getReportResults(String reportId, String instanceId, Map<String, List<String>> headers,
- ReportResultsResponseCallback callback);
+ void getReportResults(String reportId, String instanceId, Map<String, List<String>> headers, ReportResultsResponseCallback callback);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/BulkApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/BulkApiClient.java
index 679aacd..dbf1c6d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/BulkApiClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/BulkApiClient.java
@@ -53,43 +53,32 @@ public interface BulkApiClient {
/**
* Creates a Bulk Job
*
- * @param jobInfo {@link JobInfo} with required fields
- * @param callback {@link JobInfoResponseCallback} to be invoked on response or error
+ * @param jobInfo {@link JobInfo} with required fields
+ * @param callback {@link JobInfoResponseCallback} to be invoked on response
+ * or error
*/
- void createJob(JobInfo jobInfo, Map<String, List<String>> header,
- JobInfoResponseCallback callback);
+ void createJob(JobInfo jobInfo, Map<String, List<String>> header, JobInfoResponseCallback callback);
- void getJob(String jobId, Map<String, List<String>> header,
- JobInfoResponseCallback callback);
+ void getJob(String jobId, Map<String, List<String>> header, JobInfoResponseCallback callback);
- void closeJob(String jobId, Map<String, List<String>> header,
- JobInfoResponseCallback callback);
+ void closeJob(String jobId, Map<String, List<String>> header, JobInfoResponseCallback callback);
- void abortJob(String jobId, Map<String, List<String>> header,
- JobInfoResponseCallback callback);
+ void abortJob(String jobId, Map<String, List<String>> header, JobInfoResponseCallback callback);
- void createBatch(InputStream batchStream, String jobId, ContentType contentTypeEnum,
- Map<String, List<String>> header, BatchInfoResponseCallback callback);
+ void createBatch(InputStream batchStream, String jobId, ContentType contentTypeEnum, Map<String, List<String>> header, BatchInfoResponseCallback callback);
- void getBatch(String jobId, String batchId, Map<String, List<String>> header,
- BatchInfoResponseCallback callback);
+ void getBatch(String jobId, String batchId, Map<String, List<String>> header, BatchInfoResponseCallback callback);
- void getAllBatches(String jobId, Map<String, List<String>> header,
- BatchInfoListResponseCallback callback);
+ void getAllBatches(String jobId, Map<String, List<String>> header, BatchInfoListResponseCallback callback);
- void getRequest(String jobId, String batchId, Map<String, List<String>> header,
- StreamResponseCallback callback);
+ void getRequest(String jobId, String batchId, Map<String, List<String>> header, StreamResponseCallback callback);
- void getResults(String jobId, String batchId, Map<String, List<String>> header,
- StreamResponseCallback callback);
+ void getResults(String jobId, String batchId, Map<String, List<String>> header, StreamResponseCallback callback);
- void createBatchQuery(String jobId, String soqlQuery, ContentType jobContentType,
- Map<String, List<String>> header, BatchInfoResponseCallback callback);
+ void createBatchQuery(String jobId, String soqlQuery, ContentType jobContentType, Map<String, List<String>> header, BatchInfoResponseCallback callback);
- void getQueryResultIds(String jobId, String batchId, Map<String, List<String>> header,
- QueryResultIdsCallback callback);
+ void getQueryResultIds(String jobId, String batchId, Map<String, List<String>> header, QueryResultIdsCallback callback);
- void getQueryResult(String jobId, String batchId, String resultId,
- Map<String, List<String>> header, StreamResponseCallback callback);
+ void getQueryResult(String jobId, String batchId, String resultId, Map<String, List<String>> header, StreamResponseCallback callback);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/CompositeApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/CompositeApiClient.java
index 5cc3afc..4e26d92 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/CompositeApiClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/CompositeApiClient.java
@@ -42,11 +42,9 @@ public interface CompositeApiClient {
void onResponse(Optional<T> body, Map<String, String> headers, SalesforceException exception);
}
- void submitComposite(SObjectComposite composite, Map<String, List<String>> headers,
- ResponseCallback<SObjectCompositeResponse> callback) throws SalesforceException;
+ void submitComposite(SObjectComposite composite, Map<String, List<String>> headers, ResponseCallback<SObjectCompositeResponse> callback) throws SalesforceException;
- void submitCompositeBatch(SObjectBatch batch, Map<String, List<String>> headers,
- ResponseCallback<SObjectBatchResponse> callback) throws SalesforceException;
+ void submitCompositeBatch(SObjectBatch batch, Map<String, List<String>> headers, ResponseCallback<SObjectBatchResponse> callback) throws SalesforceException;
/**
* Submits given nodes (records) of SObjects and their children as a tree in
@@ -56,7 +54,6 @@ public interface CompositeApiClient {
* @param tree SObject tree to submit
* @param callback {@link ResponseCallback} to handle response or exception
*/
- void submitCompositeTree(SObjectTree tree, Map<String, List<String>> headers,
- ResponseCallback<SObjectTreeResponse> callback) throws SalesforceException;
+ void submitCompositeTree(SObjectTree tree, Map<String, List<String>> headers, ResponseCallback<SObjectTreeResponse> callback) throws SalesforceException;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultAnalyticsApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultAnalyticsApiClient.java
index d83a50d..77fbe46 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultAnalyticsApiClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultAnalyticsApiClient.java
@@ -50,7 +50,8 @@ import org.eclipse.jetty.http.HttpStatus;
import org.eclipse.jetty.util.StringUtil;
/**
- * Default implementation of {@link org.apache.camel.component.salesforce.internal.client.AnalyticsApiClient}.
+ * Default implementation of
+ * {@link org.apache.camel.component.salesforce.internal.client.AnalyticsApiClient}.
*/
public class DefaultAnalyticsApiClient extends AbstractClientBase implements AnalyticsApiClient {
@@ -58,9 +59,7 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
private static final String INCLUDE_DETAILS_QUERY_PARAM = "?includeDetails=";
private ObjectMapper objectMapper;
-
- public DefaultAnalyticsApiClient(String version, SalesforceSession session,
- SalesforceHttpClient httpClient) throws SalesforceException {
+ public DefaultAnalyticsApiClient(String version, SalesforceSession session, SalesforceHttpClient httpClient) throws SalesforceException {
super(version, session, httpClient);
objectMapper = JsonUtils.createObjectMapper();
@@ -107,12 +106,11 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
}
@Override
- public void executeSyncReport(String reportId, Boolean includeDetails, ReportMetadata reportMetadata,
- final Map<String, List<String>> headers, final ReportResultsResponseCallback callback) {
+ public void executeSyncReport(String reportId, Boolean includeDetails, ReportMetadata reportMetadata, final Map<String, List<String>> headers,
+ final ReportResultsResponseCallback callback) {
final boolean useGet = reportMetadata == null;
- final Request request = getRequest(
- useGet ? HttpMethod.GET : HttpMethod.POST, reportsUrl(reportId, includeDetails), headers);
+ final Request request = getRequest(useGet ? HttpMethod.GET : HttpMethod.POST, reportsUrl(reportId, includeDetails), headers);
// set POST data
if (!useGet) {
@@ -142,11 +140,10 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
}
@Override
- public void executeAsyncReport(String reportId, Boolean includeDetails, ReportMetadata reportMetadata,
- final Map<String, List<String>> headers, final ReportInstanceResponseCallback callback) {
+ public void executeAsyncReport(String reportId, Boolean includeDetails, ReportMetadata reportMetadata, final Map<String, List<String>> headers,
+ final ReportInstanceResponseCallback callback) {
- final Request request = getRequest(HttpMethod.POST,
- reportInstancesUrl(reportId, includeDetails), headers);
+ final Request request = getRequest(HttpMethod.POST, reportInstancesUrl(reportId, includeDetails), headers);
// set POST data
if (reportMetadata != null) {
@@ -197,11 +194,9 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
}
@Override
- public void getReportResults(String reportId, String instanceId, final Map<String, List<String>> headers,
- final ReportResultsResponseCallback callback) {
+ public void getReportResults(String reportId, String instanceId, final Map<String, List<String>> headers, final ReportResultsResponseCallback callback) {
- final Request request = getRequest(HttpMethod.GET,
- reportInstancesUrl(reportId, instanceId), headers);
+ final Request request = getRequest(HttpMethod.GET, reportInstancesUrl(reportId, instanceId), headers);
doHttpRequest(request, new ClientResponseCallback() {
@Override
@@ -231,8 +226,7 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
}
private String reportsUrl(String reportId, Boolean includeDetails) {
- return includeDetails == null ? reportsUrl(reportId)
- : reportsUrl(reportId) + INCLUDE_DETAILS_QUERY_PARAM + includeDetails;
+ return includeDetails == null ? reportsUrl(reportId) : reportsUrl(reportId) + INCLUDE_DETAILS_QUERY_PARAM + includeDetails;
}
private String reportInstancesUrl(String reportId) {
@@ -240,8 +234,7 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
}
private String reportInstancesUrl(String reportId, Boolean includeDetails) {
- return includeDetails == null ? reportInstancesUrl(reportId)
- : reportInstancesUrl(reportId) + INCLUDE_DETAILS_QUERY_PARAM + includeDetails;
+ return includeDetails == null ? reportInstancesUrl(reportId) : reportInstancesUrl(reportId) + INCLUDE_DETAILS_QUERY_PARAM + includeDetails;
}
private String reportInstancesUrl(String reportId, String instanceId) {
@@ -270,19 +263,16 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
}
} catch (UnsupportedEncodingException e) {
// log and ignore
- String msg = "Unexpected Error parsing JSON error response body + ["
- + responseContent + "] : " + e.getMessage();
+ String msg = "Unexpected Error parsing JSON error response body + [" + responseContent + "] : " + e.getMessage();
log.warn(msg, e);
} catch (IOException e) {
// log and ignore
- String msg = "Unexpected Error parsing JSON error response body + ["
- + responseContent + "] : " + e.getMessage();
+ String msg = "Unexpected Error parsing JSON error response body + [" + responseContent + "] : " + e.getMessage();
log.warn(msg, e);
}
// just report HTTP status info
- String message = String.format("Unexpected error: %s, with content: %s",
- response.getReason(), responseContent);
+ String message = String.format("Unexpected error: %s, with content: %s", response.getReason(), responseContent);
return new SalesforceException(message, statusCode);
}
@@ -292,7 +282,8 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
// set access token for all requests
setAccessToken(request);
- // set request and response content type and charset, which is always JSON for analytics API
+ // set request and response content type and charset, which is always
+ // JSON for analytics API
request.header(HttpHeader.CONTENT_TYPE, APPLICATION_JSON_UTF8);
request.header(HttpHeader.ACCEPT, APPLICATION_JSON_UTF8);
request.header(HttpHeader.ACCEPT_CHARSET, StringUtil.__UTF8);
@@ -304,29 +295,20 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
try {
request.content(new BytesContentProvider(objectMapper.writeValueAsBytes(input)));
} catch (IOException e) {
- throw new SalesforceException(
- String.format("Error marshaling request for {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error marshaling request for {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
}
}
- private <T> T unmarshalResponse(InputStream response, Request request,
- TypeReference<T> responseTypeReference)
- throws SalesforceException {
+ private <T> T unmarshalResponse(InputStream response, Request request, TypeReference<T> responseTypeReference) throws SalesforceException {
try {
return objectMapper.readValue(response, responseTypeReference);
} catch (IOException e) {
- throw new SalesforceException(
- String.format("Error unmarshaling response {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error unmarshaling response {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
}
}
- private <T> T unmarshalResponse(InputStream response, Request request, Class<T> responseClass)
- throws SalesforceException {
+ private <T> T unmarshalResponse(InputStream response, Request request, Class<T> responseClass) throws SalesforceException {
if (response == null) {
return null;
@@ -335,10 +317,7 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements Ana
try {
return objectMapper.readValue(response, responseClass);
} catch (IOException e) {
- throw new SalesforceException(
- String.format("Error unmarshaling response {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error unmarshaling response {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
}
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java
index 160118f..211b25d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultBulkApiClient.java
@@ -65,8 +65,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
private JAXBContext context;
private ObjectFactory objectFactory;
- public DefaultBulkApiClient(String version, SalesforceSession session, SalesforceHttpClient httpClient)
- throws SalesforceException {
+ public DefaultBulkApiClient(String version, SalesforceSession session, SalesforceHttpClient httpClient) throws SalesforceException {
super(version, session, httpClient);
try {
@@ -207,8 +206,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
}
@Override
- public void createBatch(InputStream batchStream, String jobId, ContentType contentTypeEnum,
- Map<String, List<String>> headers, final BatchInfoResponseCallback callback) {
+ public void createBatch(InputStream batchStream, String jobId, ContentType contentTypeEnum, Map<String, List<String>> headers, final BatchInfoResponseCallback callback) {
final Request post = getRequest(HttpMethod.POST, batchUrl(jobId, null), headers);
post.content(new InputStreamContentProvider(batchStream));
post.header(HttpHeader.CONTENT_TYPE, getContentType(contentTypeEnum) + ";charset=" + StringUtil.__UTF8);
@@ -293,8 +291,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
}
@Override
- public void createBatchQuery(String jobId, String soqlQuery, ContentType jobContentType,
- Map<String, List<String>> headers, final BatchInfoResponseCallback callback) {
+ public void createBatchQuery(String jobId, String soqlQuery, ContentType jobContentType, Map<String, List<String>> headers, final BatchInfoResponseCallback callback) {
final Request post = getRequest(HttpMethod.POST, batchUrl(jobId, null), headers);
final byte[] queryBytes;
try {
@@ -322,8 +319,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
}
@Override
- public void getQueryResultIds(String jobId, String batchId, Map<String, List<String>> headers,
- final QueryResultIdsCallback callback) {
+ public void getQueryResultIds(String jobId, String batchId, Map<String, List<String>> headers, final QueryResultIdsCallback callback) {
final Request get = getRequest(HttpMethod.GET, batchResultUrl(jobId, batchId, null), headers);
// make the call and parse the result
@@ -342,8 +338,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
}
@Override
- public void getQueryResult(String jobId, String batchId, String resultId, Map<String, List<String>> headers,
- final StreamResponseCallback callback) {
+ public void getQueryResult(String jobId, String batchId, String resultId, Map<String, List<String>> headers, final StreamResponseCallback callback) {
final Request get = getRequest(HttpMethod.GET, batchResultUrl(jobId, batchId, resultId), headers);
// make the call and parse the result
@@ -369,7 +364,8 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
// set default charset
request.header(HttpHeader.ACCEPT_CHARSET, StringUtil.__UTF8);
- // TODO check if this is really needed or not, since SF response content type seems fixed
+ // TODO check if this is really needed or not, since SF response content
+ // type seems fixed
// check if the default accept content type must be used
if (!request.getHeaders().contains(HttpHeader.ACCEPT)) {
final String contentType = getContentType(DEFAULT_ACCEPT_TYPE);
@@ -421,8 +417,7 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
}
}
- private <T> T unmarshalResponse(InputStream response, Request request, Class<T> resultClass)
- throws SalesforceException {
+ private <T> T unmarshalResponse(InputStream response, Request request, Class<T> resultClass) throws SalesforceException {
try {
Unmarshaller unmarshaller = context.createUnmarshaller();
@@ -435,23 +430,17 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
spf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);
} catch (ParserConfigurationException | SAXException ex) {
- // LOG.debug("Error setting feature on parser: " + ex.getMessage());
+ // LOG.debug("Error setting feature on parser: " +
+ // ex.getMessage());
}
- Source xmlSource =
- new SAXSource(spf.newSAXParser().getXMLReader(), new InputSource(response));
+ Source xmlSource = new SAXSource(spf.newSAXParser().getXMLReader(), new InputSource(response));
JAXBElement<T> result = unmarshaller.unmarshal(xmlSource, resultClass);
return result.getValue();
} catch (JAXBException | SAXException | ParserConfigurationException e) {
- throw new SalesforceException(
- String.format("Error unmarshaling response {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error unmarshaling response {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
} catch (IllegalArgumentException e) {
- throw new SalesforceException(
- String.format("Error unmarshaling response for {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error unmarshaling response for {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
}
}
@@ -463,15 +452,9 @@ public class DefaultBulkApiClient extends AbstractClientBase implements BulkApiC
request.content(new BytesContentProvider(contentType, byteStream.toByteArray()));
} catch (JAXBException e) {
- throw new SalesforceException(
- String.format("Error marshaling request for {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error marshaling request for {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
} catch (IllegalArgumentException e) {
- throw new SalesforceException(
- String.format("Error marshaling request for {%s:%s} : %s",
- request.getMethod(), request.getURI(), e.getMessage()),
- e);
+ throw new SalesforceException(String.format("Error marshaling request for {%s:%s} : %s", request.getMethod(), request.getURI(), e.getMessage()), e);
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultCompositeApiClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultCompositeApiClient.java
index 33e05e5..edbbaa9 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultCompositeApiClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultCompositeApiClient.java
@@ -76,8 +76,8 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
private final XStream xStreamCompositeTree;
- public DefaultCompositeApiClient(final SalesforceEndpointConfig configuration, final PayloadFormat format,
- final String version, final SalesforceSession session, final SalesforceHttpClient httpClient)
+ public DefaultCompositeApiClient(final SalesforceEndpointConfig configuration, final PayloadFormat format, final String version, final SalesforceSession session,
+ final SalesforceHttpClient httpClient)
throws SalesforceException {
super(version, session, httpClient);
this.format = format;
@@ -98,8 +98,8 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
}
@Override
- public void submitComposite(final SObjectComposite composite, final Map<String, List<String>> headers,
- final ResponseCallback<SObjectCompositeResponse> callback) throws SalesforceException {
+ public void submitComposite(final SObjectComposite composite, final Map<String, List<String>> headers, final ResponseCallback<SObjectCompositeResponse> callback)
+ throws SalesforceException {
// composite interface supports only json payload
checkCompositeFormat(format, SObjectComposite.REQUIRED_PAYLOAD_FORMAT);
@@ -110,13 +110,13 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
final ContentProvider content = serialize(NO_XSTREAM, composite, composite.objectTypes());
post.content(content);
- doHttpRequest(post, (response, responseHeaders, exception) -> callback.onResponse(
- tryToReadResponse(NO_XSTREAM, SObjectCompositeResponse.class, response), responseHeaders, exception));
+ doHttpRequest(post, (response, responseHeaders, exception) -> callback.onResponse(tryToReadResponse(NO_XSTREAM, SObjectCompositeResponse.class, response), responseHeaders,
+ exception));
}
@Override
- public void submitCompositeBatch(final SObjectBatch batch, final Map<String, List<String>> headers,
- final ResponseCallback<SObjectBatchResponse> callback) throws SalesforceException {
+ public void submitCompositeBatch(final SObjectBatch batch, final Map<String, List<String>> headers, final ResponseCallback<SObjectBatchResponse> callback)
+ throws SalesforceException {
checkCompositeBatchVersion(version, batch.getVersion());
final String url = versionUrl() + "composite/batch";
@@ -126,15 +126,13 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
final ContentProvider content = serialize(xStreamCompositeBatch, batch, batch.objectTypes());
post.content(content);
- doHttpRequest(post,
- (response, responseHeaders, exception) -> callback.onResponse(
- tryToReadResponse(xStreamCompositeBatch, SObjectBatchResponse.class, response), responseHeaders,
- exception));
+ doHttpRequest(post, (response, responseHeaders, exception) -> callback.onResponse(tryToReadResponse(xStreamCompositeBatch, SObjectBatchResponse.class, response),
+ responseHeaders, exception));
}
@Override
- public void submitCompositeTree(final SObjectTree tree, final Map<String, List<String>> headers,
- final ResponseCallback<SObjectTreeResponse> callback) throws SalesforceException {
+ public void submitCompositeTree(final SObjectTree tree, final Map<String, List<String>> headers, final ResponseCallback<SObjectTreeResponse> callback)
+ throws SalesforceException {
final String url = versionUrl() + "composite/tree/" + tree.getObjectType();
final Request post = createRequest(HttpMethod.POST, url, headers);
@@ -142,10 +140,8 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
final ContentProvider content = serialize(xStreamCompositeTree, tree, tree.objectTypes());
post.content(content);
- doHttpRequest(post,
- (response, responseHeaders, exception) -> callback.onResponse(
- tryToReadResponse(xStreamCompositeTree, SObjectTreeResponse.class, response), responseHeaders,
- exception));
+ doHttpRequest(post, (response, responseHeaders, exception) -> callback.onResponse(tryToReadResponse(xStreamCompositeTree, SObjectTreeResponse.class, response),
+ responseHeaders, exception));
}
Request createRequest(final HttpMethod method, final String url, final Map<String, List<String>> headers) {
@@ -182,8 +178,7 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
return Optional.ofNullable(writers.get(type)).orElseGet(() -> mapper.writerFor(type));
}
- ContentProvider serialize(final XStream xstream, final Object body, final Class<?>... additionalTypes)
- throws SalesforceException {
+ ContentProvider serialize(final XStream xstream, final Object body, final Class<?>... additionalTypes) throws SalesforceException {
// input stream as entity content is needed for authentication retries
if (format == PayloadFormat.JSON) {
return new InputStreamContentProvider(toJson(body));
@@ -209,8 +204,7 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
return new ByteArrayInputStream(jsonBytes);
}
- <T> Optional<T> tryToReadResponse(final XStream xstream, final Class<T> expectedType,
- final InputStream responseStream) {
+ <T> Optional<T> tryToReadResponse(final XStream xstream, final Class<T> expectedType, final InputStream responseStream) {
if (responseStream == null) {
return Optional.empty();
}
@@ -259,27 +253,23 @@ public class DefaultCompositeApiClient extends AbstractClientBase implements Com
request.getHeaders().put("Authorization", "Bearer " + accessToken);
}
- static void checkCompositeBatchVersion(final String configuredVersion, final Version batchVersion)
- throws SalesforceException {
+ static void checkCompositeBatchVersion(final String configuredVersion, final Version batchVersion) throws SalesforceException {
if (Version.create(configuredVersion).compareTo(batchVersion) < 0) {
throw new SalesforceException("Component is configured with Salesforce API version " + configuredVersion
- + ", but the payload of the Composite API batch operation requires at least " + batchVersion, 0);
+ + ", but the payload of the Composite API batch operation requires at least " + batchVersion, 0);
}
}
- static void checkCompositeFormat(final PayloadFormat configuredFormat, final PayloadFormat requiredFormat)
- throws SalesforceException {
+ static void checkCompositeFormat(final PayloadFormat configuredFormat, final PayloadFormat requiredFormat) throws SalesforceException {
if (configuredFormat != requiredFormat) {
- throw new SalesforceException(
- "Component is configured with Salesforce Composite API format " + configuredFormat
- + ", but the payload of the Composite API operation requires format " + requiredFormat,
- 0);
+ throw new SalesforceException("Component is configured with Salesforce Composite API format " + configuredFormat
+ + ", but the payload of the Composite API operation requires format " + requiredFormat, 0);
}
}
static <T> T fromXml(final XStream xstream, final InputStream responseStream) {
@SuppressWarnings("unchecked")
- final T read = (T) xstream.fromXML(responseStream);
+ final T read = (T)xstream.fromXML(responseStream);
return read;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultRestClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultRestClient.java
index 556a2d8..623f04a 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultRestClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultRestClient.java
@@ -61,8 +61,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
private ObjectMapper objectMapper;
private XStream xStream;
- public DefaultRestClient(final SalesforceHttpClient httpClient, final String version, final PayloadFormat format,
- final SalesforceSession session) throws SalesforceException {
+ public DefaultRestClient(final SalesforceHttpClient httpClient, final String version, final PayloadFormat format, final SalesforceSession session) throws SalesforceException {
super(version, session, httpClient);
this.format = format;
@@ -116,19 +115,16 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
} catch (IOException e) {
// log and ignore
- String msg = "Unexpected Error parsing " + format
- + " error response body + [" + responseContent + "] : " + e.getMessage();
+ String msg = "Unexpected Error parsing " + format + " error response body + [" + responseContent + "] : " + e.getMessage();
log.warn(msg, e);
} catch (RuntimeException e) {
// log and ignore
- String msg = "Unexpected Error parsing " + format
- + " error response body + [" + responseContent + "] : " + e.getMessage();
+ String msg = "Unexpected Error parsing " + format + " error response body + [" + responseContent + "] : " + e.getMessage();
log.warn(msg, e);
}
// just report HTTP status info
- return new SalesforceException("Unexpected error: " + reason + ", with content: " + responseContent,
- statusCode);
+ return new SalesforceException("Unexpected error: " + reason + ", with content: " + responseContent, statusCode);
}
@Override
@@ -197,8 +193,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void getSObject(String sObjectName, String id, String[] fields, Map<String, List<String>> headers,
- ResponseCallback callback) {
+ public void getSObject(String sObjectName, String id, String[] fields, Map<String, List<String>> headers, ResponseCallback callback) {
// parse fields if set
String params = "";
@@ -220,8 +215,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void createSObject(String sObjectName, InputStream sObject, Map<String, List<String>> headers,
- ResponseCallback callback) {
+ public void createSObject(String sObjectName, InputStream sObject, Map<String, List<String>> headers, ResponseCallback callback) {
// post the sObject
final Request post = getRequest(HttpMethod.POST, sobjectsUrl(sObjectName), headers);
@@ -236,8 +230,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void updateSObject(String sObjectName, String id, InputStream sObject, Map<String, List<String>> headers,
- ResponseCallback callback) {
+ public void updateSObject(String sObjectName, String id, InputStream sObject, Map<String, List<String>> headers, ResponseCallback callback) {
final Request patch = getRequest("PATCH", sobjectsUrl(sObjectName + "/" + id), headers);
// requires authorization token
setAccessToken(patch);
@@ -260,10 +253,8 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void getSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers,
- ResponseCallback callback) {
- final Request get = getRequest(HttpMethod.GET,
- sobjectsExternalIdUrl(sObjectName, fieldName, fieldValue), headers);
+ public void getSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, ResponseCallback callback) {
+ final Request get = getRequest(HttpMethod.GET, sobjectsExternalIdUrl(sObjectName, fieldName, fieldValue), headers);
// requires authorization token
setAccessToken(get);
@@ -272,10 +263,8 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void upsertSObject(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, InputStream sObject,
- ResponseCallback callback) {
- final Request patch = getRequest("PATCH",
- sobjectsExternalIdUrl(sObjectName, fieldName, fieldValue), headers);
+ public void upsertSObject(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, InputStream sObject, ResponseCallback callback) {
+ final Request patch = getRequest("PATCH", sobjectsExternalIdUrl(sObjectName, fieldName, fieldValue), headers);
// requires authorization token
setAccessToken(patch);
@@ -289,10 +278,8 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void deleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers,
- ResponseCallback callback) {
- final Request delete = getRequest(HttpMethod.DELETE,
- sobjectsExternalIdUrl(sObjectName, fieldName, fieldValue), headers);
+ public void deleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, ResponseCallback callback) {
+ final Request delete = getRequest(HttpMethod.DELETE, sobjectsExternalIdUrl(sObjectName, fieldName, fieldValue), headers);
// requires authorization token
setAccessToken(delete);
@@ -302,10 +289,10 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
@Override
public void getBlobField(String sObjectName, String id, String blobFieldName, Map<String, List<String>> headers, ResponseCallback callback) {
- final Request get = getRequest(HttpMethod.GET,
- sobjectsUrl(sObjectName + "/" + id + "/" + blobFieldName), headers);
- // TODO this doesn't seem to be required, the response is always the content binary stream
- //get.header(HttpHeader.ACCEPT_ENCODING, "base64");
+ final Request get = getRequest(HttpMethod.GET, sobjectsUrl(sObjectName + "/" + id + "/" + blobFieldName), headers);
+ // TODO this doesn't seem to be required, the response is always the
+ // content binary stream
+ // get.header(HttpHeader.ACCEPT_ENCODING, "base64");
// requires authorization token
setAccessToken(get);
@@ -378,9 +365,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
@Override
- public void apexCall(String httpMethod, String apexUrl,
- Map<String, Object> queryParams, InputStream requestDto, Map<String, List<String>> headers,
- ResponseCallback callback) {
+ public void apexCall(String httpMethod, String apexUrl, Map<String, Object> queryParams, InputStream requestDto, Map<String, List<String>> headers, ResponseCallback callback) {
// create APEX call request
final Request request;
try {
@@ -393,8 +378,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
case "PATCH":
case "POST":
request.content(new InputStreamContentProvider(requestDto));
- request.header(HttpHeader.CONTENT_TYPE,
- PayloadFormat.JSON.equals(format) ? APPLICATION_JSON_UTF8 : APPLICATION_XML_UTF8);
+ request.header(HttpHeader.CONTENT_TYPE, PayloadFormat.JSON.equals(format) ? APPLICATION_JSON_UTF8 : APPLICATION_XML_UTF8);
break;
default:
// ignore body for other methods
@@ -414,8 +398,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
}
}
- private String apexCallUrl(String apexUrl, Map<String, Object> queryParams)
- throws UnsupportedEncodingException, URISyntaxException {
+ private String apexCallUrl(String apexUrl, Map<String, Object> queryParams) throws UnsupportedEncodingException, URISyntaxException {
if (queryParams != null && !queryParams.isEmpty()) {
apexUrl = URISupport.appendParametersToURI(apexUrl, queryParams);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/RestClient.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/RestClient.java
index b806732..deb6ca3 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/RestClient.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/RestClient.java
@@ -32,23 +32,25 @@ public interface RestClient {
* Lists summary information about each API version currently available,
* including the version, label, and a link to each version's root.
*
- * @param headers additional HTTP headers to send
+ * @param headers additional HTTP headers to send
* @param callback {@link ResponseCallback} to handle response or exception
*/
void getVersions(Map<String, List<String>> headers, ResponseCallback callback);
/**
- * Lists available resources for the specified API version, including resource name and URI.
+ * Lists available resources for the specified API version, including
+ * resource name and URI.
*
- * @param headers additional HTTP headers to send
+ * @param headers additional HTTP headers to send
* @param callback {@link ResponseCallback} to handle response or exception
*/
void getResources(Map<String, List<String>> headers, ResponseCallback callback);
/**
- * Lists the available objects and their metadata for your organization's data.
+ * Lists the available objects and their metadata for your organization's
+ * data.
*
- * @param headers additional HTTP headers to send
+ * @param headers additional HTTP headers to send
* @param callback {@link ResponseCallback} to handle response or exception
*/
void getGlobalObjects(Map<String, List<String>> headers, ResponseCallback callback);
@@ -57,17 +59,18 @@ public interface RestClient {
* Describes the individual metadata for the specified object.
*
* @param sObjectName specified object name
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void getBasicInfo(String sObjectName, Map<String, List<String>> headers, ResponseCallback callback);
/**
- * Completely describes the individual metadata at all levels for the specified object.
+ * Completely describes the individual metadata at all levels for the
+ * specified object.
*
* @param sObjectName specified object name
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void getDescription(String sObjectName, Map<String, List<String>> headers, ResponseCallback callback);
@@ -75,9 +78,9 @@ public interface RestClient {
* Retrieves a record for the specified object ID.
*
* @param sObjectName specified object name
- * @param id object id
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param id object id
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void getSObject(String sObjectName, String id, String[] fields, Map<String, List<String>> headers, ResponseCallback callback);
@@ -85,9 +88,9 @@ public interface RestClient {
* Creates a record for the specified object.
*
* @param sObjectName specified object name
- * @param headers additional HTTP headers to send
- * @param sObject request entity
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param sObject request entity
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void createSObject(String sObjectName, InputStream sObject, Map<String, List<String>> headers, ResponseCallback callback);
@@ -95,10 +98,10 @@ public interface RestClient {
* Updates a record for the specified object ID.
*
* @param sObjectName specified object name
- * @param id object id
- * @param headers additional HTTP headers to send
- * @param sObject request entity
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param id object id
+ * @param headers additional HTTP headers to send
+ * @param sObject request entity
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void updateSObject(String sObjectName, String id, InputStream sObject, Map<String, List<String>> headers, ResponseCallback callback);
@@ -106,9 +109,9 @@ public interface RestClient {
* Deletes a record for the specified object ID.
*
* @param sObjectName specified object name
- * @param id object id
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param id object id
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void deleteSObject(String sObjectName, String id, Map<String, List<String>> headers, ResponseCallback callback);
@@ -116,58 +119,54 @@ public interface RestClient {
* Retrieves a record for the specified external ID.
*
* @param sObjectName specified object name
- * @param fieldName external field name
- * @param fieldValue external field value
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param fieldName external field name
+ * @param fieldValue external field value
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
- void getSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers,
- ResponseCallback callback);
+ void getSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, ResponseCallback callback);
/**
- * Creates or updates a record based on the value of a specified external ID field.
+ * Creates or updates a record based on the value of a specified external ID
+ * field.
*
* @param sObjectName specified object name
- * @param fieldName external field name
- * @param fieldValue external field value
- * @param headers additional HTTP headers to send
- * @param sObject input object to insert or update
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param fieldName external field name
+ * @param fieldValue external field value
+ * @param headers additional HTTP headers to send
+ * @param sObject input object to insert or update
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
- void upsertSObject(String sObjectName, String fieldName, String fieldValue,
- Map<String, List<String>> headers, InputStream sObject, ResponseCallback callback);
+ void upsertSObject(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, InputStream sObject, ResponseCallback callback);
/**
* Deletes a record based on the value of a specified external ID field.
*
* @param sObjectName specified object name
- * @param fieldName external field name
- * @param fieldValue external field value
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param fieldName external field name
+ * @param fieldValue external field value
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
- void deleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers,
- ResponseCallback callback);
-
+ void deleteSObjectWithId(String sObjectName, String fieldName, String fieldValue, Map<String, List<String>> headers, ResponseCallback callback);
/**
* Retrieves the specified blob field from an individual record.
*
- * @param sObjectName specified object name
- * @param id identifier of the object
+ * @param sObjectName specified object name
+ * @param id identifier of the object
* @param blobFieldName name of the field holding the blob
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
- void getBlobField(String sObjectName, String id, String blobFieldName, Map<String, List<String>> headers,
- ResponseCallback callback);
+ void getBlobField(String sObjectName, String id, String blobFieldName, Map<String, List<String>> headers, ResponseCallback callback);
/**
* Executes the specified SOQL query.
*
* @param soqlQuery SOQL query
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void query(String soqlQuery, Map<String, List<String>> headers, ResponseCallback callback);
@@ -175,8 +174,8 @@ public interface RestClient {
* Get SOQL query results using nextRecordsUrl.
*
* @param nextRecordsUrl URL for next records to fetch, returned by query()
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void queryMore(String nextRecordsUrl, Map<String, List<String>> headers, ResponseCallback callback);
@@ -184,8 +183,8 @@ public interface RestClient {
* Executes the specified SOQL query including deleted records.
*
* @param soqlQuery SOQL query
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void queryAll(String soqlQuery, Map<String, List<String>> headers, ResponseCallback callback);
@@ -193,60 +192,60 @@ public interface RestClient {
* Executes the specified SOSL search.
*
* @param soslQuery SOSL query
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void search(String soslQuery, Map<String, List<String>> headers, ResponseCallback callback);
/**
* Executes a user defined APEX REST API call.
*
- * @param httpMethod HTTP method to execute.
- * @param apexUrl APEX api url.
- * @param queryParams optional query parameters for GET methods, may be empty.
- * @param requestDto optional input DTO for POST, etc. may be null.
- * @param headers additional HTTP headers to send
- * @param callback {@link ResponseCallback} to handle response or exception
+ * @param httpMethod HTTP method to execute.
+ * @param apexUrl APEX api url.
+ * @param queryParams optional query parameters for GET methods, may be
+ * empty.
+ * @param requestDto optional input DTO for POST, etc. may be null.
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
- void apexCall(String httpMethod, String apexUrl, Map<String, Object> queryParams, InputStream requestDto,
- Map<String, List<String>> headers, ResponseCallback callback);
+ void apexCall(String httpMethod, String apexUrl, Map<String, Object> queryParams, InputStream requestDto, Map<String, List<String>> headers, ResponseCallback callback);
/**
* Fetches recently viewed records.
*
- * @param limit
- * 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.
+ * @param limit 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.
* @param headers additional HTTP headers to send
- * @param responseCallback
- * {@link ResponseCallback} to handle response or exception
+ * @param responseCallback {@link ResponseCallback} to handle response or
+ * exception
*/
void recent(Integer limit, Map<String, List<String>> headers, ResponseCallback responseCallback);
/**
* Fetches Organization Limits.
*
- * @param headers additional HTTP headers to send
- * @param responseCallback {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param responseCallback {@link ResponseCallback} to handle response or
+ * exception
*/
void limits(Map<String, List<String>> headers, ResponseCallback responseCallback);
/**
* Submits, approves or rejects particular record.
*
- * @param headers additional HTTP headers to send
- * @param callback
- * {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void approval(InputStream request, Map<String, List<String>> headers, ResponseCallback callback);
/**
* Returns a list of all approval processes.
*
- * @param headers additional HTTP headers to send
- * @param callback
- * {@link ResponseCallback} to handle response or exception
+ * @param headers additional HTTP headers to send
+ * @param callback {@link ResponseCallback} to handle response or exception
*/
void approvals(Map<String, List<String>> headers, ResponseCallback callback);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
index bed4d724..2f13b4d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
@@ -65,21 +65,21 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
@Override
public boolean accept(Request request, Response response) {
- HttpConversation conversation = ((SalesforceHttpRequest) request).getConversation();
- Integer retries = (Integer) conversation.getAttribute(AUTHENTICATION_RETRIES_ATTRIBUTE);
+ HttpConversation conversation = ((SalesforceHttpRequest)request).getConversation();
+ Integer retries = (Integer)conversation.getAttribute(AUTHENTICATION_RETRIES_ATTRIBUTE);
- // is this an authentication response for a previously handled conversation?
- if (conversation.getAttribute(AUTHENTICATION_REQUEST_ATTRIBUTE) != null
- && (retries == null || retries <= maxAuthenticationRetries)) {
+ // is this an authentication response for a previously handled
+ // conversation?
+ if (conversation.getAttribute(AUTHENTICATION_REQUEST_ATTRIBUTE) != null && (retries == null || retries <= maxAuthenticationRetries)) {
return true;
}
final int status = response.getStatus();
// handle UNAUTHORIZED and BAD_REQUEST for Bulk API,
- // the actual InvalidSessionId Bulk API error is checked and handled in the listener
+ // the actual InvalidSessionId Bulk API error is checked and handled in
+ // the listener
// also check retries haven't exceeded maxAuthenticationRetries
- return (status == HttpStatus.UNAUTHORIZED_401 || status == HttpStatus.BAD_REQUEST_400)
- && (retries == null || retries <= maxAuthenticationRetries);
+ return (status == HttpStatus.UNAUTHORIZED_401 || status == HttpStatus.BAD_REQUEST_400) && (retries == null || retries <= maxAuthenticationRetries);
}
@Override
@@ -101,13 +101,14 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
// get number of retries
HttpConversation conversation = request.getConversation();
- Integer retries = (Integer) conversation.getAttribute(AUTHENTICATION_RETRIES_ATTRIBUTE);
+ Integer retries = (Integer)conversation.getAttribute(AUTHENTICATION_RETRIES_ATTRIBUTE);
if (retries == null) {
retries = 0;
}
- // get AbstractClientBase if request originated from one, for updating token and setting auth header
- final AbstractClientBase client = (AbstractClientBase) conversation.getAttribute(CLIENT_ATTRIBUTE);
+ // get AbstractClientBase if request originated from one, for
+ // updating token and setting auth header
+ final AbstractClientBase client = (AbstractClientBase)conversation.getAttribute(CLIENT_ATTRIBUTE);
// exception response
if (result.isFailed()) {
@@ -117,14 +118,15 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
}
// response to a re-login request
- SalesforceHttpRequest origRequest = (SalesforceHttpRequest) conversation.getAttribute(AUTHENTICATION_REQUEST_ATTRIBUTE);
+ SalesforceHttpRequest origRequest = (SalesforceHttpRequest)conversation.getAttribute(AUTHENTICATION_REQUEST_ATTRIBUTE);
if (origRequest != null) {
// parse response
try {
session.parseLoginResponse(response, response.getContentAsString());
} catch (SalesforceException e) {
- // retry login request on error if we have login attempts left
+ // retry login request on error if we have login attempts
+ // left
if (retries < maxAuthenticationRetries) {
retryOnFailure(request, conversation, retries, client, e);
} else {
@@ -156,16 +158,17 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
// REST token expiry
LOG.warn("Retrying on Salesforce authentication error [{}]: [{}]", status, reason);
- // remember original request and send a relogin request in current conversation
+ // remember original request and send a relogin request in
+ // current conversation
retryLogin(request, retries);
} else if (status < HttpStatus.OK_200 || status >= HttpStatus.MULTIPLE_CHOICES_300) {
// HTTP failure status
- // get detailed cause, if request comes from an AbstractClientBase
+ // get detailed cause, if request comes from an
+ // AbstractClientBase
final InputStream inputStream = getContent().length == 0 ? null : getContentAsInputStream();
- final SalesforceException cause = client != null
- ? client.createRestException(response, inputStream) : null;
+ final SalesforceException cause = client != null ? client.createRestException(response, inputStream) : null;
if (status == HttpStatus.BAD_REQUEST_400 && cause != null && isInvalidSessionError(cause)) {
@@ -189,8 +192,7 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
}
private boolean isInvalidSessionError(SalesforceException e) {
- return e.getErrors() != null && e.getErrors().size() == 1
- && "InvalidSessionId".equals(e.getErrors().get(0).getErrorCode());
+ return e.getErrors() != null && e.getErrors().size() == 1 && "InvalidSessionId".equals(e.getErrors().get(0).getErrorCode());
}
private void retryLogin(SalesforceHttpRequest request, Integer retries) {
@@ -202,16 +204,17 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
retryRequest((SalesforceHttpRequest)session.getLoginRequest(conversation), null, retries, conversation, false);
}
- private void retryRequest(SalesforceHttpRequest request, AbstractClientBase client, Integer retries, HttpConversation conversation,
- boolean copy) {
+ private void retryRequest(SalesforceHttpRequest request, AbstractClientBase client, Integer retries, HttpConversation conversation, boolean copy) {
// copy the request to resend
- // TODO handle a change in Salesforce instanceUrl, right now we retry with the same destination
+ // TODO handle a change in Salesforce instanceUrl, right now we
+ // retry with the same destination
final Request newRequest;
if (copy) {
newRequest = httpClient.copyRequest(request, request.getURI());
newRequest.method(request.getMethod());
HttpFields headers = newRequest.getHeaders();
- // copy cookies and host for subscriptions to avoid '403::Unknown Client' errors
+ // copy cookies and host for subscriptions to avoid
+ // '403::Unknown Client' errors
for (HttpField field : request.getHeaders()) {
HttpHeader header = field.getHeader();
if (HttpHeader.COOKIE.equals(header) || HttpHeader.HOST.equals(header)) {
@@ -266,16 +269,15 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
notifier.forwardSuccessComplete(conversation.getResponseListeners(), request, response);
}
- private void forwardFailureComplete(SalesforceHttpRequest request, Throwable requestFailure,
- Response response, Throwable responseFailure) {
+ private void forwardFailureComplete(SalesforceHttpRequest request, Throwable requestFailure, Response response, Throwable responseFailure) {
HttpConversation conversation = request.getConversation();
conversation.updateResponseListeners(null);
- notifier.forwardFailureComplete(conversation.getResponseListeners(), request, requestFailure,
- response, responseFailure);
+ notifier.forwardFailureComplete(conversation.getResponseListeners(), request, requestFailure, response, responseFailure);
}
}
- // no @Override annotation here to keep it compatible with Jetty 9.2, getName was added in 9.3
+ // no @Override annotation here to keep it compatible with Jetty 9.2,
+ // getName was added in 9.3
@Override
public String getName() {
return "CamelSalesforceSecurityHandler";
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SyncResponseCallback.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SyncResponseCallback.java
index 0e3aa6c..38365f4 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SyncResponseCallback.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SyncResponseCallback.java
@@ -24,7 +24,8 @@ import java.util.concurrent.TimeUnit;
import org.apache.camel.component.salesforce.api.SalesforceException;
/**
- * Thin wrapper to handle callback for {@link RestClient.ResponseCallback} and allow waiting for results
+ * Thin wrapper to handle callback for {@link RestClient.ResponseCallback} and
+ * allow waiting for results
*/
public class SyncResponseCallback implements RestClient.ResponseCallback {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForFieldsEnum.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForFieldsEnum.java
index 6309dbf..3f79cda 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForFieldsEnum.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForFieldsEnum.java
@@ -54,4 +54,4 @@ public enum NotifyForFieldsEnum {
throw new IllegalArgumentException(value);
}
-}
\ No newline at end of file
+}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForOperationsEnum.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForOperationsEnum.java
index 69d1491..8d38135 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForOperationsEnum.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/NotifyForOperationsEnum.java
@@ -54,4 +54,4 @@ public enum NotifyForOperationsEnum {
throw new IllegalArgumentException(value);
}
-}
\ No newline at end of file
+}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractRestProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractRestProcessor.java
index c870de5..e95fb52 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractRestProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractRestProcessor.java
@@ -84,8 +84,7 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
}
// used in unit tests
- AbstractRestProcessor(final SalesforceEndpoint endpoint, final RestClient restClient,
- final Map<String, Class<?>> classMap) {
+ AbstractRestProcessor(final SalesforceEndpoint endpoint, final RestClient restClient, final Map<String, Class<?>> classMap) {
super(endpoint);
this.restClient = restClient;
this.classMap = classMap;
@@ -192,17 +191,11 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
throw new SalesforceException("Unknown operation name: " + operationName.value(), null);
}
} catch (SalesforceException e) {
- exchange.setException(new SalesforceException(
- String.format("Error processing %s: [%s] \"%s\"",
- operationName.value(), e.getStatusCode(), e.getMessage()),
- e));
+ exchange.setException(new SalesforceException(String.format("Error processing %s: [%s] \"%s\"", operationName.value(), e.getStatusCode(), e.getMessage()), e));
callback.done(true);
return true;
} catch (RuntimeException e) {
- exchange.setException(new SalesforceException(
- String.format("Unexpected Error processing %s: \"%s\"",
- operationName.value(), e.getMessage()),
- e));
+ exchange.setException(new SalesforceException(String.format("Unexpected Error processing %s: \"%s\"", operationName.value(), e.getMessage()), e));
callback.done(true);
return true;
}
@@ -214,13 +207,12 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
final void processApproval(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
final TypeConverter converter = exchange.getContext().getTypeConverter();
- final ApprovalRequest approvalRequestFromHeader = getParameter(SalesforceEndpointConfig.APPROVAL, exchange,
- IGNORE_BODY, IS_OPTIONAL, ApprovalRequest.class);
+ final ApprovalRequest approvalRequestFromHeader = getParameter(SalesforceEndpointConfig.APPROVAL, exchange, IGNORE_BODY, IS_OPTIONAL, ApprovalRequest.class);
final boolean requestGivenInHeader = approvalRequestFromHeader != null;
- // find if there is a ApprovalRequest as `approval` in the message header
- final ApprovalRequest approvalHeader = Optional.ofNullable(approvalRequestFromHeader)
- .orElse(new ApprovalRequest());
+ // find if there is a ApprovalRequest as `approval` in the message
+ // header
+ final ApprovalRequest approvalHeader = Optional.ofNullable(approvalRequestFromHeader).orElse(new ApprovalRequest());
final Message incomingMessage = exchange.getIn();
@@ -233,16 +225,16 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
final Object approvalBody = incomingMessage.getBody();
final boolean bodyIsIterable = approvalBody instanceof Iterable;
- final boolean bodyIsIterableButEmpty = bodyIsIterable && !((Iterable) approvalBody).iterator().hasNext();
+ final boolean bodyIsIterableButEmpty = bodyIsIterable && !((Iterable)approvalBody).iterator().hasNext();
- // body contains nothing of interest if it's null, holds an empty iterable or cannot be converted to
+ // body contains nothing of interest if it's null, holds an empty
+ // iterable or cannot be converted to
// ApprovalRequest
final boolean nothingInBody = !(approvalBody != null && !bodyIsIterableButEmpty);
// we found nothing in the headers or the body
if (nothingInheader && nothingInBody) {
- throw new SalesforceException("Missing " + SalesforceEndpointConfig.APPROVAL
- + " parameter in header or ApprovalRequest or List of ApprovalRequests body", 0);
+ throw new SalesforceException("Missing " + SalesforceEndpointConfig.APPROVAL + " parameter in header or ApprovalRequest or List of ApprovalRequests body", 0);
}
// let's try to resolve the request body to send
@@ -252,21 +244,20 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
requestsBody = new ApprovalRequests(approvalHeader);
} else if (bodyIsIterable) {
// multiple ApprovalRequests are found
- final Iterable<?> approvalRequests = (Iterable<?>) approvalBody;
+ final Iterable<?> approvalRequests = (Iterable<?>)approvalBody;
// use header values as template and apply them to the body
- final List<ApprovalRequest> requests = StreamSupport.stream(approvalRequests.spliterator(), false)
- .map(value -> converter.convertTo(ApprovalRequest.class, value))
- .map(request -> request.applyTemplate(approvalHeader)).collect(Collectors.toList());
+ final List<ApprovalRequest> requests = StreamSupport.stream(approvalRequests.spliterator(), false).map(value -> converter.convertTo(ApprovalRequest.class, value))
+ .map(request -> request.applyTemplate(approvalHeader)).collect(Collectors.toList());
requestsBody = new ApprovalRequests(requests);
} else {
- // we've looked at the body, and are expecting to see something resembling ApprovalRequest in there
+ // we've looked at the body, and are expecting to see something
+ // resembling ApprovalRequest in there
// but lets see if that is so
final ApprovalRequest given = converter.tryConvertTo(ApprovalRequest.class, approvalBody);
- final ApprovalRequest request = Optional.ofNullable(given).orElse(new ApprovalRequest())
- .applyTemplate(approvalHeader);
+ final ApprovalRequest request = Optional.ofNullable(given).orElse(new ApprovalRequest()).applyTemplate(approvalHeader);
requestsBody = new ApprovalRequests(request);
}
@@ -276,8 +267,7 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
restClient.approval(request, determineHeaders(exchange), processWithResponseCallback(exchange, callback));
}
- final boolean processApprovalHeaderValues(final ApprovalRequest approvalRequest,
- final Map<String, Object> incomingHeaderValues) {
+ final boolean processApprovalHeaderValues(final ApprovalRequest approvalRequest, final Map<String, Object> incomingHeaderValues) {
// loop trough all header values, find those that start with `approval.`
// set the property value to the given approvalRequest and return if
// any value was set
@@ -363,8 +353,7 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
sObjectName = getParameter(SOBJECT_NAME, exchange, IGNORE_BODY, NOT_OPTIONAL);
}
- restClient.createSObject(sObjectName, getRequestStream(exchange), determineHeaders(exchange),
- processWithResponseCallback(exchange, callback));
+ restClient.createSObject(sObjectName, getRequestStream(exchange), determineHeaders(exchange), processWithResponseCallback(exchange, callback));
}
private void processUpdateSobject(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -384,14 +373,13 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
}
final String finalsObjectId = sObjectId;
- restClient.updateSObject(sObjectName, sObjectId, getRequestStream(exchange), determineHeaders(exchange),
- new RestClient.ResponseCallback() {
- @Override
- public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
- processResponse(exchange, response, headers, exception, callback);
- restoreFields(exchange, sObjectBase, finalsObjectId, null, null);
- }
- });
+ restClient.updateSObject(sObjectName, sObjectId, getRequestStream(exchange), determineHeaders(exchange), new RestClient.ResponseCallback() {
+ @Override
+ public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
+ processResponse(exchange, response, headers, exception, callback);
+ restoreFields(exchange, sObjectBase, finalsObjectId, null, null);
+ }
+ });
}
private void processDeleteSobject(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -421,8 +409,7 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
String sObjectName;
Object oldValue = null;
String sObjectExtIdValue;
- final String sObjectExtIdName = getParameter(SOBJECT_EXT_ID_NAME,
- exchange, IGNORE_BODY, NOT_OPTIONAL);
+ final String sObjectExtIdName = getParameter(SOBJECT_EXT_ID_NAME, exchange, IGNORE_BODY, NOT_OPTIONAL);
// determine parameters from input AbstractSObject
final AbstractSObjectBase sObjectBase = exchange.getIn().getBody(AbstractSObjectBase.class);
@@ -439,21 +426,19 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
setResponseClass(exchange, sObjectName);
final Object finalOldValue = oldValue;
- restClient.getSObjectWithId(sObjectName, sObjectExtIdName, sObjectExtIdValue, determineHeaders(exchange),
- new RestClient.ResponseCallback() {
- @Override
- public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
- processResponse(exchange, response, headers, exception, callback);
- restoreFields(exchange, sObjectBase, null, sObjectExtIdName, finalOldValue);
- }
- });
+ restClient.getSObjectWithId(sObjectName, sObjectExtIdName, sObjectExtIdValue, determineHeaders(exchange), new RestClient.ResponseCallback() {
+ @Override
+ public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
+ processResponse(exchange, response, headers, exception, callback);
+ restoreFields(exchange, sObjectBase, null, sObjectExtIdName, finalOldValue);
+ }
+ });
}
private void processUpsertSobject(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
String sObjectName;
String sObjectExtIdValue;
- final String sObjectExtIdName = getParameter(SOBJECT_EXT_ID_NAME, exchange,
- IGNORE_BODY, NOT_OPTIONAL);
+ final String sObjectExtIdName = getParameter(SOBJECT_EXT_ID_NAME, exchange, IGNORE_BODY, NOT_OPTIONAL);
// determine parameters from input AbstractSObject
Object oldValue = null;
@@ -470,14 +455,13 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
}
final Object finalOldValue = oldValue;
- restClient.upsertSObject(sObjectName, sObjectExtIdName, sObjectExtIdValue, determineHeaders(exchange), getRequestStream(exchange),
- new RestClient.ResponseCallback() {
- @Override
- public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
- processResponse(exchange, response, headers, exception, callback);
- restoreFields(exchange, sObjectBase, null, sObjectExtIdName, finalOldValue);
- }
- });
+ restClient.upsertSObject(sObjectName, sObjectExtIdName, sObjectExtIdValue, determineHeaders(exchange), getRequestStream(exchange), new RestClient.ResponseCallback() {
+ @Override
+ public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
+ processResponse(exchange, response, headers, exception, callback);
+ restoreFields(exchange, sObjectBase, null, sObjectExtIdName, finalOldValue);
+ }
+ });
}
private void processDeleteSobjectWithId(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -498,21 +482,19 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
}
final Object finalOldValue = oldValue;
- restClient.deleteSObjectWithId(sObjectName, sObjectExtIdName, sObjectExtIdValue, determineHeaders(exchange),
- new RestClient.ResponseCallback() {
- @Override
- public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
- processResponse(exchange, response, headers, exception, callback);
- restoreFields(exchange, sObjectBase, null, sObjectExtIdName, finalOldValue);
- }
- });
+ restClient.deleteSObjectWithId(sObjectName, sObjectExtIdName, sObjectExtIdValue, determineHeaders(exchange), new RestClient.ResponseCallback() {
+ @Override
+ public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
+ processResponse(exchange, response, headers, exception, callback);
+ restoreFields(exchange, sObjectBase, null, sObjectExtIdName, finalOldValue);
+ }
+ });
}
private void processGetBlobField(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
String sObjectName;
// get blob field name
- final String sObjectBlobFieldName = getParameter(SOBJECT_BLOB_FIELD_NAME,
- exchange, IGNORE_BODY, NOT_OPTIONAL);
+ final String sObjectBlobFieldName = getParameter(SOBJECT_BLOB_FIELD_NAME, exchange, IGNORE_BODY, NOT_OPTIONAL);
// determine parameters from input AbstractSObject
final AbstractSObjectBase sObjectBase = exchange.getIn().getBody(AbstractSObjectBase.class);
@@ -526,14 +508,13 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
}
final String sObjectId = sObjectIdValue;
- restClient.getBlobField(sObjectName, sObjectId, sObjectBlobFieldName, determineHeaders(exchange),
- new RestClient.ResponseCallback() {
- @Override
- public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
- processResponse(exchange, response, headers, exception, callback);
- restoreFields(exchange, sObjectBase, sObjectId, null, null);
- }
- });
+ restClient.getBlobField(sObjectName, sObjectId, sObjectBlobFieldName, determineHeaders(exchange), new RestClient.ResponseCallback() {
+ @Override
+ public void onResponse(InputStream response, Map<String, String> headers, SalesforceException exception) {
+ processResponse(exchange, response, headers, exception, callback);
+ restoreFields(exchange, sObjectBase, sObjectId, null, null);
+ }
+ });
}
private void processQuery(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -587,11 +568,9 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
// set request stream
final Object requestBody = exchange.getIn().getBody();
- final InputStream requestDto =
- (requestBody != null && !(requestBody instanceof Map)) ? getRequestStream(exchange) : null;
+ final InputStream requestDto = (requestBody != null && !(requestBody instanceof Map)) ? getRequestStream(exchange) : null;
- restClient.apexCall(apexMethod, apexUrl, queryParams, requestDto, determineHeaders(exchange),
- processWithResponseCallback(exchange, callback));
+ restClient.apexCall(apexMethod, apexUrl, queryParams, requestDto, determineHeaders(exchange), processWithResponseCallback(exchange, callback));
}
private String getApexUrl(Exchange exchange) throws SalesforceException {
@@ -643,7 +622,8 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
// use endpoint map
Map<String, Object> queryParams = new HashMap<>(endpoint.getConfiguration().getApexQueryParams());
- // look for individual properties, allowing endpoint properties to be overridden
+ // look for individual properties, allowing endpoint properties to be
+ // overridden
for (Map.Entry<String, Object> entry : exchange.getIn().getHeaders().entrySet()) {
if (entry.getKey().startsWith(APEX_QUERY_PARAM_PREFIX)) {
queryParams.put(entry.getKey().substring(APEX_QUERY_PARAM_PREFIX.length()), entry.getValue());
@@ -652,15 +632,14 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
// add params from body if it's a map
final Object body = exchange.getIn().getBody();
if (body instanceof Map) {
- queryParams.putAll((Map<String, Object>) body);
+ queryParams.putAll((Map<String, Object>)body);
}
log.debug("Using APEX query params {}", queryParams);
return queryParams;
}
- private void restoreFields(Exchange exchange, AbstractSObjectBase sObjectBase,
- String sObjectId, String sObjectExtIdName, Object oldValue) {
+ private void restoreFields(Exchange exchange, AbstractSObjectBase sObjectBase, String sObjectId, String sObjectExtIdName, Object oldValue) {
// restore fields
if (sObjectBase != null) {
// restore the Id if it was cleared
@@ -672,7 +651,8 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
try {
setPropertyValue(sObjectBase, sObjectExtIdName, oldValue);
} catch (SalesforceException e) {
- // YES, the exchange may fail if the property cannot be reset!!!
+ // YES, the exchange may fail if the property cannot be
+ // reset!!!
exchange.setException(e);
}
}
@@ -685,20 +665,11 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
Method setMethod = sObjectBase.getClass().getMethod("set" + name, value.getClass());
setMethod.invoke(sObjectBase, value);
} catch (NoSuchMethodException e) {
- throw new SalesforceException(
- String.format("SObject %s does not have a field %s",
- sObjectBase.getClass().getName(), name),
- e);
+ throw new SalesforceException(String.format("SObject %s does not have a field %s", sObjectBase.getClass().getName(), name), e);
} catch (InvocationTargetException e) {
- throw new SalesforceException(
- String.format("Error setting value %s.%s",
- sObjectBase.getClass().getSimpleName(), name),
- e);
+ throw new SalesforceException(String.format("Error setting value %s.%s", sObjectBase.getClass().getSimpleName(), name), e);
} catch (IllegalAccessException e) {
- throw new SalesforceException(
- String.format("Error accessing value %s.%s",
- sObjectBase.getClass().getSimpleName(), name),
- e);
+ throw new SalesforceException(String.format("Error accessing value %s.%s", sObjectBase.getClass().getSimpleName(), name), e);
}
}
@@ -710,24 +681,15 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
// clear the value with the set method
Method setMethod = sObjectBase.getClass().getMethod("set" + propertyName, getMethod.getReturnType());
- setMethod.invoke(sObjectBase, new Object[]{null});
+ setMethod.invoke(sObjectBase, new Object[] {null});
return value;
} catch (NoSuchMethodException e) {
- throw new SalesforceException(
- String.format("SObject %s does not have a field %s",
- sObjectBase.getClass().getSimpleName(), propertyName),
- e);
+ throw new SalesforceException(String.format("SObject %s does not have a field %s", sObjectBase.getClass().getSimpleName(), propertyName), e);
} catch (InvocationTargetException e) {
- throw new SalesforceException(
- String.format("Error getting/setting value %s.%s",
- sObjectBase.getClass().getSimpleName(), propertyName),
- e);
+ throw new SalesforceException(String.format("Error getting/setting value %s.%s", sObjectBase.getClass().getSimpleName(), propertyName), e);
} catch (IllegalAccessException e) {
- throw new SalesforceException(
- String.format("Error accessing value %s.%s",
- sObjectBase.getClass().getSimpleName(), propertyName),
- e);
+ throw new SalesforceException(String.format("Error accessing value %s.%s", sObjectBase.getClass().getSimpleName(), propertyName), e);
}
}
@@ -740,8 +702,7 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
/**
* Returns {@link InputStream} to serialized form of the given object.
*
- * @param object
- * object to serialize
+ * @param object object to serialize
* @return stream to read serialized object from
*/
protected abstract InputStream getRequestStream(Message in, Object object) throws SalesforceException;
@@ -767,13 +728,9 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
// use custom response class property
final String className = getParameter(SOBJECT_CLASS, exchange, IGNORE_BODY, NOT_OPTIONAL);
try {
- sObjectClass = endpoint.getComponent().getCamelContext()
- .getClassResolver().resolveMandatoryClass(className);
+ sObjectClass = endpoint.getComponent().getCamelContext().getClassResolver().resolveMandatoryClass(className);
} catch (ClassNotFoundException e) {
- throw new SalesforceException(
- String.format("SObject class not found %s, %s",
- className, e.getMessage()),
- e);
+ throw new SalesforceException(String.format("SObject class not found %s, %s", className, e.getMessage()), e);
}
}
exchange.setProperty(RESPONSE_CLASS, sObjectClass);
@@ -784,8 +741,7 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor
}
// process response entity and set out message in exchange
- protected abstract void processResponse(Exchange exchange, InputStream responseEntity, Map<String, String> headers,
- SalesforceException ex, AsyncCallback callback);
+ protected abstract void processResponse(Exchange exchange, InputStream responseEntity, Map<String, String> headers, SalesforceException ex, AsyncCallback callback);
final boolean shouldReport(SalesforceException ex) {
return !(ex instanceof NoSuchSObjectException && notFoundBehaviour == NotFoundBehaviour.NULL);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractSalesforceProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractSalesforceProcessor.java
index 138120d..830a3e3 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractSalesforceProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractSalesforceProcessor.java
@@ -66,33 +66,37 @@ public abstract class AbstractSalesforceProcessor implements SalesforceProcessor
* Gets String value for a parameter from header, endpoint config, or
* exchange body (optional).
*
- * @param exchange exchange to inspect
- * @param convertInBody converts In body to String value if true
- * @param propName name of property
- * @param optional if {@code true} returns null, otherwise throws RestException
- * @return value of property, or {@code null} for optional parameters if not found.
- * @throws org.apache.camel.component.salesforce.api.SalesforceException
- * if the property can't be found or on conversion errors.
+ * @param exchange exchange to inspect
+ * @param convertInBody converts In body to String value if true
+ * @param propName name of property
+ * @param optional if {@code true} returns null, otherwise throws
+ * RestException
+ * @return value of property, or {@code null} for optional parameters if not
+ * found.
+ * @throws org.apache.camel.component.salesforce.api.SalesforceException if
+ * the property can't be found or on conversion errors.
*/
- protected final String getParameter(final String propName, final Exchange exchange, final boolean convertInBody,
- final boolean optional) throws SalesforceException {
+ protected final String getParameter(final String propName, final Exchange exchange, final boolean convertInBody, final boolean optional) throws SalesforceException {
return getParameter(propName, exchange, convertInBody, optional, String.class);
}
/**
- * Gets value for a parameter from header, endpoint config, or exchange body (optional).
+ * Gets value for a parameter from header, endpoint config, or exchange body
+ * (optional).
*
- * @param exchange exchange to inspect
- * @param convertInBody converts In body to parameterClass value if true
- * @param propName name of property
- * @param optional if {@code true} returns null, otherwise throws RestException
- * @param parameterClass parameter type
- * @return value of property, or {@code null} for optional parameters if not found.
- * @throws org.apache.camel.component.salesforce.api.SalesforceException
- * if the property can't be found or on conversion errors.
+ * @param exchange exchange to inspect
+ * @param convertInBody converts In body to parameterClass value if true
+ * @param propName name of property
+ * @param optional if {@code true} returns null, otherwise throws
+ * RestException
+ * @param parameterClass parameter type
+ * @return value of property, or {@code null} for optional parameters if not
+ * found.
+ * @throws org.apache.camel.component.salesforce.api.SalesforceException if
+ * the property can't be found or on conversion errors.
*/
- protected final <T> T getParameter(final String propName, final Exchange exchange, final boolean convertInBody,
- final boolean optional, final Class<T> parameterClass) throws SalesforceException {
+ protected final <T> T getParameter(final String propName, final Exchange exchange, final boolean convertInBody, final boolean optional, final Class<T> parameterClass)
+ throws SalesforceException {
final Message in = exchange.getIn();
T propValue = in.getHeader(propName, parameterClass);
@@ -100,8 +104,7 @@ public abstract class AbstractSalesforceProcessor implements SalesforceProcessor
if (propValue == null) {
// check if type conversion failed
if (in.getHeader(propName) != null) {
- throw new IllegalArgumentException(
- "Header " + propName + " could not be converted to type " + parameterClass.getName());
+ throw new IllegalArgumentException("Header " + propName + " could not be converted to type " + parameterClass.getName());
}
final Object value = endpointConfigMap.get(propName);
@@ -122,8 +125,7 @@ public abstract class AbstractSalesforceProcessor implements SalesforceProcessor
// error if property was not set
if (propValue == null && !optional) {
- final String msg = "Missing property " + propName
- + (convertInBody ? ", message body could not be converted to type " + parameterClass.getName() : "");
+ final String msg = "Missing property " + propName + (convertInBody ? ", message body could not be converted to type " + parameterClass.getName() : "");
throw new SalesforceException(msg, null);
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AnalyticsApiProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AnalyticsApiProcessor.java
index a06b2a7..03f9775 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AnalyticsApiProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AnalyticsApiProcessor.java
@@ -49,9 +49,7 @@ public class AnalyticsApiProcessor extends AbstractSalesforceProcessor {
public AnalyticsApiProcessor(SalesforceEndpoint endpoint) throws SalesforceException {
super(endpoint);
- this.analyticsClient = new DefaultAnalyticsApiClient(
- (String) endpointConfigMap.get(SalesforceEndpointConfig.API_VERSION), session,
- httpClient);
+ this.analyticsClient = new DefaultAnalyticsApiClient((String)endpointConfigMap.get(SalesforceEndpointConfig.API_VERSION), session, httpClient);
}
@Override
@@ -82,15 +80,11 @@ public class AnalyticsApiProcessor extends AbstractSalesforceProcessor {
throw new SalesforceException("Unknown operation name: " + operationName.value(), null);
}
} catch (SalesforceException e) {
- exchange.setException(new SalesforceException(
- String.format("Error processing %s: [%s] \"%s\"",
- operationName.value(), e.getStatusCode(), e.getMessage()), e));
+ exchange.setException(new SalesforceException(String.format("Error processing %s: [%s] \"%s\"", operationName.value(), e.getStatusCode(), e.getMessage()), e));
callback.done(true);
done = true;
} catch (RuntimeException e) {
- exchange.setException(new SalesforceException(
- String.format("Unexpected Error processing %s: \"%s\"",
- operationName.value(), e.getMessage()), e));
+ exchange.setException(new SalesforceException(String.format("Unexpected Error processing %s: \"%s\"", operationName.value(), e.getMessage()), e));
callback.done(true);
done = true;
}
@@ -135,17 +129,15 @@ public class AnalyticsApiProcessor extends AbstractSalesforceProcessor {
}
} else {
reportId = getParameter(REPORT_ID, exchange, USE_BODY, NOT_OPTIONAL);
- reportMetadata = getParameter(REPORT_METADATA, exchange, IGNORE_BODY, IS_OPTIONAL,
- ReportMetadata.class);
+ reportMetadata = getParameter(REPORT_METADATA, exchange, IGNORE_BODY, IS_OPTIONAL, ReportMetadata.class);
}
- analyticsClient.executeSyncReport(reportId, includeDetails, reportMetadata, determineHeaders(exchange),
- new AnalyticsApiClient.ReportResultsResponseCallback() {
- @Override
- public void onResponse(AbstractReportResultsBase reportResults, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, reportResults, headers, ex, callback);
- }
- });
+ analyticsClient.executeSyncReport(reportId, includeDetails, reportMetadata, determineHeaders(exchange), new AnalyticsApiClient.ReportResultsResponseCallback() {
+ @Override
+ public void onResponse(AbstractReportResultsBase reportResults, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, reportResults, headers, ex, callback);
+ }
+ });
}
private void processExecuteAsyncReport(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -162,30 +154,27 @@ public class AnalyticsApiProcessor extends AbstractSalesforceProcessor {
}
} else {
reportId = getParameter(REPORT_ID, exchange, USE_BODY, NOT_OPTIONAL);
- reportMetadata = getParameter(REPORT_METADATA, exchange, IGNORE_BODY, IS_OPTIONAL,
- ReportMetadata.class);
+ reportMetadata = getParameter(REPORT_METADATA, exchange, IGNORE_BODY, IS_OPTIONAL, ReportMetadata.class);
}
- analyticsClient.executeAsyncReport(reportId, includeDetails, reportMetadata, determineHeaders(exchange),
- new AnalyticsApiClient.ReportInstanceResponseCallback() {
- @Override
- public void onResponse(ReportInstance reportInstance, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, reportInstance, headers, ex, callback);
- }
- });
+ analyticsClient.executeAsyncReport(reportId, includeDetails, reportMetadata, determineHeaders(exchange), new AnalyticsApiClient.ReportInstanceResponseCallback() {
+ @Override
+ public void onResponse(ReportInstance reportInstance, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, reportInstance, headers, ex, callback);
+ }
+ });
}
private void processGetReportInstances(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
final String reportId = getParameter(REPORT_ID, exchange, USE_BODY, NOT_OPTIONAL);
- analyticsClient.getReportInstances(reportId, determineHeaders(exchange),
- new AnalyticsApiClient.ReportInstanceListResponseCallback() {
- @Override
- public void onResponse(List<ReportInstance> reportInstances, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, reportInstances, headers, ex, callback);
- }
- });
+ analyticsClient.getReportInstances(reportId, determineHeaders(exchange), new AnalyticsApiClient.ReportInstanceListResponseCallback() {
+ @Override
+ public void onResponse(List<ReportInstance> reportInstances, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, reportInstances, headers, ex, callback);
+ }
+ });
}
private void processGetReportResults(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -193,13 +182,12 @@ public class AnalyticsApiProcessor extends AbstractSalesforceProcessor {
final String reportId = getParameter(REPORT_ID, exchange, USE_BODY, NOT_OPTIONAL);
final String instanceId = getParameter(INSTANCE_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
- analyticsClient.getReportResults(reportId, instanceId, determineHeaders(exchange),
- new AnalyticsApiClient.ReportResultsResponseCallback() {
- @Override
- public void onResponse(AbstractReportResultsBase reportResults, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, reportResults, headers, ex, callback);
- }
- });
+ analyticsClient.getReportResults(reportId, instanceId, determineHeaders(exchange), new AnalyticsApiClient.ReportResultsResponseCallback() {
+ @Override
+ public void onResponse(AbstractReportResultsBase reportResults, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, reportResults, headers, ex, callback);
+ }
+ });
}
private void processResponse(Exchange exchange, Object body, Map<String, String> headers, SalesforceException ex, AsyncCallback callback) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/BulkApiProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/BulkApiProcessor.java
index 78099d8..121bd02 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/BulkApiProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/BulkApiProcessor.java
@@ -51,8 +51,7 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
public BulkApiProcessor(SalesforceEndpoint endpoint) throws SalesforceException {
super(endpoint);
- this.bulkClient = new DefaultBulkApiClient(
- (String) endpointConfigMap.get(SalesforceEndpointConfig.API_VERSION), session, httpClient);
+ this.bulkClient = new DefaultBulkApiClient((String)endpointConfigMap.get(SalesforceEndpointConfig.API_VERSION), session, httpClient);
}
@Override
@@ -101,21 +100,15 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
throw new SalesforceException("Unknown operation name: " + operationName.value(), null);
}
} catch (SalesforceException e) {
- exchange.setException(new SalesforceException(
- String.format("Error processing %s: [%s] \"%s\"",
- operationName.value(), e.getStatusCode(), e.getMessage()), e));
+ exchange.setException(new SalesforceException(String.format("Error processing %s: [%s] \"%s\"", operationName.value(), e.getStatusCode(), e.getMessage()), e));
callback.done(true);
done = true;
} catch (InvalidPayloadException e) {
- exchange.setException(new SalesforceException(
- String.format("Unexpected Error processing %s: \"%s\"",
- operationName.value(), e.getMessage()), e));
+ exchange.setException(new SalesforceException(String.format("Unexpected Error processing %s: \"%s\"", operationName.value(), e.getMessage()), e));
callback.done(true);
done = true;
} catch (RuntimeException e) {
- exchange.setException(new SalesforceException(
- String.format("Unexpected Error processing %s: \"%s\"",
- operationName.value(), e.getMessage()), e));
+ exchange.setException(new SalesforceException(String.format("Unexpected Error processing %s: \"%s\"", operationName.value(), e.getMessage()), e));
callback.done(true);
done = true;
}
@@ -188,8 +181,7 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
private void processCreateBatch(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
String jobId;
// since request is in the body, use headers or endpoint params
- ContentType contentType = ContentType.fromValue(
- getParameter(CONTENT_TYPE, exchange, IGNORE_BODY, NOT_OPTIONAL));
+ ContentType contentType = ContentType.fromValue(getParameter(CONTENT_TYPE, exchange, IGNORE_BODY, NOT_OPTIONAL));
jobId = getParameter(JOB_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
InputStream request;
@@ -200,13 +192,12 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
throw new SalesforceException(msg, e);
}
- bulkClient.createBatch(request, jobId, contentType, determineHeaders(exchange),
- new BulkApiClient.BatchInfoResponseCallback() {
- @Override
- public void onResponse(BatchInfo batchInfo, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, batchInfo, headers, ex, callback);
- }
- });
+ bulkClient.createBatch(request, jobId, contentType, determineHeaders(exchange), new BulkApiClient.BatchInfoResponseCallback() {
+ @Override
+ public void onResponse(BatchInfo batchInfo, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, batchInfo, headers, ex, callback);
+ }
+ });
}
private void processGetBatch(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -220,13 +211,12 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
jobId = getParameter(JOB_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
batchId = getParameter(BATCH_ID, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.getBatch(jobId, batchId, determineHeaders(exchange),
- new BulkApiClient.BatchInfoResponseCallback() {
- @Override
- public void onResponse(BatchInfo batchInfo, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, batchInfo, headers, ex, callback);
- }
- });
+ bulkClient.getBatch(jobId, batchId, determineHeaders(exchange), new BulkApiClient.BatchInfoResponseCallback() {
+ @Override
+ public void onResponse(BatchInfo batchInfo, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, batchInfo, headers, ex, callback);
+ }
+ });
}
private void processGetAllBatches(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -238,13 +228,12 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
} else {
jobId = getParameter(JOB_ID, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.getAllBatches(jobId, determineHeaders(exchange),
- new BulkApiClient.BatchInfoListResponseCallback() {
- @Override
- public void onResponse(List<BatchInfo> batchInfoList, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, batchInfoList, headers, ex, callback);
- }
- });
+ bulkClient.getAllBatches(jobId, determineHeaders(exchange), new BulkApiClient.BatchInfoListResponseCallback() {
+ @Override
+ public void onResponse(List<BatchInfo> batchInfoList, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, batchInfoList, headers, ex, callback);
+ }
+ });
}
private void processGetRequest(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -260,30 +249,29 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
batchId = getParameter(BATCH_ID, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.getRequest(jobId, batchId, determineHeaders(exchange),
- new BulkApiClient.StreamResponseCallback() {
- @Override
- public void onResponse(InputStream inputStream, Map<String, String> headers, SalesforceException ex) {
- // read the request stream into a StreamCache temp file
- // ensures the connection is read
- StreamCache body = null;
- if (inputStream != null) {
+ bulkClient.getRequest(jobId, batchId, determineHeaders(exchange), new BulkApiClient.StreamResponseCallback() {
+ @Override
+ public void onResponse(InputStream inputStream, Map<String, String> headers, SalesforceException ex) {
+ // read the request stream into a StreamCache temp file
+ // ensures the connection is read
+ StreamCache body = null;
+ if (inputStream != null) {
+ try {
+ body = StreamCacheConverter.convertToStreamCache(inputStream, exchange);
+ } catch (IOException e) {
+ String msg = "Error retrieving batch request: " + e.getMessage();
+ ex = new SalesforceException(msg, e);
+ } finally {
+ // close the input stream to release the Http connection
try {
- body = StreamCacheConverter.convertToStreamCache(inputStream, exchange);
- } catch (IOException e) {
- String msg = "Error retrieving batch request: " + e.getMessage();
- ex = new SalesforceException(msg, e);
- } finally {
- // close the input stream to release the Http connection
- try {
- inputStream.close();
- } catch (IOException ignore) {
- }
+ inputStream.close();
+ } catch (IOException ignore) {
}
}
- processResponse(exchange, body, headers, ex, callback);
}
- });
+ processResponse(exchange, body, headers, ex, callback);
+ }
+ });
}
private void processGetResults(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -298,30 +286,29 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
jobId = getParameter(JOB_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
batchId = getParameter(BATCH_ID, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.getResults(jobId, batchId, determineHeaders(exchange),
- new BulkApiClient.StreamResponseCallback() {
- @Override
- public void onResponse(InputStream inputStream, Map<String, String> headers, SalesforceException ex) {
- // read the result stream into a StreamCache temp file
- // ensures the connection is read
- StreamCache body = null;
- if (inputStream != null) {
+ bulkClient.getResults(jobId, batchId, determineHeaders(exchange), new BulkApiClient.StreamResponseCallback() {
+ @Override
+ public void onResponse(InputStream inputStream, Map<String, String> headers, SalesforceException ex) {
+ // read the result stream into a StreamCache temp file
+ // ensures the connection is read
+ StreamCache body = null;
+ if (inputStream != null) {
+ try {
+ body = StreamCacheConverter.convertToStreamCache(inputStream, exchange);
+ } catch (IOException e) {
+ String msg = "Error retrieving batch results: " + e.getMessage();
+ ex = new SalesforceException(msg, e);
+ } finally {
+ // close the input stream to release the Http connection
try {
- body = StreamCacheConverter.convertToStreamCache(inputStream, exchange);
- } catch (IOException e) {
- String msg = "Error retrieving batch results: " + e.getMessage();
- ex = new SalesforceException(msg, e);
- } finally {
- // close the input stream to release the Http connection
- try {
- inputStream.close();
- } catch (IOException ignore) {
- }
+ inputStream.close();
+ } catch (IOException ignore) {
}
}
- processResponse(exchange, body, headers, ex, callback);
}
- });
+ processResponse(exchange, body, headers, ex, callback);
+ }
+ });
}
private void processCreateBatchQuery(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -337,18 +324,16 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
soqlQuery = getParameter(SOBJECT_QUERY, exchange, IGNORE_BODY, NOT_OPTIONAL);
} else {
jobId = getParameter(JOB_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
- contentType = ContentType.fromValue(
- getParameter(CONTENT_TYPE, exchange, IGNORE_BODY, NOT_OPTIONAL));
+ contentType = ContentType.fromValue(getParameter(CONTENT_TYPE, exchange, IGNORE_BODY, NOT_OPTIONAL));
// reuse SOBJECT_QUERY property
soqlQuery = getParameter(SOBJECT_QUERY, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.createBatchQuery(jobId, soqlQuery, contentType, determineHeaders(exchange),
- new BulkApiClient.BatchInfoResponseCallback() {
- @Override
- public void onResponse(BatchInfo batchInfo, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, batchInfo, headers, ex, callback);
- }
- });
+ bulkClient.createBatchQuery(jobId, soqlQuery, contentType, determineHeaders(exchange), new BulkApiClient.BatchInfoResponseCallback() {
+ @Override
+ public void onResponse(BatchInfo batchInfo, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, batchInfo, headers, ex, callback);
+ }
+ });
}
private void processGetQueryResultIds(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -363,13 +348,12 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
jobId = getParameter(JOB_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
batchId = getParameter(BATCH_ID, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.getQueryResultIds(jobId, batchId, determineHeaders(exchange),
- new BulkApiClient.QueryResultIdsCallback() {
- @Override
- public void onResponse(List<String> ids, Map<String, String> headers, SalesforceException ex) {
- processResponse(exchange, ids, headers, ex, callback);
- }
- });
+ bulkClient.getQueryResultIds(jobId, batchId, determineHeaders(exchange), new BulkApiClient.QueryResultIdsCallback() {
+ @Override
+ public void onResponse(List<String> ids, Map<String, String> headers, SalesforceException ex) {
+ processResponse(exchange, ids, headers, ex, callback);
+ }
+ });
}
private void processGetQueryResult(final Exchange exchange, final AsyncCallback callback) throws SalesforceException {
@@ -387,31 +371,30 @@ public class BulkApiProcessor extends AbstractSalesforceProcessor {
batchId = getParameter(BATCH_ID, exchange, IGNORE_BODY, NOT_OPTIONAL);
resultId = getParameter(RESULT_ID, exchange, USE_BODY, NOT_OPTIONAL);
}
- bulkClient.getQueryResult(jobId, batchId, resultId, determineHeaders(exchange),
- new BulkApiClient.StreamResponseCallback() {
- @Override
- public void onResponse(InputStream inputStream, Map<String, String> headers, SalesforceException ex) {
- StreamCache body = null;
- if (inputStream != null) {
- // read the result stream into a StreamCache temp file
- // ensures the connection is read
+ bulkClient.getQueryResult(jobId, batchId, resultId, determineHeaders(exchange), new BulkApiClient.StreamResponseCallback() {
+ @Override
+ public void onResponse(InputStream inputStream, Map<String, String> headers, SalesforceException ex) {
+ StreamCache body = null;
+ if (inputStream != null) {
+ // read the result stream into a StreamCache temp file
+ // ensures the connection is read
+ try {
+ body = StreamCacheConverter.convertToStreamCache(inputStream, exchange);
+ } catch (IOException e) {
+ String msg = "Error retrieving query result: " + e.getMessage();
+ ex = new SalesforceException(msg, e);
+ } finally {
+ // close the input stream to release the Http connection
try {
- body = StreamCacheConverter.convertToStreamCache(inputStream, exchange);
+ inputStream.close();
} catch (IOException e) {
- String msg = "Error retrieving query result: " + e.getMessage();
- ex = new SalesforceException(msg, e);
- } finally {
- // close the input stream to release the Http connection
- try {
- inputStream.close();
- } catch (IOException e) {
- // ignore
- }
+ // ignore
}
}
- processResponse(exchange, body, headers, ex, callback);
}
- });
+ processResponse(exchange, body, headers, ex, callback);
+ }
+ });
}
private void processResponse(Exchange exchange, Object body, Map<String, String> headers, SalesforceException ex, AsyncCallback callback) {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/CompositeApiProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/CompositeApiProcessor.java
index 86f3279..8636341 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/CompositeApiProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/CompositeApiProcessor.java
@@ -44,8 +44,7 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
@FunctionalInterface
interface ResponseHandler<T> {
- void handleResponse(Exchange exchange, Optional<T> body, Map<String, String> headers,
- SalesforceException exception, AsyncCallback callback);
+ void handleResponse(Exchange exchange, Optional<T> body, Map<String, String> headers, SalesforceException exception, AsyncCallback callback);
}
@@ -74,22 +73,18 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
try {
switch (operationName) {
case COMPOSITE_TREE:
- return processInternal(SObjectTree.class, exchange, compositeClient::submitCompositeTree,
- this::processCompositeTreeResponse, callback);
+ return processInternal(SObjectTree.class, exchange, compositeClient::submitCompositeTree, this::processCompositeTreeResponse, callback);
case COMPOSITE_BATCH:
- return processInternal(SObjectBatch.class, exchange, compositeClient::submitCompositeBatch,
- this::processCompositeBatchResponse, callback);
+ return processInternal(SObjectBatch.class, exchange, compositeClient::submitCompositeBatch, this::processCompositeBatchResponse, callback);
case COMPOSITE:
- return processInternal(SObjectComposite.class, exchange, compositeClient::submitComposite,
- this::processCompositeResponse, callback);
+ return processInternal(SObjectComposite.class, exchange, compositeClient::submitComposite, this::processCompositeResponse, callback);
default:
throw new SalesforceException("Unknown operation name: " + operationName.value(), null);
}
} catch (final SalesforceException e) {
return processException(exchange, callback, e);
} catch (final RuntimeException e) {
- final SalesforceException exception = new SalesforceException(
- String.format("Unexpected Error processing %s: \"%s\"", operationName.value(), e.getMessage()), e);
+ final SalesforceException exception = new SalesforceException(String.format("Unexpected Error processing %s: \"%s\"", operationName.value(), e.getMessage()), e);
return processException(exchange, callback, exception);
}
}
@@ -104,8 +99,8 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
ServiceHelper.stopService(compositeClient);
}
- void processCompositeBatchResponse(final Exchange exchange, final Optional<SObjectBatchResponse> responseBody,
- final Map<String, String> headers, final SalesforceException exception, final AsyncCallback callback) {
+ void processCompositeBatchResponse(final Exchange exchange, final Optional<SObjectBatchResponse> responseBody, final Map<String, String> headers,
+ final SalesforceException exception, final AsyncCallback callback) {
try {
if (!responseBody.isPresent()) {
exchange.setException(exception);
@@ -124,8 +119,8 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
}
}
- void processCompositeResponse(final Exchange exchange, final Optional<SObjectCompositeResponse> responseBody,
- final Map<String, String> headers, final SalesforceException exception, final AsyncCallback callback) {
+ void processCompositeResponse(final Exchange exchange, final Optional<SObjectCompositeResponse> responseBody, final Map<String, String> headers,
+ final SalesforceException exception, final AsyncCallback callback) {
try {
if (!responseBody.isPresent()) {
exchange.setException(exception);
@@ -144,8 +139,8 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
}
}
- void processCompositeTreeResponse(final Exchange exchange, final Optional<SObjectTreeResponse> responseBody,
- final Map<String, String> headers, final SalesforceException exception, final AsyncCallback callback) {
+ void processCompositeTreeResponse(final Exchange exchange, final Optional<SObjectTreeResponse> responseBody, final Map<String, String> headers,
+ final SalesforceException exception, final AsyncCallback callback) {
try {
if (!responseBody.isPresent()) {
@@ -170,8 +165,7 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
}
if (hasErrors) {
- final SalesforceException withErrors = new SalesforceException(response.getAllErrors(),
- exception.getStatusCode(), exception);
+ final SalesforceException withErrors = new SalesforceException(response.getAllErrors(), exception.getStatusCode(), exception);
exchange.setException(withErrors);
}
@@ -184,9 +178,9 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
}
}
- <T, R> boolean processInternal(final Class<T> bodyType, final Exchange exchange,
- final CompositeApiClient.Operation<T, R> clientOperation, final ResponseHandler<R> responseHandler,
- final AsyncCallback callback) throws SalesforceException {
+ <T, R> boolean processInternal(final Class<T> bodyType, final Exchange exchange, final CompositeApiClient.Operation<T, R> clientOperation,
+ final ResponseHandler<R> responseHandler, final AsyncCallback callback)
+ throws SalesforceException {
final T body;
@@ -197,8 +191,8 @@ public final class CompositeApiProcessor extends AbstractSalesforceProcessor {
throw new SalesforceException(e);
}
- clientOperation.submit(body, determineHeaders(exchange), (response, responseHeaders,
- exception) -> responseHandler.handleResponse(exchange, response, responseHeaders, exception, callback));
+ clientOperation.submit(body, determineHeaders(exchange),
+ (response, responseHeaders, exception) -> responseHandler.handleResponse(exchange, response, responseHeaders, exception, callback));
return false;
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java
index dbc7b75..66908a6 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java
@@ -148,8 +148,7 @@ public class JsonRestProcessor extends AbstractRestProcessor {
// if all else fails, get body as String
final String body = in.getBody(String.class);
if (null == body) {
- String msg = "Unsupported request message body "
- + (in.getBody() == null ? null : in.getBody().getClass());
+ String msg = "Unsupported request message body " + (in.getBody() == null ? null : in.getBody().getClass());
throw new SalesforceException(msg, null);
} else {
request = new ByteArrayInputStream(body.getBytes(StandardCharsets.UTF_8));
@@ -174,8 +173,7 @@ public class JsonRestProcessor extends AbstractRestProcessor {
}
@Override
- protected void processResponse(Exchange exchange, InputStream responseEntity, Map<String, String> headers,
- SalesforceException ex, AsyncCallback callback) {
+ protected void processResponse(Exchange exchange, InputStream responseEntity, Map<String, String> headers, SalesforceException ex, AsyncCallback callback) {
// process JSON response for TypeReference
try {
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java
index d3e3533..1833333 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/SalesforceProcessor.java
@@ -46,11 +46,11 @@ public interface SalesforceProcessor extends Service {
final Object headerValue = inboundMessage.getHeader(headerName);
if (headerValue instanceof String) {
- answer.put(headerName, Collections.singletonList((String) headerValue));
+ answer.put(headerName, Collections.singletonList((String)headerValue));
} else if (headerValue instanceof String[]) {
- answer.put(headerName, Arrays.asList((String[]) headerValue));
+ answer.put(headerName, Arrays.asList((String[])headerValue));
} else if (headerValue instanceof Collection) {
- Collection<?> collection = (Collection<?>) headerValue;
+ Collection<?> collection = (Collection<?>)headerValue;
answer.put(headerName, collection.stream().map(String.class::cast).collect(Collectors.toList()));
} else {
answer.put(headerName, Collections.singletonList(String.valueOf(headerValue)));
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java
index dd90399..626724d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java
@@ -50,17 +50,18 @@ import static org.apache.camel.component.salesforce.SalesforceEndpointConfig.SOB
public class XmlRestProcessor extends AbstractRestProcessor {
- // although XStream is generally thread safe, because of the way we use aliases
+ // although XStream is generally thread safe, because of the way we use
+ // aliases
// for GET_BASIC_INFO and GET_DESCRIPTION, we need to use a ThreadLocal
- // not very efficient when both JSON and XML are used together with a single Thread pool
+ // not very efficient when both JSON and XML are used together with a single
+ // Thread pool
// but this will do for now
- private static ThreadLocal<XStream> xStream =
- new ThreadLocal<XStream>() {
- @Override
- protected XStream initialValue() {
- return XStreamUtils.createXStream();
- }
- };
+ private static ThreadLocal<XStream> xStream = new ThreadLocal<XStream>() {
+ @Override
+ protected XStream initialValue() {
+ return XStreamUtils.createXStream();
+ }
+ };
private static final String RESPONSE_ALIAS = XmlRestProcessor.class.getName() + ".responseAlias";
@@ -90,7 +91,8 @@ public class XmlRestProcessor extends AbstractRestProcessor {
// handle in built response types
exchange.setProperty(RESPONSE_CLASS, SObjectBasicInfo.class);
- // need to add alias for Salesforce XML that uses SObject name as root element
+ // need to add alias for Salesforce XML that uses SObject name as
+ // root element
exchange.setProperty(RESPONSE_ALIAS, getParameter(SOBJECT_NAME, exchange, USE_BODY, NOT_OPTIONAL));
break;
@@ -98,12 +100,14 @@ public class XmlRestProcessor extends AbstractRestProcessor {
// handle in built response types
exchange.setProperty(RESPONSE_CLASS, SObjectDescription.class);
- // need to add alias for Salesforce XML that uses SObject name as root element
+ // need to add alias for Salesforce XML that uses SObject name as
+ // root element
exchange.setProperty(RESPONSE_ALIAS, getParameter(SOBJECT_NAME, exchange, USE_BODY, NOT_OPTIONAL));
break;
case GET_SOBJECT:
- // need to add alias for Salesforce XML that uses SObject name as root element
+ // need to add alias for Salesforce XML that uses SObject name as
+ // root element
exchange.setProperty(RESPONSE_ALIAS, getParameter(SOBJECT_NAME, exchange, IGNORE_BODY, NOT_OPTIONAL));
break;
@@ -113,7 +117,8 @@ public class XmlRestProcessor extends AbstractRestProcessor {
break;
case GET_SOBJECT_WITH_ID:
- // need to add alias for Salesforce XML that uses SObject name as root element
+ // need to add alias for Salesforce XML that uses SObject name as
+ // root element
exchange.setProperty(RESPONSE_ALIAS, getParameter(SOBJECT_NAME, exchange, IGNORE_BODY, NOT_OPTIONAL));
break;
@@ -125,7 +130,8 @@ public class XmlRestProcessor extends AbstractRestProcessor {
case QUERY:
case QUERY_ALL:
case QUERY_MORE:
- // need to add alias for Salesforce XML that uses SObject name as root element
+ // need to add alias for Salesforce XML that uses SObject name as
+ // root element
exchange.setProperty(RESPONSE_ALIAS, "QueryResult");
break;
@@ -135,7 +141,8 @@ public class XmlRestProcessor extends AbstractRestProcessor {
break;
case APEX_CALL:
- // need to add alias for Salesforce XML that uses SObject name as root element
+ // need to add alias for Salesforce XML that uses SObject name as
+ // root element
exchange.setProperty(RESPONSE_ALIAS, "response");
break;
@@ -143,11 +150,12 @@ public class XmlRestProcessor extends AbstractRestProcessor {
exchange.setProperty(RESPONSE_CLASS, ApprovalResult.class);
break;
case APPROVALS:
- throw new SalesforceException("Fetching of approvals (as of 18.11.2016) with XML format results in HTTP status 500."
- + " To fetch approvals please use JSON format.", 0);
+ throw new SalesforceException("Fetching of approvals (as of 18.11.2016) with XML format results in HTTP status 500." + " To fetch approvals please use JSON format.",
+ 0);
default:
- // ignore, some operations do not require alias or class exchange properties
+ // ignore, some operations do not require alias or class exchange
+ // properties
}
}
@@ -166,8 +174,7 @@ public class XmlRestProcessor extends AbstractRestProcessor {
// if all else fails, get body as String
final String body = in.getBody(String.class);
if (null == body) {
- String msg = "Unsupported request message body "
- + (in.getBody() == null ? null : in.getBody().getClass());
+ String msg = "Unsupported request message body " + (in.getBody() == null ? null : in.getBody().getClass());
throw new SalesforceException(msg, null);
} else {
request = new ByteArrayInputStream(body.getBytes(StringUtil.__UTF8));
@@ -203,8 +210,8 @@ public class XmlRestProcessor extends AbstractRestProcessor {
}
@Override
- protected void processResponse(final Exchange exchange, final InputStream responseEntity,
- final Map<String, String> headers, final SalesforceException exception, final AsyncCallback callback) {
+ protected void processResponse(final Exchange exchange, final InputStream responseEntity, final Map<String, String> headers, final SalesforceException exception,
+ final AsyncCallback callback) {
final XStream localXStream = xStream.get();
try {
final Message out = exchange.getOut();
@@ -221,18 +228,21 @@ public class XmlRestProcessor extends AbstractRestProcessor {
final Class<?> responseClass = exchange.getProperty(RESPONSE_CLASS, Class.class);
Object response;
if (!rawPayload && responseClass != null) {
- // its ok to call this multiple times, as xstream ignores duplicate calls
+ // its ok to call this multiple times, as xstream ignores
+ // duplicate calls
localXStream.processAnnotations(responseClass);
final String responseAlias = exchange.getProperty(RESPONSE_ALIAS, String.class);
if (responseAlias != null) {
- // extremely dirty, need to flush entire cache if its holding on to an old alias!!!
- final CachingMapper mapper = (CachingMapper) localXStream.getMapper();
+ // extremely dirty, need to flush entire cache if its
+ // holding on to an old alias!!!
+ final CachingMapper mapper = (CachingMapper)localXStream.getMapper();
try {
if (mapper.realClass(responseAlias) != responseClass) {
mapper.flushCache();
}
} catch (CannotResolveClassException ignore) {
- // recent XStream versions add a ClassNotFoundException to cache
+ // recent XStream versions add a
+ // ClassNotFoundException to cache
mapper.flushCache();
}
localXStream.alias(responseAlias, responseClass);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/PushTopicHelper.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/PushTopicHelper.java
index fe78759..618c930 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/PushTopicHelper.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/PushTopicHelper.java
@@ -53,18 +53,13 @@ public class PushTopicHelper {
this.preApi29 = Double.valueOf(config.getApiVersion()) < 29.0;
// validate notify fields right away
- if (preApi29 && (config.getNotifyForOperationCreate() != null
- || config.getNotifyForOperationDelete() != null
- || config.getNotifyForOperationUndelete() != null
- || config.getNotifyForOperationUpdate() != null)) {
- throw new IllegalArgumentException("NotifyForOperationCreate, NotifyForOperationDelete"
- + ", NotifyForOperationUndelete, and NotifyForOperationUpdate"
- + " are only supported since API version 29.0"
- + ", instead use NotifyForOperations");
+ if (preApi29 && (config.getNotifyForOperationCreate() != null || config.getNotifyForOperationDelete() != null || config.getNotifyForOperationUndelete() != null
+ || config.getNotifyForOperationUpdate() != null)) {
+ throw new IllegalArgumentException("NotifyForOperationCreate, NotifyForOperationDelete" + ", NotifyForOperationUndelete, and NotifyForOperationUpdate"
+ + " are only supported since API version 29.0" + ", instead use NotifyForOperations");
} else if (!preApi29 && config.getNotifyForOperations() != null) {
- throw new IllegalArgumentException("NotifyForOperations is readonly since API version 29.0"
- + ", instead use NotifyForOperationCreate, NotifyForOperationDelete"
- + ", NotifyForOperationUndelete, and NotifyForOperationUpdate");
+ throw new IllegalArgumentException("NotifyForOperations is readonly since API version 29.0" + ", instead use NotifyForOperationCreate, NotifyForOperationDelete"
+ + ", NotifyForOperationUndelete, and NotifyForOperationUpdate");
}
}
@@ -75,13 +70,10 @@ public class PushTopicHelper {
// lookup Topic first
try {
// use SOQL to lookup Topic, since Name is not an external ID!!!
- restClient.query("SELECT Id, Name, Query, ApiVersion, IsActive, "
- + "NotifyForFields, NotifyForOperations, NotifyForOperationCreate, "
- + "NotifyForOperationDelete, NotifyForOperationUndelete, "
- + "NotifyForOperationUpdate, Description "
- + "FROM PushTopic WHERE Name = '" + topicName + "'",
- Collections.emptyMap(),
- callback);
+ restClient
+ .query("SELECT Id, Name, Query, ApiVersion, IsActive, " + "NotifyForFields, NotifyForOperations, NotifyForOperationCreate, "
+ + "NotifyForOperationDelete, NotifyForOperationUndelete, " + "NotifyForOperationUpdate, Description " + "FROM PushTopic WHERE Name = '" + topicName + "'",
+ Collections.emptyMap(), callback);
if (!callback.await(API_TIMEOUT, TimeUnit.SECONDS)) {
throw new SalesforceException("API call timeout!", null);
@@ -90,8 +82,7 @@ public class PushTopicHelper {
if (callbackException != null) {
throw callbackException;
}
- QueryRecordsPushTopic records = OBJECT_MAPPER.readValue(callback.getResponse(),
- QueryRecordsPushTopic.class);
+ QueryRecordsPushTopic records = OBJECT_MAPPER.readValue(callback.getResponse(), QueryRecordsPushTopic.class);
if (records.getTotalSize() == 1) {
PushTopic topic = records.getRecords().get(0);
@@ -100,18 +91,14 @@ public class PushTopicHelper {
// check if we need to update topic
final boolean notifyOperationsChanged;
if (preApi29) {
- notifyOperationsChanged =
- notEquals(config.getNotifyForOperations(), topic.getNotifyForOperations());
+ notifyOperationsChanged = notEquals(config.getNotifyForOperations(), topic.getNotifyForOperations());
} else {
- notifyOperationsChanged =
- notEquals(config.getNotifyForOperationCreate(), topic.getNotifyForOperationCreate())
- || notEquals(config.getNotifyForOperationDelete(), topic.getNotifyForOperationDelete())
- || notEquals(config.getNotifyForOperationUndelete(), topic.getNotifyForOperationUndelete())
- || notEquals(config.getNotifyForOperationUpdate(), topic.getNotifyForOperationUpdate());
+ notifyOperationsChanged = notEquals(config.getNotifyForOperationCreate(), topic.getNotifyForOperationCreate())
+ || notEquals(config.getNotifyForOperationDelete(), topic.getNotifyForOperationDelete())
+ || notEquals(config.getNotifyForOperationUndelete(), topic.getNotifyForOperationUndelete())
+ || notEquals(config.getNotifyForOperationUpdate(), topic.getNotifyForOperationUpdate());
}
- if (!query.equals(topic.getQuery())
- || notEquals(config.getNotifyForFields(), topic.getNotifyForFields())
- || notifyOperationsChanged) {
+ if (!query.equals(topic.getQuery()) || notEquals(config.getNotifyForFields(), topic.getNotifyForFields()) || notifyOperationsChanged) {
if (!config.isUpdateTopic()) {
String msg = "Query doesn't match existing Topic and updateTopic is set to false";
@@ -127,18 +114,12 @@ public class PushTopicHelper {
}
} catch (SalesforceException e) {
- throw new CamelException(
- String.format("Error retrieving Topic %s: %s", topicName, e.getMessage()),
- e);
+ throw new CamelException(String.format("Error retrieving Topic %s: %s", topicName, e.getMessage()), e);
} catch (IOException e) {
- throw new CamelException(
- String.format("Un-marshaling error retrieving Topic %s: %s", topicName, e.getMessage()),
- e);
+ throw new CamelException(String.format("Un-marshaling error retrieving Topic %s: %s", topicName, e.getMessage()), e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
- throw new CamelException(
- String.format("Un-marshaling error retrieving Topic %s: %s", topicName, e.getMessage()),
- e);
+ throw new CamelException(String.format("Un-marshaling error retrieving Topic %s: %s", topicName, e.getMessage()), e);
} finally {
// close stream to close HttpConnection
if (callback.getResponse() != null) {
@@ -170,8 +151,7 @@ public class PushTopicHelper {
LOG.info("Creating Topic {}: {}", topicName, topic);
final SyncResponseCallback callback = new SyncResponseCallback();
try {
- restClient.createSObject(PUSH_TOPIC_OBJECT_NAME,
- new ByteArrayInputStream(OBJECT_MAPPER.writeValueAsBytes(topic)), Collections.emptyMap(), callback);
+ restClient.createSObject(PUSH_TOPIC_OBJECT_NAME, new ByteArrayInputStream(OBJECT_MAPPER.writeValueAsBytes(topic)), Collections.emptyMap(), callback);
if (!callback.await(API_TIMEOUT, TimeUnit.SECONDS)) {
throw new SalesforceException("API call timeout!", null);
@@ -183,24 +163,15 @@ public class PushTopicHelper {
CreateSObjectResult result = OBJECT_MAPPER.readValue(callback.getResponse(), CreateSObjectResult.class);
if (!result.getSuccess()) {
- final SalesforceException salesforceException = new SalesforceException(
- result.getErrors(), HttpStatus.BAD_REQUEST_400);
- throw new CamelException(
- String.format("Error creating Topic %s: %s", topicName, result.getErrors()),
- salesforceException);
+ final SalesforceException salesforceException = new SalesforceException(result.getErrors(), HttpStatus.BAD_REQUEST_400);
+ throw new CamelException(String.format("Error creating Topic %s: %s", topicName, result.getErrors()), salesforceException);
}
} catch (SalesforceException e) {
- throw new CamelException(
- String.format("Error creating Topic %s: %s", topicName, e.getMessage()),
- e);
+ throw new CamelException(String.format("Error creating Topic %s: %s", topicName, e.getMessage()), e);
} catch (IOException e) {
- throw new CamelException(
- String.format("Un-marshaling error creating Topic %s: %s", topicName, e.getMessage()),
- e);
+ throw new CamelException(String.format("Un-marshaling error creating Topic %s: %s", topicName, e.getMessage()), e);
} catch (InterruptedException e) {
- throw new CamelException(
- String.format("Un-marshaling error creating Topic %s: %s", topicName, e.getMessage()),
- e);
+ throw new CamelException(String.format("Un-marshaling error creating Topic %s: %s", topicName, e.getMessage()), e);
} finally {
if (callback.getResponse() != null) {
try {
@@ -231,10 +202,7 @@ public class PushTopicHelper {
topic.setNotifyForOperationUpdate(config.getNotifyForOperationUpdate());
}
- restClient.updateSObject("PushTopic", topicId,
- new ByteArrayInputStream(OBJECT_MAPPER.writeValueAsBytes(topic)),
- Collections.emptyMap(),
- callback);
+ restClient.updateSObject("PushTopic", topicId, new ByteArrayInputStream(OBJECT_MAPPER.writeValueAsBytes(topic)), Collections.emptyMap(), callback);
if (!callback.await(API_TIMEOUT, TimeUnit.SECONDS)) {
throw new SalesforceException("API call timeout!", null);
@@ -245,19 +213,13 @@ public class PushTopicHelper {
}
} catch (SalesforceException e) {
- throw new CamelException(
- String.format("Error updating topic %s with query [%s] : %s", topicName, query, e.getMessage()),
- e);
+ throw new CamelException(String.format("Error updating topic %s with query [%s] : %s", topicName, query, e.getMessage()), e);
} catch (InterruptedException e) {
// reset interrupt status
Thread.currentThread().interrupt();
- throw new CamelException(
- String.format("Error updating topic %s with query [%s] : %s", topicName, query, e.getMessage()),
- e);
+ throw new CamelException(String.format("Error updating topic %s with query [%s] : %s", topicName, query, e.getMessage()), e);
} catch (IOException e) {
- throw new CamelException(
- String.format("Error updating topic %s with query [%s] : %s", topicName, query, e.getMessage()),
- e);
+ throw new CamelException(String.format("Error updating topic %s with query [%s] : %s", topicName, query, e.getMessage()), e);
} finally {
if (callback.getResponse() != null) {
try {
@@ -272,4 +234,4 @@ public class PushTopicHelper {
return o1 != null && !o1.equals(o2);
}
-}
\ No newline at end of file
+}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
index f1a0c53..0883a33 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
@@ -123,7 +123,7 @@ public class SubscriptionHelper extends ServiceSupport {
if (!message.isSuccessful()) {
LOG.warn("Handshake failure: {}", message);
- handshakeError = (String) message.get(ERROR_FIELD);
+ handshakeError = (String)message.get(ERROR_FIELD);
handshakeException = getFailure(message);
if (handshakeError != null) {
@@ -167,7 +167,7 @@ public class SubscriptionHelper extends ServiceSupport {
if (!message.isSuccessful()) {
LOG.warn("Connect failure: {}", message);
- connectError = (String) message.get(ERROR_FIELD);
+ connectError = (String)message.get(ERROR_FIELD);
connectException = getFailure(message);
} else if (reconnecting) {
@@ -175,7 +175,8 @@ public class SubscriptionHelper extends ServiceSupport {
reconnecting = false;
LOG.debug("Refreshing subscriptions to {} channels on reconnect", listenerMap.size());
- // reconnected to Salesforce, subscribe to existing channels
+ // reconnected to Salesforce, subscribe to existing
+ // channels
final Map<SalesforceConsumer, ClientSessionChannel.MessageListener> map = new HashMap<>();
map.putAll(listenerMap);
listenerMap.clear();
@@ -208,20 +209,15 @@ public class SubscriptionHelper extends ServiceSupport {
final long waitMs = MILLISECONDS.convert(CONNECT_TIMEOUT, SECONDS);
if (!client.waitFor(waitMs, BayeuxClient.State.CONNECTED)) {
if (handshakeException != null) {
- throw new CamelException(
- String.format("Exception during HANDSHAKE: %s", handshakeException.getMessage()),
- handshakeException);
+ throw new CamelException(String.format("Exception during HANDSHAKE: %s", handshakeException.getMessage()), handshakeException);
} else if (handshakeError != null) {
throw new CamelException(String.format("Error during HANDSHAKE: %s", handshakeError));
} else if (connectException != null) {
- throw new CamelException(
- String.format("Exception during CONNECT: %s", connectException.getMessage()),
- connectException);
+ throw new CamelException(String.format("Exception during CONNECT: %s", connectException.getMessage()), connectException);
} else if (connectError != null) {
throw new CamelException(String.format("Error during CONNECT: %s", connectError));
} else {
- throw new CamelException(
- String.format("Handshake request timeout after %s seconds", CONNECT_TIMEOUT));
+ throw new CamelException(String.format("Handshake request timeout after %s seconds", CONNECT_TIMEOUT));
}
}
}
@@ -308,9 +304,9 @@ public class SubscriptionHelper extends ServiceSupport {
private Exception getFailure(Message message) {
Exception exception = null;
if (message.get(EXCEPTION_FIELD) != null) {
- exception = (Exception) message.get(EXCEPTION_FIELD);
+ exception = (Exception)message.get(EXCEPTION_FIELD);
} else if (message.get(FAILURE_FIELD) != null) {
- exception = (Exception) ((Map<String, Object>)message.get("failure")).get("exception");
+ exception = (Exception)((Map<String, Object>)message.get("failure")).get("exception");
}
return exception;
}
@@ -332,7 +328,8 @@ public class SubscriptionHelper extends ServiceSupport {
}
static BayeuxClient createClient(final SalesforceComponent component) throws SalesforceException {
- // use default Jetty client from SalesforceComponent, its shared by all consumers
+ // use default Jetty client from SalesforceComponent, its shared by all
+ // consumers
final SalesforceHttpClient httpClient = component.getConfig().getHttpClient();
Map<String, Object> options = new HashMap<>();
@@ -371,7 +368,7 @@ public class SubscriptionHelper extends ServiceSupport {
// create subscription for consumer
final String channelName = getChannelName(topicName);
- setupReplay((SalesforceEndpoint) consumer.getEndpoint());
+ setupReplay((SalesforceEndpoint)consumer.getEndpoint());
// channel message listener
LOG.info("Subscribing to channel {}...", channelName);
@@ -396,13 +393,12 @@ public class SubscriptionHelper extends ServiceSupport {
if (channelName.equals(subscribedChannelName)) {
if (!message.isSuccessful()) {
- String error = (String) message.get(ERROR_FIELD);
+ String error = (String)message.get(ERROR_FIELD);
if (error == null) {
error = "Missing error message";
}
Exception failure = getFailure(message);
- String msg = String.format("Error subscribing to %s: %s", topicName,
- failure != null ? failure.getMessage() : error);
+ String msg = String.format("Error subscribing to %s: %s", topicName, failure != null ? failure.getMessage() : error);
consumer.handleException(msg, new SalesforceException(msg, failure));
} else {
// remember subscription
@@ -453,10 +449,10 @@ public class SubscriptionHelper extends ServiceSupport {
final Long componentReplayId = componentInitialReplayIdMap.getOrDefault(topicName, componentInitialReplayIdMap.get(channelName));
final Long componentDefaultReplayId = componentConfiguration.getDefaultReplayId();
- // the endpoint values have priority over component values, and the default values posteriority
+ // the endpoint values have priority over component values, and the
+ // default values posteriority
// over give topic values
- return Stream.of(replayId, endpointReplayId, componentReplayId, endpointDefaultReplayId, componentDefaultReplayId)
- .filter(Objects::nonNull).findFirst();
+ return Stream.of(replayId, endpointReplayId, componentReplayId, endpointDefaultReplayId, componentDefaultReplayId).filter(Objects::nonNull).findFirst();
}
static String getChannelName(final String topicName) {
@@ -499,7 +495,7 @@ public class SubscriptionHelper extends ServiceSupport {
if (channelName.equals(unsubscribedChannelName)) {
if (!message.isSuccessful()) {
- unsubscribeError[0] = (String) message.get(ERROR_FIELD);
+ unsubscribeError[0] = (String)message.get(ERROR_FIELD);
unsubscribeFailure[0] = getFailure(message);
} else {
// forget subscription
@@ -526,14 +522,11 @@ public class SubscriptionHelper extends ServiceSupport {
if (!latch.await(CHANNEL_TIMEOUT, SECONDS)) {
String message;
if (unsubscribeFailure[0] != null) {
- message = String.format("Error unsubscribing from topic %s: %s",
- topicName, unsubscribeFailure[0].getMessage());
+ message = String.format("Error unsubscribing from topic %s: %s", topicName, unsubscribeFailure[0].getMessage());
} else if (unsubscribeError[0] != null) {
- message = String.format("Error unsubscribing from topic %s: %s",
- topicName, unsubscribeError[0]);
+ message = String.format("Error unsubscribing from topic %s: %s", topicName, unsubscribeError[0]);
} else {
- message = String.format("Timeout error unsubscribing from topic %s after %s seconds",
- topicName, CHANNEL_TIMEOUT);
+ message = String.format("Timeout error unsubscribing from topic %s after %s seconds", topicName, CHANNEL_TIMEOUT);
}
throw new CamelException(message, unsubscribeFailure[0]);
}
@@ -551,11 +544,9 @@ public class SubscriptionHelper extends ServiceSupport {
static String getEndpointUrl(final SalesforceComponent component) {
// In version 36.0 replay is only enabled on a separate endpoint
if (Double.valueOf(component.getConfig().getApiVersion()) == 36.0) {
- boolean replayOptionsPresent = component.getConfig().getDefaultReplayId() != null
- || !component.getConfig().getInitialReplayIdMap().isEmpty();
+ boolean replayOptionsPresent = component.getConfig().getDefaultReplayId() != null || !component.getConfig().getInitialReplayIdMap().isEmpty();
if (replayOptionsPresent) {
- return component.getSession().getInstanceUrl() + "/cometd/replay/"
- + component.getConfig().getApiVersion();
+ return component.getSession().getInstanceUrl() + "/cometd/replay/" + component.getConfig().getApiVersion();
}
}
return component.getSession().getInstanceUrl() + "/cometd/" + component.getConfig().getApiVersion();
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractApprovalIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractApprovalIntegrationTest.java
index b48fa0b..f6d6b24 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractApprovalIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractApprovalIntegrationTest.java
@@ -52,9 +52,8 @@ public abstract class AbstractApprovalIntegrationTest extends AbstractSalesforce
return account;
}).collect(Collectors.toList());
- accountIds = accountsToCreate.stream().map(account -> template
- .requestBody("salesforce:createSObject?sObjectName=Account", account, CreateSObjectResult.class))
- .map(CreateSObjectResult::getId).collect(Collectors.toList());
+ accountIds = accountsToCreate.stream().map(account -> template.requestBody("salesforce:createSObject?sObjectName=Account", account, CreateSObjectResult.class))
+ .map(CreateSObjectResult::getId).collect(Collectors.toList());
}
@After
@@ -75,10 +74,9 @@ public abstract class AbstractApprovalIntegrationTest extends AbstractSalesforce
// case where '+' is not used as a part of the username.
final String wildcardUsername = userName.replace('+', '%');
- final QueryRecordsReport results = template.requestBody(
- "salesforce:query?sObjectClass=" + QueryRecordsReport.class.getName()//
- + "&sObjectQuery=SELECT Id FROM User WHERE Username LIKE '" + wildcardUsername + "'",
- NOT_USED, QueryRecordsReport.class);
+ final QueryRecordsReport results = template.requestBody("salesforce:query?sObjectClass=" + QueryRecordsReport.class.getName()//
+ + "&sObjectQuery=SELECT Id FROM User WHERE Username LIKE '" + wildcardUsername + "'", NOT_USED,
+ QueryRecordsReport.class);
userId = results.getRecords().get(0).getId();
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractBulkApiTestBase.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractBulkApiTestBase.java
index 4f123e2..96dc881 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractBulkApiTestBase.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractBulkApiTestBase.java
@@ -38,52 +38,41 @@ public abstract class AbstractBulkApiTestBase extends AbstractSalesforceTestBase
@Override
public void configure() throws Exception {
// test createJob
- from("direct:createJob").
- to("salesforce://createJob");
+ from("direct:createJob").to("salesforce://createJob");
// test getJob
- from("direct:getJob").
- to("salesforce:getJob");
+ from("direct:getJob").to("salesforce:getJob");
// test closeJob
- from("direct:closeJob").
- to("salesforce:closeJob");
+ from("direct:closeJob").to("salesforce:closeJob");
// test abortJob
- from("direct:abortJob").
- to("salesforce:abortJob");
+ from("direct:abortJob").to("salesforce:abortJob");
// test createBatch
- from("direct:createBatch").
- to("salesforce:createBatch");
+ from("direct:createBatch").to("salesforce:createBatch");
// test getBatch
- from("direct:getBatch").
- to("salesforce:getBatch");
+ from("direct:getBatch").to("salesforce:getBatch");
// test getAllBatches
- from("direct:getAllBatches").
- to("salesforce:getAllBatches");
+ from("direct:getAllBatches").to("salesforce:getAllBatches");
// test getRequest
- from("direct:getRequest").
- to("salesforce:getRequest");
+ from("direct:getRequest").to("salesforce:getRequest");
// test getResults
- from("direct:getResults").
- to("salesforce:getResults");
+ from("direct:getResults").to("salesforce:getResults");
// test createBatchQuery
- from("direct:createBatchQuery").
- to("salesforce:createBatchQuery?sObjectQuery=SELECT Name, Description__c, Price__c, Total_Inventory__c FROM Merchandise__c WHERE Name LIKE '%25Bulk API%25'");
+ from("direct:createBatchQuery")
+ .to("salesforce:createBatchQuery?sObjectQuery=SELECT Name, Description__c, Price__c, Total_Inventory__c FROM Merchandise__c WHERE Name LIKE '%25Bulk API%25'");
// test getQueryResultIds
- from("direct:getQueryResultIds").
- to("salesforce:getQueryResultIds");
+ from("direct:getQueryResultIds").to("salesforce:getQueryResultIds");
// test getQueryResult
- from("direct:getQueryResult").
- to("salesforce:getQueryResult");
+ from("direct:getQueryResult").to("salesforce:getQueryResult");
}
};
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractSalesforceTestBase.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractSalesforceTestBase.java
index 930d350..7939d39 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractSalesforceTestBase.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AbstractSalesforceTestBase.java
@@ -56,9 +56,7 @@ public abstract class AbstractSalesforceTestBase extends CamelTestSupport {
component.setHttpClientProperties(clientProperties);
// set DTO package
- component.setPackages(new String[] {
- Merchandise__c.class.getPackage().getName()
- });
+ component.setPackages(new String[] {Merchandise__c.class.getPackage().getName()});
// add it to context
context().addComponent("salesforce", component);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AnalyticsApiIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AnalyticsApiIntegrationTest.java
index 093e01e..e39f7e5 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AnalyticsApiIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/AnalyticsApiIntegrationTest.java
@@ -42,7 +42,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Integration test for Salesforce analytics API endpoints.
+ * Integration test for Salesforce analytics API endpoints.
*/
@RunWith(Theories.class)
public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
@@ -50,11 +50,8 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
private static final Logger LOG = LoggerFactory.getLogger(AnalyticsApiIntegrationTest.class);
private static final int RETRY_DELAY = 5000;
private static final int REPORT_RESULT_RETRIES = 5;
- private static final String[] REPORT_OPTIONS = new String[]{
- SalesforceReportResultsToListConverter.INCLUDE_HEADERS,
- SalesforceReportResultsToListConverter.INCLUDE_DETAILS,
- SalesforceReportResultsToListConverter.INCLUDE_SUMMARY
- };
+ private static final String[] REPORT_OPTIONS = new String[] {SalesforceReportResultsToListConverter.INCLUDE_HEADERS, SalesforceReportResultsToListConverter.INCLUDE_DETAILS,
+ SalesforceReportResultsToListConverter.INCLUDE_SUMMARY};
private static final int NUM_OPTIONS = REPORT_OPTIONS.length;
private static final int[] POWERS = new int[] {4, 2, 1};
@@ -63,6 +60,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
/**
* Get test report developer names as data points.
+ *
* @return test report developer names in test-salesforce-login.properties
* @throws Exception
*/
@@ -87,8 +85,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
log.info("Testing report {}...", reportName);
// get Report Id
- final QueryRecordsReport reports = template().requestBody("direct:queryReport",
- "SELECT Id FROM Report WHERE DeveloperName='" + reportName + "'", QueryRecordsReport.class);
+ final QueryRecordsReport reports = template().requestBody("direct:queryReport", "SELECT Id FROM Report WHERE DeveloperName='" + reportName + "'", QueryRecordsReport.class);
assertNotNull("query", reports);
final List<Report> reportsRecords = reports.getRecords();
@@ -97,8 +94,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
assertNotNull(testReportId);
// 1. getReportDescription
- final ReportDescription reportDescription = template().requestBody("direct:getReportDescription", testReportId,
- ReportDescription.class);
+ final ReportDescription reportDescription = template().requestBody("direct:getReportDescription", testReportId, ReportDescription.class);
assertNotNull("getReportDescriptions", reportDescription);
LOG.debug("getReportDescriptions: {}", reportDescription);
@@ -106,8 +102,8 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
// 2. executeSyncReport
// execute with no metadata
- SyncReportResults reportResults = template().requestBodyAndHeader("direct:executeSyncReport",
- testReportId, SalesforceEndpointConfig.INCLUDE_DETAILS, Boolean.TRUE, SyncReportResults.class);
+ SyncReportResults reportResults = template().requestBodyAndHeader("direct:executeSyncReport", testReportId, SalesforceEndpointConfig.INCLUDE_DETAILS, Boolean.TRUE,
+ SyncReportResults.class);
assertNotNull("executeSyncReport", reportResults);
LOG.debug("executeSyncReport: {}", reportResults);
@@ -122,16 +118,15 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
} else {
body = testReportMetadata;
}
- reportResults = template().requestBodyAndHeaders("direct:executeSyncReport",
- body, headers, SyncReportResults.class);
+ reportResults = template().requestBodyAndHeaders("direct:executeSyncReport", body, headers, SyncReportResults.class);
assertNotNull("executeSyncReport with metadata", reportResults);
LOG.debug("executeSyncReport with metadata: {}", reportResults);
// 3. executeAsyncReport
// execute with no metadata
- ReportInstance reportInstance = template().requestBodyAndHeader("direct:executeAsyncReport",
- testReportId, SalesforceEndpointConfig.INCLUDE_DETAILS, true, ReportInstance.class);
+ ReportInstance reportInstance = template().requestBodyAndHeader("direct:executeAsyncReport", testReportId, SalesforceEndpointConfig.INCLUDE_DETAILS, true,
+ ReportInstance.class);
assertNotNull("executeAsyncReport", reportInstance);
LOG.debug("executeAsyncReport: {}", reportInstance);
@@ -147,8 +142,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
body = testReportMetadata;
bodyMetadata = false;
}
- reportInstance = template().requestBodyAndHeaders("direct:executeAsyncReport",
- body, headers, ReportInstance.class);
+ reportInstance = template().requestBodyAndHeaders("direct:executeAsyncReport", body, headers, ReportInstance.class);
assertNotNull("executeAsyncReport with metadata", reportInstance);
LOG.debug("executeAsyncReport with metadata: {}", reportInstance);
@@ -167,11 +161,10 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
int tries = 0;
AsyncReportResults asyncReportResults = null;
while (!done) {
- asyncReportResults = template().requestBodyAndHeader("direct:getReportResults",
- testReportId, SalesforceEndpointConfig.INSTANCE_ID, testReportInstanceId, AsyncReportResults.class);
+ asyncReportResults = template().requestBodyAndHeader("direct:getReportResults", testReportId, SalesforceEndpointConfig.INSTANCE_ID, testReportInstanceId,
+ AsyncReportResults.class);
done = asyncReportResults != null
- && (asyncReportResults.getAttributes().getStatus() == ReportStatusEnum.Success
- || asyncReportResults.getAttributes().getStatus() == ReportStatusEnum.Error);
+ && (asyncReportResults.getAttributes().getStatus() == ReportStatusEnum.Success || asyncReportResults.getAttributes().getStatus() == ReportStatusEnum.Error);
if (!done) {
// avoid flooding calls
Thread.sleep(RETRY_DELAY);
@@ -183,8 +176,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
}
assertNotNull("getReportResults", asyncReportResults);
- assertEquals("getReportResults status", ReportStatusEnum.Success,
- asyncReportResults.getAttributes().getStatus());
+ assertEquals("getReportResults status", ReportStatusEnum.Success, asyncReportResults.getAttributes().getStatus());
LOG.debug("getReportResults: {}", asyncReportResults);
// 6. SalesforceReportResultsConverter tests
@@ -196,7 +188,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
// permutations of include details, include headers, include summary
final boolean[] values = new boolean[NUM_OPTIONS];
- final int nIterations = (int) Math.pow(2, NUM_OPTIONS);
+ final int nIterations = (int)Math.pow(2, NUM_OPTIONS);
for (int i = 0; i < nIterations; i++) {
@@ -212,8 +204,7 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
for (int j = 0; j < REPORT_OPTIONS.length; j++) {
headers.put(REPORT_OPTIONS[j], values[j]);
}
- convertResults = template.requestBodyAndHeaders("direct:convertResults", asyncReportResults,
- headers, String.class);
+ convertResults = template.requestBodyAndHeaders("direct:convertResults", asyncReportResults, headers, String.class);
assertNotNull("convertResults", convertResults);
LOG.debug("{}", convertResults);
@@ -227,33 +218,24 @@ public class AnalyticsApiIntegrationTest extends AbstractSalesforceTestBase {
public void configure() throws Exception {
// get Report SObject by DeveloperName
- from("direct:queryReport")
- .to("salesforce:query?sObjectClass=" + QueryRecordsReport.class.getName());
-
- from("direct:getRecentReports")
- .to("salesforce:getRecentReports");
-
- from("direct:getReportDescription")
- .to("salesforce:getReportDescription");
-
- from("direct:executeSyncReport")
- .to("salesforce:executeSyncReport");
-
- from("direct:executeAsyncReport")
- .to("salesforce:executeAsyncReport?includeDetails=true");
-
- from("direct:getReportInstances")
- .to("salesforce:getReportInstances");
-
- from("direct:getReportResults")
- .to("salesforce:getReportResults");
+ from("direct:queryReport").to("salesforce:query?sObjectClass=" + QueryRecordsReport.class.getName());
+
+ from("direct:getRecentReports").to("salesforce:getRecentReports");
+
+ from("direct:getReportDescription").to("salesforce:getReportDescription");
+
+ from("direct:executeSyncReport").to("salesforce:executeSyncReport");
+
+ from("direct:executeAsyncReport").to("salesforce:executeAsyncReport?includeDetails=true");
+
+ from("direct:getReportInstances").to("salesforce:getReportInstances");
+
+ from("direct:getReportResults").to("salesforce:getReportResults");
CsvDataFormat csv = new CsvDataFormat(CSVFormat.EXCEL);
// type converter test
- from("direct:convertResults")
- .convertBodyTo(List.class)
- .marshal(csv);
+ from("direct:convertResults").convertBodyTo(List.class).marshal(csv);
}
};
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalExamplesIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalExamplesIntegrationTest.java
index c6b22cb..dc00f87 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalExamplesIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalExamplesIntegrationTest.java
@@ -76,20 +76,18 @@ public class ApprovalExamplesIntegrationTest extends AbstractApprovalIntegration
public void configure() throws Exception {
// tag::example1Route[]
from("direct:example1")//
- .setHeader("approval.ContextId", simple("${body['contextId']}"))
- .setHeader("approval.NextApproverIds", simple("${body['nextApproverIds']}"))
- .to("salesforce:approval?"//
- + "approvalActionType=Submit"//
- + "&approvalComments=this is a test"//
- + "&approvalProcessDefinitionNameOrId=Test_Account_Process"//
- + "&approvalSkipEntryCriteria=true");
+ .setHeader("approval.ContextId", simple("${body['contextId']}")).setHeader("approval.NextApproverIds", simple("${body['nextApproverIds']}"))
+ .to("salesforce:approval?"//
+ + "approvalActionType=Submit"//
+ + "&approvalComments=this is a test"//
+ + "&approvalProcessDefinitionNameOrId=Test_Account_Process"//
+ + "&approvalSkipEntryCriteria=true");
// end::example1Route[]
// tag::example2Route[]
from("direct:example2")//
- .setHeader("approval.ContextId", simple("${body['contextId']}"))
- .setHeader("approval.NextApproverIds", simple("${body['nextApproverIds']}"))
- .to("salesforce:approval?approval=#approvalTemplate");
+ .setHeader("approval.ContextId", simple("${body['contextId']}")).setHeader("approval.NextApproverIds", simple("${body['nextApproverIds']}"))
+ .to("salesforce:approval?approval=#approvalTemplate");
// end::example2Route[]
}
};
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalIntegrationTest.java
index 3523ba6..5b79c01 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/ApprovalIntegrationTest.java
@@ -43,25 +43,25 @@ public class ApprovalIntegrationTest extends AbstractApprovalIntegrationTest {
@Test
public void shouldSubmitAndFetchApprovals() {
- final ApprovalResult approvalResult = template.requestBody(
- String.format("salesforce:approval?"//
- + "format=%s"//
- + "&approvalActionType=Submit"//
- + "&approvalContextId=%s"//
- + "&approvalNextApproverIds=%s"//
- + "&approvalComments=Integration test"//
- + "&approvalProcessDefinitionNameOrId=Test_Account_Process", format, accountIds.get(0), userId),
- NOT_USED, ApprovalResult.class);
+ final ApprovalResult approvalResult = template.requestBody(String.format("salesforce:approval?"//
+ + "format=%s"//
+ + "&approvalActionType=Submit"//
+ + "&approvalContextId=%s"//
+ + "&approvalNextApproverIds=%s"//
+ + "&approvalComments=Integration test"//
+ + "&approvalProcessDefinitionNameOrId=Test_Account_Process", format, accountIds.get(0), userId),
+ NOT_USED, ApprovalResult.class);
assertNotNull("Approval should have resulted in value", approvalResult);
assertEquals("There should be one Account waiting approval", 1, approvalResult.size());
- assertEquals("Instance status of the item in approval result should be `Pending`", "Pending",
- approvalResult.iterator().next().getInstanceStatus());
+ assertEquals("Instance status of the item in approval result should be `Pending`", "Pending", approvalResult.iterator().next().getInstanceStatus());
- // as it stands on 18.11.2016. the GET method on /vXX.X/process/approvals/ with Accept other than
- // `application/json` results in HTTP status 500, so only JSON is supported
+ // as it stands on 18.11.2016. the GET method on
+ // /vXX.X/process/approvals/ with Accept other than
+ // `application/json` results in HTTP status 500, so only JSON is
+ // supported
final Approvals approvals = template.requestBody("salesforce:approvals", NOT_USED, Approvals.class);
assertNotNull("Approvals should be fetched", approvals);
@@ -81,16 +81,14 @@ public class ApprovalIntegrationTest extends AbstractApprovalIntegrationTest {
return request;
}).collect(Collectors.toList());
- final ApprovalResult approvalResult = template.requestBody(
- String.format("salesforce:approval?"//
- + "format=%s"//
- + "&approvalActionType=Submit"//
- + "&approvalNextApproverIds=%s"//
- + "&approvalProcessDefinitionNameOrId=Test_Account_Process", format, userId),
- approvalRequests, ApprovalResult.class);
+ final ApprovalResult approvalResult = template.requestBody(String.format("salesforce:approval?"//
+ + "format=%s"//
+ + "&approvalActionType=Submit"//
+ + "&approvalNextApproverIds=%s"//
+ + "&approvalProcessDefinitionNameOrId=Test_Account_Process", format, userId),
+ approvalRequests, ApprovalResult.class);
- assertEquals("Should have same number of approval results as requests", approvalRequests.size(),
- approvalResult.size());
+ assertEquals("Should have same number of approval results as requests", approvalRequests.size(), approvalResult.size());
}
@Parameters(name = "format = {0}")
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiBatchIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiBatchIntegrationTest.java
index e519ae2..0e0cff5 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiBatchIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiBatchIntegrationTest.java
@@ -71,8 +71,7 @@ public class BulkApiBatchIntegrationTest extends AbstractBulkApiTestBase {
Map<String, Object> headers = new HashMap<>();
headers.put(SalesforceEndpointConfig.JOB_ID, jobInfo.getId());
headers.put(SalesforceEndpointConfig.CONTENT_TYPE, jobInfo.getContentType());
- BatchInfo batchInfo = template().requestBodyAndHeaders("direct:createBatch",
- request.stream, headers, BatchInfo.class);
+ BatchInfo batchInfo = template().requestBodyAndHeaders("direct:createBatch", request.stream, headers, BatchInfo.class);
assertNotNull("Null batch", batchInfo);
assertNotNull("Null batch id", batchInfo.getId());
@@ -87,7 +86,7 @@ public class BulkApiBatchIntegrationTest extends AbstractBulkApiTestBase {
batchInfo = getBatchInfo(batchInfo);
// test getRequest
- InputStream requestStream = template().requestBody("direct:getRequest", batchInfo, InputStream.class);
+ InputStream requestStream = template().requestBody("direct:getRequest", batchInfo, InputStream.class);
assertNotNull("Null batch request", requestStream);
// wait for batch to finish
@@ -102,7 +101,7 @@ public class BulkApiBatchIntegrationTest extends AbstractBulkApiTestBase {
assertEquals("Batch did not succeed", BatchStateEnum.COMPLETED, batchInfo.getState());
// test getResults
- InputStream results = template().requestBody("direct:getResults", batchInfo, InputStream.class);
+ InputStream results = template().requestBody("direct:getResults", batchInfo, InputStream.class);
assertNotNull("Null batch results", results);
// close the test job
@@ -113,4 +112,4 @@ public class BulkApiBatchIntegrationTest extends AbstractBulkApiTestBase {
public InputStream stream;
public ContentType contentType;
}
-}
\ No newline at end of file
+}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiIntegrationTest.java
index 5f8b84c..78a16d6 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiIntegrationTest.java
@@ -58,4 +58,4 @@ public class BulkApiIntegrationTest extends AbstractBulkApiTestBase {
jobInfo.setObject(Merchandise__c.class.getSimpleName());
createJob(jobInfo);
}
-}
\ No newline at end of file
+}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiJobIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiJobIntegrationTest.java
index d15e895..efca9fd 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiJobIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiJobIntegrationTest.java
@@ -47,9 +47,8 @@ public class BulkApiJobIntegrationTest extends AbstractBulkApiTestBase {
public void setupProfileWithHardDelete() throws IOException {
final SalesforceLoginConfig loginConfig = LoginConfigHelper.getLoginConfig();
- template().requestBodyAndHeader(
- "salesforce:apexCall/UpdateProfile?apexMethod=PATCH&sObjectClass=java.lang.String", null,
- SalesforceEndpointConfig.APEX_QUERY_PARAM_PREFIX + "username", loginConfig.getUserName());
+ template().requestBodyAndHeader("salesforce:apexCall/UpdateProfile?apexMethod=PATCH&sObjectClass=java.lang.String", null,
+ SalesforceEndpointConfig.APEX_QUERY_PARAM_PREFIX + "username", loginConfig.getUserName());
}
@Test
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiQueryIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiQueryIntegrationTest.java
index c703221..bba5de3 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiQueryIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/BulkApiQueryIntegrationTest.java
@@ -33,10 +33,7 @@ public class BulkApiQueryIntegrationTest extends AbstractBulkApiTestBase {
@DataPoints
public static ContentType[] getContentTypes() {
- return new ContentType[] {
- ContentType.XML,
- ContentType.CSV
- };
+ return new ContentType[] {ContentType.XML, ContentType.CSV};
}
@Theory
@@ -79,8 +76,7 @@ public class BulkApiQueryIntegrationTest extends AbstractBulkApiTestBase {
// test getQueryResult
for (String resultId : resultIds) {
- InputStream results = template().requestBodyAndHeader("direct:getQueryResult", batchInfo,
- SalesforceEndpointConfig.RESULT_ID, resultId, InputStream.class);
+ InputStream results = template().requestBodyAndHeader("direct:getQueryResult", batchInfo, SalesforceEndpointConfig.RESULT_ID, resultId, InputStream.class);
assertNotNull("Null query result", results);
}
@@ -88,4 +84,4 @@ public class BulkApiQueryIntegrationTest extends AbstractBulkApiTestBase {
template().requestBody("direct:closeJob", jobInfo, JobInfo.class);
}
-}
\ No newline at end of file
+}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiBatchIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiBatchIntegrationTest.java
index bdf8749..752c82c 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiBatchIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiBatchIntegrationTest.java
@@ -60,8 +60,7 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
}
- private static final Set<String> VERSIONS = new HashSet<>(
- Arrays.asList(SalesforceEndpointConfig.DEFAULT_VERSION, "34.0", "36.0", "37.0", "39.0"));
+ private static final Set<String> VERSIONS = new HashSet<>(Arrays.asList(SalesforceEndpointConfig.DEFAULT_VERSION, "34.0", "36.0", "37.0", "39.0"));
private String accountId;
@@ -90,8 +89,7 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final Account account = new Account();
account.setName("Composite API Batch");
- final CreateSObjectResult result = template.requestBody("salesforce:createSObject", account,
- CreateSObjectResult.class);
+ final CreateSObjectResult result = template.requestBody("salesforce:createSObject", account, CreateSObjectResult.class);
accountId = result.getId();
}
@@ -130,7 +128,7 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
/**
* The XML format fails, as Salesforce API wrongly includes whitespaces
- * inside tag names. E.g. <Ant Migration Tool>
+ * inside tag names. E.g. <Ant Migration Tool>
* https://www.w3.org/TR/2008/REC-xml-20081126/#NT-NameChar
*/
@Test
@@ -145,16 +143,18 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked")
- final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
+ final Map<String, Object> result = (Map<String, Object>)batchResult.getResult();
- // JSON and XML structure are different, XML has `LimitsSnapshot` node, JSON does not
+ // JSON and XML structure are different, XML has `LimitsSnapshot` node,
+ // JSON does not
@SuppressWarnings("unchecked")
- final Map<String, Object> limits = (Map<String, Object>) result.getOrDefault("LimitsSnapshot", result);
+ final Map<String, Object> limits = (Map<String, Object>)result.getOrDefault("LimitsSnapshot", result);
@SuppressWarnings("unchecked")
- final Map<String, String> apiRequests = (Map<String, String>) limits.get("DailyApiRequests");
+ final Map<String, String> apiRequests = (Map<String, String>)limits.get("DailyApiRequests");
- // for JSON value will be Integer, for XML (no type information) it will be String
+ // for JSON value will be Integer, for XML (no type information) it will
+ // be String
// This number can be different per org, and future releases,
// so let's just make sure it's greater than zero
assertTrue(Integer.valueOf(String.valueOf(apiRequests.get("Max"))) > 0);
@@ -175,11 +175,12 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked")
- final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
+ final Map<String, Object> result = (Map<String, Object>)batchResult.getResult();
- // JSON and XML structure are different, XML has `Result` node, JSON does not
+ // JSON and XML structure are different, XML has `Result` node, JSON
+ // does not
@SuppressWarnings("unchecked")
- final Map<String, Object> creationOutcome = (Map<String, Object>) result.getOrDefault("Result", result);
+ final Map<String, Object> creationOutcome = (Map<String, Object>)result.getOrDefault("Result", result);
assertNotNull(creationOutcome.get("id"));
}
@@ -205,11 +206,12 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked")
- final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
+ final Map<String, Object> result = (Map<String, Object>)batchResult.getResult();
- // JSON and XML structure are different, XML has `Account` node, JSON does not
+ // JSON and XML structure are different, XML has `Account` node, JSON
+ // does not
@SuppressWarnings("unchecked")
- final Map<String, String> data = (Map<String, String>) result.getOrDefault("Account", result);
+ final Map<String, String> data = (Map<String, String>)result.getOrDefault("Account", result);
assertEquals("Composite API Batch", data.get("Name"));
}
@@ -238,11 +240,12 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked")
- final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
+ final Map<String, Object> result = (Map<String, Object>)batchResult.getResult();
- // JSON and XML structure are different, XML has `QueryResult` node, JSON does not
+ // JSON and XML structure are different, XML has `QueryResult` node,
+ // JSON does not
@SuppressWarnings("unchecked")
- final Map<String, String> data = (Map<String, String>) result.getOrDefault("QueryResult", result);
+ final Map<String, String> data = (Map<String, String>)result.getOrDefault("QueryResult", result);
assertNotNull(data.get("totalSize"));
}
@@ -259,11 +262,12 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked")
- final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
+ final Map<String, Object> result = (Map<String, Object>)batchResult.getResult();
- // JSON and XML structure are different, XML has `QueryResult` node, JSON does not
+ // JSON and XML structure are different, XML has `QueryResult` node,
+ // JSON does not
@SuppressWarnings("unchecked")
- final Map<String, String> data = (Map<String, String>) result.getOrDefault("QueryResult", result);
+ final Map<String, String> data = (Map<String, String>)result.getOrDefault("QueryResult", result);
assertNotNull(data.get("totalSize"));
}
@@ -284,11 +288,12 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final SObjectBatchResult batchResult = results.get(0);
@SuppressWarnings("unchecked")
- final Map<String, Object> result = (Map<String, Object>) batchResult.getResult();
+ final Map<String, Object> result = (Map<String, Object>)batchResult.getResult();
- // JSON and XML structure are different, XML has `User` node, JSON does not
+ // JSON and XML structure are different, XML has `User` node, JSON does
+ // not
@SuppressWarnings("unchecked")
- final Map<String, String> data = (Map<String, String>) result.getOrDefault("User", result);
+ final Map<String, String> data = (Map<String, String>)result.getOrDefault("User", result);
final SalesforceLoginConfig loginConfig = LoginConfigHelper.getLoginConfig();
@@ -299,8 +304,10 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
public void shouldSupportSearch() {
final SObjectBatch batch = new SObjectBatch(version);
- // we cannot rely on search returning the `Composite API Batch` account as the search indexer runs
- // asynchronously to object creation, so that account might not be indexed at this time, so we search for
+ // we cannot rely on search returning the `Composite API Batch` account
+ // as the search indexer runs
+ // asynchronously to object creation, so that account might not be
+ // indexed at this time, so we search for
// `United` Account that should be created with developer instance
batch.addSearch("FIND {United} IN Name Fields RETURNING Account (Name)");
@@ -313,25 +320,31 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final Object searchResult;
if (firstBatchResult instanceof Map) {
- // the JSON and XML responses differ, XML has a root node which can be either SearchResults or
+ // the JSON and XML responses differ, XML has a root node which can
+ // be either SearchResults or
// SearchResultWithMetadata
- // furthermore version 37.0 search results are no longer array, but dictionary of {
- // "searchRecords": [<array>] } and the XML output changed to <SearchResultWithMetadata><searchRecords>, so
+ // furthermore version 37.0 search results are no longer array, but
+ // dictionary of {
+ // "searchRecords": [<array>] } and the XML output changed to
+ // <SearchResultWithMetadata><searchRecords>, so
// we have:
// @formatter:off
- // | version | format | response syntax |
- // | 34 | JSON | {attributes={type=Account... |
- // | 34 | XML | {SearchResults={attributes={type=Account... |
- // | 37 | JSON | {searchRecords=[{attributes={type=Account... |
- // | 37 | XML | {SearchResultWithMetadata={searchRecords={attributes={type=Account... |
+ // | version | format | response syntax |
+ // | 34 | JSON | {attributes={type=Account... |
+ // | 34 | XML | {SearchResults={attributes={type=Account... |
+ // | 37 | JSON | {searchRecords=[{attributes={type=Account... |
+ // | 37 | XML |
+ // {SearchResultWithMetadata={searchRecords={attributes={type=Account...
+ // |
// @formatter:on
@SuppressWarnings("unchecked")
- final Map<String, Object> tmp = (Map<String, Object>) firstBatchResult;
+ final Map<String, Object> tmp = (Map<String, Object>)firstBatchResult;
@SuppressWarnings("unchecked")
- final Map<String, Object> nested = (Map<String, Object>) tmp.getOrDefault("SearchResultWithMetadata", tmp);
+ final Map<String, Object> nested = (Map<String, Object>)tmp.getOrDefault("SearchResultWithMetadata", tmp);
- // JSON and XML structure are different, XML has `SearchResults` node, JSON does not
+ // JSON and XML structure are different, XML has `SearchResults`
+ // node, JSON does not
searchResult = nested.getOrDefault("searchRecords", nested.getOrDefault("SearchResults", nested));
} else {
searchResult = firstBatchResult;
@@ -340,11 +353,11 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
final Map<String, Object> result;
if (searchResult instanceof List) {
@SuppressWarnings("unchecked")
- final Map<String, Object> tmp = (Map<String, Object>) ((List) searchResult).get(0);
+ final Map<String, Object> tmp = (Map<String, Object>)((List)searchResult).get(0);
result = tmp;
} else {
@SuppressWarnings("unchecked")
- final Map<String, Object> tmp = (Map<String, Object>) searchResult;
+ final Map<String, Object> tmp = (Map<String, Object>)searchResult;
result = tmp;
}
@@ -359,8 +372,7 @@ public class CompositeApiBatchIntegrationTest extends AbstractSalesforceTestBase
from("direct:deleteBatchAccounts")
.to("salesforce:query?sObjectClass=" + Accounts.class.getName()
+ "&sObjectQuery=SELECT Id FROM Account WHERE Name = 'Account created from Composite batch API'")
- .split(simple("${body.records}")).setHeader("sObjectId", simple("${body.id}"))
- .to("salesforce:deleteSObject?sObjectName=Account").end();
+ .split(simple("${body.records}")).setHeader("sObjectId", simple("${body.id}")).to("salesforce:deleteSObject?sObjectName=Account").end();
}
};
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiIntegrationTest.java
index 3ce2ee7..f7466b5 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiIntegrationTest.java
@@ -89,8 +89,7 @@ public class CompositeApiIntegrationTest extends AbstractSalesforceTestBase {
final Account account = new Account();
account.setName("Composite API Batch");
- final CreateSObjectResult result = template.requestBody("salesforce:createSObject", account,
- CreateSObjectResult.class);
+ final CreateSObjectResult result = template.requestBody("salesforce:createSObject", account, CreateSObjectResult.class);
accountId = result.getId();
}
@@ -220,8 +219,7 @@ public class CompositeApiIntegrationTest extends AbstractSalesforceTestBase {
from("direct:deleteBatchAccounts")
.to("salesforce:query?sObjectClass=" + Accounts.class.getName()
+ "&sObjectQuery=SELECT Id FROM Account WHERE Name = 'Account created from Composite batch API'")
- .split(simple("${body.records}")).setHeader("sObjectId", simple("${body.id}"))
- .to("salesforce:deleteSObject?sObjectName=Account").end();
+ .split(simple("${body.records}")).setHeader("sObjectId", simple("${body.id}")).to("salesforce:deleteSObject?sObjectName=Account").end();
}
};
}
@@ -249,7 +247,7 @@ public class CompositeApiIntegrationTest extends AbstractSalesforceTestBase {
Assertions.assertThat(firstCompositeResponseBody).isInstanceOf(Map.class);
@SuppressWarnings("unchecked")
- final Map<String, ?> body = (Map<String, ?>) firstCompositeResponseBody;
+ final Map<String, ?> body = (Map<String, ?>)firstCompositeResponseBody;
Assertions.assertThat(body).containsKey(key);
Assertions.assertThat(body.get(key)).isNotNull();
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiTreeIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiTreeIntegrationTest.java
index 76c222c..2652cd4 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiTreeIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompositeApiTreeIntegrationTest.java
@@ -85,8 +85,7 @@ public class CompositeApiTreeIntegrationTest extends AbstractSalesforceTestBase
tree.addObject(simpleAccount3).addChild("Contacts", contact).addChild("Assets", asset);
- final SObjectTree response = template.requestBody("salesforce:composite-tree?format=" + format, tree,
- SObjectTree.class);
+ final SObjectTree response = template.requestBody("salesforce:composite-tree?format=" + format, tree, SObjectTree.class);
assertNotNull("Response should be provided", response);
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompoundTypesIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompoundTypesIntegrationTest.java
index b749248..d85b0f6 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompoundTypesIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/CompoundTypesIntegrationTest.java
@@ -24,10 +24,14 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Test support for Salesforce compound data types.
- * This test requires a custom field in the <code>Account</code> object
- * called <code>"Shipping Location"</code> of type <code>Geolocation</code> in decimal units.
- * @see <a href="https://www.salesforce.com/developer/docs/api/index_Left.htm#CSHID=compound_fields.htm|StartTopic=Content%2Fcompound_fields.htm|SkinName=webhelp">Compound data types</a>
+ * Test support for Salesforce compound data types. This test requires a custom
+ * field in the <code>Account</code> object called
+ * <code>"Shipping Location"</code> of type <code>Geolocation</code> in decimal
+ * units.
+ *
+ * @see <a href=
+ * "https://www.salesforce.com/developer/docs/api/index_Left.htm#CSHID=compound_fields.htm|StartTopic=Content%2Fcompound_fields.htm|SkinName=webhelp">Compound
+ * data types</a>
*/
public class CompoundTypesIntegrationTest extends AbstractSalesforceTestBase {
@@ -64,8 +68,7 @@ public class CompoundTypesIntegrationTest extends AbstractSalesforceTestBase {
account.setShipping_Location__Latitude__s(37.793779);
account.setShipping_Location__Longitude__s(-122.39448);
- CreateSObjectResult result = template().requestBody("direct:createSObject" + suffix,
- account, CreateSObjectResult.class);
+ CreateSObjectResult result = template().requestBody("direct:createSObject" + suffix, account, CreateSObjectResult.class);
assertNotNull(result);
assertTrue("Create success", result.getSuccess());
LOG.debug("Create: " + result);
@@ -79,8 +82,7 @@ public class CompoundTypesIntegrationTest extends AbstractSalesforceTestBase {
assertNotNull("Shipping Address", account.getShippingAddress());
assertNotNull("Shipping Location", account.getShippingAddress());
- LOG.debug("Retrieved fields billing address: {}, shipping location: {}",
- account.getBillingAddress(), account.getShipping_Location__c());
+ LOG.debug("Retrieved fields billing address: {}, shipping location: {}", account.getBillingAddress(), account.getShipping_Location__c());
} finally {
// delete the test SObject
@@ -95,25 +97,19 @@ public class CompoundTypesIntegrationTest extends AbstractSalesforceTestBase {
@Override
public void configure() throws Exception {
// testCreateSObject
- from("direct:createSObject")
- .to("salesforce:createSObject?sObjectName=Account");
+ from("direct:createSObject").to("salesforce:createSObject?sObjectName=Account");
- from("direct:createSObjectXml")
- .to("salesforce:createSObject?format=XML&sObjectName=Account");
+ from("direct:createSObjectXml").to("salesforce:createSObject?format=XML&sObjectName=Account");
// testGetSObject
- from("direct:getSObject")
- .to("salesforce:getSObject?sObjectName=Account&sObjectFields=Id,BillingAddress,ShippingAddress,Shipping_Location__c");
+ from("direct:getSObject").to("salesforce:getSObject?sObjectName=Account&sObjectFields=Id,BillingAddress,ShippingAddress,Shipping_Location__c");
- from("direct:getSObjectXml")
- .to("salesforce:getSObject?format=XML&sObjectName=Account&sObjectFields=Id,BillingAddress,ShippingAddress,Shipping_Location__c");
+ from("direct:getSObjectXml").to("salesforce:getSObject?format=XML&sObjectName=Account&sObjectFields=Id,BillingAddress,ShippingAddress,Shipping_Location__c");
// testDeleteSObject
- from("direct:deleteSObject")
- .to("salesforce:deleteSObject?sObjectName=Account");
+ from("direct:deleteSObject").to("salesforce:deleteSObject?sObjectName=Account");
- from("direct:deleteSObjectXml")
- .to("salesforce:deleteSObject?format=XML&sObjectName=Account");
+ from("direct:deleteSObjectXml").to("salesforce:deleteSObject?format=XML&sObjectName=Account");
}
};
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java
index 1905940..7859635 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java
@@ -68,8 +68,7 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase {
@Parameters
public static Iterable<Consumer<SalesforceComponent>> methods() {
- return Arrays.asList(HttpProxyIntegrationTest::configureProxyViaComponentProperties,
- HttpProxyIntegrationTest::configureProxyViaClientPropertiesMap);
+ return Arrays.asList(HttpProxyIntegrationTest::configureProxyViaComponentProperties, HttpProxyIntegrationTest::configureProxyViaClientPropertiesMap);
}
@Test
@@ -84,12 +83,12 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase {
private void doTestGetVersions(String suffix) throws Exception {
// test getVersions doesn't need a body
// assert expected result
- Object o = template().requestBody("direct:getVersions" + suffix, (Object) null);
+ Object o = template().requestBody("direct:getVersions" + suffix, (Object)null);
List<Version> versions = null;
if (o instanceof Versions) {
- versions = ((Versions) o).getVersions();
+ versions = ((Versions)o).getVersions();
} else {
- versions = (List<Version>) o;
+ versions = (List<Version>)o;
}
assertNotNull(versions);
LOG.debug("Versions: {}", versions);
@@ -105,8 +104,7 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase {
connector.setHost(HTTP_PROXY_HOST);
server.addConnector(connector);
- final String authenticationString = "Basic "
- + B64Code.encode(HTTP_PROXY_USER_NAME + ":" + HTTP_PROXY_PASSWORD, StringUtil.__ISO_8859_1);
+ final String authenticationString = "Basic " + B64Code.encode(HTTP_PROXY_USER_NAME + ":" + HTTP_PROXY_PASSWORD, StringUtil.__ISO_8859_1);
ConnectHandler connectHandler = new ConnectHandler() {
@Override
@@ -137,7 +135,7 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase {
protected void createComponent() throws Exception {
super.createComponent();
- final SalesforceComponent salesforce = (SalesforceComponent) context().getComponent("salesforce");
+ final SalesforceComponent salesforce = (SalesforceComponent)context().getComponent("salesforce");
// set HTTP client properties
final HashMap<String, Object> properties = new HashMap<>();
@@ -163,12 +161,10 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase {
public void configure() throws Exception {
// testGetVersion
- from("direct:getVersions")
- .to("salesforce:getVersions");
+ from("direct:getVersions").to("salesforce:getVersions");
// allow overriding format per endpoint
- from("direct:getVersionsXml")
- .to("salesforce:getVersions?format=XML");
+ from("direct:getVersionsXml").to("salesforce:getVersions?format=XML");
}
};
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LimitsIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LimitsIntegrationTest.java
index 81c2518..b51e63d 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LimitsIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LimitsIntegrationTest.java
@@ -41,8 +41,7 @@ public class LimitsIntegrationTest extends AbstractSalesforceTestBase {
assertLimitIsFetched("DailyBulkApiRequests", limits.getDailyBulkApiRequests());
- assertLimitIsFetched("DailyDurableGenericStreamingApiEvents",
- limits.getDailyDurableGenericStreamingApiEvents());
+ assertLimitIsFetched("DailyDurableGenericStreamingApiEvents", limits.getDailyDurableGenericStreamingApiEvents());
assertLimitIsFetched("DailyDurableStreamingApiEvents", limits.getDailyDurableStreamingApiEvents());
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LoginConfigHelper.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LoginConfigHelper.java
index 1f0b51c..c34cb51 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LoginConfigHelper.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/LoginConfigHelper.java
@@ -42,10 +42,8 @@ public final class LoginConfigHelper {
}
System.getenv().keySet().stream()//
- .filter(k -> k.startsWith("SALESFORCE_") && isNotEmpty(System.getenv(k)))
- .forEach(k -> configuration.put(fromEnvName(k), System.getenv(k)));
- System.getProperties().keySet().stream().map(String.class::cast)
- .filter(k -> k.startsWith("salesforce.") && isNotEmpty(System.getProperty(k)))
+ .filter(k -> k.startsWith("SALESFORCE_") && isNotEmpty(System.getenv(k))).forEach(k -> configuration.put(fromEnvName(k), System.getenv(k)));
+ System.getProperties().keySet().stream().map(String.class::cast).filter(k -> k.startsWith("salesforce.") && isNotEmpty(System.getProperty(k)))
.forEach(k -> configuration.put(k, System.getProperty(k)));
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/NotFoundIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/NotFoundIntegrationTest.java
index e1507a9..00c7d03 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/NotFoundIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/NotFoundIntegrationTest.java
@@ -36,9 +36,8 @@ public class NotFoundIntegrationTest extends AbstractSalesforceTestBase {
@Test
public void shouldNotReportNotFoundExceptionFromRestApiIfConfiguredNotTo() {
- final Account got = template
- .requestBody("salesforce:getSObjectWithId?sObjectName=Account&sObjectIdName=Name&format=" + format
- + "¬FoundBehaviour=NULL", "NonExistant", Account.class);
+ final Account got = template.requestBody("salesforce:getSObjectWithId?sObjectName=Account&sObjectIdName=Name&format=" + format + "¬FoundBehaviour=NULL", "NonExistant",
+ Account.class);
assertNull("Expecting null when `notFoundBehaviour` is set to NULL", got);
}
@@ -46,12 +45,10 @@ public class NotFoundIntegrationTest extends AbstractSalesforceTestBase {
@Test
public void shouldReportNotFoundExceptionFromRestApi() {
try {
- template.requestBody("salesforce:getSObjectWithId?sObjectName=Account&sObjectIdName=Name&format=" + format,
- "NonExistant", Account.class);
+ template.requestBody("salesforce:getSObjectWithId?sObjectName=Account&sObjectIdName=Name&format=" + format, "NonExistant", Account.class);
fail("Expecting CamelExecutionException");
} catch (final CamelExecutionException e) {
- assertTrue("Expecting the cause of CamelExecutionException to be NoSuchSObjectException",
- e.getCause() instanceof NoSuchSObjectException);
+ assertTrue("Expecting the cause of CamelExecutionException to be NoSuchSObjectException", e.getCause() instanceof NoSuchSObjectException);
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
index e43a96a..7fd8aa7 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RawPayloadTest.java
@@ -58,7 +58,6 @@ public class RawPayloadTest extends AbstractSalesforceTestBase {
private static HttpUrl loginUrl;
private static MockWebServer server;
-
private static String lastFormat;
private static String expectedResponse;
private static String requestBody;
@@ -102,14 +101,10 @@ public class RawPayloadTest extends AbstractSalesforceTestBase {
@Override
public MockResponse dispatch(RecordedRequest recordedRequest) throws InterruptedException {
if (recordedRequest.getPath().equals(OAUTH2_TOKEN_PATH)) {
- return new MockResponse()
- .setResponseCode(200)
- .setBody("{ \"access_token\": \"mock_token\", \"instance_url\": \"" + loginUrl + "\"}");
+ return new MockResponse().setResponseCode(200).setBody("{ \"access_token\": \"mock_token\", \"instance_url\": \"" + loginUrl + "\"}");
} else {
- return new MockResponse()
- .setResponseCode(200)
- .setHeader(HttpHeader.CONTENT_TYPE.toString(), recordedRequest.getHeader(HttpHeader.CONTENT_TYPE.toString()))
- .setBody("XML".equals(format) ? XML_RESPONSE : JSON_RESPONSE);
+ return new MockResponse().setResponseCode(200).setHeader(HttpHeader.CONTENT_TYPE.toString(), recordedRequest.getHeader(HttpHeader.CONTENT_TYPE.toString()))
+ .setBody("XML".equals(format) ? XML_RESPONSE : JSON_RESPONSE);
}
}
});
@@ -168,13 +163,10 @@ public class RawPayloadTest extends AbstractSalesforceTestBase {
from("direct:getBasicInfo").to("salesforce:getBasicInfo?sObjectName=Merchandise__c&rawPayload=true&format=" + format);
// testGetDescription
- from("direct:getDescription")
- .to("salesforce:getDescription?sObjectName=Merchandise__c&rawPayload=true&format=" + format);
+ from("direct:getDescription").to("salesforce:getDescription?sObjectName=Merchandise__c&rawPayload=true&format=" + format);
// testGetSObject
- from("direct:getSObject")
- .to("salesforce:getSObject?sObjectName=Merchandise__c&sObjectFields=Description__c,Price__c&rawPayload=true&format="
- + format);
+ from("direct:getSObject").to("salesforce:getSObject?sObjectName=Merchandise__c&sObjectFields=Description__c,Price__c&rawPayload=true&format=" + format);
// testCreateSObject
from("direct:createSObject").to("salesforce:createSObject?sObjectName=Merchandise__c&rawPayload=true&format=" + format);
@@ -186,56 +178,45 @@ public class RawPayloadTest extends AbstractSalesforceTestBase {
from("direct:deleteSObject").to("salesforce:deleteSObject?sObjectName=Merchandise__c&rawPayload=true&format=" + format);
// testGetSObjectWithId
- from("direct:getSObjectWithId")
- .to("salesforce:getSObjectWithId?sObjectName=Line_Item__c&sObjectIdName=Name&rawPayload=true&format=" + format);
+ from("direct:getSObjectWithId").to("salesforce:getSObjectWithId?sObjectName=Line_Item__c&sObjectIdName=Name&rawPayload=true&format=" + format);
// testUpsertSObject
- from("direct:upsertSObject")
- .to("salesforce:upsertSObject?sObjectName=Line_Item__c&sObjectIdName=Name&rawPayload=true&format=" + format);
+ from("direct:upsertSObject").to("salesforce:upsertSObject?sObjectName=Line_Item__c&sObjectIdName=Name&rawPayload=true&format=" + format);
// testDeleteSObjectWithId
- from("direct:deleteSObjectWithId")
- .to("salesforce:deleteSObjectWithId?sObjectName=Line_Item__c&sObjectIdName=Name&rawPayload=true&format=" + format);
+ from("direct:deleteSObjectWithId").to("salesforce:deleteSObjectWithId?sObjectName=Line_Item__c&sObjectIdName=Name&rawPayload=true&format=" + format);
// testGetBlobField
- from("direct:getBlobField")
- .to("salesforce:getBlobField?sObjectName=Document&sObjectBlobFieldName=Body&rawPayload=true&format=" + format);
+ from("direct:getBlobField").to("salesforce:getBlobField?sObjectName=Document&sObjectBlobFieldName=Body&rawPayload=true&format=" + format);
// testQuery
from("direct:query").to("salesforce:query?sObjectQuery=SELECT name from Line_Item__c&rawPayload=true&format=" + format);
// testQueryAll
- from("direct:queryAll")
- .to("salesforce:queryAll?sObjectQuery=SELECT name from Line_Item__c&rawPayload=true&format=" + format);
+ from("direct:queryAll").to("salesforce:queryAll?sObjectQuery=SELECT name from Line_Item__c&rawPayload=true&format=" + format);
// testSearch
from("direct:search").to("salesforce:search?sObjectSearch=FIND {Wee}&rawPayload=true&format=" + format);
// testApexCall
- from("direct:apexCallGet")
- .to("salesforce:apexCall?apexMethod=GET&apexUrl=Merchandise/{id}&sObjectName=Merchandise__c&rawPayload=true&format="
- + format);
+ from("direct:apexCallGet").to("salesforce:apexCall?apexMethod=GET&apexUrl=Merchandise/{id}&sObjectName=Merchandise__c&rawPayload=true&format=" + format);
- from("direct:apexCallGetWithId").to("salesforce:apexCall/Merchandise/?apexMethod=GET&id=dummyId&rawPayload=true&format="
- + format);
+ from("direct:apexCallGetWithId").to("salesforce:apexCall/Merchandise/?apexMethod=GET&id=dummyId&rawPayload=true&format=" + format);
- from("direct:apexCallPatch").to("salesforce:apexCall/Merchandise/?rawPayload=true&format=" + format
- + "&apexMethod=PATCH");
+ from("direct:apexCallPatch").to("salesforce:apexCall/Merchandise/?rawPayload=true&format=" + format + "&apexMethod=PATCH");
}
};
}
@Parameters(name = "format = {0}, endpoint = {1}")
public static List<String[]> parameters() {
- final String[] endpoints = {"direct:getVersions", "direct:getResources", "direct:getGlobalObjects",
- "direct:getBasicInfo", "direct:getDescription", "direct:getSObject", "direct:createSObject",
- "direct:updateSObject", "direct:deleteSObject", "direct:getSObjectWithId", "direct:upsertSObject",
- "direct:deleteSObjectWithId", "direct:getBlobField", "direct:query", "direct:queryAll",
- "direct:search", "direct:apexCallGet", "direct:apexCallGetWithId", "direct:apexCallPatch"};
+ final String[] endpoints = {"direct:getVersions", "direct:getResources", "direct:getGlobalObjects", "direct:getBasicInfo", "direct:getDescription", "direct:getSObject",
+ "direct:createSObject", "direct:updateSObject", "direct:deleteSObject", "direct:getSObjectWithId", "direct:upsertSObject",
+ "direct:deleteSObjectWithId", "direct:getBlobField", "direct:query", "direct:queryAll", "direct:search", "direct:apexCallGet",
+ "direct:apexCallGetWithId", "direct:apexCallPatch"};
final String[] formats = {"XML", "JSON"};
- return Stream.of(formats).flatMap(f -> Stream.of(endpoints).map(e -> new String[]{f, e}))
- .collect(Collectors.toList());
+ return Stream.of(formats).flatMap(f -> Stream.of(endpoints).map(e -> new String[] {f, e})).collect(Collectors.toList());
}
}
diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RecentIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RecentIntegrationTest.java
index d2f28fd..f51cadf 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RecentIntegrationTest.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/RecentIntegrationTest.java
@@ -57,8 +57,7 @@ public class RecentIntegrationTest extends AbstractSalesforceTestBase {
@Before
public void setupTenRecentItems() {
- final List<Account> accounts = IntStream.range(0, 10).mapToObj(RecentIntegrationTest::account)
- .collect(Collectors.toList());
+ final List<Account> accounts = IntStream.range(0, 10).mapToObj(RecentIntegrationTest::account).collect(Collectors.toList());
template.sendBody("direct:create-recent", accounts);
}
@@ -74,8 +73,7 @@ public class RecentIntegrationTest extends AbstractSalesforceTestBase {
@Test
public void shouldFetchRecentItemsLimitingByHeaderParam() {
@SuppressWarnings("unchecked")
- final List<RecentItem> items = template.requestBody("direct:test-recent-with-header-limit-param", NOT_USED,
- List.class);
+ final List<RecentItem> items = template.requestBody("direct:test-recent-with-header-limit-param", NOT_USED, List.class);
assertRecentItemsSize(items, 5);
}
@@ -83,8 +81,7 @@ public class RecentIntegrationTest extends AbstractSalesforceTestBase {
@Test
public void shouldFetchRecentItemsLimitingByParamInBody() {
@SuppressWarnings("unchecked")
- final List<RecentItem> items = template.requestBody("direct:test-recent-with-body-limit-param", NOT_USED,
- List.class);
+ final List<RecentItem> items = template.requestBody("direct:test-recent-with-body-limit-param", NOT_USED, List.class);
assertRecentItemsSize(items, 5);
}
@@ -92,8 +89,7 @@ public class RecentIntegrationTest extends AbstractSalesforceTestBase {
@Test
public void shouldFetchRecentItemsLimitingByUriParam() {
@SuppressWarnings("unchecked")
- final List<RecentItem> items = template.requestBody("direct:test-recent-with-limit-uri-param", NOT_USED,
- List.class);
+ final List<RecentItem> items = template.requestBody("direct:test-recent-with-limit-uri-param", NOT_USED, List.class);
assertRecentItemsSize(items, 5);
}
@@ -104,21 +100,17 @@ public class RecentIntegrationTest extends AbstractSalesforceTestBase {
@Override
public void configure() throws Exception {
from("direct:create-recent").split().body().to("salesforce:createSObject?sObjectName=Account").end()
- .to("salesforce:query?sObjectClass=" + Accounts.class.getName()
- + "&sObjectQuery=SELECT Id FROM Account WHERE Name LIKE 'recent-%' FOR VIEW");
+ .to("salesforce:query?sObjectClass=" + Accounts.class.getName() + "&sObjectQuery=SELECT Id FROM Account WHERE Name LIKE 'recent-%' FOR VIEW");
... 3778 lines suppressed ...