Repository: camel
Updated Branches:
  refs/heads/master a255c3580 -> 9fd3b4fbf


CAMEL-11066 Make salesforce authentication opti...

...ons simpler to configure

This improves the documentation of component properties and adds
documentation about authentication options.


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

Branch: refs/heads/master
Commit: 9fd3b4fbfa84e9ce81db1f604b6a37c8edea1ce0
Parents: a255c35
Author: Zoran Regvart <zregv...@apache.org>
Authored: Fri Mar 24 21:12:43 2017 +0100
Committer: Zoran Regvart <zregv...@apache.org>
Committed: Fri Mar 24 21:14:52 2017 +0100

----------------------------------------------------------------------
 .../src/main/docs/salesforce-component.adoc     |  81 ++++---
 .../salesforce/SalesforceComponent.java         | 211 +++++++++----------
 components/camel-salesforce/pom.xml             |   4 -
 .../SalesforceComponentConfiguration.java       |  93 +++++---
 4 files changed, 214 insertions(+), 175 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/9fd3b4fb/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 d475a52..322950f 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
@@ -24,6 +24,37 @@ NOTE: Developers wishing to contribute to the component are 
instructed
 to look at the README.md file on instructions on how to get started and
 setup your environment for running integration tests.
 
+## Authenticating to Salesforce
+
+The component supports three OAuth authentication flows:
+
+* 
https://help.salesforce.com/articleView?id=remoteaccess_oauth_username_password_flow.htm[OAuth
 2.0 Username-Password Flow]
+* 
https://help.salesforce.com/articleView?id=remoteaccess_oauth_refresh_token_flow.htm[OAuth
 2.0 Refresh Token Flow]
+* 
https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm[OAuth
 2.0 JWT Bearer Token Flow]
+
+For each of the flow different set of properties needs to be set:
+
+.Properties to set for each authentication flow
+|===
+| Property     | Where to find it on Salesforce     | Flow
+
+| clientId     | Connected App, Consumer Key        | All flows
+| clientSecret | Connected App, Consumer Secret     | Username-Password, 
Refresh Token
+| userName     | Salesforce user username           | Username-Password, JWT 
Bearer Token
+| password     | Salesforce user password           | Username-Password
+| refreshToken | From OAuth flow callback           | Refresh Token
+| keystore     | Connected App, Digital Certificate | JWT Bearer Token
+|===
+
+The component auto determines what flow you're trying to configure, to
+be remove ambiguity set the `authenticationType` property.
+
+NOTE: Using Username-Password Flow in production is not encouraged.
+
+NOTE: The certificate used in JWT Bearer Token Flow can be a selfsigned 
+certificate. The KeyStore holding the certificate and the private key
+must contain only single certificate-private key entry.
+
 ### URI format
 
 The URI scheme for a salesforce component is as follows
@@ -434,31 +465,31 @@ The Salesforce component supports 26 options which are 
listed below.
 [width="100%",cols="2,5,^1,2",options="header"]
 |=======================================================================
 | Name | Description | Default | Type
