This is an automated email from the ASF dual-hosted git repository.

dmvolod pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 4d08d8f800eb8df54482f559d6128fa219d2fa13
Author: Dmitry Volodin <dmvo...@gmail.com>
AuthorDate: Tue Feb 4 11:14:13 2020 +0300

    CAMEL-14476: Able to extend workday component for futher entities support
---
 .../src/main/docs/workday-component.adoc           |  29 +-
 .../camel/component/workday/WorkdayComponent.java  |  49 +-
 .../component/workday/WorkdayConfiguration.java    |  83 +++-
 .../camel/component/workday/WorkdayEndpoint.java   |  32 +-
 ...dayProducer.java => WorkdayReportProducer.java} |  43 +-
 ...entTest.java => WorkdayReportProducerTest.java} |  24 +-
 .../dsl/WorkdayEndpointBuilderFactory.java         | 506 ++-------------------
 7 files changed, 188 insertions(+), 578 deletions(-)

diff --git a/components/camel-workday/src/main/docs/workday-component.adoc 
b/components/camel-workday/src/main/docs/workday-component.adoc
index 26c831a..5264e14 100644
--- a/components/camel-workday/src/main/docs/workday-component.adoc
+++ b/components/camel-workday/src/main/docs/workday-component.adoc
@@ -1,10 +1,10 @@
 [[workday-component]]
 = Workday Component
 
-*Since Camel 3.1.0-SNAPSHOT*
+*Since Camel 3.1*
 
 // HEADER START
-*Both producer and consumer is supported*
+*Only producer is supported*
 // HEADER END
 
 The *Workday*: components provides the ability to detect and parse documents 
with 
@@ -28,7 +28,7 @@ following dependency to their `pom.xml`:
 == Options
 
 // component options: START
-The Workday component supports 3 options, which are listed below.
+The Workday component supports 2 options, which are listed below.
 
 
 
@@ -37,7 +37,6 @@ The Workday component supports 3 options, which are listed 
below.
 | Name | Description | Default | Type
 | *basicPropertyBinding* (advanced) | Whether the component should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities | false | boolean
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
-| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
 |===
 // component options: END
 
@@ -45,39 +44,37 @@ The Workday component supports 3 options, which are listed 
below.
 The Workday endpoint is configured using URI syntax:
 
 ----
-workday:uri
+workday:entity:path
 ----
 
 with the following path and query parameters:
 
