CAMEL-7999: More components include documentation
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/0d99e506 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/0d99e506 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/0d99e506 Branch: refs/heads/master Commit: 0d99e506e0e27052c28b1d9059fd0015ad32c4c8 Parents: 009c374 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Dec 19 13:48:29 2014 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Dec 19 13:48:29 2014 +0100 ---------------------------------------------------------------------- .../camel/component/splunk/SplunkComponent.java | 9 +++++++-- .../component/splunk/SplunkConfiguration.java | 20 +++++++++++++++----- .../camel/component/splunk/SplunkEndpoint.java | 4 ++++ 3 files changed, 26 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/0d99e506/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkComponent.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkComponent.java index 7f346e2..d0d7039 100644 --- a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkComponent.java +++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkComponent.java @@ -19,17 +19,22 @@ package org.apache.camel.component.splunk; import java.util.Map; import org.apache.camel.Endpoint; -import org.apache.camel.impl.DefaultComponent; +import org.apache.camel.impl.UriEndpointComponent; /** * Represents the component that manages {@link SplunkEndpoint}. */ -public class SplunkComponent extends DefaultComponent { +public class SplunkComponent extends UriEndpointComponent { private SplunkConfigurationFactory splunkConfigurationFactory = new DefaultSplunkConfigurationFactory(); + public SplunkComponent() { + super(SplunkEndpoint.class); + } + protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { SplunkConfiguration configuration = splunkConfigurationFactory.parseMap(parameters); + configuration.setName(remaining); setProperties(configuration, parameters); return new SplunkEndpoint(uri, this, configuration); } http://git-wip-us.apache.org/repos/asf/camel/blob/0d99e506/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java index 4a0fcff..49a1ed2 100644 --- a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java +++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkConfiguration.java @@ -17,21 +17,23 @@ package org.apache.camel.component.splunk; import com.splunk.Service; - import org.apache.camel.spi.UriParam; import org.apache.camel.spi.UriParams; +import org.apache.camel.spi.UriPath; import org.apache.camel.util.ObjectHelper; @UriParams public class SplunkConfiguration { + @UriPath(description = "Name has no purpose") + private String name; + @UriParam + private String scheme = Service.DEFAULT_SCHEME; @UriParam private String host = Service.DEFAULT_HOST; @UriParam private int port = Service.DEFAULT_PORT; @UriParam - private String scheme = Service.DEFAULT_SCHEME; - @UriParam private String app; @UriParam private String owner; @@ -39,9 +41,9 @@ public class SplunkConfiguration { private String username; @UriParam private String password; - @UriParam + @UriParam(defaultValue = "5000") private int connectionTimeout = 5000; - @UriParam + @UriParam(defaultValue = "false") private boolean useSunHttpsHandler; @UriParam private String index; @@ -73,6 +75,14 @@ public class SplunkConfiguration { @UriParam private Boolean streaming; + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + public String getInitEarliestTime() { return initEarliestTime; } http://git-wip-us.apache.org/repos/asf/camel/blob/0d99e506/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkEndpoint.java b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkEndpoint.java index 6cac1ae..52ec4da 100644 --- a/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkEndpoint.java +++ b/components/camel-splunk/src/main/java/org/apache/camel/component/splunk/SplunkEndpoint.java @@ -26,15 +26,19 @@ import org.apache.camel.Consumer; import org.apache.camel.Processor; import org.apache.camel.Producer; import org.apache.camel.impl.ScheduledPollEndpoint; +import org.apache.camel.spi.UriEndpoint; +import org.apache.camel.spi.UriParam; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * Represents a Splunk endpoint. */ +@UriEndpoint(scheme = "splunk", consumerClass = SplunkConsumer.class, label = "monitoring") public class SplunkEndpoint extends ScheduledPollEndpoint { private static final Logger LOG = LoggerFactory.getLogger(SplunkEndpoint.class); + @UriParam private SplunkConfiguration configuration; private Service service;