-| **authenticationType** (security) | Explicit authentication type to be used 
one of USERNAME_PASSWORD REFRESH_TOKEN or JWT. |  | AuthenticationType
-| **loginConfig** (security) | To use the shared SalesforceLoginConfig as 
login configuration |  | SalesforceLoginConfig
-| **loginUrl** (security) | Salesforce login URL defaults to 
https://login.salesforce.com | https://login.salesforce.com | String
-| **clientId** (security) | Salesforce connected application Consumer Key |  | 
String
-| **clientSecret** (security) | Salesforce connected application Consumer 
Secret |  | String
-| **keystore** (security) | KeyStoreParameters to use in OAuth 2.0 JWT Bearer 
Token Flow. |  | KeyStoreParameters
-| **refreshToken** (security) | Salesforce connected application Consumer 
token |  | String
-| **userName** (security) | Salesforce account user name |  | String
-| **password** (security) | Salesforce account password |  | String
-| **lazyLogin** (security) | Flag to enable/disable lazy OAuth default is 
false. When enabled OAuth token retrieval or generation is not done until the 
first API call | false | boolean
-| **config** (advanced) | To use the shared SalesforceEndpointConfig as 
endpoint configuration |  | SalesforceEndpoint Config
-| **httpClientProperties** (advanced) | Used for configuring HTTP client 
properties as key/value pairs |  | Map
-| **sslContextParameters** (security) | To configure security using 
SSLContextParameters |  | SSLContextParameters
-| **httpProxyHost** (proxy) | To configure HTTP proxy host |  | String
-| **httpProxyPort** (proxy) | To configure HTTP proxy port |  | Integer
-| **httpProxyUsername** (security) | To configure HTTP proxy username |  | 
String
-| **httpProxyPassword** (security) | To configure HTTP proxy password |  | 
String
-| **isHttpProxySocks4** (proxy) | Enable for Socks4 proxy false by default | 
false | boolean
-| **isHttpProxySecure** (security) | Enable for TLS connections true by 
default | false | boolean
-| **httpProxyIncluded Addresses** (proxy) | HTTP proxy included addresses |  | 
Set
-| **httpProxyExcluded Addresses** (proxy) | HTTP proxy excluded addresses |  | 
Set
-| **httpProxyAuthUri** (security) | HTTP proxy authentication URI |  | String
-| **httpProxyRealm** (security) | HTTP proxy authentication realm |  | String
-| **httpProxyUseDigest Auth** (security) | Use HTTP proxy Digest 
authentication false by default | false | boolean
-| **packages** (common) | Package names to scan for DTO classes (multiple 
packages can be separated by comma). |  | String[]
+| **authenticationType** (security) | Explicit authentication method to be 
used one of USERNAME_PASSWORD REFRESH_TOKEN or JWT. Salesforce component can 
auto-determine the authentication method to use from the properties set set 
this property to eliminate any ambiguity. |  | AuthenticationType
+| **loginConfig** (security) | All authentication configuration in one nested 
bean all properties set there can be set directly on the component as well |  | 
SalesforceLoginConfig
+| **loginUrl** (security) | *Required* URL of the Salesforce instance by 
default set to https://login.salesforce.com | https://login.salesforce.com | 
String
+| **clientId** (security) | *Required* OAuth Consumer Key of the connected app 
configured in the Salesforce instance setup. Typically a connected app needs to 
be configured but one can be provided by installing a package. |  | String
+| **clientSecret** (security) | OAuth Consumer Secret of the connected app 
configured in the Salesforce instance setup. |  | String
+| **keystore** (security) | KeyStore parameters to use in OAuth JWT flow. The 
KeyStore should contain only one entry with private key and certificate. 
Salesforce does not verify the certificate chain so this can easily be a 
selfsigned certificate. Make sure that you upload the certificate to the 
corresponding connected app. |  | KeyStoreParameters
+| **refreshToken** (security) | Refresh token already obtained in the refresh 
token OAuth flow. One needs to setup a web application and configure a callback 
URL to receive the refresh token or configure using the builtin callback at 
https://login.salesforce.com/services/oauth2/success or 
https://test.salesforce.com/services/oauth2/success and then retrive the 
refresh_token from the URL at the end of the flow. Note that in development 
organizations Salesforce allows hosting the callback web application at 
localhost. |  | String
+| **userName** (security) | Username used in OAuth flow to gain access to 
access token. It's easy to get started with password OAuth flow but in general 
one should avoid it as it is deemed less secure than other flows. |  | String
+| **password** (security) | Password used in OAuth flow to gain access to 
access token. It's easy to get started with password OAuth flow but in general 
one should avoid it as it is deemed less secure than other flows. Make sure 
that you append security token to the end of the password if using one. |  | 
String
+| **lazyLogin** (security) | If set to true prevents the component from 
authenticating to Salesforce with the start of the component. You would 
generaly set this to the (default) false and authenticate early and be 
immediately aware of any authentication issues. | false | boolean
+| **config** (common) | Global endpoint configuration - use to set values that 
are common to all endpoints |  | SalesforceEndpoint Config
+| **httpClientProperties** (common) | Used to set any properties that can be 
configured on the underlying HTTP client. Have a look at properties of 
SalesforceHttpClient and the Jetty HttpClient for all available options. |  | 
Map
+| **sslContextParameters** (security) | SSL parameters to use see 
SSLContextParameters class for all available options. |  | SSLContextParameters
+| **httpProxyHost** (proxy) | Hostname of the HTTP proxy server to use. |  | 
String
+| **httpProxyPort** (proxy) | Port number of the HTTP proxy server to use. |  
| Integer
+| **httpProxyUsername** (security) | Username to use to authenticate against 
the HTTP proxy server. |  | String
+| **httpProxyPassword** (security) | Password to use to authenticate against 
the HTTP proxy server. |  | String
+| **isHttpProxySocks4** (proxy) | If set to true the configures the HTTP proxy 
to use as a SOCKS4 proxy. | false | boolean
+| **isHttpProxySecure** (security) | If set to false disables the use of TLS 
when accessing the HTTP proxy. | true | boolean
+| **httpProxyIncluded Addresses** (proxy) | A list of addresses for which HTTP 
proxy server should be used. |  | Set
+| **httpProxyExcluded Addresses** (proxy) | A list of addresses for which HTTP 
proxy server should not be used. |  | Set
+| **httpProxyAuthUri** (security) | Used in authentication against the HTTP 
proxy server needs to match the URI of the proxy server in order for the 
httpProxyUsername and httpProxyPassword to be used for authentication. |  | 
String
+| **httpProxyRealm** (security) | Realm of the proxy server used in preemptive 
Basic/Digest authentication methods against the HTTP proxy server. |  | String
+| **httpProxyUseDigest Auth** (security) | If set to true Digest 
authentication will be used when authenticating to the HTTP proxyotherwise 
Basic authorization method will be used | false | boolean
+| **packages** (common) | In what packages are the generated DTO classes. 
Typically the classes would be generated using camel-salesforce-maven-plugin. 
Set it if using the generated DTOs to gain the benefit of using short SObject 
names in parameters/header values. |  | String[]
 | **resolveProperty Placeholders** (advanced) | Whether the component should 
