Clone
 

zoran regvart <zoran@regvart.com> in camel-git

12905: Safety applicationContext identity check.

Co-Authored-By: oalles <oalles@gmail.com>

12905: No need to cast ContextRefreshedEvent. Safety applicationContext identity check.

Co-Authored-By: oalles <oalles@gmail.com>

Merge pull request #2390 from candrews/patch-4

CAMEL-12593: Active deploy profile when deploying

CAMEL-10811 Provide sample Salesforce connector...

... component and example

This adds a `org.foo:salesforce-upsert-contact-connector` connector

component and updates the `camel/connectors/examples/twitter-salesforce-

example` to use it.

  1. … 4 more files in changeset.
CAMEL-10804 Create a Salesforce example

Adds documentation to the example.

CAMEL-10804 Create a Salesforce example

This adds configuration for `Camel Salesman` Connected App on Salesforce

developer instance running under `Camelus Bactrianus`

(cbactrianus@gmail.com) user.

Given a Tweet's user uses its `name` as `Last Name` and `screenName` as

custom property `Twitter Screen Name` to create a contact in the

Developer Edition Salesforce instance. The `Twitter Screen Name` field

is defined as unique so in order not to create duplicate Contacts an

update-or-insert operation is performed.

CAMEL-10780 Add test for DefaultFactoryFinder

I was hoping on doing some refactoring of `DefaultFactoryFinder` but,

the functionality I was hoping on doing turned out not to need it. So at

the end I was left with this unit test for DefaultFactoryFinder that

could help someone refactoring in the future.

CAMEL-10767 Versions of swagger-models and swag...

...ger-parser in conflict

A change was made to `swagger-modules` in `swagger-core`[1] (version

1.5.12) that changed `java.lang.Double` type with `java.math.BigDecimal`

which in turn made `swager-parser` incompatible in the version used

(1.0.22).

This was later fixed in `swagger-parser`[2] and released as version

1.0.25.

Version of `swagger-parser` updated to 1.0.25, added a test to parse the

petstore example to catch any further version mismatches.

[1] https://github.com/swagger-api/swagger-core/commit/208335a08cae610d3b5eaea75f5552efaf15477b

[2] https://github.com/swagger-api/swagger-parser/commit/d7ac638f4355cc043a14dfcd244264aa1440c627

CAMEL-10767 Versions of swagger-models and swag...

...ger-parser in conflict

A change was made to `swagger-modules` in `swagger-core`[1] (version

1.5.12) that changed `java.lang.Double` type with `java.math.BigDecimal`

which in turn made `swager-parser` incompatible in the version used

(1.0.22).

This was later fixed in `swagger-parser`[2] and released as version

1.0.25.

Version of `swagger-parser` updated to 1.0.25, added a test to parse the

petstore example to catch any further version mismatches.

[1] https://github.com/swagger-api/swagger-core/commit/208335a08cae610d3b5eaea75f5552efaf15477b

[2] https://github.com/swagger-api/swagger-parser/commit/d7ac638f4355cc043a14dfcd244264aa1440c627

CAMEL-10764 The use of BrowserCompatHostname...

...Verifier is deprecated

The BrowserCompatHostnameVerifier has been deprecated in HttpClient

version 4.4, instead DefaultHostnameVerifier should be used. The commit

also changes the type of `x509HostnameVerifier` from

`X509HostnameVerifier` to `HostnameVerifier`.

Due to HTTPCLIENT-1802[1] version of HttpClient was upgraded to 4.5.3

from 4.5.2.

Compatibility note: this changes the getter `getX509HostnameVerifier`

from `X509HostnameVerifier` to `HostnameVerifier` so any client code

using this getter needs to be changed. For the setter

`setX509HostnameVerifier` this is not an issue as the deprecated

`X509HostnameVerifier` extends from `HostnameVerifier`.

[1] https://issues.apache.org/jira/browse/HTTPCLIENT-1802

Extract HttpClientConnectionManager creation

This commit extracts creation of `HttpClientConnectionManager` in a

separate method `createConnectionManager`, this method can be then

