camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhira...@apache.org
Subject [4/4] camel git commit: CAMEL-9925: Fixed CS errors
Date Fri, 29 Apr 2016 05:51:27 GMT
CAMEL-9925: Fixed CS errors


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b69ab33a
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b69ab33a
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b69ab33a

Branch: refs/heads/camel-2.17.x
Commit: b69ab33a7c9dded49b97a0bd0e295110a66c6697
Parents: 8dfd66b
Author: Dhiraj Bokde <dhirajsb@yahoo.com>
Authored: Thu Apr 28 22:49:01 2016 -0700
Committer: Dhiraj Bokde <dhirajsb@yahoo.com>
Committed: Thu Apr 28 22:49:29 2016 -0700

----------------------------------------------------------------------
 .../client/DefaultAnalyticsApiClient.java       | 48 ++++++++++----------
 .../internal/client/DefaultRestClient.java      |  2 +-
 .../client/SalesforceSecurityHandler.java       |  9 ++--
 .../processor/AbstractSalesforceProcessor.java  |  2 +-
 .../internal/streaming/SubscriptionHelper.java  |  5 +-
 .../apache/camel/maven/CamelSalesforceMojo.java |  8 ++--
 6 files changed, 38 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b69ab33a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultAnalyticsApiClient.java