resolve property placeholders on itself when starting. Only properties which 
are of String type can use property placeholders. | true | boolean
 |=======================================================================
 // component options: END

http://git-wip-us.apache.org/repos/asf/camel/blob/9fd3b4fb/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 2c48a32..fb3387e 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
@@ -73,73 +73,129 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
 
     private static final Logger LOG = 
LoggerFactory.getLogger(SalesforceComponent.class);
 
-    @Metadata(label = "security")
+    @Metadata(description = "All authentication configuration in one nested 
bean, all properties set there can be set"
+        + " directly on the component as well", label = "common,security")
     private SalesforceLoginConfig loginConfig;
 
     // allow fine grained login as well
-    @Metadata(label = "security", defaultValue = DEFAULT_LOGIN_URL)
+    @Metadata(description = "URL of the Salesforce instance, by default set to 
" + DEFAULT_LOGIN_URL,
+        label = "common,security", defaultValue = DEFAULT_LOGIN_URL, required 
= "true")
     private String loginUrl;
-    @Metadata(label = "security", secret = true)
+
+    @Metadata(description = "OAuth Consumer Key of the connected app 
configured in the Salesforce instance setup."
+        + " Typically a connected app needs to be configured but one can be 
provided by installing a package.",
+        label = "common,security", secret = true, required = "true")
     private String clientId;
-    @Metadata(label = "security", secret = true)
+
+    @Metadata(description = "OAuth Consumer Secret of the connected app 
configured in the Salesforce instance setup.",
+        label = "common,security", secret = true)
     private String clientSecret;
-    @Metadata(label = "security", secret = true)
+
+    @Metadata(description = "Refresh token already obtained in the refresh 
token OAuth flow. One needs to setup a web"
+        + " application and configure a callback URL to receive the refresh 
token, or configure using the builtin"
+        + " callback at https://login.salesforce.com/services/oauth2/success 
or "
+        + " https://test.salesforce.com/services/oauth2/success and then 
retrive the refresh_token from the URL at the"
+        + " end of the flow. Note that in development organizations Salesforce 
allows hosting the callback web "
+        + " application at localhost.",
+        label = "common,security", secret = true)
     private String refreshToken;
-    @Metadata(label = "security", secret = true)
+
+    @Metadata(description = "Username used in OAuth flow to gain access to 
access token. It's easy to get started with" 
+        + " password OAuth flow, but in general one should avoid it as it is 
deemed less secure than other flows.",
+        label = "common,security",
+        secret = true)
     private String userName;
