Fixed CS
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/e085ef29 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/e085ef29 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/e085ef29 Branch: refs/heads/master Commit: e085ef296c012b9270106ce768c250479d1878b2 Parents: 461e15f Author: Andrea Cosentino <anco...@gmail.com> Authored: Tue May 12 23:10:14 2015 +0200 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Tue May 12 23:10:14 2015 +0200 ---------------------------------------------------------------------- .../elasticsearch/ElasticsearchComponent.java | 4 +- .../ElasticsearchConfiguration.java | 265 +++++++------------ .../elasticsearch/ElasticsearchEndpoint.java | 5 +- .../ElasticsearchActionRequestConverter.java | 21 +- 4 files changed, 109 insertions(+), 186 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/e085ef29/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java index 2ccd896..cb3b197 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchComponent.java @@ -46,12 +46,12 @@ public class ElasticsearchComponent extends UriEndpointComponent { config.setLocal(true); config.setClusterName(null); } else { - config.setLocal(false); + config.setLocal(false); config.setClusterName(remaining); } if (config.getData() == null) { - config.setData(config.isLocal()); + config.setData(config.isLocal()); } if (config.isLocal() && !config.getData()) { http://git-wip-us.apache.org/repos/asf/camel/blob/e085ef29/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java index 62d0acf..3888ed2 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchConfiguration.java @@ -62,172 +62,99 @@ public class ElasticsearchConfiguration { @UriParam(defaultValue = "9300") private int port = ElasticsearchConstants.DEFAULT_PORT; - - - - public boolean isLocal() { - return local; - } - - - - - public void setLocal(boolean local) { - this.local = local; - } - - - - - public List<InetSocketTransportAddress> getTransportAddressesList() { - return transportAddressesList; - } - - - - - public void setTransportAddressesList( - List<InetSocketTransportAddress> transportAddressesList) { - this.transportAddressesList = transportAddressesList; - } - - - - - public String getClusterName() { - return clusterName; - } - - - - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - - - - public String getOperation() { - return operation; - } - - - - - public void setOperation(String operation) { - this.operation = operation; - } - - - - - public String getIndexName() { - return indexName; - } - - - - - public void setIndexName(String indexName) { - this.indexName = indexName; - } - - - - - public String getIndexType() { - return indexType; - } - - - - - public void setIndexType(String indexType) { - this.indexType = indexType; - } - - - - - public WriteConsistencyLevel getConsistencyLevel() { - return consistencyLevel; - } - - - - - public void setConsistencyLevel(WriteConsistencyLevel consistencyLevel) { - this.consistencyLevel = consistencyLevel; - } - - - - - public ReplicationType getReplicationType() { - return replicationType; - } - - - - - public void setReplicationType(ReplicationType replicationType) { - this.replicationType = replicationType; - } - - - - - public Boolean getData() { - return data; - } - - - - - public void setData(Boolean data) { - this.data = data; - } - - - - - public String getIp() { - return ip; - } - - - - - public void setIp(String ip) { - this.ip = ip; - } - - - - - public String getTransportAddresses() { - return transportAddresses; - } - - - - - public void setTransportAddresses(String transportAddresses) { - this.transportAddresses = transportAddresses; - } - - - - - public int getPort() { - return port; - } - - - - - public void setPort(int port) { - this.port = port; - } -} + public boolean isLocal() { + return local; + } + + public void setLocal(boolean local) { + this.local = local; + } + + public List<InetSocketTransportAddress> getTransportAddressesList() { + return transportAddressesList; + } + + public void setTransportAddressesList(List<InetSocketTransportAddress> transportAddressesList) { + this.transportAddressesList = transportAddressesList; + } + + public String getClusterName() { + return clusterName; + } + + public void setClusterName(String clusterName) { + this.clusterName = clusterName; + } + + public String getOperation() { + return operation; + } + + public void setOperation(String operation) { + this.operation = operation; + } + + public String getIndexName() { + return indexName; + } + + public void setIndexName(String indexName) { + this.indexName = indexName; + } + + public String getIndexType() { + return indexType; + } + + public void setIndexType(String indexType) { + this.indexType = indexType; + } + + public WriteConsistencyLevel getConsistencyLevel() { + return consistencyLevel; + } + + public void setConsistencyLevel(WriteConsistencyLevel consistencyLevel) { + this.consistencyLevel = consistencyLevel; + } + + public ReplicationType getReplicationType() { + return replicationType; + } + + public void setReplicationType(ReplicationType replicationType) { + this.replicationType = replicationType; + } + + public Boolean getData() { + return data; + } + + public void setData(Boolean data) { + this.data = data; + } + + public String getIp() { + return ip; + } + + public void setIp(String ip) { + this.ip = ip; + } + + public String getTransportAddresses() { + return transportAddresses; + } + + public void setTransportAddresses(String transportAddresses) { + this.transportAddresses = transportAddresses; + } + + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } +} \ No newline at end of file http://git-wip-us.apache.org/repos/asf/camel/blob/e085ef29/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java ---------------------------------------------------------------------- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java index 979a93a..0077ce3 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java @@ -16,12 +16,8 @@ */ package org.apache.camel.component.elasticsearch; -import static org.elasticsearch.node.NodeBuilder.nodeBuilder; - -import java.net.URI; import java.util.ArrayList; import java.util.List; -import java.util.Map; import org.apache.camel.Consumer; import org.apache.camel.Processor; @@ -40,6 +36,7 @@ import org.elasticsearch.node.NodeBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import static org.elasticsearch.node.NodeBuilder.nodeBuilder; /** * Represents an Elasticsearch endpoint. */ http://git-wip-us.apache.org/repos/asf/camel/blob/e085ef29/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java ---------------------------------------------------------------------- diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java index 26f0125..b19c951 100644 --- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java +++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/converter/ElasticsearchActionRequestConverter.java @@ -22,7 +22,6 @@ import java.util.Map; import org.apache.camel.Converter; import org.apache.camel.Exchange; import org.apache.camel.component.elasticsearch.ElasticsearchConstants; -import org.apache.camel.component.elasticsearch.ElasticsearchConfiguration; import org.elasticsearch.action.WriteConsistencyLevel; import org.elasticsearch.action.bulk.BulkRequest; import org.elasticsearch.action.delete.DeleteRequest; @@ -55,13 +54,13 @@ public final class ElasticsearchActionRequestConverter { return indexRequest .consistencyLevel(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_CONSISTENCY_LEVEL, WriteConsistencyLevel.class)) + ElasticsearchConstants.PARAM_CONSISTENCY_LEVEL, WriteConsistencyLevel.class)) .replicationType(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_REPLICATION_TYPE, ReplicationType.class)) + ElasticsearchConstants.PARAM_REPLICATION_TYPE, ReplicationType.class)) .index(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) + ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) .type(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)); + ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)); } @Converter @@ -73,9 +72,9 @@ public final class ElasticsearchActionRequestConverter { @Converter public static GetRequest toGetRequest(String id, Exchange exchange) { return new GetRequest(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) + ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) .type(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_TYPE, + ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)).id(id); } @@ -83,10 +82,10 @@ public final class ElasticsearchActionRequestConverter { public static DeleteRequest toDeleteRequest(String id, Exchange exchange) { return new DeleteRequest() .index(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_NAME, + ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) .type(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_TYPE, + ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)).id(id); } @@ -94,9 +93,9 @@ public final class ElasticsearchActionRequestConverter { public static SearchRequest toSearchRequest(Object queryObject, Exchange exchange) { Map<?, ?> query = exchange.getContext().getTypeConverter().convertTo(Map.class, queryObject); return new SearchRequest(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) + ElasticsearchConstants.PARAM_INDEX_NAME, String.class)) .types(exchange.getIn().getHeader( - ElasticsearchConstants.PARAM_INDEX_TYPE, + ElasticsearchConstants.PARAM_INDEX_TYPE, String.class)).source(query); }