-=== Path Parameters (1 parameters):
+=== Path Parameters (2 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *uri* | *Required* The partial URL for RAAS report. |  | String
+| *entity* | *Required* The entity to be requested or subscribed via API. |  | 
Entity
+| *path* | *Required* The API path to access an entity structure. |  | String
 |===
 
 
-=== Query Parameters (13 parameters):
+=== Query Parameters (10 parameters):
 
 
 [width="100%",cols="2,5,^1,2",options="header"]
 |===
 | Name | Description | Default | Type
-| *bridgeErrorHandler* (consumer) | Allows for bridging the consumer to the 
Camel routing Error Handler, which mean any exceptions occurred while the 
consumer is trying to pickup incoming messages, or the likes, will now be 
processed as a message and handled by the routing Error Handler. By default the 
consumer will use the org.apache.camel.spi.ExceptionHandler to deal with 
exceptions, that will be logged at WARN or ERROR level and ignored. | false | 
boolean
-| *exceptionHandler* (consumer) | To let the consumer use a custom 
ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this 
option is not in use. By default the consumer will deal with exceptions, that 
will be logged at WARN or ERROR level and ignored. |  | ExceptionHandler
-| *exchangePattern* (consumer) | Sets the exchange pattern when the consumer 
creates an exchange. The value can be one of: InOnly, InOut, InOptionalOut |  | 
ExchangePattern
 | *lazyStartProducer* (producer) | Whether the producer should be started lazy 
(on the first message). By starting lazy you can use this to allow CamelContext 
and routes to startup in situations where a producer may otherwise fail during 
starting and cause the route to fail being started. By deferring this startup 
to be lazy then the startup failure can be handled during routing messages via 
Camel's routing error handlers. Beware that when the first message is processed 
then creating and [...]
 | *basicPropertyBinding* (advanced) | Whether the endpoint should use basic 
property binding (Camel 2.x) or the newer property binding with additional 
capabilities | false | boolean
-| *httpConnectionManager* (advanced) | Pool connection manager for advanced 
configuration |  | PoolingHttpClientConnectionManager
+| *httpConnectionManager* (advanced) | Pool connection manager for advanced 
configuration. |  | PoolingHttpClientConnectionManager
 | *synchronous* (advanced) | Sets whether synchronous processing should be 
strictly used, or Camel is allowed to use asynchronous processing (if 
supported). | false | boolean
-| *format* (format) | Workday Report as a service output format. |  | String
+| *reportFormat* (format) | Workday Report as a service output format. | json 
| String
 | *host* (host) | *Required* Workday Host name. |  | String
-| *clientId* (security) | *Required* Workday Client Id generated by API Client 
for Integrations. |  | String
-| *clientSecret* (security) | *Required* Workday Client Secrect generated by 
API Client for Integrations. |  | String
-| *tokenRefresh* (security) | *Required* Workday Token Refresh generated for 
Integration system user. |  | String
+| *clientId* (security) | *Required* Workday client Id generated by API client 
for integrations. |  | String
+| *clientSecret* (security) | *Required* Workday client Secret generated by 
API client for integrations. |  | String
+| *tokenRefresh* (security) | *Required* Workday token Refresh generated for 
integrations system user. |  | String
 | *tenant* (tenant) | *Required* Workday Tenant name. |  | String
 |===
 // endpoint options: END
diff --git 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayComponent.java
 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayComponent.java
index bedad74..44c4089 100644
--- 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayComponent.java
+++ 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayComponent.java
@@ -17,12 +17,12 @@
 package org.apache.camel.component.workday;
 
 import java.util.Map;
-import java.util.stream.Collectors;
 
 import org.apache.camel.Endpoint;
 import org.apache.camel.ResolveEndpointFailedException;
 import org.apache.camel.spi.annotations.Component;
 import org.apache.camel.support.DefaultComponent;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Represents the component that manages {@link WorkdayEndpoint}.
@@ -30,10 +30,11 @@ import org.apache.camel.support.DefaultComponent;
 @Component("workday")
 public class WorkdayComponent extends DefaultComponent {
 
-    public static final String RAAS_ENDPOINT_URL = 
"https://%s/ccx/service/customreport2/%s%s";;
-
     protected Endpoint createEndpoint(String uri, String remaining, 
Map<String, Object> parameters) throws Exception {
         WorkdayConfiguration configuration = new WorkdayConfiguration();
+
+        configuration = parseConfiguration(configuration, remaining, 
parameters);
+
         WorkdayEndpoint endpoint = new WorkdayEndpoint(uri, this, 
configuration);
         setProperties(endpoint, parameters);
 
@@ -42,37 +43,25 @@ public class WorkdayComponent extends DefaultComponent {
 
     @Override
     protected void afterConfiguration(String uri, String remaining, Endpoint 
endpoint, Map<String, Object> parameters) throws Exception {
-
         WorkdayEndpoint workdayEndpoint = (WorkdayEndpoint)endpoint;
         WorkdayConfiguration workdayConfiguration = 
workdayEndpoint.getWorkdayConfiguration();
-
-        validateRequiredParameters(workdayConfiguration);
-
-        StringBuilder stringBuilder = new StringBuilder(remaining);
-        stringBuilder.append("?");
-
-        if (parameters.size() > 0) {
-
-            String params = parameters.keySet().stream().map(k -> k + "=" + 
parameters.get(k)).collect(Collectors.joining("&"));
-            stringBuilder.append(params);
-            stringBuilder.append("&");
-        }
-
-        stringBuilder.append("format=");
-        stringBuilder.append(workdayConfiguration.getFormat());
-
-        String uriString = String.format(RAAS_ENDPOINT_URL, 
workdayConfiguration.getHost(), workdayConfiguration.getTenant(), 
stringBuilder.toString());
-
-        workdayEndpoint.setUri(uriString);
-
+        validateConnectionParameters(workdayConfiguration);
     }
 
-    protected void validateRequiredParameters(WorkdayConfiguration 
workdayConfiguration) {
-
-        if (workdayConfiguration.getHost() == null || 
workdayConfiguration.getTenant() == null || workdayConfiguration.getClientId() 
== null
-            || workdayConfiguration.getClientSecret() == null || 
workdayConfiguration.getTokenRefresh() == null) {
+    /**
+     * Parses the configuration
+     * @return the parsed and valid configuration to use
+     */
+    protected WorkdayConfiguration parseConfiguration(WorkdayConfiguration 
configuration, String remaining, Map<String, Object> parameters) throws 
Exception {
+        configuration.parseURI(remaining, parameters);
+        return configuration;
+    }
 
-            throw new ResolveEndpointFailedException("The parameters host, 
tenant, clientId, clientSecret and tokenRefresh are required.");
-        }
+    protected void validateConnectionParameters(WorkdayConfiguration 
workdayConfiguration) {
+        ObjectHelper.notNull(workdayConfiguration.getHost(), "Host");
+        ObjectHelper.notNull(workdayConfiguration.getTenant(), "Tenant");
+        ObjectHelper.notNull(workdayConfiguration.getClientId(), "ClientId");
+        ObjectHelper.notNull(workdayConfiguration.getClientSecret(), 
"ClientSecret");
+        ObjectHelper.notNull(workdayConfiguration.getTokenRefresh(), 
"TokenRefresh");
     }
 }
diff --git 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayConfiguration.java
 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayConfiguration.java
index 4505ce3..a2b4671 100644
--- 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayConfiguration.java
+++ 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayConfiguration.java
@@ -16,23 +16,42 @@
  */
 package org.apache.camel.component.workday;
 
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.util.Map;
+
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
+import org.apache.camel.spi.UriPath;
+import org.apache.camel.util.ObjectHelper;
 import org.apache.http.impl.conn.PoolingHttpClientConnectionManager;
 
 @UriParams
 public class WorkdayConfiguration {
 
-    @UriParam(label = "security", secret = true, description = "Workday Client 
Id generated by API Client for Integrations.")
+    // Implemented entities
+    public enum Entity {
+        report
+    }
+
+    @UriPath(description = "The entity to be requested or subscribed via 
API.", enums = "report")
+    @Metadata(required = true)
+    private Entity entity;
+
+    @UriPath(description = "The API path to access an entity structure.")
+    @Metadata(required = true)
+    private String path;
+
+    @UriParam(label = "security", secret = true, description = "Workday client 
Id generated by API client for integrations.")
     @Metadata(required = true)
     private String clientId;
 
-    @UriParam(label = "security", secret = true, description = "Workday Client 
Secrect generated by API Client for Integrations.")
+    @UriParam(label = "security", secret = true, description = "Workday client 
Secret generated by API client for integrations.")
     @Metadata(required = true)
     private String clientSecret;
 
-    @UriParam(label = "security", secret = true, description = "Workday Token 
Refresh generated for Integration system user.")
+    @UriParam(label = "security", secret = true, description = "Workday token 
Refresh generated for integrations system user.")
     @Metadata(required = true)
     private String tokenRefresh;
 
@@ -44,12 +63,30 @@ public class WorkdayConfiguration {
     @Metadata(required = true)
     private String tenant;
 
-    @UriParam(label = "format", description = "Workday Report as a service 
output format.")
-    private String format = "json";
+    @UriParam(label = "format", description = "Workday Report as a service 
output format.",  enums = "json", defaultValue = "json")
+    private String reportFormat = "json";
 
-    @UriParam(label = "advanced", description = "Pool connection manager for 
advanced configuration")
+    @UriParam(label = "advanced", description = "Pool connection manager for 
advanced configuration.")
     private PoolingHttpClientConnectionManager httpConnectionManager = new 
PoolingHttpClientConnectionManager();
 
+    private Map<String, Object> parameters;
+
+    public Entity getEntity() {
+        return entity;
+    }
+
+    public void setEntity(Entity entity) {
+        this.entity = entity;
+    }
+
+    public String getPath() {
+        return path;
+    }
+
+    public void setPath(String path) {
+        this.path = path;
+    }
+
     public String getClientId() {
         return clientId;
     }
@@ -90,12 +127,12 @@ public class WorkdayConfiguration {
         this.tenant = tenant;
     }
 
-    public String getFormat() {
-        return format;
+    public String getReportFormat() {
+        return reportFormat;
     }
 
-    public void setFormat(String format) {
-        this.format = format;
+    public void setReportFormat(String reportFormat) {
+        this.reportFormat = reportFormat;
     }
 
     public PoolingHttpClientConnectionManager getHttpConnectionManager() {
@@ -106,4 +143,28 @@ public class WorkdayConfiguration {
         this.httpConnectionManager = httpConnectionManager;
     }
 
-}
+    public Map<String, Object> getParameters() {
+        return parameters;
+    }
+
+    public void setParameters(Map<String, Object> parameters) {
+        this.parameters = parameters;
+    }
+
+    public void parseURI(String remaining, Map<String, Object> parameters) 
throws Exception {
+        String entity;
+        String path;
+        try {
+            URI u = new URI(remaining);
+            entity = u.getScheme();
+            path = u.getPath();
+        } catch (Exception e) {
+            throw new MalformedURLException(String.format("An invalid workday 
remaining uri: '%s' was provided. Error: ", remaining, e.getMessage()));
+        }
+        ObjectHelper.notNull(entity, "Entity");
+
+        setPath(path);
+        setEntity(Entity.valueOf(entity));
+        setParameters(parameters);
+    }
+}
\ No newline at end of file
diff --git 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java
 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java
index f6741cd..4bdc61f 100644
--- 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java
+++ 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayEndpoint.java
@@ -17,25 +17,18 @@
 package org.apache.camel.component.workday;
 
 import org.apache.camel.Consumer;
-import org.apache.camel.NoSuchEndpointException;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
-import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
-import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.DefaultEndpoint;
+
 /**
- * Represents a camel-workday endpoint.
+ * Represents a Workday endpoint.
  */
-
-@UriEndpoint(firstVersion = "3.1.0-SNAPSHOT", scheme = "workday", title = 
"Workday", syntax = "workday:uri", label = "hcm")
+@UriEndpoint(firstVersion = "3.1.0", scheme = "workday", title = "Workday", 
syntax = "workday:entity:path", producerOnly = true, label = "hcm")
 public class WorkdayEndpoint extends DefaultEndpoint {
 
-    @UriPath(description = "The partial URL for RAAS report.")
-    @Metadata(required = true)
-    private String uri;
-    
     @UriParam
     private WorkdayConfiguration workdayConfiguration;
 
@@ -48,13 +41,16 @@ public class WorkdayEndpoint extends DefaultEndpoint {
     }
 
     public Producer createProducer() throws Exception {
-
-        return new WorkdayProducer(this, uri);
+        switch (workdayConfiguration.getEntity()) {
+        case report:
+            return new WorkdayReportProducer(this);
+        default:
+            throw new UnsupportedOperationException(String.format("Workday 
producer %s is not implemented", workdayConfiguration.getEntity()));
+        }
     }
 
     public Consumer createConsumer(Processor processor) throws Exception {
-
-        throw new NoSuchEndpointException("Workday consumer is not 
implemented.");
+        throw new UnsupportedOperationException("Workday consumer is not 
implemented.");
     }
 
     @Override
@@ -62,14 +58,6 @@ public class WorkdayEndpoint extends DefaultEndpoint {
         return true;
     }
 
-    public String getUri() {
-        return uri;
-    }
-
-    public void setUri(String uri) {
-        this.uri = uri;
-    }
-
     public WorkdayConfiguration getWorkdayConfiguration() {
         return workdayConfiguration;
     }
diff --git 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayProducer.java
 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayReportProducer.java
similarity index 68%
rename from 
components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayProducer.java
rename to 
components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayReportProducer.java
index b4e4025..3e3aa09 100644
--- 
a/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayProducer.java
+++ 
b/components/camel-workday/src/main/java/org/apache/camel/component/workday/WorkdayReportProducer.java
@@ -16,6 +16,9 @@
  */
 package org.apache.camel.component.workday;
 
+import java.util.Map;
+import java.util.stream.Collectors;
+
 import org.apache.camel.Exchange;
 import org.apache.camel.component.workday.auth.AuthClientForIntegration;
 import org.apache.camel.component.workday.auth.AutheticationClient;
@@ -30,27 +33,22 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- * The camel-workday producer.
+ * The Workday Report producer.
  */
-public class WorkdayProducer extends DefaultProducer {
-
-    public static final String WORKDAY_RAAS_HEADER = "CamelWorkdayRAAS";
+public class WorkdayReportProducer extends DefaultProducer {
 
-    private static final Logger LOG = 
LoggerFactory.getLogger(WorkdayProducer.class);
+    public static final String WORKDAY_URL_HEADER = "CamelWorkdayURL";
+    public static final String WORKDAY_RASS_URL_TEMPALTE = 
"https://%s/ccx/service/customreport2/%s%s";;
 
-    private String workdayUri;
+    private static final Logger LOG = 
LoggerFactory.getLogger(WorkdayReportProducer.class);
 
     private WorkdayEndpoint endpoint;
 
-    private WorkdayComponent component;
-
     private AutheticationClient autheticationClient;
 
-    public WorkdayProducer(WorkdayEndpoint endpoint, String workdayUri) {
+    public WorkdayReportProducer(WorkdayEndpoint endpoint) {
         super(endpoint);
         this.endpoint = endpoint;
-        this.workdayUri = workdayUri;
-        this.component = (WorkdayComponent)this.endpoint.getComponent();
         this.autheticationClient = new 
AuthClientForIntegration(this.endpoint.getWorkdayConfiguration());
     }
 
@@ -60,11 +58,11 @@ public class WorkdayProducer extends DefaultProducer {
     }
 
     public void process(Exchange exchange) throws Exception {
-
         PoolingHttpClientConnectionManager httpClientConnectionManager = 
endpoint.getWorkdayConfiguration().getHttpConnectionManager();
         CloseableHttpClient httpClient = 
HttpClientBuilder.create().setConnectionManager(httpClientConnectionManager).build();
+        String workdayUri = prepareUri(endpoint.getWorkdayConfiguration());
 
-        HttpGet httpGet = new HttpGet(this.workdayUri);
+        HttpGet httpGet = new HttpGet(workdayUri);
         this.autheticationClient.configure(httpClient, httpGet);
 
         CloseableHttpResponse httpResponse = httpClient.execute(httpGet);
@@ -80,7 +78,24 @@ public class WorkdayProducer extends DefaultProducer {
         }
 
         exchange.getIn().setBody(report);
-        exchange.getIn().setHeader(WORKDAY_RAAS_HEADER, workdayUri);
+        exchange.getIn().setHeader(WORKDAY_URL_HEADER, workdayUri);
+    }
+
+    public String prepareUri(WorkdayConfiguration configuration) {
+        Map<String, Object> parameters = configuration.getParameters();
+        StringBuilder stringBuilder = new 
StringBuilder(configuration.getPath());
+        stringBuilder.append("?");
+        if (parameters.size() > 0) {
+            String params = parameters.keySet().stream().map(k -> k + "=" + 
parameters.get(k)).collect(Collectors.joining("&"));
+            stringBuilder.append(params);
+            stringBuilder.append("&");
+        }
+
+        stringBuilder.append("format=");
+        stringBuilder.append(configuration.getReportFormat());
+        String uriString = String.format(WORKDAY_RASS_URL_TEMPALTE, 
configuration.getHost(), configuration.getTenant(), stringBuilder.toString());
+
+        return uriString;
     }
 
 }
diff --git 
a/components/camel-workday/src/test/java/org/apache/camel/WorkdayComponentTest.java
 
b/components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java
similarity index 70%
rename from 
components/camel-workday/src/test/java/org/apache/camel/WorkdayComponentTest.java
rename to 
components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java
index 0af82bf..0b3f096 100644
--- 
a/components/camel-workday/src/test/java/org/apache/camel/WorkdayComponentTest.java
+++ 
b/components/camel-workday/src/test/java/org/apache/camel/WorkdayReportProducerTest.java
@@ -19,22 +19,24 @@ package org.apache.camel;
 import org.apache.camel.component.workday.WorkdayComponent;
 import org.apache.camel.component.workday.WorkdayConfiguration;
 import org.apache.camel.component.workday.WorkdayEndpoint;
+import org.apache.camel.component.workday.WorkdayReportProducer;
 import org.apache.camel.test.junit4.CamelTestSupport;
 import org.junit.Test;
 
-public class WorkdayComponentTest extends CamelTestSupport {
+public class WorkdayReportProducerTest extends CamelTestSupport {
 
     @Test
     public void createProducerMinimalConfiguration() throws Exception {
-
         WorkdayComponent workdayComponent = context.getComponent("workday", 
WorkdayComponent.class);
 
         WorkdayEndpoint workdayEndpoint = (WorkdayEndpoint)workdayComponent
-            .createEndpoint("workday:/<Owner>/<ReportName>?" + 
"host=impl.workday.com" + "&tenant=camel" + 
"&clientId=f7014d38-99d2-4969-b740-b5b62db6b46a"
-                            + 
"&clientSecret=7dbaf280-3cea-11ea-b77f-2e728ce88125" + 
"&tokenRefresh=88689ab63cda" + "&format=json");
+            
.createEndpoint("workday:report:/ISU_Camel/Custom_Report_Employees?" + 
"host=impl.workday.com" + "&tenant=camel" + 
"&clientId=f7014d38-99d2-4969-b740-b5b62db6b46a"
+                            + 
"&clientSecret=7dbaf280-3cea-11ea-b77f-2e728ce88125" + 
"&tokenRefresh=88689ab63cda" + "&reportFormat=json");
 
         WorkdayConfiguration workdayConfiguration = 
workdayEndpoint.getWorkdayConfiguration();
 
+        assertEquals(workdayConfiguration.getEntity(), 
WorkdayConfiguration.Entity.report);
+        assertEquals(workdayConfiguration.getPath(), 
"/ISU_Camel/Custom_Report_Employees");
         assertEquals(workdayConfiguration.getHost(), "impl.workday.com");
         assertEquals(workdayConfiguration.getTenant(), "camel");
         assertEquals(workdayConfiguration.getClientId(), 
"f7014d38-99d2-4969-b740-b5b62db6b46a");
@@ -44,17 +46,17 @@ public class WorkdayComponentTest extends CamelTestSupport {
 
     @Test
     public void createProducerNoHostConfiguration() throws Exception {
-
         WorkdayComponent workdayComponent = context.getComponent("workday", 
WorkdayComponent.class);
 
         try {
 
             WorkdayEndpoint workdayEndpoint = (WorkdayEndpoint)workdayComponent
-                .createEndpoint("workday:/<Owner>/<ReportName>?" + 
"tenant=camel" + "&clientId=f7014d38-99d2-4969-b740-b5b62db6b46a"
+                
.createEndpoint("workday:report:/ISU_Camel/Custom_Report_Employees?" + 
"tenant=camel" + "&clientId=f7014d38-99d2-4969-b740-b5b62db6b46a"
                                 + 
"&clientSecret=7dbaf280-3cea-11ea-b77f-2e728ce88125" + 
"&tokenRefresh=88689ab63cda" + "&format=json");
-        } catch (ResolveEndpointFailedException exception) {
+        } catch (Exception exception) {
 
-            assertEquals(exception.getMessage(), "Failed to resolve endpoint: 
" + "The parameters host, tenant, clientId, clientSecret and tokenRefresh are 
required.");
+            assertEquals(exception.getClass(), IllegalArgumentException.class);
+            assertEquals(exception.getMessage(), "Host must be specified");
             return;
         }
 
@@ -63,14 +65,14 @@ public class WorkdayComponentTest extends CamelTestSupport {
 
     @Test
     public void createProducerUrlValidation() throws Exception {
-
         WorkdayComponent workdayComponent = context.getComponent("workday", 
WorkdayComponent.class);
 
         WorkdayEndpoint workdayEndpoint = (WorkdayEndpoint)workdayComponent
-            .createEndpoint("workday:/ISU_Camel/Custom_Report_Employees?" + 
"host=camel.myworkday.com" + "&tenant=camel" + 
"&clientId=f7014d38-99d2-4969-b740-b5b62db6b46a"
+            
.createEndpoint("workday:report:/ISU_Camel/Custom_Report_Employees?" + 
"host=camel.myworkday.com" + "&tenant=camel" + 
"&clientId=f7014d38-99d2-4969-b740-b5b62db6b46a"
                             + 
"&clientSecret=7dbaf280-3cea-11ea-b77f-2e728ce88125" + 
"&tokenRefresh=88689ab63cda" + "&param=test1");
 
-        String workdayUri = workdayEndpoint.getUri();
+        WorkdayReportProducer workdayProducer = new 
WorkdayReportProducer(workdayEndpoint);
+        String workdayUri = 
workdayProducer.prepareUri(workdayEndpoint.getWorkdayConfiguration());
 
         assertEquals(workdayUri, 
"https://camel.myworkday.com/ccx/service/customreport2/camel/ISU_Camel/Custom_Report_Employees?param=test1&format=json";);
     }
diff --git 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WorkdayEndpointBuilderFactory.java
 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WorkdayEndpointBuilderFactory.java
index 99970f6..ab87c73 100644
--- 
a/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WorkdayEndpointBuilderFactory.java
+++ 
b/core/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/WorkdayEndpointBuilderFactory.java
@@ -17,14 +17,12 @@
 package org.apache.camel.builder.endpoint.dsl;
 
 import javax.annotation.Generated;
-import org.apache.camel.ExchangePattern;
 import org.apache.camel.builder.EndpointConsumerBuilder;
 import org.apache.camel.builder.EndpointProducerBuilder;
 import org.apache.camel.builder.endpoint.AbstractEndpointBuilder;
-import org.apache.camel.spi.ExceptionHandler;
 
 /**
- * Represents a camel-workday endpoint.
+ * Represents a Workday endpoint.
  * 
  * Generated by camel-package-maven-plugin - do not edit this file!
  */
@@ -33,283 +31,11 @@ public interface WorkdayEndpointBuilderFactory {
 
 
     /**
-     * Builder for endpoint consumers for the Workday component.
-     */
-    public interface WorkdayEndpointConsumerBuilder
-            extends
-                EndpointConsumerBuilder {
-        default AdvancedWorkdayEndpointConsumerBuilder advanced() {
-            return (AdvancedWorkdayEndpointConsumerBuilder) this;
-        }
-        /**
-         * Allows for bridging the consumer to the Camel routing Error Handler,
-         * which mean any exceptions occurred while the consumer is trying to
-         * pickup incoming messages, or the likes, will now be processed as a
-         * message and handled by the routing Error Handler. By default the
-         * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
-         * with exceptions, that will be logged at WARN or ERROR level and
-         * ignored.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: consumer
-         */
-        default WorkdayEndpointConsumerBuilder bridgeErrorHandler(
-                boolean bridgeErrorHandler) {
-            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
-            return this;
-        }
-        /**
-         * Allows for bridging the consumer to the Camel routing Error Handler,
-         * which mean any exceptions occurred while the consumer is trying to
-         * pickup incoming messages, or the likes, will now be processed as a
-         * message and handled by the routing Error Handler. By default the
-         * consumer will use the org.apache.camel.spi.ExceptionHandler to deal
-         * with exceptions, that will be logged at WARN or ERROR level and
-         * ignored.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: consumer
-         */
-        default WorkdayEndpointConsumerBuilder bridgeErrorHandler(
-                String bridgeErrorHandler) {
-            doSetProperty("bridgeErrorHandler", bridgeErrorHandler);
-            return this;
-        }
-        /**
-         * Workday Report as a service output format.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: format
-         */
-        default WorkdayEndpointConsumerBuilder format(String format) {
-            doSetProperty("format", format);
-            return this;
-        }
-        /**
-         * Workday Host name.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: host
-         */
-        default WorkdayEndpointConsumerBuilder host(String host) {
-            doSetProperty("host", host);
-            return this;
-        }
-        /**
-         * Workday Client Id generated by API Client for Integrations.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: security
-         */
-        default WorkdayEndpointConsumerBuilder clientId(String clientId) {
-            doSetProperty("clientId", clientId);
-            return this;
-        }
-        /**
-         * Workday Client Secrect generated by API Client for Integrations.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: security
-         */
-        default WorkdayEndpointConsumerBuilder clientSecret(String 
clientSecret) {
-            doSetProperty("clientSecret", clientSecret);
-            return this;
-        }
-        /**
-         * Workday Token Refresh generated for Integration system user.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: security
-         */
-        default WorkdayEndpointConsumerBuilder tokenRefresh(String 
tokenRefresh) {
-            doSetProperty("tokenRefresh", tokenRefresh);
-            return this;
-        }
-        /**
-         * Workday Tenant name.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: tenant
-         */
-        default WorkdayEndpointConsumerBuilder tenant(String tenant) {
-            doSetProperty("tenant", tenant);
-            return this;
-        }
-    }
-
-    /**
-     * Advanced builder for endpoint consumers for the Workday component.
-     */
-    public interface AdvancedWorkdayEndpointConsumerBuilder
-            extends
-                EndpointConsumerBuilder {
-        default WorkdayEndpointConsumerBuilder basic() {
-            return (WorkdayEndpointConsumerBuilder) this;
-        }
-        /**
-         * To let the consumer use a custom ExceptionHandler. Notice if the
-         * option bridgeErrorHandler is enabled then this option is not in use.
-         * By default the consumer will deal with exceptions, that will be
-         * logged at WARN or ERROR level and ignored.
-         * 
-         * The option is a: <code>org.apache.camel.spi.ExceptionHandler</code>
-         * type.
-         * 
-         * Group: consumer (advanced)
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder exceptionHandler(
-                ExceptionHandler exceptionHandler) {
-            doSetProperty("exceptionHandler", exceptionHandler);
-            return this;
-        }
-        /**
-         * To let the consumer use a custom ExceptionHandler. Notice if the
-         * option bridgeErrorHandler is enabled then this option is not in use.
-         * By default the consumer will deal with exceptions, that will be
-         * logged at WARN or ERROR level and ignored.
-         * 
-         * The option will be converted to a
-         * <code>org.apache.camel.spi.ExceptionHandler</code> type.
-         * 
-         * Group: consumer (advanced)
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder exceptionHandler(
-                String exceptionHandler) {
-            doSetProperty("exceptionHandler", exceptionHandler);
-            return this;
-        }
-        /**
-         * Sets the exchange pattern when the consumer creates an exchange.
-         * 
-         * The option is a: <code>org.apache.camel.ExchangePattern</code> type.
-         * 
-         * Group: consumer (advanced)
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder exchangePattern(
-                ExchangePattern exchangePattern) {
-            doSetProperty("exchangePattern", exchangePattern);
-            return this;
-        }
-        /**
-         * Sets the exchange pattern when the consumer creates an exchange.
-         * 
-         * The option will be converted to a
-         * <code>org.apache.camel.ExchangePattern</code> type.
-         * 
-         * Group: consumer (advanced)
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder exchangePattern(
-                String exchangePattern) {
-            doSetProperty("exchangePattern", exchangePattern);
-            return this;
-        }
-        /**
-         * Whether the endpoint should use basic property binding (Camel 2.x) 
or
-         * the newer property binding with additional capabilities.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder basicPropertyBinding(
-                boolean basicPropertyBinding) {
-            doSetProperty("basicPropertyBinding", basicPropertyBinding);
-            return this;
-        }
-        /**
-         * Whether the endpoint should use basic property binding (Camel 2.x) 
or
-         * the newer property binding with additional capabilities.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder basicPropertyBinding(
-                String basicPropertyBinding) {
-            doSetProperty("basicPropertyBinding", basicPropertyBinding);
-            return this;
-        }
-        /**
-         * Pool connection manager for advanced configuration.
-         * 
-         * The option is a:
-         * 
<code>org.apache.http.impl.conn.PoolingHttpClientConnectionManager</code> type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder httpConnectionManager(
-                Object httpConnectionManager) {
-            doSetProperty("httpConnectionManager", httpConnectionManager);
-            return this;
-        }
-        /**
-         * Pool connection manager for advanced configuration.
-         * 
-         * The option will be converted to a
-         * 
<code>org.apache.http.impl.conn.PoolingHttpClientConnectionManager</code> type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder httpConnectionManager(
-                String httpConnectionManager) {
-            doSetProperty("httpConnectionManager", httpConnectionManager);
-            return this;
-        }
-        /**
-         * Sets whether synchronous processing should be strictly used, or 
Camel
-         * is allowed to use asynchronous processing (if supported).
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder synchronous(
-                boolean synchronous) {
-            doSetProperty("synchronous", synchronous);
-            return this;
-        }
-        /**
-         * Sets whether synchronous processing should be strictly used, or 
Camel
-         * is allowed to use asynchronous processing (if supported).
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointConsumerBuilder synchronous(
-                String synchronous) {
-            doSetProperty("synchronous", synchronous);
-            return this;
-        }
-    }
-
-    /**
-     * Builder for endpoint producers for the Workday component.
+     * Builder for endpoint for the Workday component.
      */
-    public interface WorkdayEndpointProducerBuilder
-            extends
-                EndpointProducerBuilder {
-        default AdvancedWorkdayEndpointProducerBuilder advanced() {
-            return (AdvancedWorkdayEndpointProducerBuilder) this;
+    public interface WorkdayEndpointBuilder extends EndpointProducerBuilder {
+        default AdvancedWorkdayEndpointBuilder advanced() {
+            return (AdvancedWorkdayEndpointBuilder) this;
         }
         /**
          * Whether the producer should be started lazy (on the first message).
@@ -327,7 +53,7 @@ public interface WorkdayEndpointBuilderFactory {
          * Default: false
          * Group: producer
          */
-        default WorkdayEndpointProducerBuilder lazyStartProducer(
+        default WorkdayEndpointBuilder lazyStartProducer(
                 boolean lazyStartProducer) {
             doSetProperty("lazyStartProducer", lazyStartProducer);
             return this;
@@ -348,7 +74,7 @@ public interface WorkdayEndpointBuilderFactory {
          * Default: false
          * Group: producer
          */
-        default WorkdayEndpointProducerBuilder lazyStartProducer(
+        default WorkdayEndpointBuilder lazyStartProducer(
                 String lazyStartProducer) {
             doSetProperty("lazyStartProducer", lazyStartProducer);
             return this;
@@ -358,186 +84,11 @@ public interface WorkdayEndpointBuilderFactory {
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
+         * Default: json
          * Group: format
          */
-        default WorkdayEndpointProducerBuilder format(String format) {
-            doSetProperty("format", format);
-            return this;
-        }
-        /**
-         * Workday Host name.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: host
-         */
-        default WorkdayEndpointProducerBuilder host(String host) {
-            doSetProperty("host", host);
-            return this;
-        }
-        /**
-         * Workday Client Id generated by API Client for Integrations.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: security
-         */
-        default WorkdayEndpointProducerBuilder clientId(String clientId) {
-            doSetProperty("clientId", clientId);
-            return this;
-        }
-        /**
-         * Workday Client Secrect generated by API Client for Integrations.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: security
-         */
-        default WorkdayEndpointProducerBuilder clientSecret(String 
clientSecret) {
-            doSetProperty("clientSecret", clientSecret);
-            return this;
-        }
-        /**
-         * Workday Token Refresh generated for Integration system user.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: security
-         */
-        default WorkdayEndpointProducerBuilder tokenRefresh(String 
tokenRefresh) {
-            doSetProperty("tokenRefresh", tokenRefresh);
-            return this;
-        }
-        /**
-         * Workday Tenant name.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Required: true
-         * Group: tenant
-         */
-        default WorkdayEndpointProducerBuilder tenant(String tenant) {
-            doSetProperty("tenant", tenant);
-            return this;
-        }
-    }
-
-    /**
-     * Advanced builder for endpoint producers for the Workday component.
-     */
-    public interface AdvancedWorkdayEndpointProducerBuilder
-            extends
-                EndpointProducerBuilder {
-        default WorkdayEndpointProducerBuilder basic() {
-            return (WorkdayEndpointProducerBuilder) this;
-        }
-        /**
-         * Whether the endpoint should use basic property binding (Camel 2.x) 
or
-         * the newer property binding with additional capabilities.
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointProducerBuilder basicPropertyBinding(
-                boolean basicPropertyBinding) {
-            doSetProperty("basicPropertyBinding", basicPropertyBinding);
-            return this;
-        }
-        /**
-         * Whether the endpoint should use basic property binding (Camel 2.x) 
or
-         * the newer property binding with additional capabilities.
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointProducerBuilder basicPropertyBinding(
-                String basicPropertyBinding) {
-            doSetProperty("basicPropertyBinding", basicPropertyBinding);
-            return this;
-        }
-        /**
-         * Pool connection manager for advanced configuration.
-         * 
-         * The option is a:
-         * 
<code>org.apache.http.impl.conn.PoolingHttpClientConnectionManager</code> type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointProducerBuilder httpConnectionManager(
-                Object httpConnectionManager) {
-            doSetProperty("httpConnectionManager", httpConnectionManager);
-            return this;
-        }
-        /**
-         * Pool connection manager for advanced configuration.
-         * 
-         * The option will be converted to a
-         * 
<code>org.apache.http.impl.conn.PoolingHttpClientConnectionManager</code> type.
-         * 
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointProducerBuilder httpConnectionManager(
-                String httpConnectionManager) {
-            doSetProperty("httpConnectionManager", httpConnectionManager);
-            return this;
-        }
-        /**
-         * Sets whether synchronous processing should be strictly used, or 
Camel
-         * is allowed to use asynchronous processing (if supported).
-         * 
-         * The option is a: <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointProducerBuilder synchronous(
-                boolean synchronous) {
-            doSetProperty("synchronous", synchronous);
-            return this;
-        }
-        /**
-         * Sets whether synchronous processing should be strictly used, or 
Camel
-         * is allowed to use asynchronous processing (if supported).
-         * 
-         * The option will be converted to a <code>boolean</code> type.
-         * 
-         * Default: false
-         * Group: advanced
-         */
-        default AdvancedWorkdayEndpointProducerBuilder synchronous(
-                String synchronous) {
-            doSetProperty("synchronous", synchronous);
-            return this;
-        }
-    }
-
-    /**
-     * Builder for endpoint for the Workday component.
-     */
-    public interface WorkdayEndpointBuilder
-            extends
-                WorkdayEndpointConsumerBuilder,
-                WorkdayEndpointProducerBuilder {
-        default AdvancedWorkdayEndpointBuilder advanced() {
-            return (AdvancedWorkdayEndpointBuilder) this;
-        }
-        /**
-         * Workday Report as a service output format.
-         * 
-         * The option is a: <code>java.lang.String</code> type.
-         * 
-         * Group: format
-         */
-        default WorkdayEndpointBuilder format(String format) {
-            doSetProperty("format", format);
+        default WorkdayEndpointBuilder reportFormat(String reportFormat) {
+            doSetProperty("reportFormat", reportFormat);
             return this;
         }
         /**
@@ -553,7 +104,7 @@ public interface WorkdayEndpointBuilderFactory {
             return this;
         }
         /**
-         * Workday Client Id generated by API Client for Integrations.
+         * Workday client Id generated by API client for integrations.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -565,7 +116,7 @@ public interface WorkdayEndpointBuilderFactory {
             return this;
         }
         /**
-         * Workday Client Secrect generated by API Client for Integrations.
+         * Workday client Secret generated by API client for integrations.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -577,7 +128,7 @@ public interface WorkdayEndpointBuilderFactory {
             return this;
         }
         /**
-         * Workday Token Refresh generated for Integration system user.
+         * Workday token Refresh generated for integrations system user.
          * 
          * The option is a: <code>java.lang.String</code> type.
          * 
@@ -607,8 +158,7 @@ public interface WorkdayEndpointBuilderFactory {
      */
     public interface AdvancedWorkdayEndpointBuilder
             extends
-                AdvancedWorkdayEndpointConsumerBuilder,
-                AdvancedWorkdayEndpointProducerBuilder {
+                EndpointProducerBuilder {
         default WorkdayEndpointBuilder basic() {
             return (WorkdayEndpointBuilder) this;
         }
@@ -697,16 +247,20 @@ public interface WorkdayEndpointBuilderFactory {
     public interface WorkdayBuilders {
         /**
          * Workday (camel-workday)
-         * Represents a camel-workday endpoint.
+         * Represents a Workday endpoint.
          * 
          * Category: hcm
-         * Since: 3.1.0-SNAPSHOT
+         * Since: 3.1
          * Maven coordinates: org.apache.camel:camel-workday
          * 
-         * Syntax: <code>workday:uri</code>
+         * Syntax: <code>workday:entity:path</code>
          * 
-         * Path parameter: uri (required)
-         * The partial URL for RAAS report.
+         * Path parameter: entity (required)
+         * The entity to be requested or subscribed via API.
+         * The value can be one of: report
+         * 
+         * Path parameter: path (required)
+         * The API path to access an entity structure.
          */
         default WorkdayEndpointBuilder workday(String path) {
             return WorkdayEndpointBuilderFactory.workday(path);
@@ -714,16 +268,20 @@ public interface WorkdayEndpointBuilderFactory {
     }
     /**
      * Workday (camel-workday)
-     * Represents a camel-workday endpoint.
+     * Represents a Workday endpoint.
      * 
      * Category: hcm
-     * Since: 3.1.0-SNAPSHOT
+     * Since: 3.1
      * Maven coordinates: org.apache.camel:camel-workday
      * 
-     * Syntax: <code>workday:uri</code>
+     * Syntax: <code>workday:entity:path</code>
+     * 
+     * Path parameter: entity (required)
+     * The entity to be requested or subscribed via API.
+     * The value can be one of: report
      * 
-     * Path parameter: uri (required)
-     * The partial URL for RAAS report.
+     * Path parameter: path (required)
+     * The API path to access an entity structure.
      */
     static WorkdayEndpointBuilder workday(String path) {
         class WorkdayEndpointBuilderImpl extends AbstractEndpointBuilder 
implements WorkdayEndpointBuilder, AdvancedWorkdayEndpointBuilder {

Reply via email to