-    @Metadata(label = "security", secret = true)
+
+    @Metadata(description = "Password used in OAuth flow to gain access to 
access token. It's easy to get started with"
+        + " password OAuth flow, but in general one should avoid it as it is 
deemed less secure than other flows."
+        + " Make sure that you append security token to the end of the 
password if using one.",
+        label = "common,security", secret = true)
     private String password;
-    @Metadata(label = "security", secret = true)
+
+    @Metadata(description = "KeyStore parameters to use in OAuth JWT flow. The 
KeyStore should contain only one entry"
+        + " with private key and certificate. Salesforce does not verify the 
certificate chain, so this can easily be"
+        + " a selfsigned certificate. Make sure that you upload the 
certificate to the corresponding connected app.",
+        label = "common,security", secret = true)
     private KeyStoreParameters keystore;
-    @Metadata(description = "Explicit authentication type to be used, one of 
USERNAME_PASSWORD, REFRESH_TOKEN or JWT.",
-        label = "security", secret = false, enums = 
"USERNAME_PASSWORD,REFRESH_TOKEN,JWT")
+
+    @Metadata(description = "Explicit authentication method to be used, one of 
USERNAME_PASSWORD, REFRESH_TOKEN or JWT."
+        + " Salesforce component can auto-determine the authentication method 
to use from the properties set, set this "
+        + " property to eliminate any ambiguity.",
+        label = "common,security", secret = false, enums = 
"USERNAME_PASSWORD,REFRESH_TOKEN,JWT")
     private AuthenticationType authenticationType;
-    @Metadata(label = "security")
+
+    @Metadata(description = "If set to true prevents the component from 
authenticating to Salesforce with the start of"
+        + " the component. You would generaly set this to the (default) false 
and authenticate early and be immediately"
+        + " aware of any authentication issues.", defaultValue = "false", 
label = "common,security")
     private boolean lazyLogin;
 
-    @Metadata(label = "advanced")
+    @Metadata(description = "Global endpoint configuration - use to set values 
that are common to all endpoints",
+        label = "common,advanced")
     private SalesforceEndpointConfig config;
 
-    // HTTP client parameters, map of property-name to value
-    @Metadata(label = "advanced")
+    @Metadata(description = "Used to set any properties that can be configured 
on the underlying HTTP client. Have a"
+        + " look at properties of SalesforceHttpClient and the Jetty 
HttpClient for all available options.",
+        label = "common,advanced")
     private Map<String, Object> httpClientProperties;
 
-    // SSL parameters
-    @Metadata(label = "security")
+    @Metadata(description = "SSL parameters to use, see SSLContextParameters 
class for all available options.",
+        label = "common,security")
     private SSLContextParameters sslContextParameters;
 
     // Proxy host and port
-    @Metadata(label = "proxy")
+    @Metadata(description = "Hostname of the HTTP proxy server to use.", label 
= "common,proxy")
     private String httpProxyHost;
-    @Metadata(label = "proxy")
+
+    @Metadata(description = "Port number of the HTTP proxy server to use.", 
label = "common,proxy")
     private Integer httpProxyPort;
-    @Metadata(label = "proxy")
+
+    @Metadata(description = "If set to true the configures the HTTP proxy to 
use as a SOCKS4 proxy.",
+        defaultValue = "false", label = "common,proxy")
     private boolean isHttpProxySocks4;
-    @Metadata(label = "proxy,security")
+
+    @Metadata(description = "If set to false disables the use of TLS when 
accessing the HTTP proxy.",
+        defaultValue = "true", label = "common,proxy,security")
     private boolean isHttpProxySecure = true;
