[camel-k] branch release-1.2.x updated: Fix ENTESB-15219: only use default values when user doesn't provide a kamelet property value in integration
This is an automated email from the ASF dual-hosted git repository. dhirajsb pushed a commit to branch release-1.2.x in repository https://gitbox.apache.org/repos/asf/camel-k.git The following commit(s) were added to refs/heads/release-1.2.x by this push: new fe448c9 Fix ENTESB-15219: only use default values when user doesn't provide a kamelet property value in integration new c5d3b64 Merge pull request #1797 from dhirajsb/ENTESB-15219-1.2.x fe448c9 is described below commit fe448c93403b87910e4ee271067d879b7f11b0b2 Author: Dhiraj Bokde AuthorDate: Thu Oct 29 19:22:32 2020 -0700 Fix ENTESB-15219: only use default values when user doesn't provide a kamelet property value in integration --- pkg/trait/kamelets.go | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pkg/trait/kamelets.go b/pkg/trait/kamelets.go index 95f875f..c5de266 100644 --- a/pkg/trait/kamelets.go +++ b/pkg/trait/kamelets.go @@ -169,7 +169,19 @@ func (t *kameletsTrait) configureApplicationProperties(e *Environment) error { // Configuring defaults from Kamelet for _, prop := range kamelet.Status.Properties { if prop.Default != "" { - e.ApplicationProperties[fmt.Sprintf("camel.kamelet.%s.%s", kamelet.Name, prop.Name)] = prop.Default + // Check whether user specified a value + userDefined := false + propName := fmt.Sprintf("camel.kamelet.%s.%s", kamelet.Name, prop.Name) + propPrefix := propName + "=" + for _, userProp := range e.Integration.Spec.Configuration { + if strings.HasPrefix(userProp.Value, propPrefix) { + userDefined = true + break + } + } + if !userDefined { + e.ApplicationProperties[propName] = prop.Default + } } } }
[2/2] camel git commit: CAMEL-10238: Restore Cookies and HOST headers in securityhandler for subscriptions
CAMEL-10238: Restore Cookies and HOST headers in securityhandler for subscriptions Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/54c78e5c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/54c78e5c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/54c78e5c Branch: refs/heads/master Commit: 54c78e5c516b0dd81648c76049b13ed476e89f7c Parents: c5b6f9b Author: Dhiraj Bokde Authored: Thu Aug 25 00:28:58 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 25 01:20:42 2016 -0700 -- .../client/SalesforceSecurityHandler.java | 36 ++-- 1 file changed, 25 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/54c78e5c/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 679cb1c..fc11fe9 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 @@ -30,6 +30,8 @@ import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.client.util.BufferingResponseListener; +import org.eclipse.jetty.http.HttpField; +import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpStatus; import org.slf4j.Logger; @@ -208,24 +210,36 @@ public class SalesforceSecurityHandler implements ProtocolHandler { 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 +for (HttpField field : request.getHeaders()) { +HttpHeader header = field.getHeader(); +if (HttpHeader.COOKIE.equals(header) || HttpHeader.HOST.equals(header)) { +headers.add(header, field.getValue()); +} +} } else { newRequest = request; } conversation.setAttribute(AUTHENTICATION_RETRIES_ATTRIBUTE, ++retries); -LOG.debug("Retry attempt {} on authentication error for {}", retries, request); +Object originalRequest = conversation.getAttribute(AUTHENTICATION_REQUEST_ATTRIBUTE); +LOG.debug("Retry attempt {} on authentication error for {}", retries, originalRequest != null ? originalRequest : newRequest); -// update currentToken -String currentToken = session.getAccessToken(); -if (client != null) { -// update client cache for this and future requests -client.setAccessToken(currentToken); -client.setInstanceUrl(session.getInstanceUrl()); -client.setAccessToken(newRequest); -} else { -// plain request not made by an AbstractClientBase -newRequest.header(HttpHeader.AUTHORIZATION, "OAuth " + currentToken); +// update currentToken for original request +if (originalRequest == null) { + +String currentToken = session.getAccessToken(); +if (client != null) { +// update client cache for this and future requests +client.setAccessToken(currentToken); +client.setInstanceUrl(session.getInstanceUrl()); +client.setAccessToken(newRequest); +} else { +// plain request not made by an AbstractClientBase +newRequest.header(HttpHeader.AUTHORIZATION, "OAuth " + currentToken); +} } // send new async request with a new delegate
[1/2] camel git commit: CAMEL-10238: Updated subscription helper to listen for hard disconnects, and reconnect from scratch, also updated error handling throwing SalesforceException from consumer endp
Repository: camel Updated Branches: refs/heads/master c5b6f9bed -> 3ac630272 CAMEL-10238: Updated subscription helper to listen for hard disconnects, and reconnect from scratch, also updated error handling throwing SalesforceException from consumer endpoints Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3ac63027 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3ac63027 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3ac63027 Branch: refs/heads/master Commit: 3ac630272a622cc6c7df95af3dbb2611031c9b93 Parents: 54c78e5 Author: Dhiraj Bokde Authored: Thu Aug 25 01:20:07 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 25 01:20:42 2016 -0700 -- .../salesforce/SalesforceConsumer.java | 10 +- .../internal/streaming/SubscriptionHelper.java | 237 +-- 2 files changed, 172 insertions(+), 75 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3ac63027/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java -- 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 83772e6..df29dd8 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 @@ -26,7 +26,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.camel.AsyncCallback; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.apache.camel.RuntimeCamelException; +import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.api.utils.JsonUtils; import org.apache.camel.component.salesforce.internal.client.DefaultRestClient; import org.apache.camel.component.salesforce.internal.client.RestClient; @@ -185,7 +185,7 @@ public class SalesforceConsumer extends DefaultConsumer { } catch (IOException e) { final String msg = String.format("Error parsing message [%s] from Topic %s: %s", message, topicName, e.getMessage()); -handleException(msg, new RuntimeCamelException(msg, e)); +handleException(msg, new SalesforceException(msg, e)); } try { @@ -199,11 +199,13 @@ public class SalesforceConsumer extends DefaultConsumer { } }); } catch (Exception e) { -handleException(String.format("Error processing %s: %s", exchange, e.getMessage()), e); +String msg = String.format("Error processing %s: %s", exchange, e); +handleException(msg, new SalesforceException(msg, e)); } finally { Exception ex = exchange.getException(); if (ex != null) { -handleException(String.format("Unhandled exception: %s", ex.getMessage()), ex); +String msg = String.format("Unhandled exception: %s", ex.getMessage()); +handleException(msg, new SalesforceException(msg, ex)); } } } http://git-wip-us.apache.org/repos/asf/camel/blob/3ac63027/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 a501187..c9a98ee 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 @@ -30,6 +30,7 @@ import org.apache.camel.CamelException; import org.apache.camel.component.salesforce.SalesforceComponent; import org.apache.camel.component.salesforce.SalesforceConsumer; import org.apache.camel.component.salesforce.SalesforceHttpClient; +import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.i
[2/2] camel git commit: CAMEL-10238: Updated subscription helper to listen for hard disconnects, and reconnect from scratch, also updated error handling throwing SalesforceException from consumer endp
CAMEL-10238: Updated subscription helper to listen for hard disconnects, and reconnect from scratch, also updated error handling throwing SalesforceException from consumer endpoints Conflicts: components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/36f85788 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/36f85788 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/36f85788 Branch: refs/heads/camel-2.17.x Commit: 36f857888bbfc07bdcc2908d3bcbd5df01aaa03f Parents: 59b67d2 Author: Dhiraj Bokde Authored: Thu Aug 25 01:20:07 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 25 08:56:42 2016 -0700 -- .../salesforce/SalesforceConsumer.java | 9 +- .../internal/streaming/SubscriptionHelper.java | 237 +-- 2 files changed, 172 insertions(+), 74 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/36f85788/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java -- 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 e6434a5..e5c3075 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 @@ -26,6 +26,7 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.salesforce.internal.PayloadFormat; +import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.internal.client.DefaultRestClient; import org.apache.camel.component.salesforce.internal.client.RestClient; import org.apache.camel.component.salesforce.internal.streaming.PushTopicHelper; @@ -172,7 +173,7 @@ public class SalesforceConsumer extends DefaultConsumer { } catch (IOException e) { final String msg = String.format("Error parsing message [%s] from Topic %s: %s", message, topicName, e.getMessage()); -handleException(msg, new RuntimeCamelException(msg, e)); +handleException(msg, new SalesforceException(msg, e)); } try { @@ -186,11 +187,13 @@ public class SalesforceConsumer extends DefaultConsumer { } }); } catch (Exception e) { -handleException(String.format("Error processing %s: %s", exchange, e.getMessage()), e); +String msg = String.format("Error processing %s: %s", exchange, e); +handleException(msg, new SalesforceException(msg, e)); } finally { Exception ex = exchange.getException(); if (ex != null) { -handleException(String.format("Unhandled exception: %s", ex.getMessage()), ex); +String msg = String.format("Unhandled exception: %s", ex.getMessage()); +handleException(msg, new SalesforceException(msg, ex)); } } } http://git-wip-us.apache.org/repos/asf/camel/blob/36f85788/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 1cc4a21..1e3e8a4 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 @@ -28,6 +28,7 @@ import org.apache.camel.CamelException; import org.apache.camel.component.salesforce.SalesforceComponent; import org.apache.camel.component.salesforce.SalesforceConsumer; import org.apache.camel.component.salesforce.SalesforceHttpClient; +import org.apache.camel.component.salesforce.ap
[1/2] camel git commit: CAMEL-10238: Restore Cookies and HOST headers in securityhandler for subscriptions
Repository: camel Updated Branches: refs/heads/camel-2.17.x ac501457d -> 36f857888 CAMEL-10238: Restore Cookies and HOST headers in securityhandler for subscriptions Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/59b67d2d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/59b67d2d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/59b67d2d Branch: refs/heads/camel-2.17.x Commit: 59b67d2d3b56da9fde7e283255b524bad57c3e99 Parents: ac50145 Author: Dhiraj Bokde Authored: Thu Aug 25 00:28:58 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 25 08:47:46 2016 -0700 -- .../client/SalesforceSecurityHandler.java | 36 ++-- 1 file changed, 25 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/59b67d2d/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 8df28de..11c8cbe 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 @@ -30,6 +30,8 @@ import org.eclipse.jetty.client.api.Request; import org.eclipse.jetty.client.api.Response; import org.eclipse.jetty.client.api.Result; import org.eclipse.jetty.client.util.BufferingResponseListener; +import org.eclipse.jetty.http.HttpField; +import org.eclipse.jetty.http.HttpFields; import org.eclipse.jetty.http.HttpHeader; import org.eclipse.jetty.http.HttpStatus; import org.slf4j.Logger; @@ -208,24 +210,36 @@ public class SalesforceSecurityHandler implements ProtocolHandler { 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 +for (HttpField field : request.getHeaders()) { +HttpHeader header = field.getHeader(); +if (HttpHeader.COOKIE.equals(header) || HttpHeader.HOST.equals(header)) { +headers.add(header, field.getValue()); +} +} } else { newRequest = request; } conversation.setAttribute(AUTHENTICATION_RETRIES_ATTRIBUTE, ++retries); -LOG.debug("Retry attempt {} on authentication error for {}", retries, request); +Object originalRequest = conversation.getAttribute(AUTHENTICATION_REQUEST_ATTRIBUTE); +LOG.debug("Retry attempt {} on authentication error for {}", retries, originalRequest != null ? originalRequest : newRequest); -// update currentToken -String currentToken = session.getAccessToken(); -if (client != null) { -// update client cache for this and future requests -client.setAccessToken(currentToken); -client.setInstanceUrl(session.getInstanceUrl()); -client.setAccessToken(newRequest); -} else { -// plain request not made by an AbstractClientBase -newRequest.header(HttpHeader.AUTHORIZATION, "OAuth " + currentToken); +// update currentToken for original request +if (originalRequest == null) { + +String currentToken = session.getAccessToken(); +if (client != null) { +// update client cache for this and future requests +client.setAccessToken(currentToken); +client.setInstanceUrl(session.getInstanceUrl()); +client.setAccessToken(newRequest); +} else { +// plain request not made by an AbstractClientBase +newRequest.header(HttpHeader.AUTHORIZATION, "OAuth " + currentToken); +} } // send new async request with a new delegate
camel git commit: CS fixes
Repository: camel Updated Branches: refs/heads/camel-2.17.x 36f857888 -> 440538b30 CS fixes Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/440538b3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/440538b3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/440538b3 Branch: refs/heads/camel-2.17.x Commit: 440538b306b0ebd4b7e57e4c6cddf3b75231100b Parents: 36f8578 Author: Dhiraj Bokde Authored: Thu Aug 25 12:28:12 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 25 12:28:12 2016 -0700 -- .../org/apache/camel/component/salesforce/SalesforceConsumer.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/440538b3/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java -- 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 e5c3075..a98333c 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 @@ -24,8 +24,6 @@ import java.util.Map; import org.apache.camel.AsyncCallback; import org.apache.camel.Exchange; import org.apache.camel.Processor; -import org.apache.camel.RuntimeCamelException; -import org.apache.camel.component.salesforce.internal.PayloadFormat; import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.internal.client.DefaultRestClient; import org.apache.camel.component.salesforce.internal.client.RestClient;
[1/2] camel git commit: CAMEL-10238: Refactored to handle handshake failure, added increment and max backoff properties
Repository: camel Updated Branches: refs/heads/master c07557607 -> 0b15168cd CAMEL-10238: Refactored to handle handshake failure, added increment and max backoff properties Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7d97e5b5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7d97e5b5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7d97e5b5 Branch: refs/heads/master Commit: 7d97e5b5800969b74e805e66a94a6c5323bfeafc Parents: c075576 Author: Dhiraj Bokde Authored: Mon Aug 29 22:32:56 2016 -0700 Committer: Dhiraj Bokde Committed: Mon Aug 29 22:32:56 2016 -0700 -- .../salesforce/SalesforceComponent.java | 24 +++ .../salesforce/SalesforceEndpointConfig.java| 36 +++- .../internal/streaming/SubscriptionHelper.java | 165 +++ .../src/test/resources/log4j2.properties| 5 + 4 files changed, 158 insertions(+), 72 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7d97e5b5/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java -- 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 76f7012..7b7b81a 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 @@ -1060,4 +1060,28 @@ public class SalesforceComponent extends UriEndpointComponent implements Endpoin public void setInitialReplayIdMap(Map initialReplayIdMap) { getConfigOrCreate().setInitialReplayIdMap(initialReplayIdMap); } + +public long getBackoffIncrement() { +return getConfigOrCreate().getBackoffIncrement(); +} + +/** + * Backoff interval increment for Streaming connection restart attempts for failures beyond CometD auto-reconnect. + * @param backoffIncrement + */ +public void setBackoffIncrement(long backoffIncrement) { +getConfigOrCreate().setBackoffIncrement(backoffIncrement); +} + +public long getMaxBackoff() { +return getConfigOrCreate().getMaxBackoff(); +} + +/** + * Maximum backoff interval for Streaming connection restart attempts for failures beyond CometD auto-reconnect. + * @param maxBackoff + */ +public void setMaxBackoff(long maxBackoff) { +getConfigOrCreate().setMaxBackoff(maxBackoff); +} } http://git-wip-us.apache.org/repos/asf/camel/blob/7d97e5b5/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java -- 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 39d0d06..ad18aab 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 @@ -79,6 +79,10 @@ public class SalesforceEndpointConfig implements Cloneable { // 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 +public static final long DEFAULT_BACKOFF_INCREMENT = 1000L; +public static final long DEFAULT_MAX_BACKOFF = 3L; + // general properties @UriParam private String apiVersion = DEFAULT_VERSION; @@ -161,6 +165,14 @@ public class SalesforceEndpointConfig implements Cloneable { @UriParam private ObjectMapper objectMapper; +// Streaming connection restart attempt backoff interval increment +@UriParam +private long backoffIncrement = DEFAULT_BACKOFF_INCREMENT; + +// Streaming connection restart attempt maximum backoff interval +@UriParam +private long maxBackoff = DEFAULT_MAX_BACKOFF; + public SalesforceEndpointConfig copy() { try { final SalesforceEndpointConfig copy = (SalesforceEndpointConfig)
[2/2] camel git commit: CAMEL-10238: Updated component docs
CAMEL-10238: Updated component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0b15168c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0b15168c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0b15168c Branch: refs/heads/master Commit: 0b15168cd4747f7f1de8fb0f8e2230a1fe8ca4ea Parents: 7d97e5b Author: Dhiraj Bokde Authored: Mon Aug 29 22:33:26 2016 -0700 Committer: Dhiraj Bokde Committed: Mon Aug 29 22:33:26 2016 -0700 -- .../SalesforceComponentConfiguration.java | 26 .../src/main/docs/salesforce-component.adoc | 8 -- 2 files changed, 32 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0b15168c/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java -- diff --git a/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java b/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java index a971286..d27021a 100644 --- a/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java +++ b/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java @@ -269,6 +269,16 @@ public class SalesforceComponentConfiguration { * Replay IDs to start from per channel name. */ private Map initialReplayIdMap; +/** + * Backoff interval increment for Streaming connection restart attempts for + * failures beyond CometD auto-reconnect. + */ +private long backoffIncrement; +/** + * Maximum backoff interval for Streaming connection restart attempts for + * failures beyond CometD auto-reconnect. + */ +private long maxBackoff; public SalesforceLoginConfig getLoginConfig() { return loginConfig; @@ -713,4 +723,20 @@ public class SalesforceComponentConfiguration { public void setInitialReplayIdMap(Map initialReplayIdMap) { this.initialReplayIdMap = initialReplayIdMap; } + +public long getBackoffIncrement() { +return backoffIncrement; +} + +public void setBackoffIncrement(long backoffIncrement) { +this.backoffIncrement = backoffIncrement; +} + +public long getMaxBackoff() { +return maxBackoff; +} + +public void setMaxBackoff(long maxBackoff) { +this.maxBackoff = maxBackoff; +} } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/0b15168c/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc index 8f1a73d..1e2e892 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc +++ b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc @@ -205,7 +205,7 @@ Options // component options: START -The Salesforce component supports 55 options which are listed below. +The Salesforce component supports 57 options which are listed below. @@ -268,6 +268,8 @@ The Salesforce component supports 55 options which are listed below. | objectMapper | ObjectMapper | Custom Jackson ObjectMapper to use when serializing/deserializing Salesforce objects. | defaultReplayId | Integer | Default replayId setting if no value is found in link initialReplayIdMap | initialReplayIdMap | Map | Replay IDs to start from per channel name. +| backoffIncrement | long | Backoff interval increment for Streaming connection restart attempts for failures beyond CometD auto-reconnect. +| maxBackoff | long | Maximum backoff interval for Streaming connection restart attempts for failures beyond CometD auto-reconnect. |=== {% endraw %} // component options: END @@ -282,7 +284,7 @@ The Salesforce component supports 55 options which are listed below. // endpoint options: START -The Salesforce component supports 39 endpoint options which are listed below: +The Salesforce component supports 41 endpoint options which are listed below: {% raw %} [width="100%",cols="2,1,1m,1m,5",options="header"] @@ -294,6 +296,7 @@ Th
camel git commit: CAMEL-10238: Refactored to handle handshake failure, added increment and max backoff properties
Repository: camel Updated Branches: refs/heads/camel-2.17.x 1c07ce242 -> 3e5ef769e CAMEL-10238: Refactored to handle handshake failure, added increment and max backoff properties Conflicts: components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java components/camel-salesforce/camel-salesforce-component/src/test/resources/log4j2.properties Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3e5ef769 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3e5ef769 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3e5ef769 Branch: refs/heads/camel-2.17.x Commit: 3e5ef769e2d8d13338729566fdb128955b4f94bf Parents: 1c07ce2 Author: Dhiraj Bokde Authored: Mon Aug 29 22:32:56 2016 -0700 Committer: Dhiraj Bokde Committed: Mon Aug 29 22:45:22 2016 -0700 -- .../salesforce/SalesforceEndpointConfig.java| 36 +++- .../internal/streaming/SubscriptionHelper.java | 165 +++ 2 files changed, 129 insertions(+), 72 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3e5ef769/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java -- 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 2bb6306..92ca010 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 @@ -73,6 +73,10 @@ public class SalesforceEndpointConfig implements Cloneable { // 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 +public static final long DEFAULT_BACKOFF_INCREMENT = 1000L; +public static final long DEFAULT_MAX_BACKOFF = 3L; + // general properties @UriParam private String apiVersion = DEFAULT_VERSION; @@ -145,6 +149,14 @@ public class SalesforceEndpointConfig implements Cloneable { @UriParam private SalesforceHttpClient httpClient; +// Streaming connection restart attempt backoff interval increment +@UriParam +private long backoffIncrement = DEFAULT_BACKOFF_INCREMENT; + +// Streaming connection restart attempt maximum backoff interval +@UriParam +private long maxBackoff = DEFAULT_MAX_BACKOFF; + public SalesforceEndpointConfig copy() { try { final SalesforceEndpointConfig copy = (SalesforceEndpointConfig) super.clone(); @@ -485,6 +497,28 @@ public class SalesforceEndpointConfig implements Cloneable { return httpClient; } +public long getBackoffIncrement() { +return backoffIncrement; +} + +/** + * Backoff interval increment for Streaming connection restart attempts for failures beyond CometD auto-reconnect. + */ +public void setBackoffIncrement(long backoffIncrement) { +this.backoffIncrement = backoffIncrement; +} + +public long getMaxBackoff() { +return maxBackoff; +} + +/** + * Maximum backoff interval for Streaming connection restart attempts for failures beyond CometD auto-reconnect. + */ +public void setMaxBackoff(long maxBackoff) { +this.maxBackoff = maxBackoff; +} + public Map toValueMap() { final Map valueMap = new HashMap(); @@ -511,7 +545,7 @@ public class SalesforceEndpointConfig implements Cloneable { valueMap.put(JOB_ID, jobId); valueMap.put(BATCH_ID, batchId); valueMap.put(RESULT_ID, resultId); - + // add analytics API properties valueMap.put(REPORT_ID, reportId); valueMap.put(INCLUDE_DETAILS, includeDetails); http://git-wip-us.apache.org/repos/asf/camel/blob/3e5ef769/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/streaming/SubscriptionHelper.java --
[1/2] camel git commit: CAMEL-10238: Refresh oauth token on 401 in handshake error
Repository: camel Updated Branches: refs/heads/master 32ef19d89 -> 13cd60739 CAMEL-10238: Refresh oauth token on 401 in handshake error Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/13cd6073 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/13cd6073 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/13cd6073 Branch: refs/heads/master Commit: 13cd60739600d8a7522bd1b1cafcd26773449d64 Parents: 8e55d4c Author: Dhiraj Bokde Authored: Fri Sep 2 10:39:13 2016 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 2 10:39:49 2016 -0700 -- .../internal/streaming/SubscriptionHelper.java | 25 +++- 1 file changed, 14 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/13cd6073/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 ed4c152..411caa1 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 @@ -121,6 +121,20 @@ public class SubscriptionHelper extends ServiceSupport { handshakeError = (String) message.get(ERROR_FIELD); handshakeException = getFailure(message); + +if (handshakeError != null) { +// refresh oauth token, if it's a 401 error +if (handshakeError.startsWith("401::")) { +try { +LOG.info("Refreshing OAuth token..."); +session.login(session.getAccessToken()); +LOG.info("Refreshed OAuth token for re-handshake"); +} catch (SalesforceException e) { +LOG.error("Error renewing OAuth token on 401 error: " + e.getMessage(), e); +} +} +} + // restart if handshake fails for any reason restartClient(); @@ -144,17 +158,6 @@ public class SubscriptionHelper extends ServiceSupport { connectError = (String) message.get(ERROR_FIELD); connectException = getFailure(message); -if (connectError != null) { -// refresh oauth token, if it's a 403 error -if (connectError.startsWith("403::")) { -try { -session.login(null); -} catch (SalesforceException e) { -LOG.error("Error renewing OAuth token on Connect 403: " + e.getMessage(), e); -} -} -} - } else if (reconnecting) { reconnecting = false;
[2/2] camel git commit: Added javadoc for setter in endpoint
Added javadoc for setter in endpoint Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8e55d4cd Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8e55d4cd Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8e55d4cd Branch: refs/heads/master Commit: 8e55d4cd77f0bc8bf1a4537f5f12c4317f6d1530 Parents: 32ef19d Author: Dhiraj Bokde Authored: Fri Sep 2 10:23:09 2016 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 2 10:39:49 2016 -0700 -- .../org/apache/camel/component/file/GenericFileEndpoint.java | 4 1 file changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/8e55d4cd/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java index eaf12c8..d1efe7d 100644 --- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java @@ -477,6 +477,8 @@ public abstract class GenericFileEndpoint extends ScheduledPollEndpoint imple } /** + * Filters the directory based on Simple language. + * For example to filter on current date, you can use a simple date pattern such as ${date:now:yyyMMdd} * @see #setFilterDirectory(Predicate) */ public void setFilterDirectory(String expression) { @@ -496,6 +498,8 @@ public abstract class GenericFileEndpoint extends ScheduledPollEndpoint imple } /** + * Filters the file based on Simple language. + * For example to filter on file size, you can use ${file:size} > 5000 * @see #setFilterFile(Predicate) */ public void setFilterFile(String expression) {
camel git commit: CAMEL-10238: Refresh oauth token on 401 in handshake error
Repository: camel Updated Branches: refs/heads/camel-2.17.x 4f2aafed8 -> 1f7abfcb5 CAMEL-10238: Refresh oauth token on 401 in handshake error Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1f7abfcb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1f7abfcb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1f7abfcb Branch: refs/heads/camel-2.17.x Commit: 1f7abfcb586b68e19fea28331f69dd35e6f12145 Parents: 4f2aafe Author: Dhiraj Bokde Authored: Fri Sep 2 10:39:13 2016 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 2 10:43:51 2016 -0700 -- .../internal/streaming/SubscriptionHelper.java | 25 +++- 1 file changed, 14 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1f7abfcb/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 cbe84ab..9eb75ae 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 @@ -117,6 +117,20 @@ public class SubscriptionHelper extends ServiceSupport { handshakeError = (String) message.get(ERROR_FIELD); handshakeException = getFailure(message); + +if (handshakeError != null) { +// refresh oauth token, if it's a 401 error +if (handshakeError.startsWith("401::")) { +try { +LOG.info("Refreshing OAuth token..."); +session.login(session.getAccessToken()); +LOG.info("Refreshed OAuth token for re-handshake"); +} catch (SalesforceException e) { +LOG.error("Error renewing OAuth token on 401 error: " + e.getMessage(), e); +} +} +} + // restart if handshake fails for any reason restartClient(); @@ -140,17 +154,6 @@ public class SubscriptionHelper extends ServiceSupport { connectError = (String) message.get(ERROR_FIELD); connectException = getFailure(message); -if (connectError != null) { -// refresh oauth token, if it's a 403 error -if (connectError.startsWith("403::")) { -try { -session.login(null); -} catch (SalesforceException e) { -LOG.error("Error renewing OAuth token on Connect 403: " + e.getMessage(), e); -} -} -} - } else if (reconnecting) { reconnecting = false;
camel git commit: CAMEL-9039: Added karaf conditional to camel-core feature to check for shell feature before installing camel-commands-core and camel-karaf-commands
Repository: camel Updated Branches: refs/heads/master a683754b1 -> 899ecc1ea CAMEL-9039: Added karaf conditional to camel-core feature to check for shell feature before installing camel-commands-core and camel-karaf-commands Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/899ecc1e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/899ecc1e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/899ecc1e Branch: refs/heads/master Commit: 899ecc1ea9fa5a5eddbfad9179f4f199fadc9b1e Parents: a683754 Author: Dhiraj Bokde Authored: Fri Jul 31 12:08:40 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Jul 31 12:08:40 2015 -0700 -- platforms/karaf/features/src/main/resources/features.xml | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/899ecc1e/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 9d74e49..08d45e5 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -37,8 +37,11 @@ xml-specs-api mvn:org.apache.camel/camel-core/${project.version} mvn:org.apache.camel/camel-catalog/${project.version} - mvn:org.apache.camel/camel-commands-core/${project.version} - mvn:org.apache.camel.karaf/camel-karaf-commands/${project.version} + + shell + mvn:org.apache.camel/camel-commands-core/${project.version} + mvn:org.apache.camel.karaf/camel-karaf-commands/${project.version} + * = *
camel git commit: CAMEL-9039: Added karaf conditional to camel-core feature to check for shell feature before installing camel-commands-core and camel-karaf-commands
Repository: camel Updated Branches: refs/heads/camel-2.15.x 90715b566 -> ef76dba7f CAMEL-9039: Added karaf conditional to camel-core feature to check for shell feature before installing camel-commands-core and camel-karaf-commands Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ef76dba7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ef76dba7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ef76dba7 Branch: refs/heads/camel-2.15.x Commit: ef76dba7fa7c243fb269a8eb5fb8f44a3a9e4a3d Parents: 90715b5 Author: Dhiraj Bokde Authored: Fri Jul 31 12:08:40 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Jul 31 12:09:26 2015 -0700 -- platforms/karaf/features/src/main/resources/features.xml | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ef76dba7/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 22cf60b..30ba5d0 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -36,8 +36,11 @@ xml-specs-api mvn:org.apache.camel/camel-core/${project.version} mvn:org.apache.camel/camel-catalog/${project.version} - mvn:org.apache.camel/camel-commands-core/${project.version} - mvn:org.apache.camel.karaf/camel-karaf-commands/${project.version} + + shell + mvn:org.apache.camel/camel-commands-core/${project.version} + mvn:org.apache.camel.karaf/camel-karaf-commands/${project.version} + * = *
camel git commit: CAMEL-9039: Updated features namespace to version 1.2.0, which added support for conditionals
Repository: camel Updated Branches: refs/heads/master 899ecc1ea -> 7bb39d584 CAMEL-9039: Updated features namespace to version 1.2.0, which added support for conditionals Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7bb39d58 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7bb39d58 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7bb39d58 Branch: refs/heads/master Commit: 7bb39d584dd2411675a89780e0d800b2f7778bd0 Parents: 899ecc1 Author: Dhiraj Bokde Authored: Fri Jul 31 13:18:50 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Jul 31 13:18:50 2015 -0700 -- platforms/karaf/features/src/main/resources/features.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7bb39d58/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 08d45e5..1d18bdf 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -http://karaf.apache.org/xmlns/features/v1.0.0"; name='camel-${project.version}'> +http://karaf.apache.org/xmlns/features/v1.2.0"; name='camel-${project.version}'> mvn:org.apache.cxf.karaf/apache-cxf/${cxf-version}/xml/features mvn:org.apache.jclouds.karaf/jclouds-karaf/${jclouds-version}/xml/features mvn:org.ops4j.pax.cdi/pax-cdi-features/${pax-cdi-version}/xml/features
camel git commit: CAMEL-9039: Updated features namespace to version 1.2.0, which added support for conditionals
Repository: camel Updated Branches: refs/heads/camel-2.15.x ef76dba7f -> 0e259dfbb CAMEL-9039: Updated features namespace to version 1.2.0, which added support for conditionals Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0e259dfb Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0e259dfb Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0e259dfb Branch: refs/heads/camel-2.15.x Commit: 0e259dfbb0e61ebe4f2ffc6caaec1d35edef9073 Parents: ef76dba Author: Dhiraj Bokde Authored: Fri Jul 31 13:18:50 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Jul 31 13:19:45 2015 -0700 -- platforms/karaf/features/src/main/resources/features.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0e259dfb/platforms/karaf/features/src/main/resources/features.xml -- diff --git a/platforms/karaf/features/src/main/resources/features.xml b/platforms/karaf/features/src/main/resources/features.xml index 30ba5d0..502506b 100644 --- a/platforms/karaf/features/src/main/resources/features.xml +++ b/platforms/karaf/features/src/main/resources/features.xml @@ -15,7 +15,7 @@ See the License for the specific language governing permissions and limitations under the License. --> -http://karaf.apache.org/xmlns/features/v1.0.0"; name='camel-${project.version}'> +http://karaf.apache.org/xmlns/features/v1.2.0"; name='camel-${project.version}'> mvn:org.apache.cxf.karaf/apache-cxf/${cxf-version}/xml/features mvn:org.apache.jclouds.karaf/jclouds-karaf/${jclouds-version}/xml/features
camel git commit: CAMEL-8898: Added error handling for new LinkedIn OAuth behavior, also added w_share scope
Repository: camel Updated Branches: refs/heads/master 30c735106 -> df556c4a5 CAMEL-8898: Added error handling for new LinkedIn OAuth behavior, also added w_share scope Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/df556c4a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/df556c4a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/df556c4a Branch: refs/heads/master Commit: df556c4a58b9d04aad64a8ce761bbfef8b75da3a Parents: 30c7351 Author: Dhiraj Bokde Authored: Fri Sep 18 00:42:58 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 18 00:42:58 2015 -0700 -- .../api/LinkedInOAuthRequestFilter.java | 27 +++- .../component/linkedin/api/OAuthScope.java | 4 ++- 2 files changed, 24 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/df556c4a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index d625bc5..7c5def9 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -19,6 +19,7 @@ package org.apache.camel.component.linkedin.api; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.net.URLDecoder; import java.net.URLEncoder; import java.security.SecureRandom; import java.util.HashMap; @@ -131,8 +132,8 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { @SuppressWarnings("deprecation") private String getRefreshToken() { -// authorize application on user's behalf -webClient.getOptions().setRedirectEnabled(true); +// disable redirect to avoid loading error redirect URL +webClient.getOptions().setRedirectEnabled(false); try { final String csrfId = String.valueOf(new SecureRandom().nextLong()); @@ -157,7 +158,24 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { url = String.format(AUTHORIZATION_URL_WITH_SCOPE, oAuthParams.getClientId(), csrfId, builder.toString(), encodedRedirectUri); } -final HtmlPage authPage = webClient.getPage(url); +HtmlPage authPage; +try { +authPage = webClient.getPage(url); +} catch (FailingHttpStatusCodeException e) { +// only handle errors returned with redirects +if (e.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY) { +final URL location = new URL(e.getResponse().getResponseHeaderValue(HttpHeaders.LOCATION)); +final String locationQuery = location.getQuery(); +if (locationQuery != null && locationQuery.contains("error=")) { +throw new IOException(URLDecoder.decode(locationQuery).replaceAll("&", ", ")); +} else { +// follow the redirect to login form +authPage = webClient.getPage(location); +} +} else { +throw e; +} +} // look for final HtmlDivision div = authPage.getFirstByXPath("//div[@role='alert']"); @@ -173,9 +191,6 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { password.setText(oAuthParams.getUserPassword()); final HtmlSubmitInput submitInput = loginForm.getInputByName("authorize"); -// disable redirect to avoid loading redirect URL -webClient.getOptions().setRedirectEnabled(false); - // validate CSRF and get authorization code String redirectQuery; try { http://git-wip-us.apache.org/repos/asf/camel/blob/df556c4a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/OAuthScope.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/OAuthScope.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/OAuthScope.jav
camel git commit: CAMEL-8898: Added error handling for new LinkedIn OAuth behavior, also added w_share scope
Repository: camel Updated Branches: refs/heads/camel-2.15.x 483dafdbc -> efb28f1ce CAMEL-8898: Added error handling for new LinkedIn OAuth behavior, also added w_share scope Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/efb28f1c Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/efb28f1c Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/efb28f1c Branch: refs/heads/camel-2.15.x Commit: efb28f1cec0cc1265ed09c8ec0271cad4626d7b2 Parents: 483dafd Author: Dhiraj Bokde Authored: Fri Sep 18 00:42:58 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 18 00:44:07 2015 -0700 -- .../api/LinkedInOAuthRequestFilter.java | 27 +++- .../component/linkedin/api/OAuthScope.java | 4 ++- 2 files changed, 24 insertions(+), 7 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/efb28f1c/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index d625bc5..7c5def9 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -19,6 +19,7 @@ package org.apache.camel.component.linkedin.api; import java.io.IOException; import java.net.URI; import java.net.URL; +import java.net.URLDecoder; import java.net.URLEncoder; import java.security.SecureRandom; import java.util.HashMap; @@ -131,8 +132,8 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { @SuppressWarnings("deprecation") private String getRefreshToken() { -// authorize application on user's behalf -webClient.getOptions().setRedirectEnabled(true); +// disable redirect to avoid loading error redirect URL +webClient.getOptions().setRedirectEnabled(false); try { final String csrfId = String.valueOf(new SecureRandom().nextLong()); @@ -157,7 +158,24 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { url = String.format(AUTHORIZATION_URL_WITH_SCOPE, oAuthParams.getClientId(), csrfId, builder.toString(), encodedRedirectUri); } -final HtmlPage authPage = webClient.getPage(url); +HtmlPage authPage; +try { +authPage = webClient.getPage(url); +} catch (FailingHttpStatusCodeException e) { +// only handle errors returned with redirects +if (e.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY) { +final URL location = new URL(e.getResponse().getResponseHeaderValue(HttpHeaders.LOCATION)); +final String locationQuery = location.getQuery(); +if (locationQuery != null && locationQuery.contains("error=")) { +throw new IOException(URLDecoder.decode(locationQuery).replaceAll("&", ", ")); +} else { +// follow the redirect to login form +authPage = webClient.getPage(location); +} +} else { +throw e; +} +} // look for final HtmlDivision div = authPage.getFirstByXPath("//div[@role='alert']"); @@ -173,9 +191,6 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { password.setText(oAuthParams.getUserPassword()); final HtmlSubmitInput submitInput = loginForm.getInputByName("authorize"); -// disable redirect to avoid loading redirect URL -webClient.getOptions().setRedirectEnabled(false); - // validate CSRF and get authorization code String redirectQuery; try { http://git-wip-us.apache.org/repos/asf/camel/blob/efb28f1c/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/OAuthScope.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/OAuthScope.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/OA
camel git commit: CAMEL-8772: Added documentation for salesforce login config and endpoint options
Repository: camel Updated Branches: refs/heads/master df556c4a5 -> 3035cdc27 CAMEL-8772: Added documentation for salesforce login config and endpoint options Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/3035cdc2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3035cdc2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3035cdc2 Branch: refs/heads/master Commit: 3035cdc2726fa2bc32ad05c7e07c678505a7f59b Parents: df556c4 Author: Dhiraj Bokde Authored: Fri Sep 18 02:31:39 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 18 02:31:39 2015 -0700 -- .../salesforce/SalesforceEndpointConfig.java| 90 .../salesforce/SalesforceLoginConfig.java | 18 2 files changed, 108 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3035cdc2/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java -- 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 f8f7e9b..e25198e5c 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 @@ -157,6 +157,9 @@ public class SalesforceEndpointConfig implements Cloneable { return format; } +/** + * Payload format to use for Salesforce API calls, either JSON or XML, defaults to JSON + */ public void setFormat(PayloadFormat format) { this.format = format; } @@ -165,6 +168,9 @@ public class SalesforceEndpointConfig implements Cloneable { return apiVersion; } +/** + * Salesforce API version, defaults to SalesforceEndpointConfig.DEFAULT_VERSION + */ public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } @@ -173,6 +179,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectName; } +/** + * SObject name if required or supported by API + */ public void setSObjectName(String sObjectName) { this.sObjectName = sObjectName; } @@ -181,6 +190,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectId; } +/** + * SObject ID if required by API + */ public void setSObjectId(String sObjectId) { this.sObjectId = sObjectId; } @@ -189,6 +201,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectFields; } +/** + * SObject fields to retrieve + */ public void setSObjectFields(String sObjectFields) { this.sObjectFields = sObjectFields; } @@ -197,6 +212,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectIdName; } +/** + * SObject external ID field name + */ public void setSObjectIdName(String sObjectIdName) { this.sObjectIdName = sObjectIdName; } @@ -205,6 +223,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectIdValue; } +/** + * SObject external ID field value + */ public void setSObjectIdValue(String sObjectIdValue) { this.sObjectIdValue = sObjectIdValue; } @@ -213,6 +234,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectBlobFieldName; } +/** + * SObject blob field name + */ public void setSObjectBlobFieldName(String sObjectBlobFieldName) { this.sObjectBlobFieldName = sObjectBlobFieldName; } @@ -221,6 +245,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectClass; } +/** + * Fully qualified SObject class name, usually generated using camel-salesforce-maven-plugin + */ public void setSObjectClass(String sObjectClass) { this.sObjectClass = sObjectClass; } @@ -229,6 +256,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectQuery; } +/** + * Salesforce SOQL query string + */ public void setSObjectQuery(String sObjectQuery) { this.sObjectQuery = sObjectQuery; } @@ -237,6 +267,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectSearch; } +/** + * Salesforce SOSL search
camel git commit: CAMEL-8772: Added documentation for salesforce login config and endpoint options
Repository: camel Updated Branches: refs/heads/camel-2.15.x efb28f1ce -> aedefc868 CAMEL-8772: Added documentation for salesforce login config and endpoint options Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/aedefc86 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/aedefc86 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/aedefc86 Branch: refs/heads/camel-2.15.x Commit: aedefc86894e8e88ee2e3f92af3289d29236a63b Parents: efb28f1 Author: Dhiraj Bokde Authored: Fri Sep 18 02:31:39 2015 -0700 Committer: Dhiraj Bokde Committed: Fri Sep 18 02:32:04 2015 -0700 -- .../salesforce/SalesforceEndpointConfig.java| 90 .../salesforce/SalesforceLoginConfig.java | 18 2 files changed, 108 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/aedefc86/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java -- 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 f8f7e9b..e25198e5c 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 @@ -157,6 +157,9 @@ public class SalesforceEndpointConfig implements Cloneable { return format; } +/** + * Payload format to use for Salesforce API calls, either JSON or XML, defaults to JSON + */ public void setFormat(PayloadFormat format) { this.format = format; } @@ -165,6 +168,9 @@ public class SalesforceEndpointConfig implements Cloneable { return apiVersion; } +/** + * Salesforce API version, defaults to SalesforceEndpointConfig.DEFAULT_VERSION + */ public void setApiVersion(String apiVersion) { this.apiVersion = apiVersion; } @@ -173,6 +179,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectName; } +/** + * SObject name if required or supported by API + */ public void setSObjectName(String sObjectName) { this.sObjectName = sObjectName; } @@ -181,6 +190,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectId; } +/** + * SObject ID if required by API + */ public void setSObjectId(String sObjectId) { this.sObjectId = sObjectId; } @@ -189,6 +201,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectFields; } +/** + * SObject fields to retrieve + */ public void setSObjectFields(String sObjectFields) { this.sObjectFields = sObjectFields; } @@ -197,6 +212,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectIdName; } +/** + * SObject external ID field name + */ public void setSObjectIdName(String sObjectIdName) { this.sObjectIdName = sObjectIdName; } @@ -205,6 +223,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectIdValue; } +/** + * SObject external ID field value + */ public void setSObjectIdValue(String sObjectIdValue) { this.sObjectIdValue = sObjectIdValue; } @@ -213,6 +234,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectBlobFieldName; } +/** + * SObject blob field name + */ public void setSObjectBlobFieldName(String sObjectBlobFieldName) { this.sObjectBlobFieldName = sObjectBlobFieldName; } @@ -221,6 +245,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectClass; } +/** + * Fully qualified SObject class name, usually generated using camel-salesforce-maven-plugin + */ public void setSObjectClass(String sObjectClass) { this.sObjectClass = sObjectClass; } @@ -229,6 +256,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectQuery; } +/** + * Salesforce SOQL query string + */ public void setSObjectQuery(String sObjectQuery) { this.sObjectQuery = sObjectQuery; } @@ -237,6 +267,9 @@ public class SalesforceEndpointConfig implements Cloneable { return sObjectSearch; } +/** + * Salesforce
[4/4] camel git commit: Merge pull request #617 from dkhanolkar/master
Merge pull request #617 from dkhanolkar/master * PR-617: Polished formatting Added a fix to the LoginToken class to ensure future new SF fields dont cause the login to fail, added a testcase for it Fix for login failure post Salesforce Non Prod patch Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8ce5a2b2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8ce5a2b2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8ce5a2b2 Branch: refs/heads/master Commit: 8ce5a2b2f4b0c8ee599af156b5c93f52c66ed127 Parents: b029251 883b8cf Author: Dhiraj Bokde Authored: Tue Sep 22 16:39:25 2015 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 22 16:39:25 2015 -0700 -- .../salesforce/internal/dto/LoginToken.java | 2 + .../salesforce/internal/LoginTokenTest.java | 62 2 files changed, 64 insertions(+) --
[2/4] camel git commit: Fix for login failure post Salesforce Non Prod patch
Fix for login failure post Salesforce Non Prod patch Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a6c54186 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a6c54186 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a6c54186 Branch: refs/heads/master Commit: a6c54186a8f226e9b5edc48a1df0d7048a3ef7a6 Parents: b029251 Author: Devendra Khanolkar Authored: Wed Sep 16 21:16:05 2015 +1000 Committer: Dhiraj Bokde Committed: Tue Sep 22 16:11:45 2015 -0700 -- .../apache/camel/component/salesforce/internal/dto/LoginToken.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a6c54186/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java index 32a316f..be6942a 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java @@ -34,7 +34,7 @@ public class LoginToken { private String issuedAt; private String tokenType; - + private String isReadOnly; @JsonProperty("access_token")
[3/4] camel git commit: Polished formatting
Polished formatting Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/883b8cff Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/883b8cff Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/883b8cff Branch: refs/heads/master Commit: 883b8cffb1db531cfb46dfcd346eed11e6148a00 Parents: 440bd94 Author: Dhiraj Bokde Authored: Tue Sep 22 16:39:00 2015 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 22 16:39:00 2015 -0700 -- .../salesforce/internal/dto/LoginToken.java | 4 +- .../salesforce/internal/LoginTokenTest.java | 83 2 files changed, 52 insertions(+), 35 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/883b8cff/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java index e429bc5..7f7e2c6 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java @@ -22,7 +22,7 @@ import org.codehaus.jackson.annotate.JsonProperty; /** * DTO for Salesforce login */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class LoginToken { private String accessToken; @@ -36,7 +36,7 @@ public class LoginToken { private String issuedAt; private String tokenType; - + private String isReadOnly; @JsonProperty("access_token") http://git-wip-us.apache.org/repos/asf/camel/blob/883b8cff/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java index d20b662..5d08d49 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java @@ -1,3 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.camel.component.salesforce.internal; import org.apache.camel.component.salesforce.internal.dto.LoginToken; @@ -5,41 +21,42 @@ import org.codehaus.jackson.map.ObjectMapper; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; public class LoginTokenTest { - - private static final Logger LOG = LoggerFactory.getLogger(SessionIntegrationTest.class); - - @Test - public void testLoginTokenWithUnknownFields() throws Exception { - - String salesforceOAuthResponse = "{\n" + - "\"access_token\": \"00!ARMAQKg_lg_hGaRElvizVFBQHoCpvX8tzwGnROQ0_MDPXSceMeZHtm3JHkPmMhlgK0Km3rpJkwxwHInd_8o022KsDy.p4O.X\",\n" + - "\"is_readonly\": \"false\",\n" + - "\"signature\": \"XX+MYU+JrOXPSbpHa2ihMpSvUqow1iTPh7Q=\",\n" + - "\"instance_url\": \"https://--xxx.cs5.my.salesforce.com\",\n"; + - "\"id
[1/4] camel git commit: Added a fix to the LoginToken class to ensure future new SF fields dont cause the login to fail, added a testcase for it
Repository: camel Updated Branches: refs/heads/master b02925175 -> 8ce5a2b2f Added a fix to the LoginToken class to ensure future new SF fields dont cause the login to fail, added a testcase for it Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/440bd946 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/440bd946 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/440bd946 Branch: refs/heads/master Commit: 440bd9467f56848b9958b0f674a096914900d251 Parents: a6c5418 Author: Devendra Khanolkar Authored: Mon Sep 21 11:30:41 2015 +1000 Committer: Dhiraj Bokde Committed: Tue Sep 22 16:11:45 2015 -0700 -- .../salesforce/internal/dto/LoginToken.java | 2 + .../salesforce/internal/LoginTokenTest.java | 45 2 files changed, 47 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/440bd946/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java index be6942a..e429bc5 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java @@ -16,11 +16,13 @@ */ package org.apache.camel.component.salesforce.internal.dto; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; /** * DTO for Salesforce login */ +@JsonIgnoreProperties(ignoreUnknown=true) public class LoginToken { private String accessToken; http://git-wip-us.apache.org/repos/asf/camel/blob/440bd946/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java new file mode 100644 index 000..d20b662 --- /dev/null +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java @@ -0,0 +1,45 @@ +package org.apache.camel.component.salesforce.internal; + +import org.apache.camel.component.salesforce.internal.dto.LoginToken; +import org.codehaus.jackson.map.ObjectMapper; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import static org.junit.Assert.*; + +public class LoginTokenTest { + + private static final Logger LOG = LoggerFactory.getLogger(SessionIntegrationTest.class); + + @Test + public void testLoginTokenWithUnknownFields() throws Exception { + + String salesforceOAuthResponse = "{\n" + + "\"access_token\": \"00!ARMAQKg_lg_hGaRElvizVFBQHoCpvX8tzwGnROQ0_MDPXSceMeZHtm3JHkPmMhlgK0Km3rpJkwxwHInd_8o022KsDy.p4O.X\",\n" + + "\"is_readonly\": \"false\",\n" + + "\"signature\": \"XX+MYU+JrOXPSbpHa2ihMpSvUqow1iTPh7Q=\",\n" + + "\"instance_url\": \"https://--xxx.cs5.my.salesforce.com\",\n"; + + "\"id\": \"https://test.salesforce.com/id/00DO0054tO8MAI/005O001cmmdIAA\",\n"; + + "\"token_type\": \"Bearer\",\n" + + "\"issued_at\": \"1442798068621\",\n" + + "\"an_unrecognised_field\": \"foo\"\n" + + "}"; + ObjectMapper mapper = new ObjectMapper(); + Exception e = null; + LoginToken token = null; + try { + token = mapper.readValue(salesforceOAuthResponse, LoginToken.class); + } catch (Exception ex) { + e = ex; + } + + //assert ObjectMapper deserialized the SF OAuth response and returned a valid token back + assertNotNull("An invalid token was returned" , to
[1/2] camel git commit: Added a fix to the LoginToken class to ensure future new SF fields dont cause the login to fail, added a testcase for it
Repository: camel Updated Branches: refs/heads/camel-2.15.x d7cea3adf -> 2dd6f6880 Added a fix to the LoginToken class to ensure future new SF fields dont cause the login to fail, added a testcase for it Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/c13656d5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/c13656d5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/c13656d5 Branch: refs/heads/camel-2.15.x Commit: c13656d52535428e6d9fd09255c55ce703af0ae2 Parents: d7cea3a Author: Devendra Khanolkar Authored: Mon Sep 21 11:30:41 2015 +1000 Committer: Dhiraj Bokde Committed: Tue Sep 22 16:43:28 2015 -0700 -- .../salesforce/internal/dto/LoginToken.java | 2 + .../salesforce/internal/LoginTokenTest.java | 45 2 files changed, 47 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/c13656d5/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java index 32a316f..cf4d212 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java @@ -16,11 +16,13 @@ */ package org.apache.camel.component.salesforce.internal.dto; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; /** * DTO for Salesforce login */ +@JsonIgnoreProperties(ignoreUnknown=true) public class LoginToken { private String accessToken; http://git-wip-us.apache.org/repos/asf/camel/blob/c13656d5/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java new file mode 100644 index 000..d20b662 --- /dev/null +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java @@ -0,0 +1,45 @@ +package org.apache.camel.component.salesforce.internal; + +import org.apache.camel.component.salesforce.internal.dto.LoginToken; +import org.codehaus.jackson.map.ObjectMapper; +import org.junit.Test; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import static org.junit.Assert.*; + +public class LoginTokenTest { + + private static final Logger LOG = LoggerFactory.getLogger(SessionIntegrationTest.class); + + @Test + public void testLoginTokenWithUnknownFields() throws Exception { + + String salesforceOAuthResponse = "{\n" + + "\"access_token\": \"00!ARMAQKg_lg_hGaRElvizVFBQHoCpvX8tzwGnROQ0_MDPXSceMeZHtm3JHkPmMhlgK0Km3rpJkwxwHInd_8o022KsDy.p4O.X\",\n" + + "\"is_readonly\": \"false\",\n" + + "\"signature\": \"XX+MYU+JrOXPSbpHa2ihMpSvUqow1iTPh7Q=\",\n" + + "\"instance_url\": \"https://--xxx.cs5.my.salesforce.com\",\n"; + + "\"id\": \"https://test.salesforce.com/id/00DO0054tO8MAI/005O001cmmdIAA\",\n"; + + "\"token_type\": \"Bearer\",\n" + + "\"issued_at\": \"1442798068621\",\n" + + "\"an_unrecognised_field\": \"foo\"\n" + + "}"; + ObjectMapper mapper = new ObjectMapper(); + Exception e = null; + LoginToken token = null; + try { + token = mapper.readValue(salesforceOAuthResponse, LoginToken.class); + } catch (Exception ex) { + e = ex; + } + + //assert ObjectMapper deserialized the SF OAuth response and returned a valid token back + assertNotNull("An invalid token was re
[2/2] camel git commit: Polished formatting. This closes #617.
Polished formatting. This closes #617. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2dd6f688 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2dd6f688 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2dd6f688 Branch: refs/heads/camel-2.15.x Commit: 2dd6f688051b750ef45896cea82df6feb189bc31 Parents: c13656d Author: Dhiraj Bokde Authored: Tue Sep 22 16:39:00 2015 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 22 16:43:54 2015 -0700 -- .../salesforce/internal/dto/LoginToken.java | 2 +- .../salesforce/internal/LoginTokenTest.java | 83 2 files changed, 51 insertions(+), 34 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2dd6f688/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java index cf4d212..7f7e2c6 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/dto/LoginToken.java @@ -22,7 +22,7 @@ import org.codehaus.jackson.annotate.JsonProperty; /** * DTO for Salesforce login */ -@JsonIgnoreProperties(ignoreUnknown=true) +@JsonIgnoreProperties(ignoreUnknown = true) public class LoginToken { private String accessToken; http://git-wip-us.apache.org/repos/asf/camel/blob/2dd6f688/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java index d20b662..5d08d49 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/internal/LoginTokenTest.java @@ -1,3 +1,19 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.apache.camel.component.salesforce.internal; import org.apache.camel.component.salesforce.internal.dto.LoginToken; @@ -5,41 +21,42 @@ import org.codehaus.jackson.map.ObjectMapper; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import static org.junit.Assert.*; public class LoginTokenTest { - - private static final Logger LOG = LoggerFactory.getLogger(SessionIntegrationTest.class); - - @Test - public void testLoginTokenWithUnknownFields() throws Exception { - - String salesforceOAuthResponse = "{\n" + - "\"access_token\": \"00!ARMAQKg_lg_hGaRElvizVFBQHoCpvX8tzwGnROQ0_MDPXSceMeZHtm3JHkPmMhlgK0Km3rpJkwxwHInd_8o022KsDy.p4O.X\",\n" + - "\"is_readonly\": \"false\",\n" + - "\"signature\": \"XX+MYU+JrOXPSbpHa2ihMpSvUqow1iTPh7Q=\",\n" + - "\"instance_url\": \"https://--xxx.cs5.my.salesforce.com\",\n"; + - "\"id\": \"https://test.salesforce.com/id/00DO0054tO8MAI/005O001cmmdIAA\",\n"; + - "\"token_type\": \"Bearer\",\n" + -
[2/3] camel git commit: CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3
http://git-wip-us.apache.org/repos/asf/camel/blob/ec90c0b4/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 2dade18..9eb6e0c 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 @@ -26,6 +26,7 @@ import java.util.Map; import com.thoughtworks.xstream.XStream; +import org.apache.camel.component.salesforce.SalesforceHttpClient; import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.api.SalesforceMultipleChoicesException; import org.apache.camel.component.salesforce.api.dto.RestError; @@ -37,11 +38,11 @@ import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.URISupport; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; -import org.eclipse.jetty.client.ContentExchange; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.HttpExchange; -import org.eclipse.jetty.http.HttpHeaders; -import org.eclipse.jetty.http.HttpMethods; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.client.api.Response; +import org.eclipse.jetty.client.util.InputStreamContentProvider; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.util.StringUtil; @@ -56,7 +57,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient private ObjectMapper objectMapper; private XStream xStream; -public DefaultRestClient(HttpClient httpClient, String version, PayloadFormat format, SalesforceSession session) +public DefaultRestClient(SalesforceHttpClient httpClient, String version, PayloadFormat format, SalesforceSession session) throws SalesforceException { super(version, session, httpClient); @@ -72,36 +73,32 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient } @Override -protected void doHttpRequest(ContentExchange request, ClientResponseCallback callback) { +protected void doHttpRequest(Request request, ClientResponseCallback callback) { // set standard headers for all requests final String contentType = PayloadFormat.JSON.equals(format) ? APPLICATION_JSON_UTF8 : APPLICATION_XML_UTF8; -request.setRequestHeader(HttpHeaders.ACCEPT, contentType); -request.setRequestHeader(HttpHeaders.ACCEPT_CHARSET, StringUtil.__UTF8); +request.header(HttpHeader.ACCEPT, contentType); +request.header(HttpHeader.ACCEPT_CHARSET, StringUtil.__UTF8); // request content type and charset is set by the request entity super.doHttpRequest(request, callback); } @Override -protected SalesforceException createRestException(ContentExchange httpExchange, String reason) { +protected SalesforceException createRestException(Response response, InputStream responseContent) { // get status code and reason phrase -final int statusCode = httpExchange.getResponseStatus(); +final int statusCode = response.getStatus(); +String reason = response.getReason(); if (reason == null || reason.isEmpty()) { reason = HttpStatus.getMessage(statusCode); } // try parsing response according to format -String responseContent = null; try { -responseContent = httpExchange.getResponseContent(); -if (responseContent != null && !responseContent.isEmpty()) { +if (responseContent != null && responseContent.available() > 0) { final List choices; // 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>() { -} -); +choices = objectMapper.readValue(responseContent, new TypeReference>() {}); } else { RestChoices restChoices = new RestChoices(); xStream
[1/3] camel git commit: CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3
Repository: camel Updated Branches: refs/heads/master ff713bd48 -> ec90c0b4b http://git-wip-us.apache.org/repos/asf/camel/blob/ec90c0b4/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 9fdadb8..995a810 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 @@ -21,6 +21,7 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Field; +import java.net.URI; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Collections; @@ -37,6 +38,7 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import org.apache.camel.component.salesforce.SalesforceEndpointConfig; +import org.apache.camel.component.salesforce.SalesforceHttpClient; import org.apache.camel.component.salesforce.SalesforceLoginConfig; import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.api.dto.AbstractSObjectBase; @@ -66,10 +68,13 @@ import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.log.Log4JLogChute; import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; import org.codehaus.jackson.map.ObjectMapper; -import org.eclipse.jetty.client.Address; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.RedirectListener; -import org.eclipse.jetty.client.security.ProxyAuthorization; +import org.eclipse.jetty.client.HttpProxy; +import org.eclipse.jetty.client.Origin; +import org.eclipse.jetty.client.ProxyConfiguration; +import org.eclipse.jetty.client.Socks4Proxy; +import org.eclipse.jetty.client.api.Authentication; +import org.eclipse.jetty.client.util.BasicAuthentication; +import org.eclipse.jetty.client.util.DigestAuthentication; import org.eclipse.jetty.util.ssl.SslContextFactory; /** @@ -116,6 +121,30 @@ public class CamelSalesforceMojo extends AbstractMojo { protected Integer httpProxyPort; /** + * Is it a SOCKS4 Proxy? + */ +@Parameter(property = "camelSalesforce.isHttpProxySocks4") +private boolean isHttpProxySocks4; + +/** + * Is HTTP Proxy secure, i.e. using secure sockets, true by default. + */ +@Parameter(property = "camelSalesforce.isHttpProxySecure") +private boolean isHttpProxySecure = true; + +/** + * Addresses to Proxy. + */ +@Parameter(property = "camelSalesforce.httpProxyIncludedAddresses") +private Set httpProxyIncludedAddresses; + +/** + * Addresses to NOT Proxy. + */ +@Parameter(property = "camelSalesforce.httpProxyIncludedAddresses") +private Set httpProxyExcludedAddresses; + +/** * Proxy authentication username. */ @Parameter(property = "camelSalesforce.httpProxyUsername") @@ -128,6 +157,24 @@ public class CamelSalesforceMojo extends AbstractMojo { protected String httpProxyPassword; /** + * Proxy authentication URI. + */ +@Parameter(property = "camelSalesforce.httpProxyAuthUri") +protected String httpProxyAuthUri; + +/** + * Proxy authentication realm. + */ +@Parameter(property = "camelSalesforce.httpProxyRealm") +protected String httpProxyRealm; + +/** + * Proxy uses Digest authentication. + */ +@Parameter(property = "camelSalesforce.httpProxyUseDigestAuth") +protected boolean httpProxyUseDigestAuth; + +/** * Salesforce client id. */ @Parameter(property = "camelSalesforce.clientId", required = true) @@ -224,10 +271,8 @@ public class CamelSalesforceMojo extends AbstractMojo { } // connect to Salesforce -final HttpClient httpClient = createHttpClient(); - -final SalesforceSession session = new SalesforceSession(httpClient, -new SalesforceLoginConfig(loginUrl, clientId, clientSecret, userName, password, false)); +final SalesforceHttpClient httpClient = createHttpClient(); +final SalesforceSession session = httpClient.getSession(); getLog().info("Salesforce login..."); try { @@ -417,28 +462,33 @@ public class CamelSalesforceMojo extends AbstractMojo { getLog().info(String.format("Found %s matching Objects", objectNames.size())); } -protected HttpClient createHttpClient() throws MojoExecutionException { +protected SalesforceHttpClient createHttpClient() throws Moj
[3/3] camel git commit: CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3
CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ec90c0b4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ec90c0b4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ec90c0b4 Branch: refs/heads/master Commit: ec90c0b4b2c73f6323e1c320327cffa00d3e4b98 Parents: ff713bd Author: Dhiraj Bokde Authored: Thu Apr 28 19:20:18 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Apr 28 19:47:05 2016 -0700 -- .../camel-salesforce-component/pom.xml | 34 ++- .../salesforce/SalesforceComponent.java | 165 --- .../salesforce/SalesforceEndpointConfig.java| 12 +- .../salesforce/SalesforceHttpClient.java| 111 +++ .../component/salesforce/api/dto/Address.java | 10 + .../salesforce/api/dto/RestResources.java | 24 ++ .../salesforce/internal/SalesforceSession.java | 287 --- .../internal/client/AbstractClientBase.java | 195 +++-- .../client/DefaultAnalyticsApiClient.java | 95 +++--- .../internal/client/DefaultBulkApiClient.java | 93 +++--- .../internal/client/DefaultRestClient.java | 100 --- .../internal/client/SalesforceExchange.java | 36 --- .../internal/client/SalesforceHttpRequest.java | 38 +++ .../client/SalesforceSecurityHandler.java | 262 + .../client/SalesforceSecurityListener.java | 192 - .../internal/client/XStreamUtils.java | 2 +- .../processor/AbstractRestProcessor.java| 3 +- .../processor/AbstractSalesforceProcessor.java | 4 +- .../processor/AnalyticsApiProcessor.java| 3 +- .../internal/processor/JsonRestProcessor.java | 2 +- .../internal/processor/XmlRestProcessor.java| 8 +- .../internal/streaming/SubscriptionHelper.java | 38 +-- .../salesforce/AbstractBulkApiTestBase.java | 4 +- .../salesforce/AbstractSalesforceTestBase.java | 9 + .../salesforce/BulkApiIntegrationTest.java | 24 +- .../salesforce/HttpProxyIntegrationTest.java| 44 ++- .../salesforce/RestApiIntegrationTest.java | 79 +++-- .../internal/SessionIntegrationTest.java| 12 +- .../camel-salesforce-maven-plugin/pom.xml | 25 +- .../apache/camel/maven/CamelSalesforceMojo.java | 128 +++-- .../maven/HttpProxyMojoIntegrationTest.java | 43 ++- components/camel-salesforce/pom.xml | 1 + parent/pom.xml | 2 +- 33 files changed, 1263 insertions(+), 822 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ec90c0b4/components/camel-salesforce/camel-salesforce-component/pom.xml -- diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml b/components/camel-salesforce/camel-salesforce-component/pom.xml index 79267a0..ac12d73 100644 --- a/components/camel-salesforce/camel-salesforce-component/pom.xml +++ b/components/camel-salesforce/camel-salesforce-component/pom.xml @@ -31,9 +31,6 @@ Camel Salesforce support - -8.1.17.v20150415 - org.joda.time.*;version="[1.6,3)" @@ -53,17 +50,22 @@ org.eclipse.jetty jetty-client - ${jetty8-version} + ${jetty9-version} org.eclipse.jetty jetty-util - ${jetty8-version} + ${jetty9-version} + + + org.eclipse.jetty + jetty-util-ajax + ${jetty9-version} org.eclipse.jetty jetty-io - ${jetty8-version} + ${jetty9-version} org.codehaus.jackson @@ -81,11 +83,11 @@ org.eclipse.jetty - jetty-util + * - org.eclipse.jetty - jetty-io + org.slf4j + slf4j-api @@ -125,7 +127,19 @@ org.eclipse.jetty jetty-server - ${jetty8-version} + ${jetty9-version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty9-version} + test + + + org.eclipse.jetty + jetty-proxy + ${jetty9-version} test http://git-wip-us.apache.org/repos/asf/camel/blob/ec90c0b4/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java -- 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 5f93441..600dcbf 100644 --
camel git commit: CAMEL-9925: Fixed CS errors
Repository: camel Updated Branches: refs/heads/master ec90c0b4b -> 09ff7ed1a 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/09ff7ed1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/09ff7ed1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/09ff7ed1 Branch: refs/heads/master Commit: 09ff7ed1a5203eb7bfe1d404dc7454e1cae6bbe2 Parents: ec90c0b Author: Dhiraj Bokde Authored: Thu Apr 28 22:49:01 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Apr 28 22:49:01 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/09ff7ed1/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 recentReports = null; if (response != null) { try { -recentReports = unmarshalResponse(response, Request, +recentReports = unmarshalResponse(response, request, new TypeReference>() { } ); @@ -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 request = new HashMap(); -request.put("reportMetadata", reportMetadata); -marshalRequest(request, Request); +final HashMap input = new HashMap(); +input.put("reportMetadata", reportMetad
[2/4] camel git commit: CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3
http://git-wip-us.apache.org/repos/asf/camel/blob/8dfd66bd/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 2dade18..9eb6e0c 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 @@ -26,6 +26,7 @@ import java.util.Map; import com.thoughtworks.xstream.XStream; +import org.apache.camel.component.salesforce.SalesforceHttpClient; import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.api.SalesforceMultipleChoicesException; import org.apache.camel.component.salesforce.api.dto.RestError; @@ -37,11 +38,11 @@ import org.apache.camel.util.ObjectHelper; import org.apache.camel.util.URISupport; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.type.TypeReference; -import org.eclipse.jetty.client.ContentExchange; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.HttpExchange; -import org.eclipse.jetty.http.HttpHeaders; -import org.eclipse.jetty.http.HttpMethods; +import org.eclipse.jetty.client.api.Request; +import org.eclipse.jetty.client.api.Response; +import org.eclipse.jetty.client.util.InputStreamContentProvider; +import org.eclipse.jetty.http.HttpHeader; +import org.eclipse.jetty.http.HttpMethod; import org.eclipse.jetty.http.HttpStatus; import org.eclipse.jetty.util.StringUtil; @@ -56,7 +57,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient private ObjectMapper objectMapper; private XStream xStream; -public DefaultRestClient(HttpClient httpClient, String version, PayloadFormat format, SalesforceSession session) +public DefaultRestClient(SalesforceHttpClient httpClient, String version, PayloadFormat format, SalesforceSession session) throws SalesforceException { super(version, session, httpClient); @@ -72,36 +73,32 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient } @Override -protected void doHttpRequest(ContentExchange request, ClientResponseCallback callback) { +protected void doHttpRequest(Request request, ClientResponseCallback callback) { // set standard headers for all requests final String contentType = PayloadFormat.JSON.equals(format) ? APPLICATION_JSON_UTF8 : APPLICATION_XML_UTF8; -request.setRequestHeader(HttpHeaders.ACCEPT, contentType); -request.setRequestHeader(HttpHeaders.ACCEPT_CHARSET, StringUtil.__UTF8); +request.header(HttpHeader.ACCEPT, contentType); +request.header(HttpHeader.ACCEPT_CHARSET, StringUtil.__UTF8); // request content type and charset is set by the request entity super.doHttpRequest(request, callback); } @Override -protected SalesforceException createRestException(ContentExchange httpExchange, String reason) { +protected SalesforceException createRestException(Response response, InputStream responseContent) { // get status code and reason phrase -final int statusCode = httpExchange.getResponseStatus(); +final int statusCode = response.getStatus(); +String reason = response.getReason(); if (reason == null || reason.isEmpty()) { reason = HttpStatus.getMessage(statusCode); } // try parsing response according to format -String responseContent = null; try { -responseContent = httpExchange.getResponseContent(); -if (responseContent != null && !responseContent.isEmpty()) { +if (responseContent != null && responseContent.available() > 0) { final List choices; // 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>() { -} -); +choices = objectMapper.readValue(responseContent, new TypeReference>() {}); } else { RestChoices restChoices = new RestChoices(); xStream
[3/4] camel git commit: CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3
CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3 Conflicts: components/camel-salesforce/camel-salesforce-component/pom.xml components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java components/camel-salesforce/camel-salesforce-maven-plugin/pom.xml Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8dfd66bd Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8dfd66bd Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8dfd66bd Branch: refs/heads/camel-2.17.x Commit: 8dfd66bd731c6cea0885481f06e817dac0284b41 Parents: 7aa181a Author: Dhiraj Bokde Authored: Thu Apr 28 19:20:18 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Apr 28 22:13:34 2016 -0700 -- .../camel-salesforce-component/pom.xml | 31 +- .../salesforce/SalesforceComponent.java | 165 --- .../salesforce/SalesforceEndpointConfig.java| 12 +- .../salesforce/SalesforceHttpClient.java| 111 +++ .../component/salesforce/api/dto/Address.java | 10 + .../salesforce/api/dto/RestResources.java | 24 ++ .../salesforce/internal/SalesforceSession.java | 287 --- .../internal/client/AbstractClientBase.java | 195 +++-- .../client/DefaultAnalyticsApiClient.java | 95 +++--- .../internal/client/DefaultBulkApiClient.java | 93 +++--- .../internal/client/DefaultRestClient.java | 100 --- .../internal/client/SalesforceExchange.java | 36 --- .../internal/client/SalesforceHttpRequest.java | 38 +++ .../client/SalesforceSecurityHandler.java | 262 + .../client/SalesforceSecurityListener.java | 192 - .../internal/client/XStreamUtils.java | 2 +- .../processor/AbstractRestProcessor.java| 3 +- .../processor/AbstractSalesforceProcessor.java | 4 +- .../processor/AnalyticsApiProcessor.java| 3 +- .../internal/processor/JsonRestProcessor.java | 2 +- .../internal/processor/XmlRestProcessor.java| 8 +- .../internal/streaming/SubscriptionHelper.java | 38 +-- .../salesforce/AbstractBulkApiTestBase.java | 4 +- .../salesforce/AbstractSalesforceTestBase.java | 9 + .../salesforce/BulkApiIntegrationTest.java | 24 +- .../salesforce/HttpProxyIntegrationTest.java| 44 ++- .../salesforce/RestApiIntegrationTest.java | 79 +++-- .../internal/SessionIntegrationTest.java| 12 +- .../camel-salesforce-maven-plugin/pom.xml | 20 +- .../apache/camel/maven/CamelSalesforceMojo.java | 128 +++-- .../maven/HttpProxyMojoIntegrationTest.java | 43 ++- components/camel-salesforce/pom.xml | 1 + parent/pom.xml | 2 +- 33 files changed, 1263 insertions(+), 814 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/8dfd66bd/components/camel-salesforce/camel-salesforce-component/pom.xml -- diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml b/components/camel-salesforce/camel-salesforce-component/pom.xml index 83c5a0a..b15fea8 100644 --- a/components/camel-salesforce/camel-salesforce-component/pom.xml +++ b/components/camel-salesforce/camel-salesforce-component/pom.xml @@ -50,17 +50,22 @@ org.eclipse.jetty jetty-client - ${jetty-version} + ${jetty9-version} org.eclipse.jetty jetty-util - ${jetty-version} + ${jetty9-version} + + + org.eclipse.jetty + jetty-util-ajax + ${jetty9-version} org.eclipse.jetty jetty-io - ${jetty-version} + ${jetty9-version} org.codehaus.jackson @@ -78,11 +83,11 @@ org.eclipse.jetty - jetty-util + * - org.eclipse.jetty - jetty-io + org.slf4j + slf4j-api @@ -122,7 +127,19 @@ org.eclipse.jetty jetty-server - ${jetty-version} + ${jetty9-version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty9-version} + test + + + org.eclipse.jetty + jetty-proxy + ${jetty9-version} test http://git-wip-us.apache.org/repos/asf/camel/blob/8dfd66bd/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java b/co
[1/4] camel git commit: CAMEL-9925: Updated Salesforce component to use Jetty9 and cometd3
Repository: camel Updated Branches: refs/heads/camel-2.17.x 7aa181a4d -> b69ab33a7 http://git-wip-us.apache.org/repos/asf/camel/blob/8dfd66bd/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 9fdadb8..995a810 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 @@ -21,6 +21,7 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.lang.reflect.Field; +import java.net.URI; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Collections; @@ -37,6 +38,7 @@ import java.util.concurrent.TimeUnit; import java.util.regex.Pattern; import org.apache.camel.component.salesforce.SalesforceEndpointConfig; +import org.apache.camel.component.salesforce.SalesforceHttpClient; import org.apache.camel.component.salesforce.SalesforceLoginConfig; import org.apache.camel.component.salesforce.api.SalesforceException; import org.apache.camel.component.salesforce.api.dto.AbstractSObjectBase; @@ -66,10 +68,13 @@ import org.apache.velocity.runtime.RuntimeConstants; import org.apache.velocity.runtime.log.Log4JLogChute; import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader; import org.codehaus.jackson.map.ObjectMapper; -import org.eclipse.jetty.client.Address; -import org.eclipse.jetty.client.HttpClient; -import org.eclipse.jetty.client.RedirectListener; -import org.eclipse.jetty.client.security.ProxyAuthorization; +import org.eclipse.jetty.client.HttpProxy; +import org.eclipse.jetty.client.Origin; +import org.eclipse.jetty.client.ProxyConfiguration; +import org.eclipse.jetty.client.Socks4Proxy; +import org.eclipse.jetty.client.api.Authentication; +import org.eclipse.jetty.client.util.BasicAuthentication; +import org.eclipse.jetty.client.util.DigestAuthentication; import org.eclipse.jetty.util.ssl.SslContextFactory; /** @@ -116,6 +121,30 @@ public class CamelSalesforceMojo extends AbstractMojo { protected Integer httpProxyPort; /** + * Is it a SOCKS4 Proxy? + */ +@Parameter(property = "camelSalesforce.isHttpProxySocks4") +private boolean isHttpProxySocks4; + +/** + * Is HTTP Proxy secure, i.e. using secure sockets, true by default. + */ +@Parameter(property = "camelSalesforce.isHttpProxySecure") +private boolean isHttpProxySecure = true; + +/** + * Addresses to Proxy. + */ +@Parameter(property = "camelSalesforce.httpProxyIncludedAddresses") +private Set httpProxyIncludedAddresses; + +/** + * Addresses to NOT Proxy. + */ +@Parameter(property = "camelSalesforce.httpProxyIncludedAddresses") +private Set httpProxyExcludedAddresses; + +/** * Proxy authentication username. */ @Parameter(property = "camelSalesforce.httpProxyUsername") @@ -128,6 +157,24 @@ public class CamelSalesforceMojo extends AbstractMojo { protected String httpProxyPassword; /** + * Proxy authentication URI. + */ +@Parameter(property = "camelSalesforce.httpProxyAuthUri") +protected String httpProxyAuthUri; + +/** + * Proxy authentication realm. + */ +@Parameter(property = "camelSalesforce.httpProxyRealm") +protected String httpProxyRealm; + +/** + * Proxy uses Digest authentication. + */ +@Parameter(property = "camelSalesforce.httpProxyUseDigestAuth") +protected boolean httpProxyUseDigestAuth; + +/** * Salesforce client id. */ @Parameter(property = "camelSalesforce.clientId", required = true) @@ -224,10 +271,8 @@ public class CamelSalesforceMojo extends AbstractMojo { } // connect to Salesforce -final HttpClient httpClient = createHttpClient(); - -final SalesforceSession session = new SalesforceSession(httpClient, -new SalesforceLoginConfig(loginUrl, clientId, clientSecret, userName, password, false)); +final SalesforceHttpClient httpClient = createHttpClient(); +final SalesforceSession session = httpClient.getSession(); getLog().info("Salesforce login..."); try { @@ -417,28 +462,33 @@ public class CamelSalesforceMojo extends AbstractMojo { getLog().info(String.format("Found %s matching Objects", objectNames.size())); } -protected HttpClient createHttpClient() throws MojoExecutionException { +protected SalesforceHttpClient createHttpClient() throw
[4/4] camel git commit: CAMEL-9925: Fixed CS errors
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 Authored: Thu Apr 28 22:49:01 2016 -0700 Committer: Dhiraj Bokde 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 recentReports = null; if (response != null) { try { -recentReports = unmarshalResponse(response, Request, +recentReports = unmarshalResponse(response, request, new TypeReference>() { } ); @@ -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 request = new HashMap(); -request.put("reportMetadata", reportMetadata); -marshalRequest(request, Request); +final HashMap input = new HashMap(); +input.put("reportMetadata", reportMetadata); +marshalRequest(input, request); } catch
camel git commit: CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544
Repository: camel Updated Branches: refs/heads/master 02f6569e1 -> 58b7fb384 CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/58b7fb38 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/58b7fb38 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/58b7fb38 Branch: refs/heads/master Commit: 58b7fb38429a3bd9bba79b8d4b438d9b02a2be81 Parents: 02f6569 Author: Dhiraj Bokde Authored: Tue May 3 11:55:12 2016 -0700 Committer: Dhiraj Bokde Committed: Tue May 3 11:55:30 2016 -0700 -- .../org/apache/camel/component/olingo2/Olingo2Component.java | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/58b7fb38/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java -- diff --git a/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java b/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java index 8038a77..dd09fee 100644 --- a/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java +++ b/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java @@ -99,6 +99,14 @@ public class Olingo2Component extends AbstractApiComponent
camel git commit: CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544
Repository: camel Updated Branches: refs/heads/camel-2.17.x a3ac1fba0 -> 7a57f548b CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7a57f548 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7a57f548 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7a57f548 Branch: refs/heads/camel-2.17.x Commit: 7a57f548bf97874e9054c34048668e907f8837a4 Parents: a3ac1fb Author: Dhiraj Bokde Authored: Tue May 3 11:55:12 2016 -0700 Committer: Dhiraj Bokde Committed: Tue May 3 11:58:24 2016 -0700 -- .../org/apache/camel/component/olingo2/Olingo2Component.java | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7a57f548/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java -- diff --git a/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java b/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java index 23863ec..20ea3d2 100644 --- a/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java +++ b/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Component.java @@ -99,6 +99,14 @@ public class Olingo2Component extends AbstractApiComponent
camel git commit: CAMEL-9926: Updated jetty client version to 9.2.17.v20160517, which includes a fix for an http proxy issue
Repository: camel Updated Branches: refs/heads/master 3cb727769 -> 79fbb6a3b CAMEL-9926: Updated jetty client version to 9.2.17.v20160517, which includes a fix for an http proxy issue Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/79fbb6a3 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/79fbb6a3 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/79fbb6a3 Branch: refs/heads/master Commit: 79fbb6a3b8362396774eb14c408edbbf2558dd91 Parents: 3cb7277 Author: Dhiraj Bokde Authored: Mon May 23 11:10:43 2016 -0700 Committer: Dhiraj Bokde Committed: Mon May 23 11:10:43 2016 -0700 -- .../camel/component/salesforce/HttpProxyIntegrationTest.java| 5 ++--- parent/pom.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/79fbb6a3/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java -- 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 d54b207..3281452 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 @@ -32,7 +32,6 @@ import org.eclipse.jetty.util.B64Code; import org.eclipse.jetty.util.StringUtil; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,7 +42,6 @@ import static org.eclipse.jetty.http.HttpHeader.PROXY_AUTHORIZATION; /** * Test HTTP proxy configuration for Salesforce component. */ -@Ignore("Bug in Jetty9 causes java.lang.IllegalArgumentException: Invalid protocol login.salesforce.com") public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase { private static final Logger LOG = LoggerFactory.getLogger(HttpProxyIntegrationTest.class); @@ -128,9 +126,10 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase { // set HTTP proxy settings salesforce.setHttpProxyHost(HTTP_PROXY_HOST); salesforce.setHttpProxyPort(httpProxyPort); +salesforce.setIsHttpProxySecure(false); salesforce.setHttpProxyUsername(HTTP_PROXY_USER_NAME); salesforce.setHttpProxyPassword(HTTP_PROXY_PASSWORD); -salesforce.setHttpProxyAuthUri(String.format("https://%s:%s";, HTTP_PROXY_HOST, httpProxyPort)); +salesforce.setHttpProxyAuthUri(String.format("http://%s:%s";, HTTP_PROXY_HOST, httpProxyPort)); salesforce.setHttpProxyRealm(HTTP_PROXY_REALM); // set HTTP client properties http://git-wip-us.apache.org/repos/asf/camel/blob/79fbb6a3/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 5aa1953..8de5e07 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -304,7 +304,7 @@ 2.8.1 2.8.1_1 2.11 -9.2.15.v20160210 +9.2.17.v20160517 ${jetty9-version} ${jetty-version} org.eclipse.jetty
camel git commit: CAMEL-9926: Updated jetty client version to 9.2.17.v20160517, which includes a fix for an http proxy issue
Repository: camel Updated Branches: refs/heads/camel-2.17.x 0bad5b285 -> df4004898 CAMEL-9926: Updated jetty client version to 9.2.17.v20160517, which includes a fix for an http proxy issue Conflicts: parent/pom.xml Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/df400489 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/df400489 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/df400489 Branch: refs/heads/camel-2.17.x Commit: df4004898478c30b04b4ef757420228a060fc31d Parents: 0bad5b2 Author: Dhiraj Bokde Authored: Mon May 23 11:10:43 2016 -0700 Committer: Dhiraj Bokde Committed: Mon May 23 11:20:25 2016 -0700 -- .../camel/component/salesforce/HttpProxyIntegrationTest.java| 5 ++--- parent/pom.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/df400489/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/HttpProxyIntegrationTest.java -- 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 d54b207..3281452 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 @@ -32,7 +32,6 @@ import org.eclipse.jetty.util.B64Code; import org.eclipse.jetty.util.StringUtil; import org.junit.AfterClass; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -43,7 +42,6 @@ import static org.eclipse.jetty.http.HttpHeader.PROXY_AUTHORIZATION; /** * Test HTTP proxy configuration for Salesforce component. */ -@Ignore("Bug in Jetty9 causes java.lang.IllegalArgumentException: Invalid protocol login.salesforce.com") public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase { private static final Logger LOG = LoggerFactory.getLogger(HttpProxyIntegrationTest.class); @@ -128,9 +126,10 @@ public class HttpProxyIntegrationTest extends AbstractSalesforceTestBase { // set HTTP proxy settings salesforce.setHttpProxyHost(HTTP_PROXY_HOST); salesforce.setHttpProxyPort(httpProxyPort); +salesforce.setIsHttpProxySecure(false); salesforce.setHttpProxyUsername(HTTP_PROXY_USER_NAME); salesforce.setHttpProxyPassword(HTTP_PROXY_PASSWORD); -salesforce.setHttpProxyAuthUri(String.format("https://%s:%s";, HTTP_PROXY_HOST, httpProxyPort)); +salesforce.setHttpProxyAuthUri(String.format("http://%s:%s";, HTTP_PROXY_HOST, httpProxyPort)); salesforce.setHttpProxyRealm(HTTP_PROXY_REALM); // set HTTP client properties http://git-wip-us.apache.org/repos/asf/camel/blob/df400489/parent/pom.xml -- diff --git a/parent/pom.xml b/parent/pom.xml index 6ea3bca..49ff4a2 100644 --- a/parent/pom.xml +++ b/parent/pom.xml @@ -302,7 +302,7 @@ 6.1.26_4 6.1.26 8.1.17.v20150415 -9.2.15.v20160210 +9.2.17.v20160517 ${jetty8-version} 8.1.16.v20140903
camel git commit: CAMEL-9528: Fixed loadbalancer example to use mina2 component
Repository: camel Updated Branches: refs/heads/master 58b0f8d63 -> fbb769e2f CAMEL-9528: Fixed loadbalancer example to use mina2 component Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fbb769e2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fbb769e2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fbb769e2 Branch: refs/heads/master Commit: fbb769e2f9cd0384401248abb4951265004e88b7 Parents: 58b0f8d Author: Dhiraj Bokde Authored: Sun Jan 24 23:09:13 2016 -0800 Committer: Dhiraj Bokde Committed: Sun Jan 24 23:09:13 2016 -0800 -- examples/camel-example-loadbalancing/pom.xml | 2 +- .../resources/META-INF/spring/camel-context-loadbalancer.xml | 4 ++-- .../src/main/resources/META-INF/spring/camel-context-mina1.xml | 2 +- .../src/main/resources/META-INF/spring/camel-context-mina2.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fbb769e2/examples/camel-example-loadbalancing/pom.xml -- diff --git a/examples/camel-example-loadbalancing/pom.xml b/examples/camel-example-loadbalancing/pom.xml index 8e8c7d4..e61e5ec 100644 --- a/examples/camel-example-loadbalancing/pom.xml +++ b/examples/camel-example-loadbalancing/pom.xml @@ -42,7 +42,7 @@ org.apache.camel - camel-mina + camel-mina2 http://git-wip-us.apache.org/repos/asf/camel/blob/fbb769e2/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml index 249e889..7b3197b 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml @@ -40,8 +40,8 @@ - - + + http://git-wip-us.apache.org/repos/asf/camel/blob/fbb769e2/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml index 3ff9b3f..c7916aa 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml @@ -29,7 +29,7 @@ http://camel.apache.org/schema/spring";> - + localhost:9991 http://git-wip-us.apache.org/repos/asf/camel/blob/fbb769e2/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml index 5fd561a..5d07251 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml @@ -29,7 +29,7 @@ http://camel.apache.org/schema/spring";> - + localhost:9992
camel git commit: CAMEL-9528: Fixed loadbalancer example to use mina2 component
Repository: camel Updated Branches: refs/heads/camel-2.15.x 8881b79d4 -> 21a1f54d8 CAMEL-9528: Fixed loadbalancer example to use mina2 component Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/21a1f54d Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/21a1f54d Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/21a1f54d Branch: refs/heads/camel-2.15.x Commit: 21a1f54d83c121a2fae247fea36c499d2acbbbd1 Parents: 8881b79 Author: Dhiraj Bokde Authored: Sun Jan 24 23:09:13 2016 -0800 Committer: Dhiraj Bokde Committed: Sun Jan 24 23:09:48 2016 -0800 -- examples/camel-example-loadbalancing/pom.xml | 2 +- .../resources/META-INF/spring/camel-context-loadbalancer.xml | 4 ++-- .../src/main/resources/META-INF/spring/camel-context-mina1.xml | 2 +- .../src/main/resources/META-INF/spring/camel-context-mina2.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/21a1f54d/examples/camel-example-loadbalancing/pom.xml -- diff --git a/examples/camel-example-loadbalancing/pom.xml b/examples/camel-example-loadbalancing/pom.xml index dedda13..2763d7b 100644 --- a/examples/camel-example-loadbalancing/pom.xml +++ b/examples/camel-example-loadbalancing/pom.xml @@ -42,7 +42,7 @@ org.apache.camel - camel-mina + camel-mina2 http://git-wip-us.apache.org/repos/asf/camel/blob/21a1f54d/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml index 249e889..7b3197b 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml @@ -40,8 +40,8 @@ - - + + http://git-wip-us.apache.org/repos/asf/camel/blob/21a1f54d/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml index 3ff9b3f..c7916aa 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml @@ -29,7 +29,7 @@ http://camel.apache.org/schema/spring";> - + localhost:9991 http://git-wip-us.apache.org/repos/asf/camel/blob/21a1f54d/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml index 5fd561a..5d07251 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml @@ -29,7 +29,7 @@ http://camel.apache.org/schema/spring";> - + localhost:9992
camel git commit: CAMEL-9528: Fixed loadbalancer example to use mina2 component
Repository: camel Updated Branches: refs/heads/camel-2.16.x f4382b6d5 -> 2ff3e8cee CAMEL-9528: Fixed loadbalancer example to use mina2 component Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2ff3e8ce Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2ff3e8ce Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2ff3e8ce Branch: refs/heads/camel-2.16.x Commit: 2ff3e8ceedcfea87d33186de223f1b8ed69bf3ff Parents: f4382b6 Author: Dhiraj Bokde Authored: Sun Jan 24 23:09:13 2016 -0800 Committer: Dhiraj Bokde Committed: Sun Jan 24 23:20:22 2016 -0800 -- examples/camel-example-loadbalancing/pom.xml | 2 +- .../resources/META-INF/spring/camel-context-loadbalancer.xml | 4 ++-- .../src/main/resources/META-INF/spring/camel-context-mina1.xml | 2 +- .../src/main/resources/META-INF/spring/camel-context-mina2.xml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2ff3e8ce/examples/camel-example-loadbalancing/pom.xml -- diff --git a/examples/camel-example-loadbalancing/pom.xml b/examples/camel-example-loadbalancing/pom.xml index 84a1b30..4cf056d 100644 --- a/examples/camel-example-loadbalancing/pom.xml +++ b/examples/camel-example-loadbalancing/pom.xml @@ -42,7 +42,7 @@ org.apache.camel - camel-mina + camel-mina2 http://git-wip-us.apache.org/repos/asf/camel/blob/2ff3e8ce/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml index 249e889..7b3197b 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-loadbalancer.xml @@ -40,8 +40,8 @@ - - + + http://git-wip-us.apache.org/repos/asf/camel/blob/2ff3e8ce/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml index 3ff9b3f..c7916aa 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina1.xml @@ -29,7 +29,7 @@ http://camel.apache.org/schema/spring";> - + localhost:9991 http://git-wip-us.apache.org/repos/asf/camel/blob/2ff3e8ce/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml -- diff --git a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml index 5fd561a..5d07251 100644 --- a/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml +++ b/examples/camel-example-loadbalancing/src/main/resources/META-INF/spring/camel-context-mina2.xml @@ -29,7 +29,7 @@ http://camel.apache.org/schema/spring";> - + localhost:9992
camel git commit: CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544
Repository: camel Updated Branches: refs/heads/master 9fc69d506 -> 52f88a23c CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/52f88a23 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/52f88a23 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/52f88a23 Branch: refs/heads/master Commit: 52f88a23c46d89d1b9e3590f2e30ec7a48a37341 Parents: 9fc69d5 Author: Dhiraj Bokde Authored: Wed Jun 1 00:35:18 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jun 1 00:35:18 2016 -0700 -- .../apache/camel/component/linkedin/LinkedInComponent.java | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/52f88a23/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java -- diff --git a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java index 0d05a8d..db00018 100644 --- a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java +++ b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java @@ -63,6 +63,14 @@ public class LinkedInComponent extends AbstractApiComponent
camel git commit: CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544
Repository: camel Updated Branches: refs/heads/camel-2.17.x a7598455a -> fec76be80 CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fec76be8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fec76be8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fec76be8 Branch: refs/heads/camel-2.17.x Commit: fec76be80e248a5aa8f351eadc0c6af3118c8907 Parents: a759845 Author: Dhiraj Bokde Authored: Wed Jun 1 00:35:18 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jun 1 00:36:17 2016 -0700 -- .../apache/camel/component/linkedin/LinkedInComponent.java | 8 1 file changed, 8 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fec76be8/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java -- diff --git a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java index aad21e9..7fdd958 100644 --- a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java +++ b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/LinkedInComponent.java @@ -63,6 +63,14 @@ public class LinkedInComponent extends AbstractApiComponent
camel git commit: CAMEL-10039: Fixed callback url parsing in LinkedIn and Box Components
Repository: camel Updated Branches: refs/heads/master a19962b10 -> fd57cfcab CAMEL-10039: Fixed callback url parsing in LinkedIn and Box Components Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fd57cfca Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fd57cfca Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fd57cfca Branch: refs/heads/master Commit: fd57cfcabcb93e64d3a51737b470faf32de1404e Parents: a19962b Author: Dhiraj Bokde Authored: Thu Jun 9 23:20:28 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Jun 9 23:20:59 2016 -0700 -- .../org/apache/camel/component/box/internal/LoginAuthFlowUI.java | 4 ++-- .../camel/component/linkedin/api/LinkedInOAuthRequestFilter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fd57cfca/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java -- diff --git a/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java b/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java index 8044ecd..778db59 100644 --- a/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java +++ b/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java @@ -17,13 +17,13 @@ package org.apache.camel.component.box.internal; import java.io.IOException; +import java.net.URL; import java.security.GeneralSecurityException; import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.net.ssl.SSLContext; import com.box.boxjavalibv2.BoxClient; @@ -165,7 +165,7 @@ public final class LoginAuthFlowUI implements IAuthFlowUI { throw e; } final String location = e.getResponse().getResponseHeaderValue("Location"); -redirectQuery = location.substring(location.indexOf('?') + 1); +redirectQuery = new URL(location).getQuery(); } final Map params = new HashMap(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery); http://git-wip-us.apache.org/repos/asf/camel/blob/fd57cfca/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index 4d781d1..e30910a 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -202,7 +202,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { throw e; } final String location = e.getResponse().getResponseHeaderValue("Location"); -redirectQuery = location.substring(location.indexOf('?') + 1); +redirectQuery = new URL(location).getQuery(); } final Map params = new HashMap(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery);
camel git commit: CAMEL-10039: Fixed callback url parsing in LinkedIn and Box Components
Repository: camel Updated Branches: refs/heads/camel-2.17.x 16eb380b6 -> 368cb746a CAMEL-10039: Fixed callback url parsing in LinkedIn and Box Components Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/368cb746 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/368cb746 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/368cb746 Branch: refs/heads/camel-2.17.x Commit: 368cb746a3467c5ea51030ce5affb76f9d079667 Parents: 16eb380 Author: Dhiraj Bokde Authored: Thu Jun 9 23:20:28 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Jun 9 23:22:26 2016 -0700 -- .../org/apache/camel/component/box/internal/LoginAuthFlowUI.java | 4 ++-- .../camel/component/linkedin/api/LinkedInOAuthRequestFilter.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/368cb746/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java -- diff --git a/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java b/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java index 8044ecd..778db59 100644 --- a/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java +++ b/components/camel-box/src/main/java/org/apache/camel/component/box/internal/LoginAuthFlowUI.java @@ -17,13 +17,13 @@ package org.apache.camel.component.box.internal; import java.io.IOException; +import java.net.URL; import java.security.GeneralSecurityException; import java.security.SecureRandom; import java.util.HashMap; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.net.ssl.SSLContext; import com.box.boxjavalibv2.BoxClient; @@ -165,7 +165,7 @@ public final class LoginAuthFlowUI implements IAuthFlowUI { throw e; } final String location = e.getResponse().getResponseHeaderValue("Location"); -redirectQuery = location.substring(location.indexOf('?') + 1); +redirectQuery = new URL(location).getQuery(); } final Map params = new HashMap(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery); http://git-wip-us.apache.org/repos/asf/camel/blob/368cb746/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index 4d781d1..e30910a 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -202,7 +202,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { throw e; } final String location = e.getResponse().getResponseHeaderValue("Location"); -redirectQuery = location.substring(location.indexOf('?') + 1); +redirectQuery = new URL(location).getQuery(); } final Map params = new HashMap(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery);
camel git commit: CAMEL-10082: Fixed inner class name handling in camel-api-component-maven-plugin
Repository: camel Updated Branches: refs/heads/master 532f5a048 -> 201583bce CAMEL-10082: Fixed inner class name handling in camel-api-component-maven-plugin Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/201583bc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/201583bc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/201583bc Branch: refs/heads/master Commit: 201583bce4bab6dda27b5e107b63af8d23a544f3 Parents: 532f5a0 Author: Dhiraj Bokde Authored: Tue Jun 21 15:54:21 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Jun 21 15:54:21 2016 -0700 -- .../camel/util/component/ApiMethodParser.java | 30 +--- .../util/component/ApiMethodHelperTest.java | 10 +-- .../ArgumentSubstitutionParserTest.java | 12 +--- .../apache/camel/util/component/TestProxy.java | 16 +++ .../camel-api-component-maven-plugin/pom.xml| 9 ++ .../apache/camel/component/test/TestProxy.java | 16 +++ .../test/resources/test-proxy-signatures.txt| 1 + 7 files changed, 77 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/201583bc/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java index 5040bd0..a7a1a70 100644 --- a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java +++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java @@ -237,7 +237,7 @@ public abstract class ApiMethodParser { } public static Class forName(String className, ClassLoader classLoader) throws ClassNotFoundException { -Class result; +Class result = null; try { // lookup primitive types first result = PRIMITIVE_TYPES.get(className); @@ -249,10 +249,32 @@ public abstract class ApiMethodParser { if (className.endsWith("[]")) { final int firstDim = className.indexOf('['); final int nDimensions = (className.length() - firstDim) / 2; -return Array.newInstance(forName(className.substring(0, firstDim), classLoader), new int[nDimensions]).getClass(); +result = Array.newInstance(forName(className.substring(0, firstDim), classLoader), new int[nDimensions]).getClass(); +} else if (className.indexOf('.') != -1) { +// try replacing last '.' with $ to look for inner classes +String innerClass = className; +while (result == null && innerClass.indexOf('.') != -1) { +int endIndex = innerClass.lastIndexOf('.'); +innerClass = innerClass.substring(0, endIndex) + "$" + innerClass.substring(endIndex + 1); +try { +result = Class.forName(innerClass, true, classLoader); +} catch (ClassNotFoundException ignore) { +// ignore +} +} +} +if (result == null && !className.startsWith(JAVA_LANG)) { +// try loading from default Java package java.lang +try { +result = forName(JAVA_LANG + className, classLoader); +} catch (ClassNotFoundException ignore) { +// ignore +} } -// try loading from default Java package java.lang -result = Class.forName(JAVA_LANG + className, true, classLoader); +} + +if (result == null) { +throw new ClassNotFoundException(className); } return result; http://git-wip-us.apache.org/repos/asf/camel/blob/201583bc/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java index 2287993..574c9d4 100644 --- a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java +++ b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java @@ -60,6 +60,9 @@ public class ApiMethodHelperTest { methods = apiMethodHelper.getCandidateMethods("greetAll", "nameMap"); assertEquals("Can't find greetAll(nameMap)", 1, methods.size()); + +methods = apiMethodHelper.getCandidateMethods("greetInnerChild", "child"); +assertEquals("Can't fi
camel git commit: CAMEL-10082: Fixed inner class name handling in camel-api-component-maven-plugin
Repository: camel Updated Branches: refs/heads/camel-2.17.x 88c605bfa -> 1192cbd2d CAMEL-10082: Fixed inner class name handling in camel-api-component-maven-plugin Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1192cbd2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1192cbd2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1192cbd2 Branch: refs/heads/camel-2.17.x Commit: 1192cbd2de0a961c2480510db2495571b43295e4 Parents: 88c605b Author: Dhiraj Bokde Authored: Tue Jun 21 15:54:21 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Jun 21 15:57:27 2016 -0700 -- .../camel/util/component/ApiMethodParser.java | 30 +--- .../util/component/ApiMethodHelperTest.java | 10 +-- .../ArgumentSubstitutionParserTest.java | 12 +--- .../apache/camel/util/component/TestProxy.java | 16 +++ .../camel-api-component-maven-plugin/pom.xml| 9 ++ .../apache/camel/component/test/TestProxy.java | 16 +++ .../test/resources/test-proxy-signatures.txt| 1 + 7 files changed, 77 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/1192cbd2/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java -- diff --git a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java index 5040bd0..a7a1a70 100644 --- a/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java +++ b/camel-core/src/main/java/org/apache/camel/util/component/ApiMethodParser.java @@ -237,7 +237,7 @@ public abstract class ApiMethodParser { } public static Class forName(String className, ClassLoader classLoader) throws ClassNotFoundException { -Class result; +Class result = null; try { // lookup primitive types first result = PRIMITIVE_TYPES.get(className); @@ -249,10 +249,32 @@ public abstract class ApiMethodParser { if (className.endsWith("[]")) { final int firstDim = className.indexOf('['); final int nDimensions = (className.length() - firstDim) / 2; -return Array.newInstance(forName(className.substring(0, firstDim), classLoader), new int[nDimensions]).getClass(); +result = Array.newInstance(forName(className.substring(0, firstDim), classLoader), new int[nDimensions]).getClass(); +} else if (className.indexOf('.') != -1) { +// try replacing last '.' with $ to look for inner classes +String innerClass = className; +while (result == null && innerClass.indexOf('.') != -1) { +int endIndex = innerClass.lastIndexOf('.'); +innerClass = innerClass.substring(0, endIndex) + "$" + innerClass.substring(endIndex + 1); +try { +result = Class.forName(innerClass, true, classLoader); +} catch (ClassNotFoundException ignore) { +// ignore +} +} +} +if (result == null && !className.startsWith(JAVA_LANG)) { +// try loading from default Java package java.lang +try { +result = forName(JAVA_LANG + className, classLoader); +} catch (ClassNotFoundException ignore) { +// ignore +} } -// try loading from default Java package java.lang -result = Class.forName(JAVA_LANG + className, true, classLoader); +} + +if (result == null) { +throw new ClassNotFoundException(className); } return result; http://git-wip-us.apache.org/repos/asf/camel/blob/1192cbd2/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java -- diff --git a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java index 2287993..574c9d4 100644 --- a/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java +++ b/camel-core/src/test/java/org/apache/camel/util/component/ApiMethodHelperTest.java @@ -60,6 +60,9 @@ public class ApiMethodHelperTest { methods = apiMethodHelper.getCandidateMethods("greetAll", "nameMap"); assertEquals("Can't find greetAll(nameMap)", 1, methods.size()); + +methods = apiMethodHelper.getCandidateMethods("greetInnerChild", "child"); +assertEqua
[2/2] camel git commit: CAMEL-10144: Salesforce component now ignores ALL unknown properties added by Salesforce that break backward compatibility
CAMEL-10144: Salesforce component now ignores ALL unknown properties added by Salesforce that break backward compatibility Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5c3b6652 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5c3b6652 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5c3b6652 Branch: refs/heads/camel-2.17.x Commit: 5c3b6652c13ccff7c752540b7fcd77afdd1f5838 Parents: 2830967 Author: Dhiraj Bokde Authored: Wed Jul 13 19:54:24 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 19:54:24 2016 -0700 -- .../camel/component/salesforce/api/dto/AbstractDTOBase.java | 3 +++ .../component/salesforce/internal/client/DefaultRestClient.java | 1 + .../salesforce/internal/processor/XmlRestProcessor.java | 1 + .../main/java/org/apache/camel/maven/CamelSalesforceMojo.java| 4 ++-- 4 files changed, 7 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5c3b6652/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java index 9c0954a..43b9fe1 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java @@ -19,11 +19,14 @@ package org.apache.camel.component.salesforce.api.dto; import java.io.IOException; import java.io.StringWriter; +import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.map.ObjectMapper; import org.codehaus.jackson.map.annotate.JsonSerialize; // disable null values in json output @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) +// avoid running into Salesforce backward compatibility breaks +@JsonIgnoreProperties(ignoreUnknown = true) public abstract class AbstractDTOBase { private static final ObjectMapper MAPPER = new ObjectMapper(); http://git-wip-us.apache.org/repos/asf/camel/blob/5c3b6652/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 562719c..5c547b7 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 @@ -69,6 +69,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient xStream.processAnnotations(RestErrors.class); xStream.processAnnotations(RestChoices.class); +xStream.ignoreUnknownElements(); XStreamUtils.addDefaultPermissions(xStream); } http://git-wip-us.apache.org/repos/asf/camel/blob/5c3b6652/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java -- 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 a67bef5..3f8756f 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 @@ -70,6 +70,7 @@ public class XmlRestProcessor extends AbstractRestProcessor { } }); +result.ignoreUnknownElements(); XStreamUtils.addDefaultPermissions(resul
[1/2] camel git commit: CAMEL-10143: Changed LastActivityDate to DateTime
Repository: camel Updated Branches: refs/heads/camel-2.17.x 4eff18f9c -> 5c3b6652c CAMEL-10143: Changed LastActivityDate to DateTime Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/28309672 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/28309672 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/28309672 Branch: refs/heads/camel-2.17.x Commit: 283096727a00574dbcad1d6353406276b7987ca3 Parents: 4eff18f Author: Dhiraj Bokde Authored: Wed Jul 13 19:02:00 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 19:30:48 2016 -0700 -- .../component/salesforce/api/dto/AbstractSObjectBase.java | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/28309672/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java -- 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 7337a52..872fa84 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 @@ -18,6 +18,7 @@ package org.apache.camel.component.salesforce.api.dto; import org.codehaus.jackson.annotate.JsonProperty; import org.joda.time.DateTime; + //CHECKSTYLE:OFF public class AbstractSObjectBase extends AbstractDTOBase { @@ -34,7 +35,7 @@ public class AbstractSObjectBase extends AbstractDTOBase { private DateTime LastModifiedDate; private String LastModifiedById; private DateTime SystemModstamp; -private String LastActivityDate; +private DateTime LastActivityDate; private DateTime LastViewedDate; private DateTime LastReferencedDate; @@ -155,12 +156,12 @@ public class AbstractSObjectBase extends AbstractDTOBase { } @JsonProperty("LastActivityDate") -public String getLastActivityDate() { +public DateTime getLastActivityDate() { return LastActivityDate; } @JsonProperty("LastActivityDate") -public void setLastActivityDate(String lastActivityDate) { +public void setLastActivityDate(DateTime lastActivityDate) { this.LastActivityDate = lastActivityDate; }
[2/3] camel git commit: CAMEL-10144: Salesforce component now ignores ALL unknown properties added by Salesforce that break backward compatibility
CAMEL-10144: Salesforce component now ignores ALL unknown properties added by Salesforce that break backward compatibility Conflicts: components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java components/camel-salesforce/camel-salesforce-maven-plugin/src/main/java/org/apache/camel/maven/CamelSalesforceMojo.java Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ff1898b6 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ff1898b6 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ff1898b6 Branch: refs/heads/master Commit: ff1898b610fed3d961224d4741f9306f89525fef Parents: fc2686c Author: Dhiraj Bokde Authored: Wed Jul 13 19:54:24 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 20:16:59 2016 -0700 -- .../camel/component/salesforce/api/dto/AbstractDTOBase.java | 3 +++ .../component/salesforce/internal/client/DefaultRestClient.java | 1 + .../salesforce/internal/processor/XmlRestProcessor.java | 1 + .../main/java/org/apache/camel/maven/CamelSalesforceMojo.java | 5 ++--- 4 files changed, 7 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ff1898b6/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java index cd173b8..f05735c 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java @@ -19,11 +19,14 @@ package org.apache.camel.component.salesforce.api.dto; import java.io.IOException; import java.io.StringWriter; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; // disable null values in json output @JsonInclude(JsonInclude.Include.NON_NULL) +// avoid running into Salesforce backward compatibility breaks +@JsonIgnoreProperties(ignoreUnknown = true) public abstract class AbstractDTOBase { private static final ObjectMapper MAPPER = new ObjectMapper(); http://git-wip-us.apache.org/repos/asf/camel/blob/ff1898b6/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 4aaa225..9d5849e 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 @@ -69,6 +69,7 @@ public class DefaultRestClient extends AbstractClientBase implements RestClient xStream.processAnnotations(RestErrors.class); xStream.processAnnotations(RestChoices.class); +xStream.ignoreUnknownElements(); XStreamUtils.addDefaultPermissions(xStream); } http://git-wip-us.apache.org/repos/asf/camel/blob/ff1898b6/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java -- 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 a67bef5..3f8756f 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/intern
[1/3] camel git commit: CAMEL-10143: Changed LastActivityDate to DateTime
Repository: camel Updated Branches: refs/heads/master 3a8722abd -> 690726893 CAMEL-10143: Changed LastActivityDate to DateTime Conflicts: components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fc2686c6 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fc2686c6 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fc2686c6 Branch: refs/heads/master Commit: fc2686c66387e7873d5986d71f351c17c79be724 Parents: 3a8722a Author: Dhiraj Bokde Authored: Wed Jul 13 19:02:00 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 20:12:03 2016 -0700 -- .../component/salesforce/api/dto/AbstractSObjectBase.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fc2686c6/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java -- 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 bbdc3ac..183a7aa 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 @@ -36,7 +36,7 @@ public class AbstractSObjectBase extends AbstractDTOBase { private ZonedDateTime LastModifiedDate; private String LastModifiedById; private ZonedDateTime SystemModstamp; -private String LastActivityDate; +private ZonedDateTime LastActivityDate; private ZonedDateTime LastViewedDate; private ZonedDateTime LastReferencedDate; @@ -157,12 +157,12 @@ public class AbstractSObjectBase extends AbstractDTOBase { } @JsonProperty("LastActivityDate") -public String getLastActivityDate() { +public ZonedDateTime getLastActivityDate() { return LastActivityDate; } @JsonProperty("LastActivityDate") -public void setLastActivityDate(String lastActivityDate) { +public void setLastActivityDate(ZonedDateTime lastActivityDate) { this.LastActivityDate = lastActivityDate; }
[3/3] camel git commit: Created JsonUtils to create properly configured ObjectMapper
Created JsonUtils to create properly configured ObjectMapper Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/69072689 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/69072689 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/69072689 Branch: refs/heads/master Commit: 6907268939de07eebd919abdc6c547c4c2043a7d Parents: ff1898b Author: Dhiraj Bokde Authored: Wed Jul 13 23:11:37 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 23:11:37 2016 -0700 -- .../salesforce/SalesforceConsumer.java | 3 +- .../salesforce/api/dto/AbstractDTOBase.java | 4 +- .../salesforce/internal/SalesforceSession.java | 3 +- .../client/DefaultAnalyticsApiClient.java | 2 +- .../internal/client/DefaultRestClient.java | 2 +- .../salesforce/internal/client/JsonUtils.java | 35 + .../internal/datetime/DateTimeDeserializer.java | 52 +++ .../internal/datetime/DateTimeModule.java | 31 .../internal/datetime/DateTimeSerializer.java | 48 ++ .../internal/joda/DateTimeDeserializer.java | 53 .../internal/joda/DateTimeModule.java | 31 .../internal/joda/DateTimeSerializer.java | 48 -- .../internal/processor/JsonRestProcessor.java | 8 +-- .../internal/streaming/PushTopicHelper.java | 3 +- .../api/MultiSelectPicklistJsonTest.java| 7 ++- .../salesforce/internal/LoginTokenTest.java | 7 ++- .../apache/camel/maven/CamelSalesforceMojo.java | 3 +- 17 files changed, 191 insertions(+), 149 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/69072689/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java -- 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 e606a81..93d8faa 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 @@ -28,6 +28,7 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.salesforce.internal.client.DefaultRestClient; +import org.apache.camel.component.salesforce.internal.client.JsonUtils; import org.apache.camel.component.salesforce.internal.client.RestClient; import org.apache.camel.component.salesforce.internal.streaming.PushTopicHelper; import org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper; @@ -42,7 +43,7 @@ import org.cometd.bayeux.client.ClientSessionChannel; public class SalesforceConsumer extends DefaultConsumer { -private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); +private static final ObjectMapper OBJECT_MAPPER = JsonUtils.createObjectMapper(); private static final String EVENT_PROPERTY = "event"; private static final String TYPE_PROPERTY = "type"; private static final String CREATED_DATE_PROPERTY = "createdDate"; http://git-wip-us.apache.org/repos/asf/camel/blob/69072689/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java index f05735c..060605c 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java @@ -23,13 +23,15 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.camel.component.salesforce.internal.client.JsonUtils; + // disable null values in json output @JsonInclude(JsonInclude.Include.NON_NULL) // avoid running into Salesforce backward compatibility breaks @JsonIgnoreProperties(ignoreUnk
camel git commit: CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544
Repository: camel Updated Branches: refs/heads/master 690726893 -> 668f77a1e CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/668f77a1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/668f77a1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/668f77a1 Branch: refs/heads/master Commit: 668f77a1e5d3802a27be45eb88f3492089546cdb Parents: 6907268 Author: Dhiraj Bokde Authored: Wed Jul 13 23:56:31 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 23:56:31 2016 -0700 -- .../java/org/apache/camel/component/box/BoxComponent.java| 8 .../camel/component/google/drive/GoogleDriveComponent.java | 5 + .../camel/component/google/mail/GoogleMailComponent.java | 5 + 3 files changed, 18 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/668f77a1/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java -- diff --git a/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java index dd7d0f0..c770d8f 100644 --- a/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java +++ b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java @@ -64,6 +64,14 @@ public class BoxComponent extends AbstractApiComponenthttp://git-wip-us.apache.org/repos/asf/camel/blob/668f77a1/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java -- diff --git a/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java b/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java index bcb2b25..2554d0e 100644 --- a/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java +++ b/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java @@ -67,6 +67,11 @@ public class GoogleDriveComponent extends AbstractApiComponenthttp://git-wip-us.apache.org/repos/asf/camel/blob/668f77a1/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java -- diff --git a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java index 71401e9..b6896d6 100644 --- a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java +++ b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java @@ -68,6 +68,11 @@ public class GoogleMailComponent extends AbstractApiComponent
camel git commit: CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544
Repository: camel Updated Branches: refs/heads/camel-2.17.x 5c3b6652c -> a298774f5 CAMEL-9941: Added getter to workaround blueprint issue ARIES-1544 Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a298774f Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a298774f Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a298774f Branch: refs/heads/camel-2.17.x Commit: a298774f5c55cd368ebf44815db9077e6d233582 Parents: 5c3b665 Author: Dhiraj Bokde Authored: Wed Jul 13 23:56:31 2016 -0700 Committer: Dhiraj Bokde Committed: Wed Jul 13 23:57:18 2016 -0700 -- .../java/org/apache/camel/component/box/BoxComponent.java| 8 .../camel/component/google/drive/GoogleDriveComponent.java | 5 + .../camel/component/google/mail/GoogleMailComponent.java | 5 + 3 files changed, 18 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a298774f/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java -- diff --git a/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java index dd7d0f0..c770d8f 100644 --- a/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java +++ b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java @@ -64,6 +64,14 @@ public class BoxComponent extends AbstractApiComponenthttp://git-wip-us.apache.org/repos/asf/camel/blob/a298774f/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java -- diff --git a/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java b/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java index bcb2b25..2554d0e 100644 --- a/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java +++ b/components/camel-google-drive/src/main/java/org/apache/camel/component/google/drive/GoogleDriveComponent.java @@ -67,6 +67,11 @@ public class GoogleDriveComponent extends AbstractApiComponenthttp://git-wip-us.apache.org/repos/asf/camel/blob/a298774f/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java -- diff --git a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java index 71401e9..b6896d6 100644 --- a/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java +++ b/components/camel-google-mail/src/main/java/org/apache/camel/component/google/mail/GoogleMailComponent.java @@ -68,6 +68,11 @@ public class GoogleMailComponent extends AbstractApiComponent
camel git commit: CAMEL-10094: Use meaningful LinkedIn error message for oauth2 auth error
Repository: camel Updated Branches: refs/heads/camel-2.17.x ae6993976 -> ecab52ae7 CAMEL-10094: Use meaningful LinkedIn error message for oauth2 auth error Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ecab52ae Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ecab52ae Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ecab52ae Branch: refs/heads/camel-2.17.x Commit: ecab52ae72f1b100474a152f831586f8555d9437 Parents: ae69939 Author: Dhiraj Bokde Authored: Mon Jul 25 00:00:46 2016 -0700 Committer: Dhiraj Bokde Committed: Mon Jul 25 00:02:01 2016 -0700 -- .../camel/component/linkedin/api/LinkedInOAuthRequestFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ecab52ae/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index a54c21a..d78f095 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -205,7 +205,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { redirectQuery = new URL(location).getQuery(); } if (redirectQuery == null) { -throw new IllegalArgumentException("Redirect Query is null cannot use it as input"); +throw new IllegalArgumentException("Redirect response query is null, check username, password and permissions"); } final Map params = new HashMap(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery);
camel git commit: CAMEL-10094: Use meaningful LinkedIn error message for oauth2 auth error
Repository: camel Updated Branches: refs/heads/master fd7852b1c -> 90535ba80 CAMEL-10094: Use meaningful LinkedIn error message for oauth2 auth error Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/90535ba8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/90535ba8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/90535ba8 Branch: refs/heads/master Commit: 90535ba809dde19da37d061ceb9e7035cb1fc932 Parents: fd7852b Author: Dhiraj Bokde Authored: Mon Jul 25 00:00:46 2016 -0700 Committer: Dhiraj Bokde Committed: Mon Jul 25 00:01:18 2016 -0700 -- .../camel/component/linkedin/api/LinkedInOAuthRequestFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/90535ba8/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java -- diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java index a54c21a..d78f095 100644 --- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java +++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java @@ -205,7 +205,7 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter { redirectQuery = new URL(location).getQuery(); } if (redirectQuery == null) { -throw new IllegalArgumentException("Redirect Query is null cannot use it as input"); +throw new IllegalArgumentException("Redirect response query is null, check username, password and permissions"); } final Map params = new HashMap(); final Matcher matcher = QUERY_PARAM_PATTERN.matcher(redirectQuery);
[1/2] camel git commit: Moved Salesforce JsonUtils to exported package for OSGi
Repository: camel Updated Branches: refs/heads/master d57797c33 -> cace59f02 Moved Salesforce JsonUtils to exported package for OSGi Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/abb814d7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/abb814d7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/abb814d7 Branch: refs/heads/master Commit: abb814d7341d7d02266b8aaf6c650ea913d669ae Parents: d57797c Author: Dhiraj Bokde Authored: Tue Jul 26 16:36:16 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Jul 26 16:39:20 2016 -0700 -- .../salesforce/SalesforceConsumer.java | 2 +- .../salesforce/api/dto/AbstractDTOBase.java | 2 +- .../salesforce/api/utils/JsonUtils.java | 34 +++ .../salesforce/internal/SalesforceSession.java | 2 +- .../client/DefaultAnalyticsApiClient.java | 1 + .../internal/client/DefaultRestClient.java | 1 + .../salesforce/internal/client/JsonUtils.java | 35 .../internal/processor/JsonRestProcessor.java | 2 +- .../internal/streaming/PushTopicHelper.java | 2 +- .../api/MultiSelectPicklistJsonTest.java| 2 +- .../salesforce/internal/LoginTokenTest.java | 2 +- .../apache/camel/maven/CamelSalesforceMojo.java | 2 +- 12 files changed, 44 insertions(+), 43 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/abb814d7/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java -- 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 93d8faa..be0ed52 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 @@ -28,7 +28,7 @@ import org.apache.camel.Exchange; import org.apache.camel.Processor; import org.apache.camel.RuntimeCamelException; import org.apache.camel.component.salesforce.internal.client.DefaultRestClient; -import org.apache.camel.component.salesforce.internal.client.JsonUtils; +import org.apache.camel.component.salesforce.api.utils.JsonUtils; import org.apache.camel.component.salesforce.internal.client.RestClient; import org.apache.camel.component.salesforce.internal.streaming.PushTopicHelper; import org.apache.camel.component.salesforce.internal.streaming.SubscriptionHelper; http://git-wip-us.apache.org/repos/asf/camel/blob/abb814d7/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java index 060605c..a98f281 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractDTOBase.java @@ -23,7 +23,7 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.ObjectMapper; -import org.apache.camel.component.salesforce.internal.client.JsonUtils; +import org.apache.camel.component.salesforce.api.utils.JsonUtils; // disable null values in json output @JsonInclude(JsonInclude.Include.NON_NULL) http://git-wip-us.apache.org/repos/asf/camel/blob/abb814d7/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/JsonUtils.java -- 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 new file mode 100644 index 000..2c3a04f --- /dev/null +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/Jso
[2/2] camel git commit: CAMEL-10090: Fixed Salesforce DateTime handling in a utility class DateTimeUtils
CAMEL-10090: Fixed Salesforce DateTime handling in a utility class DateTimeUtils Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cace59f0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cace59f0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cace59f0 Branch: refs/heads/master Commit: cace59f0254e78cd1b1342c3ea1fc70c5dfb9b23 Parents: abb814d Author: Dhiraj Bokde Authored: Tue Jul 26 16:58:28 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Jul 26 16:58:28 2016 -0700 -- .../salesforce/api/JodaTimeConverter.java | 67 .../salesforce/api/utils/DateTimeConverter.java | 56 .../api/utils/DateTimeDeserializer.java | 43 + .../salesforce/api/utils/DateTimeModule.java| 31 + .../api/utils/DateTimeSerializer.java | 38 +++ .../salesforce/api/utils/DateTimeUtils.java | 57 + .../internal/datetime/DateTimeDeserializer.java | 52 --- .../internal/datetime/DateTimeModule.java | 31 - .../internal/datetime/DateTimeSerializer.java | 48 -- .../internal/processor/XmlRestProcessor.java| 4 +- 10 files changed, 227 insertions(+), 200 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/cace59f0/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/JodaTimeConverter.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/JodaTimeConverter.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/JodaTimeConverter.java deleted file mode 100644 index c2c056d..000 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/JodaTimeConverter.java +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.salesforce.api; - -import java.lang.reflect.Constructor; -import java.time.ZonedDateTime; -import java.time.format.DateTimeFormatter; -import java.time.format.DateTimeFormatterBuilder; - -import com.thoughtworks.xstream.converters.ConversionException; -import com.thoughtworks.xstream.converters.Converter; -import com.thoughtworks.xstream.converters.MarshallingContext; -import com.thoughtworks.xstream.converters.UnmarshallingContext; -import com.thoughtworks.xstream.io.HierarchicalStreamReader; -import com.thoughtworks.xstream.io.HierarchicalStreamWriter; - - -/** - * XStream converter for handling JodaTime fields. - */ -public class JodaTimeConverter implements Converter { - -private final DateTimeFormatter formatter = new DateTimeFormatterBuilder() -.appendPattern("-MM-dd'T'HH:mm:ss") -.appendOffset("+HH:mm", "Z") -.toFormatter(); - -@Override -public void marshal(Object o, HierarchicalStreamWriter writer, MarshallingContext context) { -ZonedDateTime dateTime = (ZonedDateTime) o; -writer.setValue(formatter.format(dateTime)); -} - -@Override -public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context) { -String dateTimeStr = reader.getValue(); -Class requiredType = context.getRequiredType(); -try { -return formatter.parse(dateTimeStr, ZonedDateTime::from); -} catch (Exception e) { -throw new ConversionException( -String.format("Error reading ZonedDateTime from value %s: %s", -dateTimeStr, e.getMessage()), -e); -} -} - -@Override -public boolean canConvert(Class aClass) { -return ZonedDateTime.class.isAssignableFrom(aClass); -} - -} http://git-wip-us.apache.org/repos/asf/camel/blob/cace59f0/components/camel-salesforce/camel-salesforce-comp
[16/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentConfiguration.java -- diff --git a/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentConfiguration.java b/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentConfiguration.java index c4b186d..702b11b 100644 --- a/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentConfiguration.java +++ b/components-starter/camel-quickfix-starter/src/main/java/org/apache/camel/component/quickfixj/springboot/QuickfixjComponentConfiguration.java @@ -19,6 +19,7 @@ package org.apache.camel.component.quickfixj.springboot; import java.util.Map; import org.apache.camel.component.quickfixj.QuickfixjConfiguration; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; import quickfix.LogFactory; import quickfix.MessageFactory; import quickfix.MessageStoreFactory; @@ -35,14 +36,17 @@ public class QuickfixjComponentConfiguration { /** * To use the given MessageFactory */ +@NestedConfigurationProperty private MessageFactory messageFactory; /** * To use the given LogFactory */ +@NestedConfigurationProperty private LogFactory logFactory; /** * To use the given MessageStoreFactory */ +@NestedConfigurationProperty private MessageStoreFactory messageStoreFactory; /** * To use the given map of pre configured QuickFix configurations mapped to http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java -- diff --git a/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java b/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java index ca57cd3..e35c860 100644 --- a/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java +++ b/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentAutoConfiguration.java @@ -45,6 +45,26 @@ public class RestletComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentConfiguration.java -- diff --git a/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentConfiguration.java b/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentConfiguration.java index 612d6af..83f53e3 100644 --- a/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/component/restlet/springboot/RestletComponentConfiguration.java +++ b/components-starter/camel-restlet-starter/src/main/java/org/apache/camel/co
[25/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java -- diff --git a/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java b/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java index e6576aa..237e19c 100644 --- a/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java +++ b/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java @@ -17,11 +17,12 @@ package org.apache.camel.component.cache.springboot; import net.sf.ehcache.store.MemoryStoreEvictionPolicy; -import org.apache.camel.component.cache.CacheConfiguration; import org.apache.camel.component.cache.CacheEventListenerRegistry; import org.apache.camel.component.cache.CacheLoaderRegistry; import org.apache.camel.component.cache.CacheManagerFactory; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * The cache component enables you to perform caching operations using EHCache @@ -36,71 +37,17 @@ public class CacheComponentConfiguration { * To use the given CacheManagerFactory for creating the CacheManager. By * default the DefaultCacheManagerFactory is used. */ +@NestedConfigurationProperty private CacheManagerFactory cacheManagerFactory; /** - * Sets the Cache configuration. Properties of the shared configuration can - * also be set individually. + * Sets the Cache configuration */ -private CacheConfiguration configuration; +private CacheConfigurationNestedConfiguration configuration; /** * Sets the location of the ehcache.xml file to load from classpath or file * system. By default the file is loaded from classpath:ehcache.xml */ private String configurationFile; -/** - * Name of the cache - */ -private String cacheName; -/** - * The number of elements that may be stored in the defined cache in memory. - */ -private Integer maxElementsInMemory; -/** - * Which eviction strategy to use when maximum number of elements in memory - * is reached. The strategy defines which elements to be removed. LRU - Lest - * Recently Used LFU - Lest Frequently Used FIFO - First In First Out - */ -private MemoryStoreEvictionPolicy memoryStoreEvictionPolicy; -/** - * Specifies whether cache may overflow to disk - */ -private Boolean overflowToDisk; -/** - * Sets whether elements are eternal. If eternal timeouts are ignored and - * the element never expires. - */ -private Boolean eternal; -/** - * The maximum time between creation time and when an element expires. Is - * used only if the element is not eternal - */ -private long timeToLiveSeconds; -/** - * The maximum amount of time between accesses before an element expires - */ -private long timeToIdleSeconds; -/** - * Whether the disk store persists between restarts of the application. - */ -private Boolean diskPersistent; -/** - * The number of seconds between runs of the disk expiry thread. - */ -private long diskExpiryThreadIntervalSeconds; -/** - * To configure event listeners using the CacheEventListenerRegistry - */ -private CacheEventListenerRegistry eventListenerRegistry; -/** - * To configure cache loader using the CacheLoaderRegistry - */ -private CacheLoaderRegistry cacheLoaderRegistry; -/** - * Whether to turn on allowing to store non serializable objects in the - * cache. If this option is enabled then overflow to disk cannot be enabled - * as well. - */ -private Boolean objectCache; public CacheManagerFactory getCacheManagerFactory() { return cacheManagerFactory; @@ -110,11 +57,12 @@ public class CacheComponentConfiguration { this.cacheManagerFactory = cacheManagerFactory; } -public CacheConfiguration getConfiguration() { +public CacheConfigurationNestedConfiguration getConfiguration() { return configuration; } -public void setConfiguration(CacheConfiguration configuration) { +public void setConfiguration( +CacheConfigurationNestedConfiguration configuration) { this.configuration = configuration; } @@ -126,102 +74,186 @@ public class CacheComponentConfiguration { this.configurationFile = configurationFile;
[04/26] camel git commit: Revert "CAMEL-10197: Added plain get/set to components for spring-boot configuration"
http://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java -- diff --git a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java index e80c635..9b2928b 100644 --- a/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java +++ b/components/camel-xmlsecurity/src/main/java/org/apache/camel/component/xmlsecurity/XmlSignatureComponent.java @@ -18,20 +18,10 @@ package org.apache.camel.component.xmlsecurity; import java.net.MalformedURLException; import java.net.URI; -import java.util.List; import java.util.Map; -import javax.xml.crypto.AlgorithmMethod; -import javax.xml.crypto.KeySelector; -import javax.xml.crypto.URIDereferencer; -import javax.xml.crypto.dsig.spec.XPathFilterParameterSpec; import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; -import org.apache.camel.component.xmlsecurity.api.KeyAccessor; -import org.apache.camel.component.xmlsecurity.api.ValidationFailedHandler; -import org.apache.camel.component.xmlsecurity.api.XmlSignature2Message; -import org.apache.camel.component.xmlsecurity.api.XmlSignatureChecker; -import org.apache.camel.component.xmlsecurity.api.XmlSignatureProperties; import org.apache.camel.component.xmlsecurity.processor.XmlSignerConfiguration; import org.apache.camel.component.xmlsecurity.processor.XmlVerifierConfiguration; import org.apache.camel.impl.UriEndpointComponent; @@ -63,11 +53,11 @@ public class XmlSignatureComponent extends UriEndpointComponent { name = u.getPath(); } catch (Exception e) { throw new MalformedURLException( -String.format( -"An invalid xmlsecurity uri was provided '%s'." -+ " Check the uri matches the format xmlsecurity:sign:// or xmlsecurity:verify:", -uri -) +String.format( +"An invalid xmlsecurity uri was provided '%s'." ++ " Check the uri matches the format xmlsecurity:sign:// or xmlsecurity:verify:", +uri +) ); } XmlSignatureEndpoint endpoint; @@ -79,11 +69,11 @@ public class XmlSignatureComponent extends UriEndpointComponent { endpoint = new XmlVerifierEndpoint(uri, this, config); } else { throw new IllegalStateException( -String.format( -"Endpoint uri '%s'" + " is wrong configured. Operation '%s'" -+ " is not supported. Supported operations are: sign, verify", -uri, scheme -) +String.format( +"Endpoint uri '%s'" + " is wrong configured. Operation '%s'" ++ " is not supported. Supported operations are: sign, verify", +uri, scheme +) ); } setProperties(endpoint.getConfiguration(), parameters); @@ -101,7 +91,7 @@ public class XmlSignatureComponent extends UriEndpointComponent { } /** - * To use a shared XmlSignerConfiguration configuration to use as base for configuring endpoints. Properties of the shared configuration can also be set individually. + * To use a shared XmlSignerConfiguration configuration to use as base for configuring endpoints. */ public void setSignerConfiguration(XmlSignerConfiguration signerConfiguration) { this.signerConfiguration = signerConfiguration; @@ -115,723 +105,10 @@ public class XmlSignatureComponent extends UriEndpointComponent { } /** - * To use a shared XmlVerifierConfiguration configuration to use as base for configuring endpoints. Properties of the shared configuration can also be set individually. + * To use a shared XmlVerifierConfiguration configuration to use as base for configuring endpoints. */ public void setVerifierConfiguration(XmlVerifierConfiguration verifierConfiguration) { this.verifierConfiguration = verifierConfiguration; } -public URIDereferencer getSignerUriDereferencer() { -return getSignerConfiguration().getUriDereferencer(); -} - -/** - * If you want to restrict the remote access via reference URIs, you can setSigner - * an own dereferencer. Optional parameter. If not setSigner the provider default - * dereferencer is used which can resolve URI fragments, HTTP, file and - * XPpointer URIs. - * - * Attention: The implementation is provider dependent! -
[06/26] camel git commit: Revert "CAMEL-10197: Added plain get/set to components for spring-boot configuration"
http://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailComponent.java -- diff --git a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailComponent.java b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailComponent.java index 10b5514..081d364 100644 --- a/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailComponent.java +++ b/components/camel-mail/src/main/java/org/apache/camel/component/mail/MailComponent.java @@ -19,11 +19,8 @@ package org.apache.camel.component.mail; import java.net.URI; import java.util.HashSet; import java.util.Map; -import java.util.Properties; import java.util.Set; -import javax.mail.Message; -import javax.mail.Session; import javax.mail.search.SearchTerm; import org.apache.camel.CamelContext; @@ -31,7 +28,6 @@ import org.apache.camel.Endpoint; import org.apache.camel.impl.UriEndpointComponent; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.ObjectHelper; -import org.apache.camel.util.jsse.SSLContextParameters; /** * Component for JavaMail. @@ -111,7 +107,7 @@ public class MailComponent extends UriEndpointComponent { } /** - * Sets the Mail configuration. Properties of the shared configuration can also be set individually. + * Sets the Mail configuration * * @param configuration the configuration to use by default for endpoints */ @@ -129,484 +125,4 @@ public class MailComponent extends UriEndpointComponent { public void setContentTypeResolver(ContentTypeResolver contentTypeResolver) { this.contentTypeResolver = contentTypeResolver; } - -/** - * Is the used protocol to be secure or not - */ -public boolean isSecureProtocol() { -return getConfiguration().isSecureProtocol(); -} - -public boolean isStartTlsEnabled() { -return getConfiguration().isStartTlsEnabled(); -} - -public String getMailStoreLogInformation() { -return getConfiguration().getMailStoreLogInformation(); -} - -public JavaMailSender getJavaMailSender() { -return getConfiguration().getJavaMailSender(); -} - -/** - * To use a custom {@link JavaMailSender} for sending emails. - * @param javaMailSender - */ -public void setJavaMailSender(JavaMailSender javaMailSender) { -getConfiguration().setJavaMailSender(javaMailSender); -} - -public String getHost() { -return getConfiguration().getHost(); -} - -/** - * The mail server host name - * @param host - */ -public void setHost(String host) { -getConfiguration().setHost(host); -} - -public Properties getJavaMailProperties() { -return getConfiguration().getJavaMailProperties(); -} - -/** - * Sets the java mail options. Will clear any default properties and only use the properties - * provided for this method. - * @param javaMailProperties - */ -public void setJavaMailProperties(Properties javaMailProperties) { -getConfiguration().setJavaMailProperties(javaMailProperties); -} - -public Properties getAdditionalJavaMailProperties() { -return getConfiguration().getAdditionalJavaMailProperties(); -} - -/** - * Sets additional java mail properties, that will append/override any default properties - * that is set based on all the other options. This is useful if you need to add some - * special options but want to keep the others as is. - * @param additionalJavaMailProperties - */ -public void setAdditionalJavaMailProperties(Properties additionalJavaMailProperties) { - getConfiguration().setAdditionalJavaMailProperties(additionalJavaMailProperties); -} - -public String getPassword() { -return getConfiguration().getPassword(); -} - -/** - * The password for login - * @param password - */ -public void setPassword(String password) { -getConfiguration().setPassword(password); -} - -public String getSubject() { -return getConfiguration().getSubject(); -} - -/** - * The Subject of the message being sent. Note: Setting the subject in the header takes precedence over this option. - * @param subject - */ -public void setSubject(String subject) { -getConfiguration().setSubject(subject); -} - -public int getPort() { -return getConfiguration().getPort(); -} - -/** - * The port number of the mail server - * @param port - */ -public void setPort(int port) { -getConfiguration().setPort(port); -} - -public String getProtocol() { -return getConfiguration().getProtocol(); -} - -/** - * The protocol for communicating with the mail server - * @param protocol
[05/26] camel git commit: Revert "CAMEL-10197: Added plain get/set to components for spring-boot configuration"
http://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java -- diff --git a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java index 33b814e..f515c94 100644 --- a/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java +++ b/components/camel-netty4/src/main/java/org/apache/camel/component/netty4/NettyComponent.java @@ -18,24 +18,17 @@ package org.apache.camel.component.netty4; import java.net.URI; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.util.concurrent.ThreadFactory; -import io.netty.channel.ChannelHandler; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.handler.ssl.SslHandler; import io.netty.util.concurrent.DefaultEventExecutorGroup; import io.netty.util.concurrent.EventExecutorGroup; import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; -import org.apache.camel.LoggingLevel; import org.apache.camel.impl.UriEndpointComponent; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.concurrent.CamelThreadFactory; -import org.apache.camel.util.jsse.SSLContextParameters; public class NettyComponent extends UriEndpointComponent { private NettyConfiguration configuration; @@ -109,7 +102,7 @@ public class NettyComponent extends UriEndpointComponent { } /** - * To use the NettyConfiguration as configuration when creating endpoints. Properties of the shared configuration can also be set individually. + * To use the NettyConfiguration as configuration when creating endpoints. */ public void setConfiguration(NettyConfiguration configuration) { this.configuration = configuration; @@ -165,846 +158,4 @@ public class NettyComponent extends UriEndpointComponent { super.doStop(); } -private NettyConfiguration getConfigurationOrCreate() { -if (this.getConfiguration() == null) { -this.setConfiguration(new NettyConfiguration()); -} -return this.getConfiguration(); -} - -public String getAddress() { -return getConfigurationOrCreate().getAddress(); -} - -public boolean isTcp() { -return getConfigurationOrCreate().isTcp(); -} - -public String getProtocol() { -return getConfigurationOrCreate().getProtocol(); -} - -/** - * The protocol to use which can be tcp or udp. - * @param protocol - */ -public void setProtocol(String protocol) { -getConfigurationOrCreate().setProtocol(protocol); -} - -public String getHost() { -return getConfigurationOrCreate().getHost(); -} - -/** - * The hostname. - * - * For the consumer the hostname is localhost or 0.0.0.0 - * For the producer the hostname is the remote host to connect to - * @param host - */ -public void setHost(String host) { -getConfigurationOrCreate().setHost(host); -} - -public int getPort() { -return getConfigurationOrCreate().getPort(); -} - -/** - * The host port number - * @param port - */ -public void setPort(int port) { -getConfigurationOrCreate().setPort(port); -} - -public boolean isBroadcast() { -return getConfigurationOrCreate().isBroadcast(); -} - -/** - * Setting to choose Multicast over UDP - * @param broadcast - */ -public void setBroadcast(boolean broadcast) { -getConfigurationOrCreate().setBroadcast(broadcast); -} - -public int getSendBufferSize() { -return getConfigurationOrCreate().getSendBufferSize(); -} - -/** - * The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes. - * @param sendBufferSize - */ -public void setSendBufferSize(int sendBufferSize) { -getConfigurationOrCreate().setSendBufferSize(sendBufferSize); -} - -public int getReceiveBufferSize() { -return getConfigurationOrCreate().getReceiveBufferSize(); -} - -/** - * The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes. - * @param receiveBufferSize - */ -public void setReceiveBufferSize(int receiveBufferSize) { -getConfigurationOrCreate().setReceiveBufferSize(receiveBufferSize); -} - -public int getReceiveBufferSizePredictor() { -return getConfigurationOrCreate().getReceiveBufferSizePredictor(); -} - -/** - * Configures the buffer size predictor. See details at Jetty documentation and this mail thread. - * @param receiveBufferSizePredictor - */ -public void setReceiveBufferSizePredictor(int rece
[26/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/d485f2f0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/d485f2f0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/d485f2f0 Branch: refs/heads/master Commit: d485f2f00ea356e4ad9b3062691f7349ac51de23 Parents: 89d94df Author: Dhiraj Bokde Authored: Tue Sep 20 12:48:04 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 12:50:30 2016 -0700 -- .../AhcComponentAutoConfiguration.java | 20 + .../springboot/AhcComponentConfiguration.java |6 + .../WsComponentAutoConfiguration.java | 20 + .../ws/springboot/WsComponentConfiguration.java |6 + .../AMQPComponentAutoConfiguration.java | 20 + .../springboot/AMQPComponentConfiguration.java | 49 +- .../ApnsComponentAutoConfiguration.java | 20 + .../springboot/ApnsComponentConfiguration.java |2 + .../WebsocketComponentAutoConfiguration.java| 20 + .../WebsocketComponentConfiguration.java|5 + .../AvroComponentAutoConfiguration.java | 20 + .../springboot/AvroComponentConfiguration.java | 257 +-- .../BeanstalkComponentAutoConfiguration.java| 20 + .../BeanstalkComponentConfiguration.java|2 + .../BoxComponentAutoConfiguration.java | 20 + .../springboot/BoxComponentConfiguration.java | 429 ++-- .../BraintreeComponentAutoConfiguration.java| 20 + .../BraintreeComponentConfiguration.java| 146 +- .../CacheComponentAutoConfiguration.java| 20 + .../springboot/CacheComponentConfiguration.java | 346 ++-- .../CometdComponentAutoConfiguration.java | 20 + .../CometdComponentConfiguration.java |3 + .../DirectComponentAutoConfiguration.java | 20 + .../DirectComponentConfiguration.java |6 +- .../DirectVmComponentAutoConfiguration.java | 20 + .../DirectVmComponentConfiguration.java |8 +- .../LogComponentAutoConfiguration.java | 20 + .../springboot/LogComponentConfiguration.java |2 + .../PropertiesComponentAutoConfiguration.java | 20 + .../PropertiesComponentConfiguration.java |3 + .../RestComponentAutoConfiguration.java | 20 + .../SchedulerComponentAutoConfiguration.java| 20 + .../SedaComponentAutoConfiguration.java | 20 + .../springboot/SedaComponentConfiguration.java |2 + .../StubComponentAutoConfiguration.java | 20 + .../springboot/StubComponentConfiguration.java |2 + .../ValidatorComponentAutoConfiguration.java| 20 + .../ValidatorComponentConfiguration.java|2 + .../VmComponentAutoConfiguration.java | 20 + .../vm/springboot/VmComponentConfiguration.java |2 + .../XsltComponentAutoConfiguration.java | 20 + .../springboot/XsltComponentConfiguration.java | 34 +- ...italSignatureComponentAutoConfiguration.java | 20 + .../DigitalSignatureComponentConfiguration.java | 530 ++--- .../CxfRsComponentAutoConfiguration.java| 20 + .../springboot/CxfRsComponentConfiguration.java |2 + .../CxfComponentAutoConfiguration.java | 20 + .../springboot/CxfComponentConfiguration.java |2 + .../DisruptorComponentAutoConfiguration.java| 20 + .../DisruptorVmComponentAutoConfiguration.java | 20 + .../DockerComponentAutoConfiguration.java | 20 + .../DockerComponentConfiguration.java | 221 ++- .../EjbComponentAutoConfiguration.java | 20 + ...ElasticsearchComponentAutoConfiguration.java | 20 + .../ElasticsearchComponentConfiguration.java|2 + .../ElsqlComponentAutoConfiguration.java| 20 + .../springboot/ElsqlComponentConfiguration.java |2 + .../FacebookComponentAutoConfiguration.java | 20 + .../FacebookComponentConfiguration.java | 338 +++- .../FlinkComponentAutoConfiguration.java| 20 + .../springboot/FlinkComponentConfiguration.java |5 + .../FreemarkerComponentAutoConfiguration.java | 20 + .../FreemarkerComponentConfiguration.java |2 + .../GangliaComponentAutoConfiguration.java | 20 + .../GangliaComponentConfiguration.java | 354 ++-- ...oogleCalendarComponentAutoConfiguration.java | 20 + .../GoogleCalendarComponentConfiguration.java | 157 +- .../GoogleDriveComponentAutoConfiguration.java | 20 + .../GoogleDriveComponentConfiguration.java | 118 +- .../GoogleMailComponentAutoConfiguration.java | 20 + .../GoogleMailComponentConfiguration.java | 118 +- ...GuavaEventBusComponentAutoConfiguration.java | 20 + .../GuavaEventBusComponentConfiguration.java|2 + .../HazelcastComponentAutoConfiguration.java| 20 + .../HazelcastComp
[07/26] camel git commit: Revert "CAMEL-10197: Added plain get/set to components for spring-boot configuration"
http://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java -- diff --git a/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java index 65b8b5a..c770d8f 100644 --- a/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java +++ b/components/camel-box/src/main/java/org/apache/camel/component/box/BoxComponent.java @@ -16,13 +16,6 @@ */ package org.apache.camel.component.box; -import java.util.Map; - -import com.box.boxjavalibv2.BoxConnectionManagerBuilder; -import com.box.boxjavalibv2.IBoxConfig; -import com.box.boxjavalibv2.authorization.IAuthSecureStorage; -import com.box.boxjavalibv2.authorization.OAuthRefreshListener; - import org.apache.camel.CamelContext; import org.apache.camel.Endpoint; import org.apache.camel.component.box.internal.BoxApiCollection; @@ -30,7 +23,6 @@ import org.apache.camel.component.box.internal.BoxApiName; import org.apache.camel.component.box.internal.BoxClientHelper; import org.apache.camel.component.box.internal.CachedBoxClient; import org.apache.camel.util.component.AbstractApiComponent; -import org.apache.camel.util.jsse.SSLContextParameters; /** * Represents the component that manages {@link BoxEndpoint}. @@ -65,7 +57,7 @@ public class BoxComponent extends AbstractApiComponent getHttpParams() { -return getConfigurationOrCreate().getHttpParams(); -} - -/** - * Custom HTTP params for settings like proxy host - * @param httpParams - */ -public void setHttpParams(Map httpParams) { -getConfigurationOrCreate().setHttpParams(httpParams); -} - -public SSLContextParameters getSslContextParameters() { -return getConfigurationOrCreate().getSslContextParameters(); -} - -/** - * To configure security using SSLContextParameters. - * @param sslContextParameters - */ -public void setSslContextParameters(SSLContextParameters sslContextParameters) { - getConfigurationOrCreate().setSslContextParameters(sslContextParameters); -} - -public int getLoginTimeout() { -return getConfigurationOrCreate().getLoginTimeout(); -} - -/** - * Amount of time the component will wait for a response from Box.com, default is 30 seconds - * @param loginTimeout - */ -public void setLoginTimeout(int loginTimeout) { -getConfigurationOrCreate().setLoginTimeout(loginTimeout); -} } http://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java -- diff --git a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java index 3f65ae4..8918771 100644 --- a/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java +++ b/components/camel-braintree/src/main/java/org/apache/camel/component/braintree/BraintreeComponent.java @@ -18,7 +18,6 @@ package org.apache.camel.component.braintree; import java.util.HashMap; import java.util.Map; -import java.util.logging.Level; import com.braintreegateway.BraintreeGateway; import org.apache.camel.CamelContext; @@ -56,7 +55,7 @@ public class BraintreeComponent extends AbstractApiComponenthttp://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java -- diff --git a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java index 06d5808..e482162 100755 --- a/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java +++ b/components/camel-cache/src/main/java/org/apache/camel/component/cache/CacheComponent.java @@ -76,7 +76,7 @@ public class CacheComponent extends UriEndpointComponent { } /** - * Sets the Cache configuration. Properties of the shared configuration can also be set individually. + * Sets the Cache configuration * * @param configuration the configuration to use by default for endpoints */ @@ -116,155 +116,4 @@ public class CacheComponent extends UriEndpointComponent { ServiceHelper.stopService(cacheManagerFactory); super.doStop(); } - -public String getCacheName() { -return configuration.getCacheName(); -} - -/** - * Name of the cache - * @param cacheName - */ -
[13/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components/camel-crypto/src/main/docs/crypto-component.adoc -- diff --git a/components/camel-crypto/src/main/docs/crypto-component.adoc b/components/camel-crypto/src/main/docs/crypto-component.adoc index 2cabaf3..0a993e6 100644 --- a/components/camel-crypto/src/main/docs/crypto-component.adoc +++ b/components/camel-crypto/src/main/docs/crypto-component.adoc @@ -18,7 +18,7 @@ Options ^^^ // component options: START -The Crypto (JCE) component supports 21 options which are listed below. +The Crypto (JCE) component supports 1 options which are listed below. @@ -26,27 +26,7 @@ The Crypto (JCE) component supports 21 options which are listed below. [width="100%",cols="2,1m,7",options="header"] |=== | Name | Java Type | Description -| configuration | DigitalSignatureConfiguration | To use the shared DigitalSignatureConfiguration as configuration. Properties of the shared configuration can also be set individually. -| name | String | The logical name of this operation. -| algorithm | String | Sets the JCE name of the Algorithm that should be used for the signer. -| alias | String | Sets the alias used to query the KeyStore for keys and link Certificate Certificates to be used in signing and verifying exchanges. This value can be provided at runtime via the message header link DigitalSignatureConstantsKEYSTORE_ALIAS -| privateKey | PrivateKey | Set the PrivateKey that should be used to sign the exchange -| privateKeyName | String | Sets the reference name for a PrivateKey that can be fond in the registry. -| publicKey | PublicKey | Set the PublicKey that should be used to verify the signature in the exchange. -| publicKeyName | String | Sets the reference name for a publicKey that can be fond in the registry. -| certificate | Certificate | Set the Certificate that should be used to verify the signature in the exchange based on its payload. -| certificateName | String | Sets the reference name for a PrivateKey that can be fond in the registry. -| keystore | KeyStore | Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges. A KeyStore is typically used with an alias either one supplied in the Route definition or dynamically via the message header CamelSignatureKeyStoreAlias. If no alias is supplied and there is only a single entry in the Keystore then this single entry will be used. -| keystoreName | String | Sets the reference name for a Keystore that can be fond in the registry. -| password | char[] | Sets the password used to access an aliased PrivateKey in the KeyStore. -| keyStoreParameters | KeyStoreParameters | Sets the KeyStore that can contain keys and Certficates for use in signing and verifying exchanges based on the given KeyStoreParameters. A KeyStore is typically used with an alias either one supplied in the Route definition or dynamically via the message header CamelSignatureKeyStoreAlias. If no alias is supplied and there is only a single entry in the Keystore then this single entry will be used. -| secureRandomName | String | Sets the reference name for a SecureRandom that can be fond in the registry. -| secureRandom | SecureRandom | Set the SecureRandom used to initialize the Signature service -| bufferSize | Integer | Set the size of the buffer used to read in the Exchange payload data. -| provider | String | Set the id of the security provider that provides the configured Signature algorithm. -| signatureHeaderName | String | Set the name of the message header that should be used to store the base64 encoded signature. This defaults to 'CamelDigitalSignature' -| clearHeaders | boolean | Determines if the Signature specific headers be cleared after signing and verification. Defaults to true and should only be made otherwise at your extreme peril as vital private information such as Keys and passwords may escape if unset. -| cryptoOperation | String | Set the Crypto operation from that supplied after the crypto scheme in the endpoint uri e.g. crypto:sign sets sign as the operation. +| configuration | DigitalSignatureConfiguration | To use the shared DigitalSignatureConfiguration as configuration |=== {% endraw %} // component options: END http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components/camel-docker/src/main/docs/docker-component.adoc -- diff --git a/components/camel-docker/src/main/docs/docker-component.adoc b/components/camel-docker/src/main/docs/docker-component.adoc index 0a14fc4..e03136b 100644 --- a/components/camel-docker/src/main/docs/docker-component.adoc +++ b/components/camel-docker/src/main/docs/docker-component.adoc @@ -38,7 +38,7 @@ The Do
[11/26] camel git commit: Fixed CS Errors
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/89d94df4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/89d94df4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/89d94df4 Branch: refs/heads/master Commit: 89d94df4a247ac3b7bbd8584a193d7b6cf138d94 Parents: 3c6cbf9 Author: Dhiraj Bokde Authored: Tue Sep 20 12:46:58 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 12:46:58 2016 -0700 -- .../camel/maven/packaging/ReadmeComponentMojo.java| 14 +++--- .../packaging/SpringBootAutoConfigurationMojo.java| 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/89d94df4/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java index a7a7599..d355541 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/ReadmeComponentMojo.java @@ -76,6 +76,13 @@ public class ReadmeComponentMojo extends AbstractMojo { protected File docDir; /** + * Whether to fail the build fast if any Warnings was detected. + * + * @parameter + */ +protected Boolean failFast; + +/** * build context to check changed files and mark them for refresh (used for * m2e compatibility) * @@ -84,13 +91,6 @@ public class ReadmeComponentMojo extends AbstractMojo { */ private BuildContext buildContext; -/** - * Whether to fail the build fast if any WARNINGS was detected. - * - * @parameter - */ -protected Boolean failFast; - @Override public void execute() throws MojoExecutionException, MojoFailureException { executeComponent(); http://git-wip-us.apache.org/repos/asf/camel/blob/89d94df4/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index c6068c38..7d0e89c 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -454,7 +454,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { private String propertyType; private PropertySource propertySource; -public ResolvedProperty(String propertyType, PropertySource propertySource) { +ResolvedProperty(String propertyType, PropertySource propertySource) { this.propertyType = propertyType; this.propertySource = propertySource; }
[02/26] camel git commit: CAMEL-10197: Fixed handling of arrays and enums for spring boot configuration
CAMEL-10197: Fixed handling of arrays and enums for spring boot configuration Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0f7163e9 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0f7163e9 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0f7163e9 Branch: refs/heads/master Commit: 0f7163e9f4eb501a8a9d2d53679590d289fa8165 Parents: b26d81c Author: Dhiraj Bokde Authored: Wed Aug 31 18:37:43 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 07:30:24 2016 -0700 -- .../SpringBootAutoConfigurationMojo.java| 74 ++-- 1 file changed, 51 insertions(+), 23 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/0f7163e9/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index 3a3f9f4..d1529b1 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -54,11 +54,9 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; import org.jboss.forge.roaster.Roaster; -import org.jboss.forge.roaster.model.JavaEnum; import org.jboss.forge.roaster.model.JavaType; import org.jboss.forge.roaster.model.Type; import org.jboss.forge.roaster.model.source.AnnotationSource; -import org.jboss.forge.roaster.model.source.FieldSource; import org.jboss.forge.roaster.model.source.Import; import org.jboss.forge.roaster.model.source.JavaClassSource; import org.jboss.forge.roaster.model.source.MethodSource; @@ -99,7 +97,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { /** * Classes to exclude when adding {@link NestedConfigurationProperty} annotations. */ -private static final Pattern EXCLUDE_CLASSES_PATTERN = Pattern.compile("^((java\\.)|(javax\\.)).*"); +private static final Pattern EXCLUDE_INNER_PATTERN = Pattern.compile("^((java\\.)|(javax\\.)).*"); private static final Map PRIMITIVEMAP; @@ -340,7 +338,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { } PropertySource prop = javaClass.addProperty(type, option.getName()); -if (!type.endsWith(INNER_TYPE_SUFFIX) && !EXCLUDE_CLASSES_PATTERN.matcher(type).matches() && Strings.isBlank(option.getEnumValues())) { +if (!(type.endsWith(INNER_TYPE_SUFFIX) || !(type.indexOf('[') == -1) || EXCLUDE_INNER_PATTERN.matcher(type).matches() || !Strings.isBlank(option.getEnumValues( { // add nested configuration annotation for complex properties prop.getField().addAnnotation(NestedConfigurationProperty.class); } @@ -384,20 +382,28 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { // parse option type for (PropertySource sourceProp : nestedType.getProperties()) { -final Type sourcePropType = sourceProp.getType(); final MethodSource mutator = sourceProp.getMutator(); // NOTE: fields with no setters are skipped if (mutator == null) { continue; } -final String optionType = getSimpleJavaType(sourcePropType.getQualifiedNameWithGenerics()); -final FieldSource field = sourceProp.getField(); - - +// strip array dimensions +Type propType = sourceProp.getType(); +final String optionType = getSimpleJavaType(resolveParamType(nestedType, propType.getName())); final PropertySource prop = innerClass.addProperty(optionType, sourceProp.getName()); +boolean anEnum; +Class optionClass; +if (!propType.isArray()) { +optionClass = loadClass(projectClassLoader, optionType); +anEnum = optionClass.isEnum(); +} else { +optionClass = null; +anEnum = false; +} + // add nested configuration annotation for complex properties -if (!EXCLUDE_CLASSES_PATTERN.matcher(optionType).matches() && !isEnum(projectClassLoader
[17/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java -- diff --git a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java index 6325701..bdfacc9 100644 --- a/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java +++ b/components-starter/camel-netty4-starter/src/main/java/org/apache/camel/component/netty4/springboot/NettyComponentConfiguration.java @@ -16,6 +16,7 @@ */ package org.apache.camel.component.netty4.springboot; +import java.io.File; import java.util.List; import java.util.Map; import io.netty.channel.ChannelHandler; @@ -25,12 +26,14 @@ import io.netty.handler.ssl.SslHandler; import io.netty.util.concurrent.EventExecutorGroup; import org.apache.camel.LoggingLevel; import org.apache.camel.component.netty4.ClientInitializerFactory; -import org.apache.camel.component.netty4.NettyConfiguration; +import org.apache.camel.component.netty4.NettyComponent; import org.apache.camel.component.netty4.NettyServerBootstrapFactory; import org.apache.camel.component.netty4.ServerInitializerFactory; import org.apache.camel.component.netty4.TextLineDelimiter; import org.apache.camel.util.jsse.SSLContextParameters; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Socket level networking using TCP or UDP with the Netty 4.x library. @@ -47,362 +50,13 @@ public class NettyComponentConfiguration { private Integer maximumPoolSize; /** * To use the NettyConfiguration as configuration when creating endpoints. - * Properties of the shared configuration can also be set individually. */ -private NettyConfiguration configuration; +private NettyConfigurationNestedConfiguration configuration; /** * To use the given EventExecutorGroup */ +@NestedConfigurationProperty private EventExecutorGroup executorService; -/** - * The protocol to use which can be tcp or udp. - */ -private String protocol; -/** - * The hostname. For the consumer the hostname is localhost or 0.0.0.0 For - * the producer the hostname is the remote host to connect to - */ -private String host; -/** - * The host port number - */ -private Integer port; -/** - * Setting to choose Multicast over UDP - */ -private Boolean broadcast; -/** - * The TCP/UDP buffer sizes to be used during outbound communication. Size - * is bytes. - */ -private Integer sendBufferSize; -/** - * The TCP/UDP buffer sizes to be used during inbound communication. Size is - * bytes. - */ -private Integer receiveBufferSize; -/** - * Configures the buffer size predictor. See details at Jetty documentation - * and this mail thread. - */ -private Integer receiveBufferSizePredictor; -/** - * When netty works on nio mode it uses default workerCount parameter from - * Netty which is cpu_core_threads2. User can use this operation to override - * the default workerCount from Netty - */ -private Integer workerCount; -/** - * When netty works on nio mode it uses default bossCount parameter from - * Netty which is 1. User can use this operation to override the default - * bossCount from Netty - */ -private Integer bossCount; -/** - * Setting to ensure socket is not closed due to inactivity - */ -private Boolean keepAlive; -/** - * Setting to improve TCP protocol performance - */ -private Boolean tcpNoDelay; -/** - * Setting to facilitate socket multiplexing - */ -private Boolean reuseAddress; -/** - * Time to wait for a socket connection to be available. Value is in millis. - */ -private Integer connectTimeout; -/** - * Allows to configure a backlog for netty consumer (server). Note the - * backlog is just a best effort depending on the OS. Setting this option to - * a value such as 200 500 or 1000 tells the TCP stack how long the accept - * queue can be If this option is not configured then the backlog depends on - * OS setting. - */ -private Integer backlog; -/** - * Setting to specify whether SSL encryption is applied to this endpoint - */ -private Boolean ssl; -/** - * When enabled and in SSL mode then the Netty consumer will enrich the -
[18/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-netty4-http-starter/src/main/java/org/apache/camel/component/netty4/http/springboot/NettyHttpComponentConfiguration.java -- diff --git a/components-starter/camel-netty4-http-starter/src/main/java/org/apache/camel/component/netty4/http/springboot/NettyHttpComponentConfiguration.java b/components-starter/camel-netty4-http-starter/src/main/java/org/apache/camel/component/netty4/http/springboot/NettyHttpComponentConfiguration.java index 462be0d..6d06a16 100644 --- a/components-starter/camel-netty4-http-starter/src/main/java/org/apache/camel/component/netty4/http/springboot/NettyHttpComponentConfiguration.java +++ b/components-starter/camel-netty4-http-starter/src/main/java/org/apache/camel/component/netty4/http/springboot/NettyHttpComponentConfiguration.java @@ -16,23 +16,15 @@ */ package org.apache.camel.component.netty4.http.springboot; -import java.util.List; -import java.util.Map; -import io.netty.channel.ChannelHandler; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.group.ChannelGroup; -import io.netty.handler.ssl.SslHandler; import io.netty.util.concurrent.EventExecutorGroup; import org.apache.camel.LoggingLevel; -import org.apache.camel.component.netty4.ClientInitializerFactory; import org.apache.camel.component.netty4.NettyConfiguration; -import org.apache.camel.component.netty4.NettyServerBootstrapFactory; -import org.apache.camel.component.netty4.ServerInitializerFactory; import org.apache.camel.component.netty4.http.NettyHttpBinding; -import org.apache.camel.component.netty4.http.NettyHttpSecurityConfiguration; +import org.apache.camel.component.netty4.http.SecurityAuthenticator; +import org.apache.camel.component.netty4.http.SecurityConstraint; import org.apache.camel.spi.HeaderFilterStrategy; -import org.apache.camel.util.jsse.SSLContextParameters; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Netty HTTP server and client using the Netty 4.x library. @@ -46,18 +38,20 @@ public class NettyHttpComponentConfiguration { * To use a custom org.apache.camel.component.netty4.http.NettyHttpBinding * for binding to/from Netty and Camel Message API. */ +@NestedConfigurationProperty private NettyHttpBinding nettyHttpBinding; /** * To use a custom org.apache.camel.spi.HeaderFilterStrategy to filter * headers. */ +@NestedConfigurationProperty private HeaderFilterStrategy headerFilterStrategy; /** * Refers to a * org.apache.camel.component.netty4.http.NettyHttpSecurityConfiguration for * configuring secure web resources. */ -private NettyHttpSecurityConfiguration securityConfiguration; +private NettyHttpSecurityConfigurationNestedConfiguration securityConfiguration; /** * The thread pool size for the EventExecutorGroup if its in use. The * default value is 16. @@ -65,290 +59,14 @@ public class NettyHttpComponentConfiguration { private Integer maximumPoolSize; /** * To use the NettyConfiguration as configuration when creating endpoints. - * Properties of the shared configuration can also be set individually. */ +@NestedConfigurationProperty private NettyConfiguration configuration; /** * To use the given EventExecutorGroup */ +@NestedConfigurationProperty private EventExecutorGroup executorService; -/** - * The protocol to use which can be tcp or udp. - */ -private String protocol; -/** - * The hostname. For the consumer the hostname is localhost or 0.0.0.0 For - * the producer the hostname is the remote host to connect to - */ -private String host; -/** - * The host port number - */ -private Integer port; -/** - * The TCP/UDP buffer sizes to be used during outbound communication. Size - * is bytes. - */ -private Integer sendBufferSize; -/** - * The TCP/UDP buffer sizes to be used during inbound communication. Size is - * bytes. - */ -private Integer receiveBufferSize; -/** - * Configures the buffer size predictor. See details at Jetty documentation - * and this mail thread. - */ -private Integer receiveBufferSizePredictor; -/** - * When netty works on nio mode it uses default workerCount parameter from - * Netty which is cpu_core_threads2. User can use this operation to override - * the default workerCount from Netty - */ -private Integer workerCount; -/** - * When netty works on nio mode it uses default bossCount parameter from - * Netty which is 1. User can use this operation to override the default - * bossCount from Netty - */ -private Integer bossCount; -/** - * Se
[14/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java -- diff --git a/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java b/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java index 6e18352..5af3cc4 100644 --- a/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java +++ b/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentAutoConfiguration.java @@ -45,6 +45,26 @@ public class UndertowComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java -- diff --git a/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java b/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java index 4bece05..a03aa81 100644 --- a/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java +++ b/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java @@ -19,6 +19,7 @@ package org.apache.camel.component.undertow.springboot; import org.apache.camel.component.undertow.UndertowHttpBinding; import org.apache.camel.util.jsse.SSLContextParameters; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * The undertow component provides HTTP-based endpoints for consuming and @@ -33,10 +34,12 @@ public class UndertowComponentConfiguration { * To use a custom HttpBinding to control the mapping between Camel message * and HttpClient. */ +@NestedConfigurationProperty private UndertowHttpBinding undertowHttpBinding; /** * To configure security using SSLContextParameters */ +@NestedConfigurationProperty private SSLContextParameters sslContextParameters; public UndertowHttpBinding getUndertowHttpBinding() { http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-velocity-starter/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java -- diff --git a/components-starter/camel-velocity-starter/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java b/components-starter/camel-velocity-starter/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java index be0b585..46b851b 100644 --- a/components-starter/camel-velocity-starter/src/main/java/org/apache/camel/component/velocity/springboot/VelocityComponentAutoConfiguration.java +++ b/components-starter/camel-velocity-starter/src/main/java/org/apache/camel/component/velocity/springboot/
[12/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components/camel-netty4/src/main/docs/netty4-component.adoc -- diff --git a/components/camel-netty4/src/main/docs/netty4-component.adoc b/components/camel-netty4/src/main/docs/netty4-component.adoc index 8ff2fce..fed269d 100644 --- a/components/camel-netty4/src/main/docs/netty4-component.adoc +++ b/components/camel-netty4/src/main/docs/netty4-component.adoc @@ -59,7 +59,7 @@ Options // component options: START -The Netty4 component supports 69 options which are listed below. +The Netty4 component supports 3 options which are listed below. @@ -68,74 +68,8 @@ The Netty4 component supports 69 options which are listed below. |=== | Name | Java Type | Description | maximumPoolSize | int | The thread pool size for the EventExecutorGroup if its in use. The default value is 16. -| configuration | NettyConfiguration | To use the NettyConfiguration as configuration when creating endpoints. Properties of the shared configuration can also be set individually. +| configuration | NettyConfiguration | To use the NettyConfiguration as configuration when creating endpoints. | executorService | EventExecutorGroup | To use the given EventExecutorGroup -| protocol | String | The protocol to use which can be tcp or udp. -| host | String | The hostname. For the consumer the hostname is localhost or 0.0.0.0 For the producer the hostname is the remote host to connect to -| port | int | The host port number -| broadcast | boolean | Setting to choose Multicast over UDP -| sendBufferSize | int | The TCP/UDP buffer sizes to be used during outbound communication. Size is bytes. -| receiveBufferSize | int | The TCP/UDP buffer sizes to be used during inbound communication. Size is bytes. -| receiveBufferSizePredictor | int | Configures the buffer size predictor. See details at Jetty documentation and this mail thread. -| workerCount | int | When netty works on nio mode it uses default workerCount parameter from Netty which is cpu_core_threads2. User can use this operation to override the default workerCount from Netty -| bossCount | int | When netty works on nio mode it uses default bossCount parameter from Netty which is 1. User can use this operation to override the default bossCount from Netty -| keepAlive | boolean | Setting to ensure socket is not closed due to inactivity -| tcpNoDelay | boolean | Setting to improve TCP protocol performance -| reuseAddress | boolean | Setting to facilitate socket multiplexing -| connectTimeout | int | Time to wait for a socket connection to be available. Value is in millis. -| backlog | int | Allows to configure a backlog for netty consumer (server). Note the backlog is just a best effort depending on the OS. Setting this option to a value such as 200 500 or 1000 tells the TCP stack how long the accept queue can be If this option is not configured then the backlog depends on OS setting. -| ssl | boolean | Setting to specify whether SSL encryption is applied to this endpoint -| sslClientCertHeaders | boolean | When enabled and in SSL mode then the Netty consumer will enrich the Camel Message with headers having information about the client certificate such as subject name issuer name serial number and the valid date range. -| sslHandler | SslHandler | Reference to a class that could be used to return an SSL Handler -| sslContextParameters | SSLContextParameters | To configure security using SSLContextParameters -| needClientAuth | boolean | Configures whether the server needs client authentication when using SSL. -| keyStoreResource | String | Client side certificate keystore to be used for encryption. Is loaded by default from classpath but you can prefix with classpath: file: or http: to load the resource from different systems. -| trustStoreResource | String | Server side certificate keystore to be used for encryption. Is loaded by default from classpath but you can prefix with classpath: file: or http: to load the resource from different systems. -| keyStoreFormat | String | Keystore format to be used for payload encryption. Defaults to JKS if not set -| securityProvider | String | Security provider to be used for payload encryption. Defaults to SunX509 if not set. -| passphrase | String | Password setting to use in order to encrypt/decrypt payloads sent using SSH -| serverInitializerFactory | ServerInitializerFactory | To use a custom ServerInitializerFactory -| nettyServerBootstrapFactory | NettyServerBootstrapFactory | To use a custom NettyServerBootstrapFactory -| requestTimeout | long | Allows to use a timeout for the Netty producer when calling a remote server. By default no timeout is in use. The value is in milli seconds so eg 3 is 30 seconds. The requestTimeout is using Netty's ReadTimeoutHandler to trigger the timeout. -| sync | boolean
[19/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-netty-starter/src/main/java/org/apache/camel/component/netty/springboot/NettyComponentConfiguration.java -- diff --git a/components-starter/camel-netty-starter/src/main/java/org/apache/camel/component/netty/springboot/NettyComponentConfiguration.java b/components-starter/camel-netty-starter/src/main/java/org/apache/camel/component/netty/springboot/NettyComponentConfiguration.java index 79e95db..4627381 100644 --- a/components-starter/camel-netty-starter/src/main/java/org/apache/camel/component/netty/springboot/NettyComponentConfiguration.java +++ b/components-starter/camel-netty-starter/src/main/java/org/apache/camel/component/netty/springboot/NettyComponentConfiguration.java @@ -16,11 +16,12 @@ */ package org.apache.camel.component.netty.springboot; +import java.io.File; import java.util.List; import java.util.Map; import org.apache.camel.LoggingLevel; import org.apache.camel.component.netty.ClientPipelineFactory; -import org.apache.camel.component.netty.NettyConfiguration; +import org.apache.camel.component.netty.NettyComponent; import org.apache.camel.component.netty.NettyServerBootstrapFactory; import org.apache.camel.component.netty.ServerPipelineFactory; import org.apache.camel.component.netty.TextLineDelimiter; @@ -31,6 +32,8 @@ import org.jboss.netty.channel.socket.nio.BossPool; import org.jboss.netty.channel.socket.nio.WorkerPool; import org.jboss.netty.handler.ssl.SslHandler; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * Socket level networking using TCP or UDP with the Netty 3.x library. @@ -42,351 +45,20 @@ public class NettyComponentConfiguration { /** * To use the NettyConfiguration as configuration when creating endpoints. - * Properties of the shared configuration can also be set individually. */ -private NettyConfiguration configuration; +private NettyConfigurationNestedConfiguration configuration; /** * The core pool size for the ordered thread pool if its in use. The default * value is 16. */ private Integer maximumPoolSize; -/** - * Whether to use ordered thread pool to ensure events are processed orderly - * on the same channel. See details at the netty javadoc of - * org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor - * for more details. - */ -private Boolean orderedThreadPoolExecutor; -/** - * Sets the cap on the number of objects that can be allocated by the pool - * (checked out to clients or idle awaiting checkout) at a given time. Use a - * negative value for no limit. - */ -private Integer producerPoolMaxActive; -/** - * Sets the minimum number of instances allowed in the producer pool before - * the evictor thread (if active) spawns new objects. - */ -private Integer producerPoolMinIdle; -/** - * Sets the cap on the number of idle instances in the pool. - */ -private Integer producerPoolMaxIdle; -/** - * Sets the minimum amount of time (value in millis) an object may sit idle - * in the pool before it is eligible for eviction by the idle object - * evictor. - */ -private long producerPoolMinEvictableIdle; -/** - * Whether producer pool is enabled or not. Important: Do not turn this off - * as the pooling is needed for handling concurrency and reliable - * request/reply. - */ -private Boolean producerPoolEnabled; -/** - * This option supports connection less udp sending which is a real fire and - * forget. A connected udp send receive the PortUnreachableException if no - * one is listen on the receiving port. - */ -private Boolean udpConnectionlessSending; -/** - * If the clientMode is true netty consumer will connect the address as a - * TCP client. - */ -private Boolean clientMode; -/** - * If the useChannelBuffer is true netty producer will turn the message body - * into ChannelBuffer before sending it out. - */ -private Boolean useChannelBuffer; -/** - * The maximum total size of the queued events per channel when using - * orderedThreadPoolExecutor. Specify 0 to disable. - */ -private long maxChannelMemorySize; -/** - * The maximum total size of the queued events for this pool when using - * orderedThreadPoolExecutor. Specify 0 to disable. - */ -private long maxTotalMemorySize; -/** - * The protocol to use which can be tcp or udp. - */ -private String protocol; -/** - * The hostname. For the consumer the hostname is localhost or 0.0.0.0 For - * the produc
[20/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java -- diff --git a/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java b/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java index 59767c4..b879db6 100644 --- a/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java +++ b/components-starter/camel-mqtt-starter/src/main/java/org/apache/camel/component/mqtt/springboot/MQTTComponentAutoConfiguration.java @@ -44,6 +44,26 @@ public class MQTTComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java -- diff --git a/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java b/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java index 491f2e1..760879e 100644 --- a/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java +++ b/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentAutoConfiguration.java @@ -44,6 +44,26 @@ public class MsvComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentConfiguration.java -- diff --git a/components-starter/camel-msv-starter/src/main/java/org/apache/camel/component/validator/msv/springboot/MsvComponentConfiguration.java b/components-starter/camel-msv-starter/src/main/jav
[22/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java -- diff --git a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java index 504de2d..5bddc33 100644 --- a/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java +++ b/components-starter/camel-jms-starter/src/main/java/org/apache/camel/component/jms/springboot/JmsComponentConfiguration.java @@ -19,15 +19,20 @@ package org.apache.camel.component.jms.springboot; import javax.jms.ConnectionFactory; import javax.jms.ExceptionListener; import org.apache.camel.LoggingLevel; +import org.apache.camel.component.jms.ConsumerType; import org.apache.camel.component.jms.DefaultTaskExecutorType; -import org.apache.camel.component.jms.JmsConfiguration; +import org.apache.camel.component.jms.JmsComponent; import org.apache.camel.component.jms.JmsKeyFormatStrategy; +import org.apache.camel.component.jms.JmsMessageType; +import org.apache.camel.component.jms.JmsProviderMetadata; import org.apache.camel.component.jms.MessageCreatedStrategy; +import org.apache.camel.component.jms.MessageListenerContainerFactory; import org.apache.camel.component.jms.QueueBrowseStrategy; import org.apache.camel.component.jms.ReplyToType; import org.apache.camel.spi.HeaderFilterStrategy; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; +import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.context.ApplicationContext; import org.springframework.core.task.TaskExecutor; import org.springframework.jms.core.JmsOperations; @@ -48,7 +53,7 @@ public class JmsComponentConfiguration { /** * To use a shared JMS configuration */ -private JmsConfiguration configuration; +private JmsConfigurationNestedConfiguration configuration; /** * Specifies whether the consumer accept messages while it is stopping. You * may consider enabling this option if you start and stop JMS routes at @@ -179,6 +184,7 @@ public class JmsComponentConfiguration { * errorHandlerLogStackTrace options. This makes it much easier to configure * than having to code a custom errorHandler. */ +@NestedConfigurationProperty private ErrorHandler errorHandler; /** * Allows to configure the default errorHandler logging level for logging @@ -249,6 +255,7 @@ public class JmsComponentConfiguration { * org.springframework.jms.support.converter.MessageConverter so you can be * in control how to map to/from a javax.jms.Message. */ +@NestedConfigurationProperty private MessageConverter messageConverter; /** * Specifies whether Camel should auto map the received JMS message to a @@ -292,13 +299,13 @@ public class JmsComponentConfiguration { /** * The timeout for receiving messages (in milliseconds). */ -private long receiveTimeout; +private Long receiveTimeout; /** * Specifies the interval between recovery attempts i.e. when a connection * is being refreshed in milliseconds. The default is 5000 ms that is 5 * seconds. */ -private long recoveryInterval; +private Long recoveryInterval; /** * Deprecated: Enabled by default if you specify a durableSubscriptionName * and a clientId. @@ -308,12 +315,13 @@ public class JmsComponentConfiguration { /** * Allows you to specify a custom task executor for consuming messages. */ +@NestedConfigurationProperty private TaskExecutor taskExecutor; /** * When sending messages specifies the time-to-live of the message (in * milliseconds). */ -private long timeToLive; +private Long timeToLive; /** * Specifies whether to use transacted mode */ @@ -326,6 +334,7 @@ public class JmsComponentConfiguration { /** * The Spring transaction manager to use. */ +@NestedConfigurationProperty private PlatformTransactionManager transactionManager; /** * The name of the transaction to use. @@ -376,7 +385,7 @@ public class JmsComponentConfiguration { * and thus have per message individual timeout values. See also the * requestTimeoutCheckerInterval option. */ -private long requestTimeout; +private Long requestTimeout; /** * Configures how often Camel should check for timed out Exchanges when * doing request/reply over JMS. By default Camel checks once per secon
[15/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentConfiguration.java -- diff --git a/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentConfiguration.java b/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentConfiguration.java index f7d9cc8..6f9d239 100644 --- a/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentConfiguration.java +++ b/components-starter/camel-smpp-starter/src/main/java/org/apache/camel/component/smpp/springboot/SmppComponentConfiguration.java @@ -17,10 +17,11 @@ package org.apache.camel.component.smpp.springboot; import java.util.Map; -import org.apache.camel.component.smpp.SmppConfiguration; +import org.apache.camel.component.smpp.SmppComponent; import org.apache.camel.component.smpp.SmppSplittingPolicy; import org.jsmpp.session.SessionStateListener; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * To send and receive SMS using a SMSC (Short Message Service Center). @@ -31,509 +32,604 @@ import org.springframework.boot.context.properties.ConfigurationProperties; public class SmppComponentConfiguration { /** - * To use the shared SmppConfiguration as configuration. Properties of the - * shared configuration can also be set individually. + * To use the shared SmppConfiguration as configuration. */ -private SmppConfiguration configuration; -/** - * Hostname for the SMSC server to use. - */ -private String host; -/** - * Port number for the SMSC server to use. - */ -private Integer port; -/** - * The system id (username) for connecting to SMSC server. - */ -private String systemId; -/** - * Defines the data coding according the SMPP 3.4 specification section - * 5.2.19. Example data encodings are: 0: SMSC Default Alphabet 3: Latin 1 - * (ISO-8859-1) 4: Octet unspecified (8-bit binary) 8: UCS2 (ISO/IEC-10646) - * 13: Extended Kanji JIS(X 0212-1990) - */ -private Byte dataCoding; -/** - * Defines encoding of data according the SMPP 3.4 specification section - * 5.2.19. 0: SMSC Default Alphabet 4: 8 bit Alphabet 8: UCS2 Alphabet - */ -private Byte alphabet; -/** - * Defines the encoding scheme of the short message user data. Only for - * SubmitSm ReplaceSm and SubmitMulti. - */ -private String encoding; -/** - * The password for connecting to SMSC server. - */ -private String password; -/** - * Defines the interval in milliseconds between the confidence checks. The - * confidence check is used to test the communication path between an ESME - * and an SMSC. - */ -private Integer enquireLinkTimer; -/** - * Defines the maximum period of inactivity allowed after a transaction - * after which an SMPP entity may assume that the session is no longer - * active. This timer may be active on either communicating SMPP entity - * (i.e. SMSC or ESME). - */ -private Integer transactionTimer; -/** - * This parameter is used to categorize the type of ESME (External Short - * Message Entity) that is binding to the SMSC (max. 13 characters). - */ -private String systemType; -/** - * Is used to request an SMSC delivery receipt and/or SME originated - * acknowledgements. The following values are defined: 0: No SMSC delivery - * receipt requested. 1: SMSC delivery receipt requested where final - * delivery outcome is success or failure. 2: SMSC delivery receipt - * requested where the final delivery outcome is delivery failure. - */ -private Byte registeredDelivery; -/** - * The service type parameter can be used to indicate the SMS Application - * service associated with the message. The following generic service_types - * are defined: CMT: Cellular Messaging CPT: Cellular Paging VMN: Voice Mail - * Notification VMA: Voice Mail Alerting WAP: Wireless Application Protocol - * USSD: Unstructured Supplementary Services Data - */ -private String serviceType; -/** - * Defines the type of number (TON) to be used in the SME originator address - * parameters. The following TON values are defined: 0: Unknown 1: - * International 2: National 3: Network Specific 4: Subscriber Number 5: - * Alphanumeric 6: Abbreviated - */ -private Byte sourceAddrTon; -/** - * Defines the type of number (TON) to be used in the SME destination - * address parameters. Only for SubmitSm SubmitMulti CancelSm and DataSm. - * The f
[03/26] camel git commit: CAMEL-10197: Exclude abstract classes and classes with no fields from being converted into nested configuration property classes for spring boot
CAMEL-10197: Exclude abstract classes and classes with no fields from being converted into nested configuration property classes for spring boot Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fa6ee0b0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fa6ee0b0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fa6ee0b0 Branch: refs/heads/master Commit: fa6ee0b0cb60f21f4117b240942081b9e69a2ccd Parents: 0f7163e Author: Dhiraj Bokde Authored: Fri Sep 2 10:21:48 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 07:30:24 2016 -0700 -- .../SpringBootAutoConfigurationMojo.java| 69 +++- 1 file changed, 54 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fa6ee0b0/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index d1529b1..c6068c38 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -24,6 +24,7 @@ import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; +import java.util.AbstractCollection; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -333,7 +334,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { type = getSimpleJavaType(type); // generate inner class for non-primitive options -if (isNestedProperty(type, project, nestedTypes)) { +if (isNestedProperty(type, nestedTypes)) { type = option.getShortJavaType() + INNER_TYPE_SUFFIX; } @@ -380,18 +381,14 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { .setLiteralInitializer(nestedType.getCanonicalName() + ".class"); // parse option type -for (PropertySource sourceProp : nestedType.getProperties()) { +for (ResolvedProperty resolvedProperty : getProperties(nestedType)) { -final MethodSource mutator = sourceProp.getMutator(); -// NOTE: fields with no setters are skipped -if (mutator == null) { -continue; -} +String optionType = resolvedProperty.propertyType; +PropertySource sourceProp = resolvedProperty.propertySource; -// strip array dimensions Type propType = sourceProp.getType(); -final String optionType = getSimpleJavaType(resolveParamType(nestedType, propType.getName())); final PropertySource prop = innerClass.addProperty(optionType, sourceProp.getName()); + boolean anEnum; Class optionClass; if (!propType.isArray()) { @@ -415,6 +412,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { } String description = null; +final MethodSource mutator = sourceProp.getMutator(); if (mutator.hasJavaDoc()) { description = mutator.getJavaDoc().getFullText(); } else if (sourceProp.hasField()) { @@ -451,6 +449,34 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { writeSourceIfChanged(javaClass, fileName); } +// resolved property type name and property source, Roaster doesn't resolve inner classes correctly +private class ResolvedProperty { +private String propertyType; +private PropertySource propertySource; + +public ResolvedProperty(String propertyType, PropertySource propertySource) { +this.propertyType = propertyType; +this.propertySource = propertySource; +} +} + +// get properties for nested type and super types, only properties with setters are supported!!! +private List getProperties(JavaClassSource nestedType) { +final List properties = new ArrayList<>(); +final Set names = new HashSet<>(); +do { +for (PropertySource propertySource : nestedType.getProperties()) { +// NOTE: fields with no setters are skipped +if (propertySo
[21/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentConfiguration.java -- diff --git a/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentConfiguration.java b/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentConfiguration.java index c534089..38cd520 100644 --- a/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentConfiguration.java +++ b/components-starter/camel-linkedin-starter/src/main/java/org/apache/camel/component/linkedin/springboot/LinkedInComponentConfiguration.java @@ -17,11 +17,11 @@ package org.apache.camel.component.linkedin.springboot; import java.util.Map; -import org.apache.camel.component.linkedin.LinkedInConfiguration; import org.apache.camel.component.linkedin.api.OAuthScope; import org.apache.camel.component.linkedin.api.OAuthSecureStorage; import org.apache.camel.component.linkedin.internal.LinkedInApiName; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * The linkedin component is uses for retrieving LinkedIn user profiles @@ -35,153 +35,161 @@ public class LinkedInComponentConfiguration { /** * To use the shared configuration */ -private LinkedInConfiguration configuration; -/** - * What kind of operation to perform - */ -private LinkedInApiName apiName; -/** - * What sub operation to use for the selected operation - */ -private String methodName; -/** - * LinkedIn user account name MUST be provided - */ -private String userName; -/** - * LinkedIn account password - */ -private String userPassword; -/** - * Callback interface for providing an OAuth token or to store the token - * generated by the component. The callback should return null on the first - * call and then save the created token in the saveToken() callback. If the - * callback returns null the first time a userPassword MUST be provided - */ -private OAuthSecureStorage secureStorage; -/** - * LinkedIn application client ID - */ -private String clientId; -/** - * LinkedIn application client secret - */ -private String clientSecret; -/** - * List of LinkedIn scopes as specified at - * https://developer.linkedin.com/documents/authenticationgranting - */ -private OAuthScope[] scopes; -/** - * Application redirect URI although the component never redirects to this - * page to avoid having to have a functioning redirect server. So for - * testing one could use https://localhost - */ -private String redirectUri; -/** - * Custom HTTP params for example proxy host and port use constants from - * AllClientPNames - */ -private Map httpParams; -/** - * Flag to enable/disable lazy OAuth default is true. when enabled OAuth - * token retrieval or generation is not done until the first REST call - */ -private Boolean lazyAuth; +private LinkedInConfigurationNestedConfiguration configuration; -public LinkedInConfiguration getConfiguration() { +public LinkedInConfigurationNestedConfiguration getConfiguration() { return configuration; } -public void setConfiguration(LinkedInConfiguration configuration) { +public void setConfiguration( +LinkedInConfigurationNestedConfiguration configuration) { this.configuration = configuration; } -public LinkedInApiName getApiName() { -return apiName; -} - -public void setApiName(LinkedInApiName apiName) { -this.apiName = apiName; -} - -public String getMethodName() { -return methodName; -} - -public void setMethodName(String methodName) { -this.methodName = methodName; -} - -public String getUserName() { -return userName; -} - -public void setUserName(String userName) { -this.userName = userName; -} - -public String getUserPassword() { -return userPassword; -} - -public void setUserPassword(String userPassword) { -this.userPassword = userPassword; -} - -public OAuthSecureStorage getSecureStorage() { -return secureStorage; -} - -public void setSecureStorage(OAuthSecureStorage secureStorage) { -this.secureStorage = secureStorage; -} - -public String getClientId() { -return clientId; -} - -public void setClientId(String clientId) { -this.clientId = clientId; -} - -public String getClientSecret() { -
[01/26] camel git commit: CAMEL-10197: Added support for creating Spring auto configuration inner classes to avoid flattening endpoint options into component classes
Repository: camel Updated Branches: refs/heads/master 8526fab4b -> d485f2f00 CAMEL-10197: Added support for creating Spring auto configuration inner classes to avoid flattening endpoint options into component classes Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b26d81c8 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b26d81c8 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b26d81c8 Branch: refs/heads/master Commit: b26d81c891af4185505a42dd85d454ff9e5eceea Parents: 8526fab Author: Dhiraj Bokde Authored: Wed Aug 31 09:05:35 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 07:30:23 2016 -0700 -- .../maven/camel-package-maven-plugin/pom.xml| 4 + .../SpringBootAutoConfigurationMojo.java| 256 +++ 2 files changed, 212 insertions(+), 48 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/b26d81c8/tooling/maven/camel-package-maven-plugin/pom.xml -- diff --git a/tooling/maven/camel-package-maven-plugin/pom.xml b/tooling/maven/camel-package-maven-plugin/pom.xml index 7ad0e39..de96be4 100644 --- a/tooling/maven/camel-package-maven-plugin/pom.xml +++ b/tooling/maven/camel-package-maven-plugin/pom.xml @@ -130,6 +130,10 @@ org.slf4j slf4j-log4j12 + + org.apache.camel + spi-annotations + http://git-wip-us.apache.org/repos/asf/camel/blob/b26d81c8/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index 1ca1616..3a3f9f4 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -18,16 +18,24 @@ package org.apache.camel.maven.packaging; import java.io.File; import java.io.FileInputStream; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TreeSet; +import java.util.regex.Pattern; import java.util.stream.Collectors; import org.apache.camel.maven.packaging.model.ComponentModel; @@ -37,6 +45,8 @@ import org.apache.camel.maven.packaging.model.DataFormatOptionModel; import org.apache.camel.maven.packaging.model.EndpointOptionModel; import org.apache.camel.maven.packaging.model.LanguageModel; import org.apache.camel.maven.packaging.model.LanguageOptionModel; +import org.apache.camel.spi.UriParam; +import org.apache.camel.spi.UriPath; import org.apache.commons.io.FileUtils; import org.apache.maven.model.Resource; import org.apache.maven.plugin.AbstractMojo; @@ -44,7 +54,11 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.project.MavenProject; import org.jboss.forge.roaster.Roaster; +import org.jboss.forge.roaster.model.JavaEnum; +import org.jboss.forge.roaster.model.JavaType; +import org.jboss.forge.roaster.model.Type; import org.jboss.forge.roaster.model.source.AnnotationSource; +import org.jboss.forge.roaster.model.source.FieldSource; import org.jboss.forge.roaster.model.source.Import; import org.jboss.forge.roaster.model.source.JavaClassSource; import org.jboss.forge.roaster.model.source.MethodSource; @@ -54,6 +68,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.context.properties.DeprecatedConfigurationProperty; import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -64,6 +79,7 @@ import static org.apache.camel.maven.packaging.PackageHelper.loadText; * Generate Spring Boot auto configuration files for Camel c
[24/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java -- diff --git a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java index 03c9496..b6adb12 100644 --- a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java +++ b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/springboot/DisruptorComponentAutoConfiguration.java @@ -45,6 +45,26 @@ public class DisruptorComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java -- diff --git a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java index 44a630e..3cb6920 100644 --- a/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java +++ b/components-starter/camel-disruptor-starter/src/main/java/org/apache/camel/component/disruptor/vm/springboot/DisruptorVmComponentAutoConfiguration.java @@ -45,6 +45,26 @@ public class DisruptorVmComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-docker-starter/src/main/java/org/apache/camel/component/docker/springboot/DockerComponentAutoConfiguration.java -- diff --git a/components-starter/camel-docker
[23/26] camel git commit: CAMEL-10197: Regenerated asciidoc and spring-boot starter configuration with NestedConfiguration support
http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-guava-eventbus-starter/src/main/java/org/apache/camel/component/guava/eventbus/springboot/GuavaEventBusComponentConfiguration.java -- diff --git a/components-starter/camel-guava-eventbus-starter/src/main/java/org/apache/camel/component/guava/eventbus/springboot/GuavaEventBusComponentConfiguration.java b/components-starter/camel-guava-eventbus-starter/src/main/java/org/apache/camel/component/guava/eventbus/springboot/GuavaEventBusComponentConfiguration.java index 932a8b5..800e994 100644 --- a/components-starter/camel-guava-eventbus-starter/src/main/java/org/apache/camel/component/guava/eventbus/springboot/GuavaEventBusComponentConfiguration.java +++ b/components-starter/camel-guava-eventbus-starter/src/main/java/org/apache/camel/component/guava/eventbus/springboot/GuavaEventBusComponentConfiguration.java @@ -18,6 +18,7 @@ package org.apache.camel.component.guava.eventbus.springboot; import com.google.common.eventbus.EventBus; import org.springframework.boot.context.properties.ConfigurationProperties; +import org.springframework.boot.context.properties.NestedConfigurationProperty; /** * The guava-eventbus component provides integration bridge between Camel and @@ -31,6 +32,7 @@ public class GuavaEventBusComponentConfiguration { /** * To use the given Guava EventBus instance */ +@NestedConfigurationProperty private EventBus eventBus; /** * The interface with method(s) marked with the Subscribe annotation. http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentAutoConfiguration.java -- diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentAutoConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentAutoConfiguration.java index 1b6f679..2d54892 100644 --- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentAutoConfiguration.java +++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentAutoConfiguration.java @@ -45,6 +45,26 @@ public class HazelcastComponentAutoConfiguration { Map parameters = new HashMap<>(); IntrospectionSupport.getProperties(configuration, parameters, null, false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredField( +"CAMEL_NESTED_CLASS").get(null); +HashMap nestedParameters = new HashMap<>(); +IntrospectionSupport.getProperties(value, nestedParameters, +null, false); +Object nestedProperty = nestedClass.newInstance(); +IntrospectionSupport.setProperties(camelContext, +camelContext.getTypeConverter(), nestedProperty, +nestedParameters); +entry.setValue(nestedProperty); +} catch (NoSuchFieldException e) { +} +} +} IntrospectionSupport.setProperties(camelContext, camelContext.getTypeConverter(), component, parameters); return component; http://git-wip-us.apache.org/repos/asf/camel/blob/d485f2f0/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentConfiguration.java -- diff --git a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentConfiguration.java b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentConfiguration.java index 2a418f7..484b309 100644 --- a/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentConfiguration.java +++ b/components-starter/camel-hazelcast-starter/src/main/java/org/apache/camel/component/hazelcast/springboot/HazelcastComponentConfiguration.java @@ -18,6 +18,7 @@ package org.apache.camel.component.hazelcast.springboot; import com.hazelcast.core.HazelcastInstance; import org.sp
[08/26] camel git commit: Revert "CAMEL-10197: Added plain get/set to components for spring-boot configuration"
Revert "CAMEL-10197: Added plain get/set to components for spring-boot configuration" This reverts commit bdab2fc632afa9270a7ca79ea55952887e56f644. Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/a04fb15b Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/a04fb15b Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/a04fb15b Branch: refs/heads/master Commit: a04fb15ba8cee420fda7692b0262b35af04749ea Parents: fa6ee0b Author: Dhiraj Bokde Authored: Tue Sep 20 05:45:47 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 07:31:14 2016 -0700 -- .../BraintreeComponentConfiguration.java| 136 +-- .../FacebookComponentConfiguration.java | 329 +-- .../GoogleCalendarComponentConfiguration.java | 145 +--- .../GoogleDriveComponentConfiguration.java | 106 +-- .../GoogleMailComponentConfiguration.java | 106 +-- .../KestrelComponentConfiguration.java | 36 - .../LuceneComponentConfiguration.java | 84 +- .../NagiosComponentConfiguration.java | 76 +- .../Olingo2ComponentConfiguration.java | 137 +-- .../XmlSignatureComponentConfiguration.java | 662 +-- .../camel/component/avro/AvroComponent.java | 147 +--- .../camel/component/box/BoxComponent.java | 214 + .../component/braintree/BraintreeComponent.java | 150 +--- .../camel/component/cache/CacheComponent.java | 153 +--- .../crypto/DigitalSignatureComponent.java | 344 +--- .../camel/component/docker/DockerComponent.java | 2 +- .../component/facebook/FacebookComponent.java | 326 +-- .../component/ganglia/GangliaComponent.java | 182 +--- .../calendar/GoogleCalendarComponent.java | 144 +--- .../google/drive/GoogleDriveComponent.java | 108 +-- .../google/mail/GoogleMailComponent.java| 108 +-- .../component/kestrel/KestrelComponent.java | 38 - .../component/kestrel/KestrelConfiguration.java | 9 - .../component/linkedin/LinkedInComponent.java | 155 +--- .../camel/component/lucene/LuceneComponent.java | 85 +- .../camel/component/mail/MailComponent.java | 486 +-- .../camel/component/mina/MinaComponent.java | 271 +- .../camel/component/mina2/Mina2Component.java | 336 +--- .../camel/component/nagios/NagiosComponent.java | 77 +- .../camel/component/netty/NettyComponent.java | 815 +- .../camel/component/netty4/NettyComponent.java | 851 +-- .../component/olingo2/Olingo2Component.java | 130 +-- .../salesforce/SalesforceComponent.java | 517 +-- .../camel/component/smpp/SmppComponent.java | 557 +--- .../xmlsecurity/XmlSignatureComponent.java | 747 +--- .../component/zookeeper/ZooKeeperComponent.java | 121 +-- .../zookeeper/ZooKeeperConfiguration.java | 3 - 37 files changed, 61 insertions(+), 8832 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/a04fb15b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConfiguration.java -- diff --git a/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConfiguration.java b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConfiguration.java index 51dffbc..60f2b7f 100644 --- a/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConfiguration.java +++ b/components-starter/camel-braintree-starter/src/main/java/org/apache/camel/component/braintree/springboot/BraintreeComponentConfiguration.java @@ -17,7 +17,6 @@ package org.apache.camel.component.braintree.springboot; import org.apache.camel.component.braintree.BraintreeConfiguration; -import org.apache.camel.component.braintree.internal.BraintreeApiName; import org.springframework.boot.context.properties.ConfigurationProperties; /** @@ -30,54 +29,9 @@ import org.springframework.boot.context.properties.ConfigurationProperties; public class BraintreeComponentConfiguration { /** - * To use the shared configuration. Properties of the shared configuration - * can also be set individually. + * To use the shared configuration */ private BraintreeConfiguration configuration; -/** - * What kind of operation to perform - */ -private BraintreeApiName apiName; -/** - * What sub operation to use for the selected operation - */ -private String methodName; -/** - * The environment Either SANDBOX or PRODUCTION - */ -private String enviro
[10/26] camel git commit: Fixed CS errors
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/3c6cbf92 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/3c6cbf92 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/3c6cbf92 Branch: refs/heads/master Commit: 3c6cbf92fec3d83f1f3edf9fa08fe6863d5355c0 Parents: 026fa6f Author: Dhiraj Bokde Authored: Tue Sep 20 10:05:01 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 10:05:01 2016 -0700 -- .../camel/component/jcache/JCacheProviders.java | 24 ++-- .../aggregate/JCacheAggregationRepository.java | 2 +- .../idempotent/JCacheIdempotentRepository.java | 2 +- .../JCacheIdempotentRepositoryTest.java | 2 +- .../JUnitFatJarRouterTest.java | 8 +++ .../StandaloneFatJarRouterTest.java | 10 .../swagger/SwaggerRestProducerFactory.java | 6 ++--- 7 files changed, 26 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/3c6cbf92/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/JCacheProviders.java -- diff --git a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/JCacheProviders.java b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/JCacheProviders.java index dc08832..1a9e139 100644 --- a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/JCacheProviders.java +++ b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/JCacheProviders.java @@ -18,21 +18,21 @@ package org.apache.camel.component.jcache; public enum JCacheProviders implements JCacheProvider { hazelcast{{ -shortName = "hazelcast"; -className = "com.hazelcast.cache.HazelcastCachingProvider"; -}}, +shortName = "hazelcast"; +className = "com.hazelcast.cache.HazelcastCachingProvider"; +}}, ehcache {{ -shortName = "ehcache"; -className = "org.ehcache.jsr107.EhcacheCachingProvider"; -}}, +shortName = "ehcache"; +className = "org.ehcache.jsr107.EhcacheCachingProvider"; +}}, caffeine {{ -shortName = "caffeine"; -className = "com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider"; -}}, +shortName = "caffeine"; +className = "com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider"; +}}, ispnEmbedded {{ -shortName = "infinispan-embedded"; -className = "org.infinispan.jcache.embedded.JCachingProvider"; -}}; +shortName = "infinispan-embedded"; +className = "org.infinispan.jcache.embedded.JCachingProvider"; +}}; protected String shortName; protected String className; http://git-wip-us.apache.org/repos/asf/camel/blob/3c6cbf92/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/aggregate/JCacheAggregationRepository.java -- diff --git a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/aggregate/JCacheAggregationRepository.java b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/aggregate/JCacheAggregationRepository.java index 482dd26..d5bf011 100644 --- a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/aggregate/JCacheAggregationRepository.java +++ b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/aggregate/JCacheAggregationRepository.java @@ -25,8 +25,8 @@ import javax.cache.Cache; import org.apache.camel.CamelContext; import org.apache.camel.Exchange; import org.apache.camel.component.jcache.JCacheConfiguration; -import org.apache.camel.component.jcache.JCacheManager; import org.apache.camel.component.jcache.JCacheHelper; +import org.apache.camel.component.jcache.JCacheManager; import org.apache.camel.impl.DefaultExchange; import org.apache.camel.impl.DefaultExchangeHolder; import org.apache.camel.spi.OptimisticLockingAggregationRepository; http://git-wip-us.apache.org/repos/asf/camel/blob/3c6cbf92/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepository.java -- diff --git a/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepository.java b/components/camel-jcache/src/main/java/org/apache/camel/component/jcache/processor/idempotent/JCacheIdempotentRepository.java index b41c32c..0c8e747 100644 --- a/components/camel-jcache/src/main/java/org/ap
[09/26] camel git commit: Restored setter javadoc for component docs
Restored setter javadoc for component docs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/026fa6fc Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/026fa6fc Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/026fa6fc Branch: refs/heads/master Commit: 026fa6fc487ef6b7210afbda8383b0f1ad62975c Parents: a04fb15 Author: Dhiraj Bokde Authored: Tue Sep 20 07:28:41 2016 -0700 Committer: Dhiraj Bokde Committed: Tue Sep 20 07:31:15 2016 -0700 -- .../camel/component/kestrel/KestrelConfiguration.java | 9 + .../camel/component/zookeeper/ZooKeeperConfiguration.java | 3 +++ 2 files changed, 12 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/026fa6fc/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelConfiguration.java -- diff --git a/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelConfiguration.java b/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelConfiguration.java index b697eaa..576aed1 100644 --- a/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelConfiguration.java +++ b/components/camel-kestrel/src/main/java/org/apache/camel/component/kestrel/KestrelConfiguration.java @@ -57,6 +57,9 @@ public class KestrelConfiguration implements Cloneable { return addresses; } +/** + * The addresses + */ public void setAddresses(String[] addresses) { this.addresses = addresses; } @@ -65,6 +68,9 @@ public class KestrelConfiguration implements Cloneable { return waitTimeMs; } +/** + * The wait time in milliseconds + */ public void setWaitTimeMs(int waitTimeMs) { this.waitTimeMs = waitTimeMs; } @@ -73,6 +79,9 @@ public class KestrelConfiguration implements Cloneable { return concurrentConsumers; } +/** + * The number of concurrent consumers + */ public void setConcurrentConsumers(int concurrentConsumers) { if (concurrentConsumers <= 0) { throw new IllegalArgumentException("Invalid value for concurrentConsumers: " + concurrentConsumers); http://git-wip-us.apache.org/repos/asf/camel/blob/026fa6fc/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java -- diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java index 66a9e74..34d3edb 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java @@ -92,6 +92,9 @@ public class ZooKeeperConfiguration implements Cloneable { return null; } +/** + * The zookeeper server hosts + */ public void setServers(List servers) { this.servers = servers; }
[2/7] camel git commit: CAMEL-10197: Fixed maven plugin to ignore interfaces, enums and abstract classes from being annotated with @NestedConfigurationProperty
CAMEL-10197: Fixed maven plugin to ignore interfaces, enums and abstract classes from being annotated with @NestedConfigurationProperty Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/76f7914a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/76f7914a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/76f7914a Branch: refs/heads/master Commit: 76f7914ad8dfff15676d833ca148b9fb955ed84a Parents: 6e0b1ad Author: Dhiraj Bokde Authored: Thu Sep 29 16:51:58 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 16:58:41 2016 -0700 -- .../SpringBootAutoConfigurationMojo.java| 52 ++-- 1 file changed, 25 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/76f7914a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java -- diff --git a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java index 07b3d35..45bdcc2 100644 --- a/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java +++ b/tooling/maven/camel-package-maven-plugin/src/main/java/org/apache/camel/maven/packaging/SpringBootAutoConfigurationMojo.java @@ -21,10 +21,10 @@ import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; +import java.lang.reflect.Modifier; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; -import java.util.AbstractCollection; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -331,15 +331,20 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { } String type = option.getJavaType(); -type = getSimpleJavaType(type); // generate inner class for non-primitive options -if (isNestedProperty(type, nestedTypes)) { +type = getSimpleJavaType(type); +JavaClassSource javaClassSource = readJavaType(type); +if (isNestedProperty(nestedTypes, javaClassSource)) { type = option.getShortJavaType() + INNER_TYPE_SUFFIX; } PropertySource prop = javaClass.addProperty(type, option.getName()); -if (!(type.endsWith(INNER_TYPE_SUFFIX) || !(type.indexOf('[') == -1) || EXCLUDE_INNER_PATTERN.matcher(type).matches() || !Strings.isBlank(option.getEnumValues( { +if (!type.endsWith(INNER_TYPE_SUFFIX) +&& type.indexOf('[') == -1 +&& !EXCLUDE_INNER_PATTERN.matcher(type).matches() +&& Strings.isBlank(option.getEnumValues()) +&& (javaClassSource == null || (javaClassSource.isClass() && !javaClassSource.isAbstract( { // add nested configuration annotation for complex properties prop.getField().addAnnotation(NestedConfigurationProperty.class); } @@ -357,11 +362,7 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { if ("java.lang.String".equals(option.getJavaType())) { prop.getField().setStringInitializer(option.getDefaultValue()); } else if ("integer".equals(option.getType()) || "boolean".equals(option.getType())) { -String value = option.getDefaultValue(); -if ("long".equals(option.getJavaType()) && !value.toUpperCase().endsWith("L")) { -value = value + "L"; -} -prop.getField().setLiteralInitializer(value); + prop.getField().setLiteralInitializer(option.getDefaultValue()); } else if (!Strings.isBlank(option.getEnumValues())) { String enumShortName = type.substring(type.lastIndexOf(".") + 1); prop.getField().setLiteralInitializer(enumShortName + "." + option.getDefaultValue()); @@ -404,7 +405,13 @@ public class SpringBootAutoConfigurationMojo extends AbstractMojo { } // add nested configuration annotation for complex properties -if (!EXCLUDE_INNER_PATTERN.matcher(optionType).matches() && !propType.isArray() && !anEnum) { +if (!EXCLUDE_INNER_PATTERN.matcher(optionType).matches() +&& !propType.isArray() +&& !anEnum +&& optionClass != null +
[5/7] camel git commit: Fixed CS errors
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/df487b28 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/df487b28 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/df487b28 Branch: refs/heads/master Commit: df487b283198b03a56de536ce6b1e4784747be17 Parents: 76f7914 Author: Dhiraj Bokde Authored: Thu Sep 29 17:38:19 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 17:38:19 2016 -0700 -- .../EjbComponentAutoConfiguration.java | 71 + .../springboot/EjbComponentConfiguration.java | 56 .../main/resources/META-INF/spring.factories| 19 ++ .../IBatisComponentAutoConfiguration.java | 71 + .../IBatisComponentConfiguration.java | 70 + .../main/resources/META-INF/spring.factories| 19 ++ .../JcloudsComponentAutoConfiguration.java | 72 ++ .../JcloudsComponentConfiguration.java | 57 + .../main/resources/META-INF/spring.factories| 19 ++ .../QuartzComponentAutoConfiguration.java | 71 + .../QuartzComponentConfiguration.java | 122 + .../main/resources/META-INF/spring.factories| 19 ++ .../SparkComponentAutoConfiguration.java| 71 + .../springboot/SparkComponentConfiguration.java | 256 +++ .../main/resources/META-INF/spring.factories| 19 ++ .../component/netty4/NettyConfiguration.java| 2 +- .../component/netty4/NettyPayloadHelper.java| 2 +- 17 files changed, 1014 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/df487b28/components-starter/camel-ejb-starter/src/main/java/org/apache/camel/component/ejb/springboot/EjbComponentAutoConfiguration.java -- diff --git a/components-starter/camel-ejb-starter/src/main/java/org/apache/camel/component/ejb/springboot/EjbComponentAutoConfiguration.java b/components-starter/camel-ejb-starter/src/main/java/org/apache/camel/component/ejb/springboot/EjbComponentAutoConfiguration.java new file mode 100644 index 000..64936bb --- /dev/null +++ b/components-starter/camel-ejb-starter/src/main/java/org/apache/camel/component/ejb/springboot/EjbComponentAutoConfiguration.java @@ -0,0 +1,71 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.camel.component.ejb.springboot; + +import java.util.HashMap; +import java.util.Map; +import org.apache.camel.CamelContext; +import org.apache.camel.component.ejb.EjbComponent; +import org.apache.camel.util.IntrospectionSupport; +import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; +import org.springframework.boot.context.properties.EnableConfigurationProperties; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * Generated by camel-package-maven-plugin - do not edit this file! + */ +@Configuration +@EnableConfigurationProperties(EjbComponentConfiguration.class) +public class EjbComponentAutoConfiguration { + +@Bean(name = "ejb-component") +@ConditionalOnClass(CamelContext.class) +@ConditionalOnMissingBean(EjbComponent.class) +public EjbComponent configureEjbComponent(CamelContext camelContext, +EjbComponentConfiguration configuration) throws Exception { +EjbComponent component = new EjbComponent(); +component.setCamelContext(camelContext); +Map parameters = new HashMap<>(); +IntrospectionSupport.getProperties(configuration, parameters, null, +false); +for (Map.Entry entry : parameters.entrySet()) { +Object value = entry.getValue(); +Class paramClass = value.getClass(); +if (paramClass.getName().endsWith("NestedConfiguration")) { +Class nestedClass = null; +try { +nestedClass = (Class) paramClass.getDeclaredFie
[7/7] camel git commit: CAMEL-10197: Updated component starters without annotated interfaces and abstract classes
CAMEL-10197: Updated component starters without annotated interfaces and abstract classes Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/af4b4814 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/af4b4814 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/af4b4814 Branch: refs/heads/master Commit: af4b48147f76c1046854888d98d10d236bc08b4b Parents: 7381fd8 Author: Dhiraj Bokde Authored: Thu Sep 29 17:55:26 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 17:55:26 2016 -0700 -- .../box/springboot/BoxComponentConfiguration.java | 3 --- .../cache/springboot/CacheComponentConfiguration.java | 1 - .../DigitalSignatureComponentConfiguration.java | 1 - .../jms/springboot/JmsComponentConfiguration.java | 10 -- .../springboot/LinkedInComponentConfiguration.java| 2 -- .../lucene/springboot/LuceneComponentConfiguration.java | 1 - .../mail/springboot/MailComponentConfiguration.java | 2 -- .../mina2/springboot/Mina2ComponentConfiguration.java | 1 - .../http/springboot/NettyHttpComponentConfiguration.java | 2 -- .../netty/springboot/NettyComponentConfiguration.java | 8 .../http/springboot/NettyHttpComponentConfiguration.java | 2 -- .../netty4/springboot/NettyComponentConfiguration.java| 10 -- .../smpp/springboot/SmppComponentConfiguration.java | 2 -- .../ssh/springboot/SshComponentConfiguration.java | 1 - .../springboot/XmlSignatureComponentConfiguration.java| 8 .../yammer/springboot/YammerComponentConfiguration.java | 2 -- 16 files changed, 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/af4b4814/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java -- diff --git a/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java b/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java index 7baa2fd..5f0b721 100644 --- a/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java +++ b/components-starter/camel-box-starter/src/main/java/org/apache/camel/component/box/springboot/BoxComponentConfiguration.java @@ -75,7 +75,6 @@ public class BoxComponentConfiguration { * component to be able to create a token automatically a user password * must be provided. */ -@NestedConfigurationProperty private IAuthSecureStorage authSecureStorage; /** * Box user name, MUST be provided @@ -90,7 +89,6 @@ public class BoxComponentConfiguration { * OAuth listener for token updates, if the Camel application needs to * use the access token outside the route */ -@NestedConfigurationProperty private OAuthRefreshListener refreshListener; /** * Flag to revoke OAuth refresh token on route shutdown, default false. @@ -112,7 +110,6 @@ public class BoxComponentConfiguration { /** * Custom Box SDK configuration, not required normally */ -@NestedConfigurationProperty private IBoxConfig boxConfig; /** * Custom Box connection manager builder, used to override default http://git-wip-us.apache.org/repos/asf/camel/blob/af4b4814/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java -- diff --git a/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java b/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java index 237e19c..609fd2b 100644 --- a/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java +++ b/components-starter/camel-cache-starter/src/main/java/org/apache/camel/component/cache/springboot/CacheComponentConfiguration.java @@ -37,7 +37,6 @@ public class CacheComponentConfiguration { * To use the given CacheManagerFactory for creating the CacheManager. By * default the DefaultCacheManagerFactory is used. */ -@NestedConfigurationProperty private CacheManagerFactory cacheManagerFactory; /** * Sets the Cache configuration http://git-wip-us.apache.org/repos/asf/camel/blob/af4b4814/components-starter/camel-crypto-starter/src/main/java/o
[4/7] camel git commit: CAMEL-10197: Fixed long default values to use 'L' suffix
CAMEL-10197: Fixed long default values to use 'L' suffix Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/6e0b1ad1 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/6e0b1ad1 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/6e0b1ad1 Branch: refs/heads/master Commit: 6e0b1ad10d1a9af6b852efd61861d937d575041b Parents: 5cfe110 Author: Dhiraj Bokde Authored: Thu Sep 29 15:54:15 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 16:58:41 2016 -0700 -- .../java/org/apache/camel/component/direct/DirectComponent.java| 2 +- .../org/apache/camel/component/directvm/DirectVmComponent.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/6e0b1ad1/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java b/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java index 0a7aae5..30b2352 100644 --- a/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java +++ b/camel-core/src/main/java/org/apache/camel/component/direct/DirectComponent.java @@ -37,7 +37,7 @@ public class DirectComponent extends UriEndpointComponent { // on DefaultCamelContext private final Map consumers = new HashMap(); private boolean block; -@Metadata(defaultValue = "3") +@Metadata(defaultValue = "3L") private long timeout = 3L; public DirectComponent() { http://git-wip-us.apache.org/repos/asf/camel/blob/6e0b1ad1/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmComponent.java -- diff --git a/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmComponent.java b/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmComponent.java index d5c341f..dc38c9b 100644 --- a/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmComponent.java +++ b/camel-core/src/main/java/org/apache/camel/component/directvm/DirectVmComponent.java @@ -40,7 +40,7 @@ public class DirectVmComponent extends UriEndpointComponent { // on DefaultCamelContext private static final ConcurrentMap CONSUMERS = new ConcurrentHashMap(); private boolean block; -@Metadata(defaultValue = "3") +@Metadata(defaultValue = "3L") private long timeout = 3L; private HeaderFilterStrategy headerFilterStrategy; @Metadata(defaultValue = "true")
[1/7] camel git commit: Fixed CS errors
Repository: camel Updated Branches: refs/heads/master 9210dec59 -> af4b48147 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/58fdee5a Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/58fdee5a Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/58fdee5a Branch: refs/heads/master Commit: 58fdee5a99a094a868a72a4b18434cd1eedbd435 Parents: 9210dec Author: Dhiraj Bokde Authored: Thu Sep 29 15:51:46 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 16:58:40 2016 -0700 -- components/camel-ahc/pom.xml | 1 + .../main/java/org/apache/camel/component/xquery/XQueryBuilder.java | 2 ++ .../camel/spring/boot/fatjarroutertests/JUnitFatJarRouterTest.java | 1 + 3 files changed, 4 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/58fdee5a/components/camel-ahc/pom.xml -- diff --git a/components/camel-ahc/pom.xml b/components/camel-ahc/pom.xml index a9cfd3e..ea4cca1 100644 --- a/components/camel-ahc/pom.xml +++ b/components/camel-ahc/pom.xml @@ -48,6 +48,7 @@ io.netty netty-all + ${netty-version} http://git-wip-us.apache.org/repos/asf/camel/blob/58fdee5a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java -- diff --git a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java b/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java index fd202b5..0f9eff1 100644 --- a/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java +++ b/components/camel-saxon/src/main/java/org/apache/camel/component/xquery/XQueryBuilder.java @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; import java.util.concurrent.atomic.AtomicBoolean; + import javax.xml.transform.Result; import javax.xml.transform.Source; import javax.xml.transform.dom.DOMResult; @@ -53,6 +54,7 @@ import net.sf.saxon.query.XQueryExpression; import net.sf.saxon.trans.XPathException; import net.sf.saxon.value.ObjectValue; import net.sf.saxon.value.Whitespace; + import org.apache.camel.BytesSource; import org.apache.camel.Exchange; import org.apache.camel.Expression; http://git-wip-us.apache.org/repos/asf/camel/blob/58fdee5a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/fatjarroutertests/JUnitFatJarRouterTest.java -- diff --git a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/fatjarroutertests/JUnitFatJarRouterTest.java b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/fatjarroutertests/JUnitFatJarRouterTest.java index a541a72..33fb5ba 100644 --- a/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/fatjarroutertests/JUnitFatJarRouterTest.java +++ b/components/camel-spring-boot/src/test/java/org/apache/camel/spring/boot/fatjarroutertests/JUnitFatJarRouterTest.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.lang.management.ManagementFactory; import java.net.URL; import java.util.Set; + import javax.management.MBeanServer; import javax.management.MalformedObjectNameException; import javax.management.ObjectName;
[3/7] camel git commit: Removed trace logging in Salesforce integration tests
Removed trace logging in Salesforce integration tests Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5cfe1105 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5cfe1105 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5cfe1105 Branch: refs/heads/master Commit: 5cfe11058f80cbeffbbee89dd8517c8cffde26e4 Parents: 58fdee5 Author: Dhiraj Bokde Authored: Thu Sep 29 15:52:20 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 16:58:41 2016 -0700 -- .../src/test/resources/log4j2.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5cfe1105/components/camel-salesforce/camel-salesforce-component/src/test/resources/log4j2.properties -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/resources/log4j2.properties b/components/camel-salesforce/camel-salesforce-component/src/test/resources/log4j2.properties index 4b5b208..4024c16 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/test/resources/log4j2.properties +++ b/components/camel-salesforce/camel-salesforce-component/src/test/resources/log4j2.properties @@ -27,7 +27,7 @@ appender.out.layout.pattern = %d [%-15.15t] %-5p %-30.30c{1} - %m%n rootLogger.level = INFO rootLogger.appenderRef.file.ref = file -logger.salesforce.name = org.apache.camel.component.salesforce -logger.salesforce.level = TRACE +#logger.salesforce.name = org.apache.camel.component.salesforce +#logger.salesforce.level = TRACE #logger.httpclient.name = org.eclipse.jetty -#logger.httpclient.level = DEBUG \ No newline at end of file +#logger.httpclient.level = DEBUG
[6/7] camel git commit: Updated asciidoc
Updated asciidoc Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7381fd80 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7381fd80 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7381fd80 Branch: refs/heads/master Commit: 7381fd80a11b8c1dfe36005ecd03181adc6eb965 Parents: df487b2 Author: Dhiraj Bokde Authored: Thu Sep 29 17:53:43 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 17:53:43 2016 -0700 -- .../camel-netty4-http/src/main/docs/netty4-http-component.adoc| 3 ++- components/camel-solr/src/main/docs/solr-component.adoc | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/7381fd80/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc -- diff --git a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc index e18fdab..21d994a 100644 --- a/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc +++ b/components/camel-netty4-http/src/main/docs/netty4-http-component.adoc @@ -109,7 +109,7 @@ The Netty4 HTTP component supports 6 options which are listed below. // endpoint options: START -The Netty4 HTTP component supports 81 endpoint options which are listed below: +The Netty4 HTTP component supports 82 endpoint options which are listed below: {% raw %} [width="100%",cols="2,1,1m,1m,5",options="header"] @@ -163,6 +163,7 @@ The Netty4 HTTP component supports 81 endpoint options which are listed below: | producerPoolMinEvictableIdle | producer (advanced) | 30 | long | Sets the minimum amount of time (value in millis) an object may sit idle in the pool before it is eligible for eviction by the idle object evictor. | producerPoolMinIdle | producer (advanced) | | int | Sets the minimum number of instances allowed in the producer pool before the evictor thread (if active) spawns new objects. | useRelativePath | producer (advanced) | false | boolean | Sets whether to use a relative path in HTTP requests. +| allowSerializedHeaders | advanced | false | boolean | Only used for TCP when transferExchange is true. When set to true serializable objects in headers and properties will be added to the exchange. Otherwise Camel will exclude any non-serializable objects and log it at WARN level. | bootstrapConfiguration | advanced | | NettyServerBootstrapConfiguration | To use a custom configured NettyServerBootstrapConfiguration for configuring this endpoint. | channelGroup | advanced | | ChannelGroup | To use a explicit ChannelGroup. | configuration | advanced | | NettyHttpConfiguration | To use a custom configured NettyHttpConfiguration for configuring this endpoint. http://git-wip-us.apache.org/repos/asf/camel/blob/7381fd80/components/camel-solr/src/main/docs/solr-component.adoc -- diff --git a/components/camel-solr/src/main/docs/solr-component.adoc b/components/camel-solr/src/main/docs/solr-component.adoc index 0be1bb4..c2a6916 100644 --- a/components/camel-solr/src/main/docs/solr-component.adoc +++ b/components/camel-solr/src/main/docs/solr-component.adoc @@ -46,7 +46,7 @@ The Solr component has no options. // endpoint options: START -The Solr component supports 14 endpoint options which are listed below: +The Solr component supports 15 endpoint options which are listed below: {% raw %} [width="100%",cols="2,1,1m,1m,5",options="header"] @@ -63,6 +63,7 @@ The Solr component supports 14 endpoint options which are listed below: | soTimeout | producer | | Integer | Read timeout on the underlying HttpConnectionManager. This is desirable for queries but probably not for indexing | streamingQueueSize | producer | 10 | int | Set the queue size for the StreamingUpdateSolrServer | streamingThreadCount | producer | 2 | int | Set the number of threads for the StreamingUpdateSolrServer +| exchangePattern | advanced | InOnly | ExchangePattern | Sets the default exchange pattern when creating an exchange | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). | collection | solrCloud | | String | Set the collection name which the solrCloud server could use | zkHost | solrCloud | | String | Set the ZooKeeper host information which the solrCloud could use such as zkhost=localhost:8123.
camel git commit: CAMEL-10359: Fixed xml queryAll API, ported groovy test to junit for uniformity
Repository: camel Updated Branches: refs/heads/master af4b48147 -> 9c4449c09 CAMEL-10359: Fixed xml queryAll API, ported groovy test to junit for uniformity Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/9c4449c0 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/9c4449c0 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/9c4449c0 Branch: refs/heads/master Commit: 9c4449c093ecfd5948747b710365925ed7056d71 Parents: af4b481 Author: Dhiraj Bokde Authored: Thu Sep 29 19:41:32 2016 -0700 Committer: Dhiraj Bokde Committed: Thu Sep 29 19:41:32 2016 -0700 -- .../camel-salesforce-component/pom.xml | 6 --- .../internal/processor/XmlRestProcessor.java| 1 + .../api/utils/DateTimeUtilsTest.groovy | 56 .../salesforce/api/utils/DateTimeUtilsTest.java | 47 4 files changed, 48 insertions(+), 62 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/9c4449c0/components/camel-salesforce/camel-salesforce-component/pom.xml -- diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml b/components/camel-salesforce/camel-salesforce-component/pom.xml index 8be8836..190c681 100644 --- a/components/camel-salesforce/camel-salesforce-component/pom.xml +++ b/components/camel-salesforce/camel-salesforce-component/pom.xml @@ -41,12 +41,6 @@ - org.spockframework - spock-core - 1.0-groovy-2.4 - test - - org.apache.commons commons-csv ${commons-csv-version} http://git-wip-us.apache.org/repos/asf/camel/blob/9c4449c0/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java -- 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 418e2fd..729649a 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 @@ -138,6 +138,7 @@ public class XmlRestProcessor extends AbstractRestProcessor { break; case QUERY: +case QUERY_ALL: case QUERY_MORE: // need to add alias for Salesforce XML that uses SObject name as root element exchange.setProperty(RESPONSE_ALIAS, "QueryResult"); http://git-wip-us.apache.org/repos/asf/camel/blob/9c4449c0/components/camel-salesforce/camel-salesforce-component/src/test/groovy/org/apache/camel/component/salesforce/api/utils/DateTimeUtilsTest.groovy -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/groovy/org/apache/camel/component/salesforce/api/utils/DateTimeUtilsTest.groovy b/components/camel-salesforce/camel-salesforce-component/src/test/groovy/org/apache/camel/component/salesforce/api/utils/DateTimeUtilsTest.groovy deleted file mode 100644 index 8452fe0..000 --- a/components/camel-salesforce/camel-salesforce-component/src/test/groovy/org/apache/camel/component/salesforce/api/utils/DateTimeUtilsTest.groovy +++ /dev/null @@ -1,56 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.camel.component.salesforce.api.utils - -import spock.lang.Ignore -import spock.lang.Specification -import spock.lang.Unroll - -import java.time.ZoneId -import java.time.ZonedDateTime - -class DateTimeUtilsTest extends Specification { -@Unroll -def "Date #zonedDateTime sh
[3/7] camel git commit: CAMEL-10743: Added rawPayload parameter in Salesforce Spring Boot starter
CAMEL-10743: Added rawPayload parameter in Salesforce Spring Boot starter Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ecd132a2 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ecd132a2 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ecd132a2 Branch: refs/heads/master Commit: ecd132a22b31bd9e7a48be637f037ff5f98d3e23 Parents: 227e262 Author: Dhiraj Bokde Authored: Thu Aug 3 00:35:41 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:53 2017 -0700 -- .../springboot/SalesforceComponentConfiguration.java | 14 ++ 1 file changed, 14 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ecd132a2/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java -- diff --git a/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java b/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java index 89d3597..094dbfa 100644 --- a/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java +++ b/platforms/spring-boot/components-starter/camel-salesforce-starter/src/main/java/org/apache/camel/component/salesforce/springboot/SalesforceComponentConfiguration.java @@ -565,6 +565,12 @@ public class SalesforceComponentConfiguration */ private PayloadFormat format; /** + * Use raw payload {@link String} for request and response (either JSON + * or XML depending on {@code format} ), instead of DTOs, false by + * default + */ +private Boolean rawPayload = false; +/** * Salesforce API version, defaults to * SalesforceEndpointConfig.DEFAULT_VERSION */ @@ -792,6 +798,14 @@ public class SalesforceComponentConfiguration this.format = format; } +public Boolean getRawPayload() { +return rawPayload; +} + +public void setRawPayload(Boolean rawPayload) { +this.rawPayload = rawPayload; +} + public String getApiVersion() { return apiVersion; }
[1/7] camel git commit: CAMEL-10744: Added utility APIs in Salesforce JsonUtils to generate JSON schema from SObjectDescription, added required modules to Karaf camel-salesforce feature
Repository: camel Updated Branches: refs/heads/master 0a7433d3a -> 2f1f266eb CAMEL-10744: Added utility APIs in Salesforce JsonUtils to generate JSON schema from SObjectDescription, added required modules to Karaf camel-salesforce feature Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/ef945994 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/ef945994 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/ef945994 Branch: refs/heads/master Commit: ef9459945b48f369896a06edc8133e11d52884a7 Parents: fa4e612 Author: Dhiraj Bokde Authored: Thu Aug 3 00:12:19 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:52 2017 -0700 -- .../camel-salesforce-component/pom.xml | 15 ++ .../salesforce/api/utils/JsonUtils.java | 225 +++ .../salesforce/api/utils/JsonUtilsTest.java | 56 + parent/pom.xml | 6 + .../features/src/main/resources/features.xml| 2 + 5 files changed, 304 insertions(+) -- http://git-wip-us.apache.org/repos/asf/camel/blob/ef945994/components/camel-salesforce/camel-salesforce-component/pom.xml -- diff --git a/components/camel-salesforce/camel-salesforce-component/pom.xml b/components/camel-salesforce/camel-salesforce-component/pom.xml index 60ec3d5..822cb8b 100644 --- a/components/camel-salesforce/camel-salesforce-component/pom.xml +++ b/components/camel-salesforce/camel-salesforce-component/pom.xml @@ -91,6 +91,15 @@ com.fasterxml.jackson.core jackson-databind + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + + + com.fasterxml.jackson.module + jackson-module-jsonSchema + com.thoughtworks.xstream xstream @@ -172,6 +181,12 @@ ${junit-toolbox-version} test + + com.squareup.okhttp3 + mockwebserver + ${squareup-okhttp3-version} + test + http://git-wip-us.apache.org/repos/asf/camel/blob/ef945994/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/JsonUtils.java -- 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 2c3a04f..959e00b 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 @@ -16,13 +16,50 @@ */ package org.apache.camel.component.salesforce.api.utils; +import java.lang.reflect.Modifier; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; + +import static java.util.stream.Collectors.joining; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonValueFormat; +import com.fasterxml.jackson.module.jsonSchema.JsonSchema; +import com.fasterxml.jackson.module.jsonSchema.JsonSchemaGenerator; +import com.fasterxml.jackson.module.jsonSchema.types.ArraySchema; +import com.fasterxml.jackson.module.jsonSchema.types.BooleanSchema; +import com.fasterxml.jackson.module.jsonSchema.types.IntegerSchema; +import com.fasterxml.jackson.module.jsonSchema.types.NullSchema; +import com.fasterxml.jackson.module.jsonSchema.types.NumberSchema; +import com.fasterxml.jackson.module.jsonSchema.types.ObjectSchema; +import com.fasterxml.jackson.module.jsonSchema.types.SimpleTypeSchema; +import com.fasterxml.jackson.module.jsonSchema.types.StringSchema; + +import org.apache.camel.component.salesforce.api.dto.AbstractDTOBase; +import org.apache.camel.component.salesforce.api.dto.AbstractQueryRecordsBase; +import org.apache.camel.component.salesforce.api.dto.Address; +import org.apache.camel.component.salesforce.api.dto.GeoLocation; +import org.apache.camel.component.salesforce.api.dto.PickListValue; +import org.apache.camel.component.salesforce.api.dto.SObjectDescription; +import org.apache.camel.component.salesforce.api.dto.SObjectField; +import org.apache.camel.impl.DefaultPackageScanClassResolver; /** * Factory class for creating {@linkplain com.fasterxml.jackson
[7/7] camel git commit: CAMEL-10743: Added support for rawPayload parameter in Salesforce Streaming API
CAMEL-10743: Added support for rawPayload parameter in Salesforce Streaming API Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/2f1f266e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/2f1f266e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/2f1f266e Branch: refs/heads/master Commit: 2f1f266eb1cf4a642ae571fc1ee916283255de0c Parents: 84625b8 Author: Dhiraj Bokde Authored: Thu Aug 3 00:38:52 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:54 2017 -0700 -- .../component/salesforce/SalesforceConsumer.java | 5 - .../salesforce/StreamingApiIntegrationTest.java| 17 + 2 files changed, 21 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/2f1f266e/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceConsumer.java -- 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 df29dd8..0484aee 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 @@ -174,7 +174,10 @@ public class SalesforceConsumer extends DefaultConsumer { final String sObjectString = objectMapper.writeValueAsString(sObject); log.debug("Received SObject: {}", sObjectString); -if (sObjectClass == null) { +if (endpoint.getConfiguration().getRawPayload()) { +// return sobject string as exchange body +in.setBody(sObjectString); +} else if (sObjectClass == null) { // return sobject map as exchange body in.setBody(sObject); } else { http://git-wip-us.apache.org/repos/asf/camel/blob/2f1f266e/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/StreamingApiIntegrationTest.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/StreamingApiIntegrationTest.java b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/StreamingApiIntegrationTest.java index e0ed9ff..33139df 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/StreamingApiIntegrationTest.java +++ b/components/camel-salesforce/camel-salesforce-component/src/test/java/org/apache/camel/component/salesforce/StreamingApiIntegrationTest.java @@ -36,6 +36,12 @@ public class StreamingApiIntegrationTest extends AbstractSalesforceTestBase { mock.expectedHeaderReceived("CamelSalesforceTopicName", "CamelTestTopic"); mock.expectedHeaderReceived("CamelSalesforceChannel", "/topic/CamelTestTopic"); +MockEndpoint rawPayloadMock = getMockEndpoint("mock:RawPayloadCamelTestTopic"); +rawPayloadMock.expectedMessageCount(1); +// assert expected static headers +rawPayloadMock.expectedHeaderReceived("CamelSalesforceTopicName", "CamelTestTopic"); +rawPayloadMock.expectedHeaderReceived("CamelSalesforceChannel", "/topic/CamelTestTopic"); + Merchandise__c merchandise = new Merchandise__c(); merchandise.setName("TestNotification"); merchandise.setDescription__c("Merchandise for testing Streaming API updated on " + ZonedDateTime.now().toString()); @@ -50,6 +56,7 @@ public class StreamingApiIntegrationTest extends AbstractSalesforceTestBase { mock.assertIsSatisfied(); final Message in = mock.getExchanges().get(0).getIn(); merchandise = in.getMandatoryBody(Merchandise__c.class); + assertNotNull("Missing event body", merchandise); log.info("Merchandise notification: {}", merchandise.toString()); assertNotNull("Missing field Id", merchandise.getId()); @@ -60,6 +67,11 @@ public class StreamingApiIntegrationTest extends AbstractSalesforceTestBase { assertNotNull("Missing header CamelSalesforceEventType", in.getHeader("CamelSalesforceEventType")); assertNotNull("Missing header CamelSalesforceCreatedDate", in.getHeader("CamelSalesforceCreatedDate")); +// validate raw payload message +
[2/7] camel git commit: CAMEL-10743: Added guard for Apex REST APIs and other minor fixes for JSON Schema support
CAMEL-10743: Added guard for Apex REST APIs and other minor fixes for JSON Schema support Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/fa4e6123 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/fa4e6123 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/fa4e6123 Branch: refs/heads/master Commit: fa4e6123fbd4f264a1d685c4f5250672e8f23c22 Parents: 0a7433d Author: Dhiraj Bokde Authored: Wed Aug 2 23:16:52 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:52 2017 -0700 -- .../salesforce/api/dto/AbstractSObjectBase.java | 2 +- .../salesforce/api/utils/DateTimeDeserializer.java | 4 .../salesforce/api/utils/DateTimeSerializer.java | 12 .../salesforce/internal/SalesforceSession.java | 5 + .../internal/client/DefaultRestClient.java | 15 --- 5 files changed, 34 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/fa4e6123/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/dto/AbstractSObjectBase.java -- 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 183a7aa..404bfa2 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 @@ -21,7 +21,7 @@ import java.time.ZonedDateTime; import com.fasterxml.jackson.annotation.JsonProperty; //CHECKSTYLE:OFF -public class AbstractSObjectBase extends AbstractDTOBase { +public abstract class AbstractSObjectBase extends AbstractDTOBase { // WARNING: these fields have case sensitive names, // the field name MUST match the field name used by Salesforce http://git-wip-us.apache.org/repos/asf/camel/blob/fa4e6123/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeDeserializer.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeDeserializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeDeserializer.java index e62496e..fefa68b 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeDeserializer.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeDeserializer.java @@ -41,4 +41,8 @@ public class DateTimeDeserializer extends JsonDeserializer { throw JsonMappingException.from(deserializationContext, "Expected String value, got: " + currentToken); } +@Override +public Class handledType() { +return ZonedDateTime.class; +} } http://git-wip-us.apache.org/repos/asf/camel/blob/fa4e6123/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeSerializer.java -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeSerializer.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeSerializer.java index ccf936a..26c8a39 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeSerializer.java +++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/api/utils/DateTimeSerializer.java @@ -20,8 +20,11 @@ import java.io.IOException; import java.time.ZonedDateTime; import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JavaType; +import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.jsonFormatVisitors.JsonFormatVisitorWrapper; public class DateTimeSerializer extends JsonSerializer { @@ -35,4 +38
[4/7] camel git commit: CAMEL-10743: Added support for rawPayload parameter in Salesforce REST APIs
CAMEL-10743: Added support for rawPayload parameter in Salesforce REST APIs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/84625b80 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/84625b80 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/84625b80 Branch: refs/heads/master Commit: 84625b800f699bce15dc0bfeb8eac7e5ffd7252f Parents: ecd132a Author: Dhiraj Bokde Authored: Thu Aug 3 00:38:21 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:53 2017 -0700 -- .../processor/AbstractRestProcessor.java| 6 + .../internal/processor/JsonRestProcessor.java | 6 +- .../internal/processor/XmlRestProcessor.java| 3 +- .../component/salesforce/RawPayloadTest.java| 240 +++ .../salesforce/RestApiIntegrationTest.java | 1 + 5 files changed, 252 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/84625b80/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractRestProcessor.java -- 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 758cc57..74be887 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 @@ -810,6 +810,12 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor protected abstract InputStream getRequestStream(Object object) throws SalesforceException; private void setResponseClass(Exchange exchange, String sObjectName) throws SalesforceException { + +// nothing to do if using rawPayload +if (rawPayload) { +return; +} + Class sObjectClass; if (sObjectName != null) { http://git-wip-us.apache.org/repos/asf/camel/blob/84625b80/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java -- 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 b361fb3..777338a 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 @@ -183,13 +183,13 @@ public class JsonRestProcessor extends AbstractRestProcessor { } } else if (responseEntity != null) { // do we need to un-marshal a response -Object response = null; +final Object response; Class responseClass = exchange.getProperty(RESPONSE_CLASS, Class.class); -if (responseClass != null) { +if (!rawPayload && responseClass != null) { response = objectMapper.readValue(responseEntity, responseClass); } else { TypeReference responseType = exchange.getProperty(RESPONSE_TYPE, TypeReference.class); -if (responseType != null) { +if (!rawPayload && responseType != null) { response = objectMapper.readValue(responseEntity, responseType); } else { // return the response as a stream, for getBlobField http://git-wip-us.apache.org/repos/asf/camel/blob/84625b80/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java -- 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/componen
[5/7] camel git commit: CAMEL-10744: Updated camel salesforce maven plugin to generate json schema file with types for Salesforce objects
CAMEL-10744: Updated camel salesforce maven plugin to generate json schema file with types for Salesforce objects Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/5eaaf981 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/5eaaf981 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/5eaaf981 Branch: refs/heads/master Commit: 5eaaf9810a65caa602ff720cdcbba8ffeaaf9530 Parents: ef94599 Author: Dhiraj Bokde Authored: Thu Aug 3 00:16:56 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:53 2017 -0700 -- .../apache/camel/maven/CamelSalesforceMojo.java | 72 +--- .../CamelSalesforceMojoIntegrationTest.java | 33 +++-- 2 files changed, 90 insertions(+), 15 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/5eaaf981/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 a169047..6a48ea7 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 @@ -24,6 +24,8 @@ import java.io.Writer; import java.lang.reflect.Field; import java.net.URI; import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; import java.security.GeneralSecurityException; import java.util.ArrayList; import java.util.Arrays; @@ -272,6 +274,24 @@ public class CamelSalesforceMojo extends AbstractMojo { @Parameter(property = "camelSalesforce.useStringsForPicklists", defaultValue = "false") protected Boolean useStringsForPicklists; +/** + * Generate JSON Schema for DTOs, instead of Java Objects. + */ +@Parameter(property = "camelSalesforce.jsonSchema") +protected boolean jsonSchema; + +/** + * Schema ID for JSON Schema for DTOs. + */ +@Parameter(property = "camelSalesforce.jsonSchemaId", defaultValue = JsonUtils.DEFAULT_ID_PREFIX) +protected String jsonSchemaId; + +/** + * Schema ID for JSON Schema for DTOs. + */ +@Parameter(property = "camelSalesforce.jsonSchemaFilename", defaultValue = "salesforce-dto-schema.json") +protected String jsonSchemaFilename; + VelocityEngine engine; private long responseTimeout; @@ -402,22 +422,52 @@ public class CamelSalesforceMojo extends AbstractMojo { } } -getLog().info("Generating Java Classes..."); -// generate POJOs for every object description -final GeneratorUtility utility = new GeneratorUtility(useStringsForPicklists); -// should we provide a flag to control timestamp generation? -final String generatedDate = new Date().toString(); -for (SObjectDescription description : descriptions) { -if (IGNORED_OBJECTS.contains(description.getName())) { -continue; +if (!jsonSchema) { + +getLog().info("Generating Java Classes..."); +// generate POJOs for every object description +final GeneratorUtility utility = new GeneratorUtility(useStringsForPicklists); +// should we provide a flag to control timestamp generation? +final String generatedDate = new Date().toString(); +for (SObjectDescription description : descriptions) { +if (IGNORED_OBJECTS.contains(description.getName())) { +continue; +} +try { +processDescription(pkgDir, description, utility, generatedDate); +} catch (IOException e) { +throw new MojoExecutionException("Unable to generate source files for: " + description.getName(), e); +} +} + +getLog().info(String.format("Successfully generated %s Java Classes", descriptions.size() * 2)); + +} else { + +getLog().info("Generating JSON Schema..."); +// generate JSON schema for every object description +final ObjectMapper schemaObjectMapper = JsonUtils.createSchemaObjectMapper(); +final Set allSchemas = new HashSet<>(); +for (SObjectDescription description : descriptions) { +
[6/7] camel git commit: CAMEL-10743: Add rawPayload parameter to support XML or JSON String input and output with Salesforce endpoints, avoiding generating DTOs
CAMEL-10743: Add rawPayload parameter to support XML or JSON String input and output with Salesforce endpoints, avoiding generating DTOs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/227e2629 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/227e2629 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/227e2629 Branch: refs/heads/master Commit: 227e262934fde83f9a87f48177eaca316504bfbd Parents: 5eaaf981 Author: Dhiraj Bokde Authored: Thu Aug 3 00:34:32 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 00:43:53 2017 -0700 -- .../src/main/docs/salesforce-component.adoc | 3 ++- .../component/salesforce/SalesforceComponent.java | 2 +- .../salesforce/SalesforceEndpointConfig.java| 16 .../processor/AbstractSalesforceProcessor.java | 2 ++ 4 files changed, 21 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/227e2629/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc -- diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc index a898a7e..df1407d 100644 --- a/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc +++ b/components/camel-salesforce/camel-salesforce-component/src/main/docs/salesforce-component.adoc @@ -533,7 +533,7 @@ with the following path and query parameters: | **topicName** | The name of the topic to use | | String |=== - Query Parameters (42 parameters): + Query Parameters (43 parameters): [width="100%",cols="2,5,^1,2",options="header"] |=== @@ -562,6 +562,7 @@ with the following path and query parameters: | **notifyForOperationUndelete** (common) | Notify for un-delete operation defaults to false (API version = 29.0) | | Boolean | **notifyForOperationUpdate** (common) | Notify for update operation defaults to false (API version = 29.0) | | Boolean | **objectMapper** (common) | Custom Jackson ObjectMapper to use when serializing/deserializing Salesforce objects. | | ObjectMapper +| **rawPayload** (common) | Use raw payload String for request and response (either JSON or XML depending on format) instead of DTOs false by default | false | boolean | **reportId** (common) | Salesforce1 Analytics report Id | | String | **reportMetadata** (common) | Salesforce1 Analytics report metadata for filtering | | ReportMetadata | **resultId** (common) | Bulk API Result ID | | String http://git-wip-us.apache.org/repos/asf/camel/blob/227e2629/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceComponent.java -- 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 2b6f181..5609031 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 @@ -377,7 +377,7 @@ public class SalesforceComponent extends DefaultComponent implements VerifiableC LOG.info("Found {} generated classes in packages: {}", classMap.size(), Arrays.asList(packages)); } else { // use an empty map to avoid NPEs later -LOG.warn("Missing property packages, getSObject* operations will NOT work"); +LOG.warn("Missing property packages, getSObject* operations will NOT work without property rawPayload=true"); classMap = new HashMap>(0); } http://git-wip-us.apache.org/repos/asf/camel/blob/227e2629/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/SalesforceEndpointConfig.java -- 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 5363c0c..a23e83d
[6/8] camel git commit: CAMEL-10743: Added support for rawPayload parameter in Salesforce REST APIs
CAMEL-10743: Added support for rawPayload parameter in Salesforce REST APIs Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/da79c3b5 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/da79c3b5 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/da79c3b5 Branch: refs/heads/camel-2.19.x Commit: da79c3b5cf1b8b26f06d5c490d8c69d90c45081c Parents: 6787c74 Author: Dhiraj Bokde Authored: Thu Aug 3 00:38:21 2017 -0700 Committer: Dhiraj Bokde Committed: Thu Aug 3 01:14:12 2017 -0700 -- .../processor/AbstractRestProcessor.java| 6 + .../internal/processor/JsonRestProcessor.java | 6 +- .../internal/processor/XmlRestProcessor.java| 3 +- .../component/salesforce/RawPayloadTest.java| 240 +++ .../salesforce/RestApiIntegrationTest.java | 1 + 5 files changed, 252 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/camel/blob/da79c3b5/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/AbstractRestProcessor.java -- 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 758cc57..74be887 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 @@ -810,6 +810,12 @@ public abstract class AbstractRestProcessor extends AbstractSalesforceProcessor protected abstract InputStream getRequestStream(Object object) throws SalesforceException; private void setResponseClass(Exchange exchange, String sObjectName) throws SalesforceException { + +// nothing to do if using rawPayload +if (rawPayload) { +return; +} + Class sObjectClass; if (sObjectName != null) { http://git-wip-us.apache.org/repos/asf/camel/blob/da79c3b5/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/JsonRestProcessor.java -- 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 d52601f..a8086f7 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 @@ -184,13 +184,13 @@ public class JsonRestProcessor extends AbstractRestProcessor { } } else if (responseEntity != null) { // do we need to un-marshal a response -Object response = null; +final Object response; Class responseClass = exchange.getProperty(RESPONSE_CLASS, Class.class); -if (responseClass != null) { +if (!rawPayload && responseClass != null) { response = objectMapper.readValue(responseEntity, responseClass); } else { TypeReference responseType = exchange.getProperty(RESPONSE_TYPE, TypeReference.class); -if (responseType != null) { +if (!rawPayload && responseType != null) { response = objectMapper.readValue(responseEntity, responseType); } else { // return the response as a stream, for getBlobField http://git-wip-us.apache.org/repos/asf/camel/blob/da79c3b5/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/XmlRestProcessor.java -- 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/co