reused from a component based on the `HttpComponent`.

(cherry picked from commit dd8b972ea5e7e0cc3e94f30d7261900cb780305f)

Extract HttpClientBuilder creation

This commit extracts creation of `HttpClientBuilder` in a separate

method `createHttpClientBuilder`, this method can be then reused from a

component based on the `HttpComponent`.

(cherry picked from commit e3601df1eb06988ca326dedfd7bb0f5508a3bb1a)

CAMEL-10732 Remove from all caches when Groovy ...

...script is removed from Camel script cache

This commit wraps the `Class<Script>` in a `org.apache.camel.Service`

before placing it in the cache so that on removal from the cache `stop`

method would be invoked in which Groovy's `InvokerHelper` is used to

cleanup three other caches that still hold references to the Script

Class in question.

CAMEL-10732 Remove from all caches when Groovy ...

...script is removed from Camel script cache

This commit wraps the `Class<Script>` in a `org.apache.camel.Service`

before placing it in the cache so that on removal from the cache `stop`

method would be invoked in which Groovy's `InvokerHelper` is used to

cleanup three other caches that still hold references to the Script

Class in question.

CAMEL-10732 Remove from all caches when Groovy ...

...script is removed from Camel script cache

This commit wraps the `Class<Script>` in a `org.apache.camel.Service`

before placing it in the cache so that on removal from the cache `stop`

method would be invoked in which Groovy's `InvokerHelper` is used to

cleanup three other caches that still hold references to the Script

Class in question.

CAMEL-10726 Correlation of JMS InOut exchanges ...

...with custom JMS property

This commit adds a setter on the component for setting the new

configuration option `correlationProperty` used for custom property

message correlation.

CAMEL-10726 Correlation of JMS InOut exchanges ...

...with custom JMS property

This commit adds a new configuration option `correlationProperty` if set

its value will be used instead of `JMSCorrelationID` JMS message

property to correlate messages in InOut (request-reply) exchange.

Also, if this `correlationProperty` is set, `JMSCorrelationID` will not

be consulted on the incoming message or set on the outgoing message.

CAMEL-9945 Upgrade to jetty 9.3

Java compiler uses the actual return type of the method in the compiled

class and as the signature of

`org.eclipse.jetty.client.HttpClient::getProtocolHandlers` method

changed between Jetty 9.2 and 9.3 in return type it could be compiled

and run against both versions, but it could not be compiled with one

version and run against another.

This commit uses reflection when calling `getProtocolHandlers` method to

maintain compatibility with 9.2 and 9.3 versions of Jetty regardless of

compile time vs runtime version.

CAMEL-10716 Salesforce Composite API wrongly ch...

...ecks for minimum supported version

Fixes an issue when the Batch request and the configured component

version is version 34.0.

Salesforce Composite API cleanup

This commit does not introduce any new functionality, its purpose is to

reduce technical debt by the way of simple code cleanup.

CAMEL-9945 Upgrade to Jetty 9.3

In Jetty 9.3 API signature changed from:

List<ProtocolHandler> getProtocolHandler()

to:

ProtocolHandlers getProtocolHandler()

This commit adds reflection bridge to keep the compatibility with Jetty

9.2 and Jetty 9.3.

Tested with Jetty versions: 9.2.19.v20160908, 9.3.8.v20160314,

9.4.0.v20161208

Fix Checkstyle in camel-salesforce-maven-plugin

CAMEL-10571 SObject tree creation, Composite API

This commit implements support for SObject tree creation via Salesforce

Composite API. This allows user to create multiple, up to 200, records

including parent-child relationships, up to 5 levels using one API call.

For instance:

Account account = ...

Contact president = ...

Contact marketing = ...

Account anotherAccount = ...

Contact sales = ...

Asset someAsset = ...

// build the tree

SObjectTree request = new SObjectTree();

request.addObject(account).addChildren(president, marketing);

request.addObject(anotherAccount).addChild(sales).addChild(someAsset);

final SObjectTree response =

template.requestBody("salesforce:composite-tree", tree,

SObjectTree.class);