-    @Metadata(label = "proxy")
+
+    @Metadata(description = "A list of addresses for which HTTP proxy server 
should be used.", label = "common,proxy")
     private Set<String> httpProxyIncludedAddresses;
-    @Metadata(label = "proxy")
+
+    @Metadata(description = "A list of addresses for which HTTP proxy server 
should not be used.",
+        label = "common,proxy")
     private Set<String> httpProxyExcludedAddresses;
 
     // Proxy basic authentication
-    @Metadata(label = "proxy,security", secret = true)
+    @Metadata(description = "Username to use to authenticate against the HTTP 
proxy server.",
+        label = "common,proxy,security", secret = true)
     private String httpProxyUsername;
-    @Metadata(label = "proxy,security", secret = true)
+
+    @Metadata(description = "Password to use to authenticate against the HTTP 
proxy server.",
+        label = "common,proxy,security", secret = true)
     private String httpProxyPassword;
-    @Metadata(label = "proxy,security")
+
+    @Metadata(description = "Used in authentication against the HTTP proxy 
server, needs to match the URI of the proxy"
+        + " server in order for the httpProxyUsername and httpProxyPassword to 
be used for authentication.",
+        label = "common,proxy,security")
     private String httpProxyAuthUri;
-    @Metadata(label = "proxy,security")
+
+    @Metadata(description = "Realm of the proxy server, used in preemptive 
Basic/Digest authentication methods against"
+        + " the HTTP proxy server.", label = "common,proxy,security")
     private String httpProxyRealm;
-    @Metadata(label = "proxy,security")
+
+    @Metadata(description = "If set to true Digest authentication will be used 
when authenticating to the HTTP proxy,"
+        + "otherwise Basic authorization method will be used", defaultValue = 
"false", label = "common,proxy,security")
     private boolean httpProxyUseDigestAuth;
 
-    // DTO packages to scan
+    @Metadata(description = "In what packages are the generated DTO classes. 
Typically the classes would be generated"
+        + " using camel-salesforce-maven-plugin. Set it if using the generated 
DTOs to gain the benefit of using short "
+        + " SObject names in parameters/header values.", label = "common")
     private String[] packages;
 
     // component state
     private SalesforceHttpClient httpClient;
+
     private SalesforceSession session;
+
     private Map<String, Class<?>> classMap;
 
     // Lazily created helper for consumer endpoints
@@ -226,17 +282,16 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
     @Override
     protected void doStart() throws Exception {
         if (loginConfig == null) {
-            if (ObjectHelper.isNotEmpty(password)) {
-                loginConfig = new SalesforceLoginConfig(loginUrl, clientId, 
clientSecret, userName, password, lazyLogin);
-            } else if (ObjectHelper.isNotEmpty(refreshToken)) {
-                loginConfig = new SalesforceLoginConfig(loginUrl, clientId, 
clientSecret, refreshToken, lazyLogin);
-            } else if (ObjectHelper.isNotEmpty(keystore)) {
-                loginConfig = new SalesforceLoginConfig(loginUrl, clientId, 
userName, keystore, lazyLogin);
-            } else {
-                throw new IllegalArgumentException("Cannot define a login 
configuration, the component configuration"
-                    + " does not contain `password`, `refreshToken` or 
`keystore` parameters. Specifying one of those"
-                    + " determines the type of authentication performed.");
-            }
+            loginConfig = new SalesforceLoginConfig();
+            loginConfig.setClientId(clientId);
+            loginConfig.setClientSecret(clientSecret);
+            loginConfig.setKeystore(keystore);
+            loginConfig.setLazyLogin(lazyLogin);
+            loginConfig.setLoginUrl(loginUrl);
+            loginConfig.setPassword(password);
+            loginConfig.setRefreshToken(refreshToken);
+            loginConfig.setType(authenticationType);
+            loginConfig.setUserName(userName);
 
             LOG.debug("Created login configuration: {}", loginConfig);
         } else {
@@ -449,16 +504,10 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return loginConfig;
     }
 
-    /**
-     * To use the shared SalesforceLoginConfig as login configuration
-     */
     public void setLoginConfig(SalesforceLoginConfig loginConfig) {
         this.loginConfig = loginConfig;
     }
 
-    /**
-     * Salesforce login URL, defaults to https://login.salesforce.com
-     */
     public void setLoginUrl(String loginUrl) {
         this.loginUrl = loginUrl;
     }
@@ -467,9 +516,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return clientId;
     }
 
-    /**
-     * Salesforce connected application Consumer Key
-     */
     public void setClientId(String clientId) {
         this.clientId = clientId;
     }
@@ -479,16 +525,10 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
 
     }
 
-    /**
-     * Salesforce connected application Consumer Secret
-     */
     public void setClientSecret(String clientSecret) {
         this.clientSecret = clientSecret;
     }
 
-    /**
-     * {@link KeyStoreParameters} to use in OAuth 2.0 JWT Bearer Token Flow.
-     */
     public void setKeystore(final KeyStoreParameters keystore) {
         this.keystore = keystore;
     }
@@ -501,9 +541,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return refreshToken;
     }
 
