You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/01/22 18:51:50 UTC

[04/11] camel git commit: CAMEL-10546: Deprecated PropertiesDefinition in camel-core

CAMEL-10546: Deprecated PropertiesDefinition in camel-core


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

Branch: refs/heads/master
Commit: 8430133ad5a9384f6de7510d37c515e7a27cc0e9
Parents: bac2b54
Author: aldettinger <al...@gmail.com>
Authored: Thu Jan 19 16:14:23 2017 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Jan 22 18:06:43 2017 +0100

----------------------------------------------------------------------
 .../camel/model/GlobalOptionDefinition.java     | 59 +++++++++++++++++++
 .../camel/model/GlobalOptionsDefinition.java    | 62 ++++++++++++++++++++
 .../camel/model/PropertiesDefinition.java       |  3 +
 .../apache/camel/model/PropertyDefinition.java  |  3 +
 .../resources/org/apache/camel/model/jaxb.index |  2 +
 5 files changed, 129 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/8430133a/camel-core/src/main/java/org/apache/camel/model/GlobalOptionDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/GlobalOptionDefinition.java b/camel-core/src/main/java/org/apache/camel/model/GlobalOptionDefinition.java
new file mode 100644
index 0000000..edbf0bc
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/model/GlobalOptionDefinition.java
@@ -0,0 +1,59 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Models a string key/value pair for configuring some global options on
+ * {@link CamelContext} such as {@link Exchange#LOG_DEBUG_BODY_MAX_CHARS}.
+ */
+@Metadata(label = "configuration")
+@XmlRootElement(name = "globalOption")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class GlobalOptionDefinition {
+    @XmlAttribute(required = true)
+    String key;
+    @XmlAttribute(required = true)
+    String value;
+
+    public GlobalOptionDefinition() {
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String getValue() {
+        return value;
+    }
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8430133a/camel-core/src/main/java/org/apache/camel/model/GlobalOptionsDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/GlobalOptionsDefinition.java b/camel-core/src/main/java/org/apache/camel/model/GlobalOptionsDefinition.java
new file mode 100644
index 0000000..e936aaf
--- /dev/null
+++ b/camel-core/src/main/java/org/apache/camel/model/GlobalOptionsDefinition.java
@@ -0,0 +1,62 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.model;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.Exchange;
+import org.apache.camel.spi.Metadata;
+
+/**
+ * Models a series of string key/value pairs for configuring some global options
+ * on {@link CamelContext} such as {@link Exchange#LOG_DEBUG_BODY_MAX_CHARS}.
+ */
+@Metadata(label = "configuration")
+@XmlRootElement(name = "globalOptions")
+@XmlAccessorType(XmlAccessType.FIELD)
+public class GlobalOptionsDefinition {
+    @XmlElement(name = "globalOption")
+    private List<GlobalOptionDefinition> globalOptions;
+
+    public GlobalOptionsDefinition() {
+    }
+
+    public void setGlobalOptions(List<GlobalOptionDefinition> globalOptions) {
+        this.globalOptions = globalOptions;
+    }
+
+    public List<GlobalOptionDefinition> getGlobalOptions() {
+        return globalOptions;
+    }
+
+    public Map<String, String> asMap() {
+        Map<String, String> globalOptionsAsMap = new HashMap<>();
+        for (GlobalOptionDefinition globalOption : getGlobalOptions()) {
+            globalOptionsAsMap.put(globalOption.getKey(), globalOption.getValue());
+        }
+        return globalOptionsAsMap;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/8430133a/camel-core/src/main/java/org/apache/camel/model/PropertiesDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/PropertiesDefinition.java b/camel-core/src/main/java/org/apache/camel/model/PropertiesDefinition.java
index 419e4b9..1b0401a 100644
--- a/camel-core/src/main/java/org/apache/camel/model/PropertiesDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/PropertiesDefinition.java
@@ -28,10 +28,13 @@ import org.apache.camel.spi.Metadata;
 
 /**
  * A series of key value pair
+ *
+ * @deprecated Use {@link GlobalOptionsDefinition} instead.
  */
 @Metadata(label = "configuration")
 @XmlRootElement(name = "properties")
 @XmlAccessorType(XmlAccessType.FIELD)
+@Deprecated
 public class PropertiesDefinition {
     @XmlElement(name = "property")
     private List<PropertyDefinition> properties;

http://git-wip-us.apache.org/repos/asf/camel/blob/8430133a/camel-core/src/main/java/org/apache/camel/model/PropertyDefinition.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/model/PropertyDefinition.java b/camel-core/src/main/java/org/apache/camel/model/PropertyDefinition.java
index 7f4b02b..c61745c 100644
--- a/camel-core/src/main/java/org/apache/camel/model/PropertyDefinition.java
+++ b/camel-core/src/main/java/org/apache/camel/model/PropertyDefinition.java
@@ -25,10 +25,13 @@ import org.apache.camel.spi.Metadata;
 
 /**
  * A key value pair
+ *
+ * @deprecated Use {@link GlobalOptionDefinition} instead.
  */
 @Metadata(label = "configuration")
 @XmlRootElement(name = "property")
 @XmlAccessorType(XmlAccessType.FIELD)
+@Deprecated
 public class PropertyDefinition {
     @XmlAttribute(required = true)
     String key;

http://git-wip-us.apache.org/repos/asf/camel/blob/8430133a/camel-core/src/main/resources/org/apache/camel/model/jaxb.index
----------------------------------------------------------------------
diff --git a/camel-core/src/main/resources/org/apache/camel/model/jaxb.index b/camel-core/src/main/resources/org/apache/camel/model/jaxb.index
index aef22fa..b1b877d 100644
--- a/camel-core/src/main/resources/org/apache/camel/model/jaxb.index
+++ b/camel-core/src/main/resources/org/apache/camel/model/jaxb.index
@@ -30,6 +30,8 @@ ExpressionSubElementDefinition
 FilterDefinition
 FinallyDefinition
 FromDefinition
+GlobalOptionsDefinition
+GlobalOptionDefinition
 HystrixDefinition
 HystrixConfigurationDefinition
 IdempotentConsumerDefinition