----------------------------------------------------------------------
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 f6e72dc..29c7c70 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
@@ -61,16 +61,16 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements
Ana
     @Override
     public void getRecentReports(final RecentReportsResponseCallback callback) {
 
-        final Request Request = getRequest(HttpMethod.GET, reportsUrl());
+        final Request request = getRequest(HttpMethod.GET, reportsUrl());
 
-        doHttpRequest(Request, new ClientResponseCallback() {
+        doHttpRequest(request, new ClientResponseCallback() {
             @Override
             @SuppressWarnings("unchecked")
             public void onResponse(InputStream response, SalesforceException ex) {
                 List<RecentReport> recentReports = null;
                 if (response != null) {
                     try {
-                        recentReports = unmarshalResponse(response, Request,
+                        recentReports = unmarshalResponse(response, request,
                             new TypeReference<List<RecentReport>>() {
                             }
                         );
@@ -86,14 +86,14 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements
Ana
     @Override
     public void getReportDescription(String reportId, final ReportDescriptionResponseCallback
callback) {
 
-        final Request Request = getRequest(HttpMethod.GET, reportsDescribeUrl(reportId));
+        final Request request = getRequest(HttpMethod.GET, reportsDescribeUrl(reportId));
 
-        doHttpRequest(Request, new ClientResponseCallback() {
+        doHttpRequest(request, new ClientResponseCallback() {
             @Override
             public void onResponse(InputStream response, SalesforceException ex) {
                 ReportDescription reportDescription = null;
                 try {
-                    reportDescription = unmarshalResponse(response, Request, ReportDescription.class);
+                    reportDescription = unmarshalResponse(response, request, ReportDescription.class);
                 } catch (SalesforceException e) {
                     ex = e;
                 }
@@ -107,28 +107,28 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements
Ana
                                   final ReportResultsResponseCallback callback) {
 
         final boolean useGet = reportMetadata == null;
-        final Request Request = getRequest(
+        final Request request = getRequest(
             useGet ? HttpMethod.GET : HttpMethod.POST, reportsUrl(reportId, includeDetails));
 
         // set POST data
         if (!useGet) {
             try {
                 // wrap reportMetadata in a map
-                final HashMap<String, Object> request = new HashMap<String, Object>();
-                request.put("reportMetadata", reportMetadata);
-                marshalRequest(request, Request);
+                final HashMap<String, Object> input = new HashMap<String, Object>();
+                input.put("reportMetadata", reportMetadata);
+                marshalRequest(input, request);
             } catch (SalesforceException e) {
                 callback.onResponse(null, e);
                 return;
             }
         }
 
-        doHttpRequest(Request, new ClientResponseCallback() {
+        doHttpRequest(request, new ClientResponseCallback() {
             @Override
             public void onResponse(InputStream response, SalesforceException ex) {
                 SyncReportResults reportResults = null;
                 try {
-                    reportResults = unmarshalResponse(response, Request, SyncReportResults.class);
+                    reportResults = unmarshalResponse(response, request, SyncReportResults.class);
                 } catch (SalesforceException e) {
                     ex = e;
                 }
@@ -141,28 +141,28 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements
Ana
     public void executeAsyncReport(String reportId, Boolean includeDetails, ReportMetadata
reportMetadata,
                                    final ReportInstanceResponseCallback callback) {
 
-        final Request Request = getRequest(HttpMethod.POST,
+        final Request request = getRequest(HttpMethod.POST,
             reportInstancesUrl(reportId, includeDetails));
 
         // set POST data
         if (reportMetadata != null) {
             try {
                 // wrap reportMetadata in a map
-                final HashMap<String, Object> request = new HashMap<String, Object>();
-                request.put("reportMetadata", reportMetadata);
-                marshalRequest(request, Request);
+                final HashMap<String, Object> input = new HashMap<String, Object>();
+                input.put("reportMetadata", reportMetadata);
+                marshalRequest(input, request);
             } catch (SalesforceException e) {
                 callback.onResponse(null, e);
                 return;
             }
         }
 
-        doHttpRequest(Request, new ClientResponseCallback() {
+        doHttpRequest(request, new ClientResponseCallback() {
             @Override
             public void onResponse(InputStream response, SalesforceException ex) {
                 ReportInstance reportInstance = null;
                 try {
-                    reportInstance = unmarshalResponse(response, Request, ReportInstance.class);
+                    reportInstance = unmarshalResponse(response, request, ReportInstance.class);
                 } catch (SalesforceException e) {
                     ex = e;
                 }
@@ -174,16 +174,16 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements
Ana
     @Override
     public void getReportInstances(String reportId, final ReportInstanceListResponseCallback
callback) {
 
-        final Request Request = getRequest(HttpMethod.GET, reportInstancesUrl(reportId));
+        final Request request = getRequest(HttpMethod.GET, reportInstancesUrl(reportId));
 
-        doHttpRequest(Request, new ClientResponseCallback() {
+        doHttpRequest(request, new ClientResponseCallback() {
             @Override
             @SuppressWarnings("unchecked")
             public void onResponse(InputStream response, SalesforceException ex) {
                 List<ReportInstance> reportInstances = null;
                 if (response != null) {
                     try {
-                        reportInstances = unmarshalResponse(response, Request,
+                        reportInstances = unmarshalResponse(response, request,
                             new TypeReference<List<ReportInstance>>() {
                             }
                         );
@@ -199,15 +199,15 @@ public class DefaultAnalyticsApiClient extends AbstractClientBase implements
Ana
     @Override
     public void getReportResults(String reportId, String instanceId, final ReportResultsResponseCallback
callback) {
 
-        final Request Request = getRequest(HttpMethod.GET,
+        final Request request = getRequest(HttpMethod.GET,
             reportInstancesUrl(reportId, instanceId));
 
-        doHttpRequest(Request, new ClientResponseCallback() {
+        doHttpRequest(request, new ClientResponseCallback() {
             @Override
             public void onResponse(InputStream response, SalesforceException ex) {
                 AsyncReportResults reportResults = null;
                 try {
-                    reportResults = unmarshalResponse(response, Request, AsyncReportResults.class);
+                    reportResults = unmarshalResponse(response, request, AsyncReportResults.class);
                 } catch (SalesforceException e) {
                     ex = e;
                 }

http://git-wip-us.apache.org/repos/asf/camel/blob/b69ab33a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/DefaultRestClient.java
----------------------------------------------------------------------
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 9eb6e0c..562719c 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
@@ -98,7 +98,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient
                 // return list of choices as error message for 300
                 if (statusCode == HttpStatus.MULTIPLE_CHOICES_300) {
                     if (PayloadFormat.JSON.equals(format)) {
-                        choices = objectMapper.readValue(responseContent, new TypeReference<List<String>>()
{});
+                        choices = objectMapper.readValue(responseContent, new TypeReference<List<String>>()
{ });
                     } else {
                         RestChoices restChoices = new RestChoices();
                         xStream.fromXML(responseContent, restChoices);

http://git-wip-us.apache.org/repos/asf/camel/blob/b69ab33a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/client/SalesforceSecurityHandler.java
----------------------------------------------------------------------
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 6a02b92..8df28de 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
@@ -37,11 +37,12 @@ import org.slf4j.LoggerFactory;
 
 public class SalesforceSecurityHandler implements ProtocolHandler {
 
+    static final String CLIENT_ATTRIBUTE = SalesforceSecurityHandler.class.getName().concat("camel-salesforce-client");
+    static final String AUTHENTICATION_REQUEST_ATTRIBUTE = SalesforceSecurityHandler.class.getName().concat(".request");
+
     private static final Logger LOG = LoggerFactory.getLogger(SalesforceSecurityHandler.class);
 
     private static final String AUTHENTICATION_RETRIES_ATTRIBUTE = SalesforceSecurityHandler.class.getName().concat(".retries");
-    static final String CLIENT_ATTRIBUTE = SalesforceSecurityHandler.class.getName().concat("camel-salesforce-client");
-    static final String AUTHENTICATION_REQUEST_ATTRIBUTE = SalesforceSecurityHandler.class.getName().concat(".request");
 
     private final SalesforceHttpClient httpClient;
     private final SalesforceSession session;
@@ -161,8 +162,8 @@ public class SalesforceSecurityHandler implements ProtocolHandler {
                 // HTTP failure status
                 // 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)) {
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b69ab33a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractSalesforceProcessor.java
----------------------------------------------------------------------
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 76095ba..3d25e90 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
@@ -24,10 +24,10 @@ import org.apache.camel.Message;
 import org.apache.camel.NoTypeConversionAvailableException;
 import org.apache.camel.component.salesforce.SalesforceComponent;
 import org.apache.camel.component.salesforce.SalesforceEndpoint;
+import org.apache.camel.component.salesforce.SalesforceHttpClient;
 import org.apache.camel.component.salesforce.api.SalesforceException;
 import org.apache.camel.component.salesforce.internal.OperationName;
 import org.apache.camel.component.salesforce.internal.SalesforceSession;
-import org.apache.camel.component.salesforce.SalesforceHttpClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 

http://git-wip-us.apache.org/repos/asf/camel/blob/b69ab33a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java
----------------------------------------------------------------------
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 228177c..1cc4a21 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
@@ -21,6 +21,9 @@ import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.CountDownLatch;
 
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+import static java.util.concurrent.TimeUnit.SECONDS;
+
 import org.apache.camel.CamelException;
 import org.apache.camel.component.salesforce.SalesforceComponent;
 import org.apache.camel.component.salesforce.SalesforceConsumer;
@@ -37,8 +40,6 @@ import org.eclipse.jetty.http.HttpHeader;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
-import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.cometd.bayeux.Channel.META_CONNECT;
 import static org.cometd.bayeux.Channel.META_HANDSHAKE;
 import static org.cometd.bayeux.Channel.META_SUBSCRIBE;

http://git-wip-us.apache.org/repos/asf/camel/blob/b69ab33a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
index 995a810..f2bbde9 100644
--- a/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
+++ b/components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java
@@ -124,25 +124,25 @@ public class CamelSalesforceMojo extends AbstractMojo {
      * Is it a SOCKS4 Proxy?
      */
     @Parameter(property = "camelSalesforce.isHttpProxySocks4")
-    private boolean isHttpProxySocks4;
+    protected boolean isHttpProxySocks4;
 
     /**
      * Is HTTP Proxy secure, i.e. using secure sockets, true by default.
      */
     @Parameter(property = "camelSalesforce.isHttpProxySecure")
-    private boolean isHttpProxySecure = true;
+    protected boolean isHttpProxySecure = true;
 
     /**
      * Addresses to Proxy.
      */
     @Parameter(property = "camelSalesforce.httpProxyIncludedAddresses")
-    private Set<String> httpProxyIncludedAddresses;
+    protected Set<String> httpProxyIncludedAddresses;
 
     /**
      * Addresses to NOT Proxy.
      */
     @Parameter(property = "camelSalesforce.httpProxyIncludedAddresses")
-    private Set<String> httpProxyExcludedAddresses;
+    protected Set<String> httpProxyExcludedAddresses;
 
     /**
      * Proxy authentication username.


Mime
View raw message