Component docs
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/30d86101 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/30d86101 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/30d86101 Branch: refs/heads/master Commit: 30d86101b24d09a0f14e9a2f2a152e2b48f71968 Parents: 19522de Author: Claus Ibsen <davscl...@apache.org> Authored: Thu May 7 11:10:37 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Thu May 7 11:10:37 2015 +0200 ---------------------------------------------------------------------- .../component/file/GenericFileEndpoint.java | 2 +- .../component/hazelcast/HazelcastComponent.java | 7 ++- .../hazelcast/HazelcastDefaultEndpoint.java | 34 ++++++++++++++ .../camel/component/hbase/HBaseComponent.java | 7 +++ .../camel/component/hbase/HBaseEndpoint.java | 47 ++++++++++++++++---- 5 files changed, 86 insertions(+), 11 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/30d86101/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java ---------------------------------------------------------------------- diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java index ea122cf..616fec3 100644 --- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java +++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileEndpoint.java @@ -1066,7 +1066,7 @@ public abstract class GenericFileEndpoint<T> extends ScheduledPollEndpoint imple } /** - * Tlo define a maximum messages to gather per poll. + * To define a maximum messages to gather per poll. * By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. * Set a value of 0 or negative to disabled it. * Notice: If this option is in use then the File and FTP components will limit before any sorting. http://git-wip-us.apache.org/repos/asf/camel/blob/30d86101/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java index 0f29082..ec49638 100644 --- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java +++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastComponent.java @@ -46,7 +46,7 @@ public class HazelcastComponent extends UriEndpointComponent { private final HazelcastComponentHelper helper = new HazelcastComponentHelper(); private HazelcastInstance hazelcastInstance; - private boolean createOwnInstance; + private transient boolean createOwnInstance; public HazelcastComponent() { super(HazelcastDefaultEndpoint.class); @@ -169,6 +169,10 @@ public class HazelcastComponent extends UriEndpointComponent { return hazelcastInstance; } + /** + * The hazelcast instance reference which can be used for hazelcast endpoint. + * If you don't specify the instance reference, camel use the default hazelcast instance from the camel-hazelcast instance. + */ public void setHazelcastInstance(HazelcastInstance hazelcastInstance) { this.hazelcastInstance = hazelcastInstance; } @@ -188,7 +192,6 @@ public class HazelcastComponent extends UriEndpointComponent { // check if an already created instance is given then just get instance by its name. if (hzInstance == null && parameters.get(HAZELCAST_INSTANCE_NAME_PARAM) != null) { hzInstance = Hazelcast.getHazelcastInstanceByName((String) parameters.get(HAZELCAST_INSTANCE_NAME_PARAM)); - parameters.remove(HAZELCAST_INSTANCE_NAME_PARAM); } // Now create onw instance component http://git-wip-us.apache.org/repos/asf/camel/blob/30d86101/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java index d1fd79b..5cdee44 100644 --- a/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java +++ b/components/camel-hazelcast/src/main/java/org/apache/camel/component/hazelcast/HazelcastDefaultEndpoint.java @@ -37,6 +37,8 @@ public abstract class HazelcastDefaultEndpoint extends DefaultEndpoint { @UriParam protected HazelcastInstance hazelcastInstance; @UriParam + protected String hazelcastInstanceName; + @UriParam private int defaultOperation = -1; public HazelcastDefaultEndpoint(HazelcastInstance hazelcastInstance, String endpointUri, Component component) { @@ -61,18 +63,50 @@ public abstract class HazelcastDefaultEndpoint extends DefaultEndpoint { return command; } + /** + * What operation to perform. + */ public void setCommand(HazelcastCommand command) { this.command = command; } + public String getCacheName() { + return cacheName; + } + + /** + * The name of the cache + */ + public void setCacheName(String cacheName) { + this.cacheName = cacheName; + } + public HazelcastInstance getHazelcastInstance() { return hazelcastInstance; } + /** + * The hazelcast instance reference which can be used for hazelcast endpoint. + */ public void setHazelcastInstance(HazelcastInstance hazelcastInstance) { this.hazelcastInstance = hazelcastInstance; } + public String getHazelcastInstanceName() { + return hazelcastInstanceName; + } + + /** + * The hazelcast instance reference name which can be used for hazelcast endpoint. + * If you don't specify the instance reference, camel use the default hazelcast instance from the camel-hazelcast instance. + */ + public void setHazelcastInstanceName(String hazelcastInstanceName) { + this.hazelcastInstanceName = hazelcastInstanceName; + } + + /** + * To specify a default operation to use, if no operation header has been provided. + */ public void setDefaultOperation(int defaultOperation) { this.defaultOperation = defaultOperation; } http://git-wip-us.apache.org/repos/asf/camel/blob/30d86101/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java index a402b6f..339ff72 100644 --- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java +++ b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseComponent.java @@ -98,6 +98,9 @@ public class HBaseComponent extends UriEndpointComponent { return configuration; } + /** + * To use the shared configuration + */ public void setConfiguration(Configuration configuration) { this.configuration = configuration; } @@ -106,6 +109,10 @@ public class HBaseComponent extends UriEndpointComponent { return poolMaxSize; } + /** + * Maximum number of references to keep for each table in the HTable pool. + * The default value is 10. + */ public void setPoolMaxSize(int poolMaxSize) { this.poolMaxSize = poolMaxSize; } http://git-wip-us.apache.org/repos/asf/camel/blob/30d86101/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java index 881b35e..cb08a02 100644 --- a/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java +++ b/components/camel-hbase/src/main/java/org/apache/camel/component/hbase/HBaseEndpoint.java @@ -43,28 +43,27 @@ public class HBaseEndpoint extends DefaultEndpoint { private final HTablePool tablePool; private HBaseAdmin admin; - @UriPath @Metadata(required = "true") + @UriPath(description = "The name of the table") @Metadata(required = "true") private final String tableName; - //Operation properties. - @UriParam(defaultValue = "100") + @UriParam(label = "producer", defaultValue = "100") private int maxResults = 100; @UriParam private List<Filter> filters; - @UriParam + @UriParam(label = "consumer", enums = "CamelHBasePut,CamelHBaseGet,CamelHBaseScan,CamelHBaseDelete") private String operation; - @UriParam(defaultValue = "true") + @UriParam(label = "consumer", defaultValue = "true") private boolean remove = true; - @UriParam + @UriParam(enums = "header,body") private String mappingStrategyName; @UriParam private String mappingStrategyClassName; @UriParam private CellMappingStrategyFactory cellMappingStrategyFactory = new CellMappingStrategyFactory(); - @UriParam + @UriParam(label = "consumer") private HBaseRemoveHandler removeHandler = new HBaseDeleteHandler(); @UriParam private HBaseRow rowModel; - @UriParam + @UriParam(label = "consumer") private int maxMessagesPerPoll; public HBaseEndpoint(String uri, HBaseComponent component, HTablePool tablePool, String tableName) { @@ -111,6 +110,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return maxResults; } + /** + * The maximum number of rows to scan. + */ public void setMaxResults(int maxResults) { this.maxResults = maxResults; } @@ -119,6 +121,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return filters; } + /** + * A list of filters to use. + */ public void setFilters(List<Filter> filters) { this.filters = filters; } @@ -127,6 +132,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return operation; } + /** + * The HBase operation to perform + */ public void setOperation(String operation) { this.operation = operation; } @@ -135,6 +143,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return cellMappingStrategyFactory; } + /** + * To use a custom CellMappingStrategyFactory that is responsible for mapping cells. + */ public void setCellMappingStrategyFactory(CellMappingStrategyFactory cellMappingStrategyFactory) { this.cellMappingStrategyFactory = cellMappingStrategyFactory; } @@ -143,6 +154,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return mappingStrategyName; } + /** + * The strategy to use for mapping Camel messages to HBase columns. Supported values: header, or body. + */ public void setMappingStrategyName(String mappingStrategyName) { this.mappingStrategyName = mappingStrategyName; } @@ -151,6 +165,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return mappingStrategyClassName; } + /** + * The class name of a custom mapping strategy implementation. + */ public void setMappingStrategyClassName(String mappingStrategyClassName) { this.mappingStrategyClassName = mappingStrategyClassName; } @@ -159,6 +176,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return rowModel; } + /** + * An instance of org.apache.camel.component.hbase.model.HBaseRow which describes how each row should be modeled + */ public void setRowModel(HBaseRow rowModel) { this.rowModel = rowModel; } @@ -167,6 +187,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return remove; } + /** + * If the option is true, Camel HBase Consumer will remove the rows which it processes. + */ public void setRemove(boolean remove) { this.remove = remove; } @@ -175,6 +198,9 @@ public class HBaseEndpoint extends DefaultEndpoint { return removeHandler; } + /** + * To use a custom HBaseRemoveHandler that is executed when a row is to be removed. + */ public void setRemoveHandler(HBaseRemoveHandler removeHandler) { this.removeHandler = removeHandler; } @@ -183,6 +209,11 @@ public class HBaseEndpoint extends DefaultEndpoint { return maxMessagesPerPoll; } + /** + * Gets the maximum number of messages as a limit to poll at each polling. + * <p/> + * Is default unlimited, but use 0 or negative number to disable it as unlimited. + */ public void setMaxMessagesPerPoll(int maxMessagesPerPoll) { this.maxMessagesPerPoll = maxMessagesPerPoll; }