Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 609c21366 -> 7b5db245f
  refs/heads/master f57e2fffb -> 23cd70e23


CAMEL-9472: Add multi value to component docs


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

Branch: refs/heads/master
Commit: df2b8c722d8292ec57ba0dda25808acf18f4a8af
Parents: f57e2ff
Author: Claus Ibsen <davscl...@apache.org>
Authored: Mon Jan 4 14:09:33 2016 +0100
Committer: Claus Ibsen <davscl...@apache.org>
Committed: Mon Jan 4 15:24:17 2016 +0100

----------------------------------------------------------------------
 .../camel/component/quartz/QuartzComponent.java | 15 ++++--
 .../camel/component/quartz/QuartzEndpoint.java  | 54 ++++++++++++++++++++
 2 files changed, 66 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/df2b8c72/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
----------------------------------------------------------------------
diff --git 
a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
 
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
index 5bcea28..9e8b13c 100644
--- 
a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
+++ 
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzComponent.java
@@ -94,7 +94,7 @@ public class QuartzComponent extends UriEndpointComponent 
implements StartupList
         String path = ObjectHelper.after(u.getPath(), "/");
         String host = u.getHost();
         String cron = getAndRemoveParameter(parameters, "cron", String.class);
-        Boolean fireNow = getAndRemoveParameter(parameters, "fireNow", 
Boolean.class, Boolean.FALSE);
+        boolean fireNow = getAndRemoveParameter(parameters, "fireNow", 
Boolean.class, Boolean.FALSE);
         Integer startDelayedSeconds = getAndRemoveParameter(parameters, 
"startDelayedSeconds", Integer.class);
         if (startDelayedSeconds != null) {
             if (scheduler.isStarted()) {
@@ -162,8 +162,17 @@ public class QuartzComponent extends UriEndpointComponent 
implements StartupList
         answer.setGroupName(group);
         answer.setTimerName(name);
         answer.setCron(cron);
-
-        setProperties(answer.getJobDetail(), jobParameters);
+        answer.setFireNow(fireNow);
+        if (startDelayedSeconds != null) {
+            answer.setStartDelayedSeconds(startDelayedSeconds);
+        }
+        if (triggerParameters != null && !triggerParameters.isEmpty()) {
+            answer.setTriggerParameters(triggerParameters);
+        }
+        if (jobParameters != null && !jobParameters.isEmpty()) {
+            answer.setJobParameters(jobParameters);
+            setProperties(answer.getJobDetail(), jobParameters);
+        }
 
         // enrich job data map with trigger information
         if (cron != null) {

http://git-wip-us.apache.org/repos/asf/camel/blob/df2b8c72/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
----------------------------------------------------------------------
diff --git 
a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
 
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
index 9682164..903f505 100644
--- 
a/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
+++ 
b/components/camel-quartz/src/main/java/org/apache/camel/component/quartz/QuartzEndpoint.java
@@ -17,6 +17,7 @@
 package org.apache.camel.component.quartz;
 
 import java.util.Date;
+import java.util.Map;
 
 import org.apache.camel.CamelExchangeException;
 import org.apache.camel.Exchange;
@@ -31,6 +32,7 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.ServiceSupport;
+import org.apache.camel.util.IntrospectionSupport;
 import org.apache.camel.util.ObjectHelper;
 import org.apache.camel.util.ServiceHelper;
 import org.quartz.JobDetail;
@@ -66,7 +68,15 @@ public class QuartzEndpoint extends DefaultEndpoint 
implements ShutdownableServi
     @UriParam
     private boolean pauseJob;
     @UriParam
+    private boolean fireNow;
+    @UriParam
+    private int startDelayedSeconds;
+    @UriParam
     private boolean usingFixedCamelContextName;
+    @UriParam(prefix = "trigger.", multiValue = true)
+    private Map<String, Object> triggerParameters;
+    @UriParam(prefix = "job.", multiValue = true)
+    private Map<String, Object> jobParameters;
 
     public QuartzEndpoint(final String endpointUri, final QuartzComponent 
component) {
         super(endpointUri, component);
@@ -282,6 +292,28 @@ public class QuartzEndpoint extends DefaultEndpoint 
implements ShutdownableServi
         this.pauseJob = pauseJob;
     }
 
+    public boolean isFireNow() {
+        return fireNow;
+    }
+
+    /**
+     * Whether to fire the scheduler asap when its started using the simple 
trigger (this option does not support cron)
+     */
+    public void setFireNow(boolean fireNow) {
+        this.fireNow = fireNow;
+    }
+
+    public int getStartDelayedSeconds() {
+        return startDelayedSeconds;
+    }
+
+    /**
+     * Seconds to wait before starting the quartz scheduler.
+     */
+    public void setStartDelayedSeconds(int startDelayedSeconds) {
+        this.startDelayedSeconds = startDelayedSeconds;
+    }
+
     public boolean isUsingFixedCamelContextName() {
         return usingFixedCamelContextName;
     }
@@ -294,6 +326,28 @@ public class QuartzEndpoint extends DefaultEndpoint 
implements ShutdownableServi
         this.usingFixedCamelContextName = usingFixedCamelContextName;
     }
 
+    public Map<String, Object> getTriggerParameters() {
+        return triggerParameters;
+    }
+
+    /**
+     * To configure additional options on the trigger.
+     */
+    public void setTriggerParameters(Map<String, Object> triggerParameters) {
+        this.triggerParameters = triggerParameters;
+    }
+
+    public Map<String, Object> getJobParameters() {
+        return jobParameters;
+    }
+
+    /**
+     * To configure additional options on the job.
+     */
+    public void setJobParameters(Map<String, Object> jobParameters) {
+        this.jobParameters = jobParameters;
+    }
+
     // Implementation methods
     // 
-------------------------------------------------------------------------
 

Reply via email to