-    /**
-     * Salesforce connected application Consumer token
-     */
     public void setRefreshToken(String refreshToken) {
         this.refreshToken = refreshToken;
     }
@@ -512,9 +549,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return userName;
     }
 
-    /**
-     * Salesforce account user name
-     */
     public void setUserName(String userName) {
         this.userName = userName;
     }
@@ -523,9 +557,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return password;
     }
 
-    /**
-     * Salesforce account password
-     */
     public void setPassword(String password) {
         this.password = password;
     }
@@ -534,9 +565,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return lazyLogin;
     }
 
-    /**
-     * Flag to enable/disable lazy OAuth, default is false. When enabled, 
OAuth token retrieval or generation is not done until the first API call
-     */
     public void setLazyLogin(boolean lazyLogin) {
         this.lazyLogin = lazyLogin;
     }
@@ -545,9 +573,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return config;
     }
 
-    /**
-     * To use the shared SalesforceEndpointConfig as endpoint configuration
-     */
     public void setConfig(SalesforceEndpointConfig config) {
         this.config = config;
     }
@@ -556,9 +581,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpClientProperties;
     }
 
-    /**
-     * Used for configuring HTTP client properties as key/value pairs
-     */
     public void setHttpClientProperties(Map<String, Object> 
httpClientProperties) {
         this.httpClientProperties = httpClientProperties;
     }
@@ -567,9 +589,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return sslContextParameters;
     }
 
-    /**
-     * To configure security using SSLContextParameters
-     */
     public void setSslContextParameters(SSLContextParameters 
sslContextParameters) {
         this.sslContextParameters = sslContextParameters;
     }
@@ -578,9 +597,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyHost;
     }
 
-    /**
-     * To configure HTTP proxy host
-     */
     public void setHttpProxyHost(String httpProxyHost) {
         this.httpProxyHost = httpProxyHost;
     }
@@ -589,9 +605,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyPort;
     }
 
-    /**
-     * To configure HTTP proxy port
-     */
     public void setHttpProxyPort(Integer httpProxyPort) {
         this.httpProxyPort = httpProxyPort;
     }
@@ -600,9 +613,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyUsername;
     }
 
-    /**
-     * To configure HTTP proxy username
-     */
     public void setHttpProxyUsername(String httpProxyUsername) {
         this.httpProxyUsername = httpProxyUsername;
     }
@@ -611,9 +621,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyPassword;
     }
 
-    /**
-     * To configure HTTP proxy password
-     */
     public void setHttpProxyPassword(String httpProxyPassword) {
         this.httpProxyPassword = httpProxyPassword;
     }
@@ -622,9 +629,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return isHttpProxySocks4;
     }
 
-    /**
-     * Enable for Socks4 proxy, false by default
-     */
     public void setIsHttpProxySocks4(boolean isHttpProxySocks4) {
         this.isHttpProxySocks4 = isHttpProxySocks4;
     }
@@ -633,9 +637,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return isHttpProxySecure;
     }
 
-    /**
-     * Enable for TLS connections, true by default
-     */
     public void setIsHttpProxySecure(boolean isHttpProxySecure) {
         this.isHttpProxySecure = isHttpProxySecure;
     }
@@ -644,9 +645,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyIncludedAddresses;
     }
 
-    /**
-     * HTTP proxy included addresses
-     */
     public void setHttpProxyIncludedAddresses(Set<String> 
httpProxyIncludedAddresses) {
         this.httpProxyIncludedAddresses = httpProxyIncludedAddresses;
     }
@@ -655,9 +653,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyExcludedAddresses;
     }
 
-    /**
-     * HTTP proxy excluded addresses
-     */
     public void setHttpProxyExcludedAddresses(Set<String> 
httpProxyExcludedAddresses) {
         this.httpProxyExcludedAddresses = httpProxyExcludedAddresses;
     }
@@ -666,9 +661,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyAuthUri;
     }
 
-    /**
-     * HTTP proxy authentication URI
-     */
     public void setHttpProxyAuthUri(String httpProxyAuthUri) {
         this.httpProxyAuthUri = httpProxyAuthUri;
     }
@@ -677,9 +669,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyRealm;
     }
 
-    /**
-     * HTTP proxy authentication realm
-     */
     public void setHttpProxyRealm(String httpProxyRealm) {
         this.httpProxyRealm = httpProxyRealm;
     }