The returned response in the output message is the identical object

received in the body of the input message updated with identifiers

received on successful record creation or populated errors on failure.

  1. … 14 more files in changeset.
CAMEL-10593 Support for Composite API batch

This commit implements support for Salesforce Composite Batch API[1]

that allows the user to combine up to 25 requests in a single batch and

then send them in a single HTTP request saving on the request round trip

time and bandwidth.

One would use this operation like this:

//Create the batch request:

final SObjectBatch batch = new SObjectBatch("38.0");

final Account updates = new Account();

updates.set...

//Use the builder methods to add up to 25 operations

batch.addUpdate("Account", accountId, updates)

.addGet("Account", "001D000000K0fXOIAZ")

.add...

final SObjectBatchResponse response =

template.requestBody("salesforce:composite-batch?format=JSON", batch,

SObjectBatchResponse.class);

[1]

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_batch.htm

  1. … 7 more files in changeset.
SObjectDescription metadata in DTOs

This commit adds SObjectDescription by making the DTOs extend

AbstractDescribedSObjectBase (new class) instead of AbstractSObjectBase.

The code generation is performed in Velocity template by recursing the

bean SObjectDescription properties. Helper methods are added to

GeneratorUtility that help track the stack of the recursive invocation.

To prevent hitting Java method length restriction (64K) some properties

are blacklisted: PicklistValues and ChildRelationships which most likely

would not be needed in the component operation anyways.

(cherry picked from commit 2d14fd8caa58f4520cf70801a27a0a57b023f492)

CAMEL-10519 Disable TLSv1.0 in camel-salesforce

Fixed warning message formatting.

CAMEL-10519 Disable TLSv1.0 in camel-salesforce

This commit adds a warning message if the used JSSE implementation does

not support TLS version 1.1 or newer. TLS version 1.0 is disabled by

default and additionaly all SSL versions are disabled -- which is done

by default in BaseSSLContextParameters, so its added here so that the

new default configuration does not override and allow SSL versions.

The main purpose of this commit is to allow users that are using Java 7

without support for TLS version 1.1 or newer, i.e. not using Oracle or

IBM Java or using custom SSL configuration with custom JSSE provider

that is configured or does not support TLS version 1.1 or newer --

to get an early warning (before March, 2017 when Salesforce disables TLS

version 1.0). And to set default enabled SSL protocols to TLS version

1.1 and onward.

CAMEL-8396 Update Salesforce component to support new REST APIs in Sa...

...lesforce API V33.0

This commit adds support for getting and sending approvals for

processing via Salesforce REST API[1].

Two new operations were added `approvals` to fetch any approvals already

in progress, and `approval` to initiate approval process on the supplied

record or records (batch).

For instance, `approvals` can be simply used as:

...to("salesforce:approvals")

.split().body()

.log("${body.entityId} - ${body.instanceStatus}")

And to send a record for approval you can use:

...to("salesforce:approval?approval.actionType=Submit&...")

.log("${body.id} - ${body.instanceStatus}")

The `approval` operation has the ability to set properties on the

endpoint (let's call that template), via message headers and message

body. These can be combined, to place default values on the endpoint

(template), and runtime values trough headers or message body.

If the message body is an `Iterable` of `ApprovalRequest` objects then

they will be submitted in a batch.

The auto complete options were not up to date, added values for recent,

limit and the new approval and approvals operations.

[1]

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_process_approvals.htm

  1. … 10 more files in changeset.
CAMEL-10472 Update Salesforce component to support recent items REST API

- added documentation.

- updates by

camel-package-maven-plugin:prepare-spring-boot-auto-configuration to the

SalesforceComponentConfiguration.java.

CAMEL-10472 Update Salesforce component to support recent items REST API

This commit adds support for getting recent items via Salesforce REST API[1].

New operation `recent` was added and can be used like:

...to("salesforce:recent")

.split().body()

.log("${body.name} at ${body.attributes.url}");

Number of items returned can be limited by the `limit` parameter in URI,

body or headers.

[1] https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_recent_items.htm