@@ -688,9 +677,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return httpProxyUseDigestAuth;
     }
 
-    /**
-     * Use HTTP proxy Digest authentication, false by default
-     */
     public void setHttpProxyUseDigestAuth(boolean httpProxyUseDigestAuth) {
         this.httpProxyUseDigestAuth = httpProxyUseDigestAuth;
     }
@@ -699,16 +685,10 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return packages;
     }
 
-    /**
-     * Package names to scan for DTO classes (multiple packages can be 
separated by comma).
-     */
     public void setPackages(String[] packages) {
         this.packages = packages;
     }
 
-    /**
-     * Package names to scan for DTO classes (multiple packages can be 
separated by comma).
-     */
     public void setPackages(String packages) {
         // split using comma
         if (packages != null) {
@@ -724,9 +704,6 @@ public class SalesforceComponent extends 
UriEndpointComponent implements Endpoin
         return classMap;
     }
 
-    /**
-     * TODO: document
-     */
     public ComponentVerifier getVerifier() {
         return new SalesforceComponentVerifier(this);
     }

http://git-wip-us.apache.org/repos/asf/camel/blob/9fd3b4fb/components/camel-salesforce/pom.xml
----------------------------------------------------------------------
diff --git a/components/camel-salesforce/pom.xml 
b/components/camel-salesforce/pom.xml
index 629b02c..684c710 100644
--- a/components/camel-salesforce/pom.xml
+++ b/components/camel-salesforce/pom.xml
@@ -46,10 +46,6 @@
         <groupId>org.apache.camel</groupId>
         <artifactId>camel-package-maven-plugin</artifactId>
         <version>${project.version}</version>
-        <configuration>
-          <!-- TODO: remove all this when we have salesforce documented -->
-          <validate>false</validate>
-        </configuration>
         <executions>
           <execution>
             <id>prepare</id>

http://git-wip-us.apache.org/repos/asf/camel/blob/9fd3b4fb/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 bef0db4..5ae2470 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
@@ -44,108 +44,143 @@ import 
org.springframework.boot.context.properties.NestedConfigurationProperty;
 public class SalesforceComponentConfiguration {
 
     /**
-     * Explicit authentication type to be used one of USERNAME_PASSWORD
-     * REFRESH_TOKEN or JWT.
+     * Explicit authentication method to be used one of USERNAME_PASSWORD
+     * REFRESH_TOKEN or JWT. Salesforce component can auto-determine the
+     * authentication method to use from the properties set set this property 
to
+     * eliminate any ambiguity.
      */
     private AuthenticationType authenticationType;
     /**
-     * To use the shared SalesforceLoginConfig as login configuration
+     * All authentication configuration in one nested bean all properties set
+     * there can be set directly on the component as well
      */
     private SalesforceLoginConfigNestedConfiguration loginConfig;
     /**
-     * Salesforce login URL defaults to https://login.salesforce.com
+     * URL of the Salesforce instance by default set to
+     * https://login.salesforce.com
      */
     private String loginUrl = "https://login.salesforce.com";;
     /**
-     * Salesforce connected application Consumer Key
+     * OAuth Consumer Key of the connected app configured in the Salesforce
+     * instance setup. Typically a connected app needs to be configured but one
+     * can be provided by installing a package.
      */
     private String clientId;
     /**
-     * Salesforce connected application Consumer Secret
+     * OAuth Consumer Secret of the connected app configured in the Salesforce
+     * instance setup.
      */
     private String clientSecret;
     /**
-     * KeyStoreParameters to use in OAuth 2.0 JWT Bearer Token Flow.
+     * KeyStore parameters to use in OAuth JWT flow. The KeyStore should 
contain
+     * only one entry with private key and certificate. Salesforce does not
+     * verify the certificate chain so this can easily be a selfsigned
+     * certificate. Make sure that you upload the certificate to the
+     * corresponding connected app.
      */
     @NestedConfigurationProperty
     private KeyStoreParameters keystore;
     /**
-     * Salesforce connected application Consumer token
+     * Refresh token already obtained in the refresh token OAuth flow. One 
needs
+     * to setup a web application and configure a callback URL to receive the
+     * refresh token or configure using the builtin callback at
+     * https://login.salesforce.com/services/oauth2/success or
+     * https://test.salesforce.com/services/oauth2/success and then retrive the
+     * refresh_token from the URL at the end of the flow. Note that in
+     * development organizations Salesforce allows hosting the callback web
+     * application at localhost.
      */
     private String refreshToken;
     /**
-     * Salesforce account user name
+     * Username used in OAuth flow to gain access to access token. It's easy to
+     * get started with password OAuth flow but in general one should avoid it
+     * as it is deemed less secure than other flows.
      */
     private String userName;
     /**
-     * Salesforce account password
+     * Password used in OAuth flow to gain access to access token. It's easy to
+     * get started with password OAuth flow but in general one should avoid it
+     * as it is deemed less secure than other flows. Make sure that you append
+     * security token to the end of the password if using one.
      */
     private String password;
     /**
-     * Flag to enable/disable lazy OAuth default is false. When enabled OAuth
-     * token retrieval or generation is not done until the first API call
+     * If set to true prevents the component from authenticating to Salesforce
+     * with the start of the component. You would generaly set this to the
+     * (default) false and authenticate early and be immediately aware of any
+     * authentication issues.
      */
     private Boolean lazyLogin = false;
     /**
-     * To use the shared SalesforceEndpointConfig as endpoint configuration
+     * Global endpoint configuration - use to set values that are common to all
+     * endpoints
      */
     private SalesforceEndpointConfigNestedConfiguration config;
     /**
-     * Used for configuring HTTP client properties as key/value pairs
+     * Used to set any properties that can be configured on the underlying HTTP
+     * client. Have a look at properties of SalesforceHttpClient and the Jetty
+     * HttpClient for all available options.
      */
     private Map<String, Object> httpClientProperties;
     /**
-     * To configure security using SSLContextParameters
+     * SSL parameters to use see SSLContextParameters class for all available
+     * options.
      */
     @NestedConfigurationProperty
     private SSLContextParameters sslContextParameters;
     /**
-     * To configure HTTP proxy host
+     * Hostname of the HTTP proxy server to use.
      */
     private String httpProxyHost;
     /**
-     * To configure HTTP proxy port
+     * Port number of the HTTP proxy server to use.
      */
     private Integer httpProxyPort;
     /**
-     * To configure HTTP proxy username
+     * Username to use to authenticate against the HTTP proxy server.
      */
     private String httpProxyUsername;
     /**
-     * To configure HTTP proxy password
+     * Password to use to authenticate against the HTTP proxy server.
      */
     private String httpProxyPassword;
     /**
-     * Enable for Socks4 proxy false by default
+     * If set to true the configures the HTTP proxy to use as a SOCKS4 proxy.
      */
     private Boolean isHttpProxySocks4 = false;
     /**
-     * Enable for TLS connections true by default
+     * If set to false disables the use of TLS when accessing the HTTP proxy.
      */
-    private Boolean isHttpProxySecure = false;
+    private Boolean isHttpProxySecure = true;
     /**
-     * HTTP proxy included addresses
+     * A list of addresses for which HTTP proxy server should be used.
      */
     private Set<String> httpProxyIncludedAddresses;
     /**
-     * HTTP proxy excluded addresses
+     * A list of addresses for which HTTP proxy server should not be used.
      */
     private Set<String> httpProxyExcludedAddresses;
     /**
-     * HTTP proxy authentication URI
+     * Used in authentication against the HTTP proxy server needs to match the
+     * URI of the proxy server in order for the httpProxyUsername and
+     * httpProxyPassword to be used for authentication.
      */
     private String httpProxyAuthUri;
     /**
-     * HTTP proxy authentication realm
+     * Realm of the proxy server used in preemptive Basic/Digest authentication
+     * methods against the HTTP proxy server.
      */
     private String httpProxyRealm;
     /**
-     * Use HTTP proxy Digest authentication false by default
+     * If set to true Digest authentication will be used when authenticating to
+     * the HTTP proxyotherwise Basic authorization method will be used
      */
     private Boolean httpProxyUseDigestAuth = false;
     /**
-     * Package names to scan for DTO classes (multiple packages can be 
separated
-     * by comma).
+     * In what packages are the generated DTO classes. Typically the classes
+     * would be generated using camel-salesforce-maven-plugin. Set it if using
+     * the generated DTOs to gain the benefit of using short SObject names in
+     * parameters/header values.
      */
     private String[] packages;
     /**

Reply via email to