You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ji...@apache.org on 2018/05/08 14:53:51 UTC
[geode] branch develop updated: GEODE-5032: massage configuration
objects for better usability. (#1931)
This is an automated email from the ASF dual-hosted git repository.
jinmeiliao pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 71994b4 GEODE-5032: massage configuration objects for better usability. (#1931)
71994b4 is described below
commit 71994b466a1985521f59c0274198ee84709b8bf3
Author: jinmeiliao <ji...@pivotal.io>
AuthorDate: Tue May 8 07:53:44 2018 -0700
GEODE-5032: massage configuration objects for better usability. (#1931)
* Consolidate DeclarableType
---
.../geode/cache/configuration/CacheConfig.java | 266 ++--------
.../geode/cache/configuration/CacheLoaderType.java | 122 -----
.../configuration/CacheTransactionManagerType.java | 192 +-------
.../geode/cache/configuration/CacheWriterType.java | 122 -----
...sWithParametersType.java => ClassNameType.java} | 71 ++-
.../geode/cache/configuration/DeclarableType.java | 61 ++-
.../configuration/ExpirationAttributesType.java | 101 +---
.../cache/configuration/FunctionServiceType.java | 96 +---
.../geode/cache/configuration/InitializerType.java | 124 -----
.../geode/cache/configuration/ObjectType.java | 133 +++++
.../geode/cache/configuration/ParameterType.java | 29 +-
.../apache/geode/cache/configuration/PdxType.java | 100 +---
.../cache/configuration/RegionAttributesType.java | 543 ++-------------------
.../geode/cache/configuration/RegionConfig.java | 112 +----
.../geode/cache/configuration/ServerType.java | 100 +---
.../geode/cache/configuration/StringType.java | 88 ----
.../internal/cli/commands/ConfigurePDXCommand.java | 3 +-
.../geode/cache/configuration/CacheConfigTest.java | 158 ++++--
.../cache/configuration/DeclarableTypeTest.java | 78 +++
19 files changed, 527 insertions(+), 1972 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
index 16db02d..eccc894 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
@@ -285,7 +285,7 @@ public class CacheConfig {
protected CacheConfig.GatewayReceiver gatewayReceiver;
@XmlElement(name = "gateway-conflict-resolver",
namespace = "http://geode.apache.org/schema/cache")
- protected CacheConfig.GatewayConflictResolver gatewayConflictResolver;
+ protected DeclarableType gatewayConflictResolver;
@XmlElement(name = "async-event-queue", namespace = "http://geode.apache.org/schema/cache")
protected List<CacheConfig.AsyncEventQueue> asyncEventQueue;
@XmlElement(name = "cache-server", namespace = "http://geode.apache.org/schema/cache")
@@ -312,7 +312,7 @@ public class CacheConfig {
@XmlElement(namespace = "http://geode.apache.org/schema/cache")
protected List<String> backup;
@XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected InitializerType initializer;
+ protected DeclarableType initializer;
@XmlAnyElement(lax = true)
protected List<CacheElement> cacheElements;
@XmlAttribute(name = "copy-on-read")
@@ -467,10 +467,10 @@ public class CacheConfig {
* Gets the value of the gatewayConflictResolver property.
*
* possible object is
- * {@link CacheConfig.GatewayConflictResolver }
+ * {@link DeclarableType }
*
*/
- public CacheConfig.GatewayConflictResolver getGatewayConflictResolver() {
+ public DeclarableType getGatewayConflictResolver() {
return gatewayConflictResolver;
}
@@ -478,10 +478,10 @@ public class CacheConfig {
* Sets the value of the gatewayConflictResolver property.
*
* allowed object is
- * {@link CacheConfig.GatewayConflictResolver }
+ * {@link DeclarableType }
*
*/
- public void setGatewayConflictResolver(CacheConfig.GatewayConflictResolver value) {
+ public void setGatewayConflictResolver(DeclarableType value) {
this.gatewayConflictResolver = value;
}
@@ -818,10 +818,10 @@ public class CacheConfig {
* Gets the value of the initializer property.
*
* possible object is
- * {@link InitializerType }
+ * {@link DeclarableType }
*
*/
- public InitializerType getInitializer() {
+ public DeclarableType getInitializer() {
return initializer;
}
@@ -829,10 +829,10 @@ public class CacheConfig {
* Sets the value of the initializer property.
*
* allowed object is
- * {@link InitializerType }
+ * {@link DeclarableType }
*
*/
- public void setInitializer(InitializerType value) {
+ public void setInitializer(DeclarableType value) {
this.initializer = value;
}
@@ -1110,13 +1110,13 @@ public class CacheConfig {
public static class AsyncEventQueue {
@XmlElement(name = "gateway-event-filter", namespace = "http://geode.apache.org/schema/cache")
- protected List<ClassWithParametersType> gatewayEventFilter;
+ protected List<DeclarableType> gatewayEventFilter;
@XmlElement(name = "gateway-event-substitution-filter",
namespace = "http://geode.apache.org/schema/cache")
- protected ClassWithParametersType gatewayEventSubstitutionFilter;
+ protected DeclarableType gatewayEventSubstitutionFilter;
@XmlElement(name = "async-event-listener", namespace = "http://geode.apache.org/schema/cache",
required = true)
- protected ClassWithParametersType asyncEventListener;
+ protected DeclarableType asyncEventListener;
@XmlAttribute(name = "id", required = true)
protected String id;
@XmlAttribute(name = "parallel")
@@ -1161,13 +1161,13 @@ public class CacheConfig {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*
*/
- public List<ClassWithParametersType> getGatewayEventFilter() {
+ public List<DeclarableType> getGatewayEventFilter() {
if (gatewayEventFilter == null) {
- gatewayEventFilter = new ArrayList<ClassWithParametersType>();
+ gatewayEventFilter = new ArrayList<DeclarableType>();
}
return this.gatewayEventFilter;
}
@@ -1176,10 +1176,10 @@ public class CacheConfig {
* Gets the value of the gatewayEventSubstitutionFilter property.
*
* possible object is
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*/
- public ClassWithParametersType getGatewayEventSubstitutionFilter() {
+ public DeclarableType getGatewayEventSubstitutionFilter() {
return gatewayEventSubstitutionFilter;
}
@@ -1187,10 +1187,10 @@ public class CacheConfig {
* Sets the value of the gatewayEventSubstitutionFilter property.
*
* allowed object is
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*/
- public void setGatewayEventSubstitutionFilter(ClassWithParametersType value) {
+ public void setGatewayEventSubstitutionFilter(DeclarableType value) {
this.gatewayEventSubstitutionFilter = value;
}
@@ -1198,10 +1198,10 @@ public class CacheConfig {
* Gets the value of the asyncEventListener property.
*
* possible object is
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*/
- public ClassWithParametersType getAsyncEventListener() {
+ public DeclarableType getAsyncEventListener() {
return asyncEventListener;
}
@@ -1209,10 +1209,10 @@ public class CacheConfig {
* Sets the value of the asyncEventListener property.
*
* allowed object is
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*/
- public void setAsyncEventListener(ClassWithParametersType value) {
+ public void setAsyncEventListener(DeclarableType value) {
this.asyncEventListener = value;
}
@@ -1537,94 +1537,6 @@ public class CacheConfig {
}
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class GatewayConflictResolver {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
-
/**
* <p>
* Java class for anonymous complex type.
@@ -2024,7 +1936,7 @@ public class CacheConfig {
@XmlElement(name = "gateway-endpoint", namespace = "http://geode.apache.org/schema/cache")
protected List<CacheConfig.GatewayHub.Gateway.GatewayEndpoint> gatewayEndpoint;
@XmlElement(name = "gateway-listener", namespace = "http://geode.apache.org/schema/cache")
- protected List<CacheConfig.GatewayHub.Gateway.GatewayListener> gatewayListener;
+ protected List<DeclarableType> gatewayListener;
@XmlElement(name = "gateway-queue", namespace = "http://geode.apache.org/schema/cache")
protected CacheConfig.GatewayHub.Gateway.GatewayQueue gatewayQueue;
@XmlAttribute(name = "early-ack")
@@ -2089,13 +2001,13 @@ public class CacheConfig {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link CacheConfig.GatewayHub.Gateway.GatewayListener }
+ * {@link DeclarableType }
*
*
*/
- public List<CacheConfig.GatewayHub.Gateway.GatewayListener> getGatewayListener() {
+ public List<DeclarableType> getGatewayListener() {
if (gatewayListener == null) {
- gatewayListener = new ArrayList<CacheConfig.GatewayHub.Gateway.GatewayListener>();
+ gatewayListener = new ArrayList<DeclarableType>();
}
return this.gatewayListener;
}
@@ -2355,94 +2267,6 @@ public class CacheConfig {
}
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class GatewayListener {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
-
/**
* <p>
* Java class for anonymous complex type.
@@ -2732,7 +2556,7 @@ public class CacheConfig {
@XmlElement(name = "gateway-transport-filter",
namespace = "http://geode.apache.org/schema/cache")
- protected List<ClassWithParametersType> gatewayTransportFilter;
+ protected List<DeclarableType> gatewayTransportFilter;
@XmlAttribute(name = "start-port")
protected String startPort;
@XmlAttribute(name = "end-port")
@@ -2767,13 +2591,13 @@ public class CacheConfig {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*
*/
- public List<ClassWithParametersType> getGatewayTransportFilter() {
+ public List<DeclarableType> getGatewayTransportFilter() {
if (gatewayTransportFilter == null) {
- gatewayTransportFilter = new ArrayList<ClassWithParametersType>();
+ gatewayTransportFilter = new ArrayList<DeclarableType>();
}
return this.gatewayTransportFilter;
}
@@ -2980,13 +2804,13 @@ public class CacheConfig {
public static class GatewaySender {
@XmlElement(name = "gateway-event-filter", namespace = "http://geode.apache.org/schema/cache")
- protected List<ClassWithParametersType> gatewayEventFilter;
+ protected List<DeclarableType> gatewayEventFilter;
@XmlElement(name = "gateway-event-substitution-filter",
namespace = "http://geode.apache.org/schema/cache")
- protected ClassWithParametersType gatewayEventSubstitutionFilter;
+ protected DeclarableType gatewayEventSubstitutionFilter;
@XmlElement(name = "gateway-transport-filter",
namespace = "http://geode.apache.org/schema/cache")
- protected List<ClassWithParametersType> gatewayTransportFilter;
+ protected List<DeclarableType> gatewayTransportFilter;
@XmlAttribute(name = "id", required = true)
protected String id;
@XmlAttribute(name = "remote-distributed-system-id", required = true)
@@ -3039,13 +2863,13 @@ public class CacheConfig {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*
*/
- public List<ClassWithParametersType> getGatewayEventFilter() {
+ public List<DeclarableType> getGatewayEventFilter() {
if (gatewayEventFilter == null) {
- gatewayEventFilter = new ArrayList<ClassWithParametersType>();
+ gatewayEventFilter = new ArrayList<DeclarableType>();
}
return this.gatewayEventFilter;
}
@@ -3054,10 +2878,10 @@ public class CacheConfig {
* Gets the value of the gatewayEventSubstitutionFilter property.
*
* possible object is
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*/
- public ClassWithParametersType getGatewayEventSubstitutionFilter() {
+ public DeclarableType getGatewayEventSubstitutionFilter() {
return gatewayEventSubstitutionFilter;
}
@@ -3065,10 +2889,10 @@ public class CacheConfig {
* Sets the value of the gatewayEventSubstitutionFilter property.
*
* allowed object is
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*/
- public void setGatewayEventSubstitutionFilter(ClassWithParametersType value) {
+ public void setGatewayEventSubstitutionFilter(DeclarableType value) {
this.gatewayEventSubstitutionFilter = value;
}
@@ -3091,13 +2915,13 @@ public class CacheConfig {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link ClassWithParametersType }
+ * {@link DeclarableType }
*
*
*/
- public List<ClassWithParametersType> getGatewayTransportFilter() {
+ public List<DeclarableType> getGatewayTransportFilter() {
if (gatewayTransportFilter == null) {
- gatewayTransportFilter = new ArrayList<ClassWithParametersType>();
+ gatewayTransportFilter = new ArrayList<DeclarableType>();
}
return this.gatewayTransportFilter;
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheLoaderType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheLoaderType.java
deleted file mode 100644
index 8789573..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheLoaderType.java
+++ /dev/null
@@ -1,122 +0,0 @@
-
-/*
- * 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.geode.cache.configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.geode.annotations.Experimental;
-
-
-/**
- *
- * A "cache-loader" element describes a region's CacheLoader.
- *
- *
- * <p>
- * Java class for cache-loader-type complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="cache-loader-type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "cache-loader-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"className", "parameter"})
-@Experimental
-public class CacheLoaderType {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
-}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheTransactionManagerType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheTransactionManagerType.java
index 5956983..d048c71 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheTransactionManagerType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheTransactionManagerType.java
@@ -85,9 +85,9 @@ import org.apache.geode.annotations.Experimental;
public class CacheTransactionManagerType {
@XmlElement(name = "transaction-listener", namespace = "http://geode.apache.org/schema/cache")
- protected List<CacheTransactionManagerType.TransactionListener> transactionListener;
+ protected List<DeclarableType> transactionListener;
@XmlElement(name = "transaction-writer", namespace = "http://geode.apache.org/schema/cache")
- protected CacheTransactionManagerType.TransactionWriter transactionWriter;
+ protected DeclarableType transactionWriter;
/**
* Gets the value of the transactionListener property.
@@ -108,13 +108,13 @@ public class CacheTransactionManagerType {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link CacheTransactionManagerType.TransactionListener }
+ * {@link DeclarableType }
*
*
*/
- public List<CacheTransactionManagerType.TransactionListener> getTransactionListener() {
+ public List<DeclarableType> getTransactionListener() {
if (transactionListener == null) {
- transactionListener = new ArrayList<CacheTransactionManagerType.TransactionListener>();
+ transactionListener = new ArrayList<DeclarableType>();
}
return this.transactionListener;
}
@@ -123,10 +123,10 @@ public class CacheTransactionManagerType {
* Gets the value of the transactionWriter property.
*
* possible object is
- * {@link CacheTransactionManagerType.TransactionWriter }
+ * {@link DeclarableType }
*
*/
- public CacheTransactionManagerType.TransactionWriter getTransactionWriter() {
+ public DeclarableType getTransactionWriter() {
return transactionWriter;
}
@@ -134,185 +134,11 @@ public class CacheTransactionManagerType {
* Sets the value of the transactionWriter property.
*
* allowed object is
- * {@link CacheTransactionManagerType.TransactionWriter }
+ * {@link DeclarableType }
*
*/
- public void setTransactionWriter(CacheTransactionManagerType.TransactionWriter value) {
+ public void setTransactionWriter(DeclarableType value) {
this.transactionWriter = value;
}
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class TransactionListener {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class TransactionWriter {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheWriterType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheWriterType.java
deleted file mode 100644
index e5d3cc4..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/CacheWriterType.java
+++ /dev/null
@@ -1,122 +0,0 @@
-
-/*
- * 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.geode.cache.configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.geode.annotations.Experimental;
-
-
-/**
- *
- * A "cache-writer" element describes a region's CacheWriter.
- *
- *
- * <p>
- * Java class for cache-writer-type complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="cache-writer-type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "cache-writer-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"className", "parameter"})
-@Experimental
-public class CacheWriterType {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
-}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/ClassWithParametersType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/ClassNameType.java
similarity index 59%
rename from geode-core/src/main/java/org/apache/geode/cache/configuration/ClassWithParametersType.java
rename to geode-core/src/main/java/org/apache/geode/cache/configuration/ClassNameType.java
index 121a2c7..77a8ff6 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/ClassWithParametersType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/ClassNameType.java
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -18,31 +17,26 @@
package org.apache.geode.cache.configuration;
-import java.util.ArrayList;
-import java.util.List;
+import java.util.Objects;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import org.apache.geode.annotations.Experimental;
-
-
/**
* <p>
- * Java class for class-with-parameters-type complex type.
+ * Java class for anonymous complex type.
*
* <p>
* The following schema fragment specifies the expected content contained within this class.
*
* <pre>
- * <complexType name="class-with-parameters-type">
+ * <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
@@ -52,16 +46,18 @@ import org.apache.geode.annotations.Experimental;
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "class-with-parameters-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"className", "parameter"})
-@Experimental
-public class ClassWithParametersType {
+@XmlType(name = "", propOrder = {"className"})
+public class ClassNameType {
@XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
required = true)
protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
+
+ public ClassNameType() {}
+
+ public ClassNameType(String className) {
+ this.className = className;
+ }
/**
* Gets the value of the className property.
@@ -85,34 +81,25 @@ public class ClassWithParametersType {
this.className = value;
}
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
}
- return this.parameter;
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ClassNameType that = (ClassNameType) o;
+ return Objects.equals(className, that.className);
}
+ @Override
+ public String toString() {
+ return className;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(className);
+ }
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/DeclarableType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/DeclarableType.java
index 9934252..a47fce9 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/DeclarableType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/DeclarableType.java
@@ -1,4 +1,3 @@
-
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
@@ -20,6 +19,7 @@ package org.apache.geode.cache.configuration;
import java.util.ArrayList;
import java.util.List;
+import java.util.Objects;
import java.util.Properties;
import java.util.stream.Collectors;
@@ -31,7 +31,6 @@ import javax.xml.bind.annotation.XmlType;
import org.apache.geode.annotations.Experimental;
import org.apache.geode.management.internal.cli.domain.ClassName;
-
/**
*
* A "declarable" element specifies a Declarable object to be placed in a Region entry.
@@ -60,13 +59,9 @@ import org.apache.geode.management.internal.cli.domain.ClassName;
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "declarable-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"className", "parameter"})
+ propOrder = {"parameter"})
@Experimental
-public class DeclarableType {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
+public class DeclarableType extends ClassNameType {
@XmlElement(namespace = "http://geode.apache.org/schema/cache")
protected List<ParameterType> parameter;
@@ -84,30 +79,6 @@ public class DeclarableType {
.map(k -> new ParameterType(k, properties.getProperty(k))).collect(Collectors.toList());
}
-
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
/**
* Gets the value of the parameter property.
*
@@ -138,4 +109,30 @@ public class DeclarableType {
return this.parameter;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ DeclarableType that = (DeclarableType) o;
+ return Objects.equals(className, that.className) && Objects.equals(parameter, that.parameter);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(className, parameter);
+ }
+
+ @Override
+ public String toString() {
+ if (parameter == null) {
+ return className;
+ }
+
+ return className + "{"
+ + parameter.stream().map(Objects::toString).collect(Collectors.joining(",")) + "}";
+ }
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/ExpirationAttributesType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/ExpirationAttributesType.java
index 87eec06..b6a5d54 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/ExpirationAttributesType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/ExpirationAttributesType.java
@@ -18,9 +18,6 @@
package org.apache.geode.cache.configuration;
-import java.util.ArrayList;
-import java.util.List;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -84,7 +81,7 @@ import org.apache.geode.annotations.Experimental;
public class ExpirationAttributesType {
@XmlElement(name = "custom-expiry", namespace = "http://geode.apache.org/schema/cache")
- protected ExpirationAttributesType.CustomExpiry customExpiry;
+ protected DeclarableType customExpiry;
@XmlAttribute(name = "action")
protected String action;
@XmlAttribute(name = "timeout", required = true)
@@ -94,10 +91,10 @@ public class ExpirationAttributesType {
* Gets the value of the customExpiry property.
*
* possible object is
- * {@link ExpirationAttributesType.CustomExpiry }
+ * {@link DeclarableType }
*
*/
- public ExpirationAttributesType.CustomExpiry getCustomExpiry() {
+ public DeclarableType getCustomExpiry() {
return customExpiry;
}
@@ -105,10 +102,10 @@ public class ExpirationAttributesType {
* Sets the value of the customExpiry property.
*
* allowed object is
- * {@link ExpirationAttributesType.CustomExpiry }
+ * {@link DeclarableType }
*
*/
- public void setCustomExpiry(ExpirationAttributesType.CustomExpiry value) {
+ public void setCustomExpiry(DeclarableType value) {
this.customExpiry = value;
}
@@ -155,92 +152,4 @@ public class ExpirationAttributesType {
public void setTimeout(String value) {
this.timeout = value;
}
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class CustomExpiry {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/FunctionServiceType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/FunctionServiceType.java
index 3875ba9..12f5a9d 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/FunctionServiceType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/FunctionServiceType.java
@@ -73,7 +73,7 @@ import org.apache.geode.annotations.Experimental;
public class FunctionServiceType {
@XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<FunctionServiceType.Function> function;
+ protected List<DeclarableType> function;
/**
* Gets the value of the function property.
@@ -94,102 +94,14 @@ public class FunctionServiceType {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link FunctionServiceType.Function }
+ * {@link DeclarableType }
*
*
*/
- public List<FunctionServiceType.Function> getFunction() {
+ public List<DeclarableType> getFunction() {
if (function == null) {
- function = new ArrayList<FunctionServiceType.Function>();
+ function = new ArrayList<DeclarableType>();
}
return this.function;
}
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class Function {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/InitializerType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/InitializerType.java
deleted file mode 100644
index d655904..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/InitializerType.java
+++ /dev/null
@@ -1,124 +0,0 @@
-
-/*
- * 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.geode.cache.configuration;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.apache.geode.annotations.Experimental;
-
-
-/**
- *
- * A "initializer" element specifies a Declarable object whose init method
- * will be called after all other cache.xml initialization is
- * complete.
- *
- *
- * <p>
- * Java class for initializer-type complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="initializer-type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "initializer-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"className", "parameter"})
-@Experimental
-public class InitializerType {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
-}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/ObjectType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/ObjectType.java
new file mode 100644
index 0000000..0a78f0d
--- /dev/null
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/ObjectType.java
@@ -0,0 +1,133 @@
+/*
+ * 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.geode.cache.configuration;
+
+import java.util.Objects;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * <p>
+ * Java class for anonymous complex type.
+ *
+ * <p>
+ * The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType>
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <choice>
+ * <element name="string" type="{http://geode.apache.org/schema/cache}string-type"/>
+ * <element name="declarable" type="{http://geode.apache.org/schema/cache}declarable-type"/>
+ * </choice>
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "", propOrder = {"string", "declarable"})
+public class ObjectType {
+ @XmlElement(name = "string", namespace = "http://geode.apache.org/schema/cache")
+ protected String string;
+ @XmlElement(name = "declarable", namespace = "http://geode.apache.org/schema/cache")
+ protected DeclarableType declarable;
+
+ public ObjectType() {}
+
+ public ObjectType(String string) {
+ this.string = string;
+ }
+
+ public ObjectType(DeclarableType declarable) {
+ this.declarable = declarable;
+ }
+
+ /**
+ * Gets the value of the string property.
+ *
+ */
+ public String getString() {
+ return string;
+ }
+
+ /**
+ * Sets the value of the string property.
+ *
+ */
+ public void setString(String string) {
+ this.string = string;
+ }
+
+ /**
+ * Gets the value of the declarable property.
+ *
+ * possible object is
+ * {@link DeclarableType }
+ *
+ */
+ public DeclarableType getDeclarable() {
+ return declarable;
+ }
+
+ /**
+ * Sets the value of the declarable property.
+ *
+ * allowed object is
+ * {@link DeclarableType }
+ *
+ */
+ public void setDeclarable(DeclarableType value) {
+ this.declarable = value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ObjectType that = (ObjectType) o;
+ return Objects.equals(string, that.string) && Objects.equals(declarable, that.declarable);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(string, declarable);
+ }
+
+ @Override
+ public String toString() {
+ if (string != null) {
+ return string;
+ }
+
+ if (declarable != null) {
+ return declarable.toString();
+ }
+ return "";
+ }
+}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/ParameterType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/ParameterType.java
index c0e3e56..7b56f1c 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/ParameterType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/ParameterType.java
@@ -18,6 +18,8 @@
package org.apache.geode.cache.configuration;
+import java.util.Objects;
+
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -56,13 +58,17 @@ import org.apache.geode.annotations.Experimental;
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "parameter-type", namespace = "http://geode.apache.org/schema/cache")
@Experimental
-public class ParameterType extends RegionConfig.Entry.Type {
+public class ParameterType extends ObjectType {
@XmlAttribute(name = "name", required = true)
protected String name;
public ParameterType() {};
+ public ParameterType(String name) {
+ this.name = name;
+ }
+
public ParameterType(String name, String value) {
this.name = name;
setString(value);
@@ -90,4 +96,25 @@ public class ParameterType extends RegionConfig.Entry.Type {
this.name = value;
}
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass()) {
+ return false;
+ }
+ ParameterType that = (ParameterType) o;
+ return Objects.equals(name, that.name) && super.equals(o);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(name);
+ }
+
+ @Override
+ public String toString() {
+ return name + ":" + super.toString();
+ }
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/PdxType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/PdxType.java
index ffcdabe..9947565 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/PdxType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/PdxType.java
@@ -18,9 +18,6 @@
package org.apache.geode.cache.configuration;
-import java.util.ArrayList;
-import java.util.List;
-
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
@@ -78,7 +75,7 @@ import org.apache.geode.annotations.Experimental;
public class PdxType {
@XmlElement(name = "pdx-serializer", namespace = "http://geode.apache.org/schema/cache")
- protected PdxType.PdxSerializer pdxSerializer;
+ protected DeclarableType pdxSerializer;
@XmlAttribute(name = "read-serialized")
protected Boolean readSerialized;
@XmlAttribute(name = "ignore-unread-fields")
@@ -92,10 +89,10 @@ public class PdxType {
* Gets the value of the pdxSerializer property.
*
* possible object is
- * {@link PdxType.PdxSerializer }
+ * {@link DeclarableType }
*
*/
- public PdxType.PdxSerializer getPdxSerializer() {
+ public DeclarableType getPdxSerializer() {
return pdxSerializer;
}
@@ -103,10 +100,10 @@ public class PdxType {
* Sets the value of the pdxSerializer property.
*
* allowed object is
- * {@link PdxType.PdxSerializer }
+ * {@link DeclarableType }
*
*/
- public void setPdxSerializer(PdxType.PdxSerializer value) {
+ public void setPdxSerializer(DeclarableType value) {
this.pdxSerializer = value;
}
@@ -198,91 +195,4 @@ public class PdxType {
this.diskStoreName = value;
}
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class PdxSerializer {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionAttributesType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionAttributesType.java
index a829629..bd83cfa 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionAttributesType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionAttributesType.java
@@ -358,13 +358,13 @@ public class RegionAttributesType {
@XmlElement(name = "subscription-attributes", namespace = "http://geode.apache.org/schema/cache")
protected RegionAttributesType.SubscriptionAttributes subscriptionAttributes;
@XmlElement(name = "cache-loader", namespace = "http://geode.apache.org/schema/cache")
- protected CacheLoaderType cacheLoader;
+ protected DeclarableType cacheLoader;
@XmlElement(name = "cache-writer", namespace = "http://geode.apache.org/schema/cache")
- protected CacheWriterType cacheWriter;
+ protected DeclarableType cacheWriter;
@XmlElement(name = "cache-listener", namespace = "http://geode.apache.org/schema/cache")
- protected List<RegionAttributesType.CacheListener> cacheListener;
+ protected List<DeclarableType> cacheListener;
@XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected RegionAttributesType.Compressor compressor;
+ protected ClassNameType compressor;
@XmlElement(name = "eviction-attributes", namespace = "http://geode.apache.org/schema/cache")
protected RegionAttributesType.EvictionAttributes evictionAttributes;
@XmlAttribute(name = "concurrency-level")
@@ -670,10 +670,10 @@ public class RegionAttributesType {
* Gets the value of the cacheLoader property.
*
* possible object is
- * {@link CacheLoaderType }
+ * {@link DeclarableType }
*
*/
- public CacheLoaderType getCacheLoader() {
+ public DeclarableType getCacheLoader() {
return cacheLoader;
}
@@ -681,10 +681,10 @@ public class RegionAttributesType {
* Sets the value of the cacheLoader property.
*
* allowed object is
- * {@link CacheLoaderType }
+ * {@link DeclarableType }
*
*/
- public void setCacheLoader(CacheLoaderType value) {
+ public void setCacheLoader(DeclarableType value) {
this.cacheLoader = value;
}
@@ -692,10 +692,10 @@ public class RegionAttributesType {
* Gets the value of the cacheWriter property.
*
* possible object is
- * {@link CacheWriterType }
+ * {@link DeclarableType }
*
*/
- public CacheWriterType getCacheWriter() {
+ public DeclarableType getCacheWriter() {
return cacheWriter;
}
@@ -703,10 +703,10 @@ public class RegionAttributesType {
* Sets the value of the cacheWriter property.
*
* allowed object is
- * {@link CacheWriterType }
+ * {@link DeclarableType }
*
*/
- public void setCacheWriter(CacheWriterType value) {
+ public void setCacheWriter(DeclarableType value) {
this.cacheWriter = value;
}
@@ -729,13 +729,13 @@ public class RegionAttributesType {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link RegionAttributesType.CacheListener }
+ * {@link DeclarableType }
*
*
*/
- public List<RegionAttributesType.CacheListener> getCacheListener() {
+ public List<DeclarableType> getCacheListener() {
if (cacheListener == null) {
- cacheListener = new ArrayList<RegionAttributesType.CacheListener>();
+ cacheListener = new ArrayList<DeclarableType>();
}
return this.cacheListener;
}
@@ -744,10 +744,10 @@ public class RegionAttributesType {
* Gets the value of the compressor property.
*
* possible object is
- * {@link RegionAttributesType.Compressor }
+ * {@link ClassNameType }
*
*/
- public RegionAttributesType.Compressor getCompressor() {
+ public ClassNameType getCompressor() {
return compressor;
}
@@ -755,10 +755,10 @@ public class RegionAttributesType {
* Sets the value of the compressor property.
*
* allowed object is
- * {@link RegionAttributesType.Compressor }
+ * {@link ClassNameType }
*
*/
- public void setCompressor(RegionAttributesType.Compressor value) {
+ public void setCompressor(ClassNameType value) {
this.compressor = value;
}
@@ -1416,147 +1416,6 @@ public class RegionAttributesType {
* <complexType>
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class CacheListener {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className"})
- public static class Compressor {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <choice>
* <element name="asynchronous-writes">
* <complexType>
@@ -2104,69 +1963,11 @@ public class RegionAttributesType {
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class LruHeapPercentage {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache")
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
+ public static class LruHeapPercentage extends DeclarableType {
@XmlAttribute(name = "action")
protected EnumActionDestroyOverflow action;
/**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- /**
* Gets the value of the action property.
*
* possible object is
@@ -2216,93 +2017,11 @@ public class RegionAttributesType {
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class LruMemorySize {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache")
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
- @XmlAttribute(name = "action")
- protected EnumActionDestroyOverflow action;
+ public static class LruMemorySize extends LruHeapPercentage {
@XmlAttribute(name = "maximum")
protected String maximum;
/**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- /**
- * Gets the value of the action property.
- *
- * possible object is
- * {@link EnumActionDestroyOverflow }
- *
- */
- public EnumActionDestroyOverflow getAction() {
- return action;
- }
-
- /**
- * Sets the value of the action property.
- *
- * allowed object is
- * {@link EnumActionDestroyOverflow }
- *
- */
- public void setAction(EnumActionDestroyOverflow value) {
- this.action = value;
- }
-
- /**
* Gets the value of the maximum property.
*
* possible object is
@@ -2584,9 +2303,9 @@ public class RegionAttributesType {
public static class PartitionAttributes {
@XmlElement(name = "partition-resolver", namespace = "http://geode.apache.org/schema/cache")
- protected RegionAttributesType.PartitionAttributes.PartitionResolver partitionResolver;
+ protected DeclarableType partitionResolver;
@XmlElement(name = "partition-listener", namespace = "http://geode.apache.org/schema/cache")
- protected List<RegionAttributesType.PartitionAttributes.PartitionListener> partitionListener;
+ protected List<DeclarableType> partitionListener;
@XmlElement(name = "fixed-partition-attributes",
namespace = "http://geode.apache.org/schema/cache")
protected List<RegionAttributesType.PartitionAttributes.FixedPartitionAttributes> fixedPartitionAttributes;
@@ -2609,10 +2328,10 @@ public class RegionAttributesType {
* Gets the value of the partitionResolver property.
*
* possible object is
- * {@link RegionAttributesType.PartitionAttributes.PartitionResolver }
+ * {@link DeclarableType }
*
*/
- public RegionAttributesType.PartitionAttributes.PartitionResolver getPartitionResolver() {
+ public DeclarableType getPartitionResolver() {
return partitionResolver;
}
@@ -2620,11 +2339,10 @@ public class RegionAttributesType {
* Sets the value of the partitionResolver property.
*
* allowed object is
- * {@link RegionAttributesType.PartitionAttributes.PartitionResolver }
+ * {@link DeclarableType }
*
*/
- public void setPartitionResolver(
- RegionAttributesType.PartitionAttributes.PartitionResolver value) {
+ public void setPartitionResolver(DeclarableType value) {
this.partitionResolver = value;
}
@@ -2647,14 +2365,13 @@ public class RegionAttributesType {
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link RegionAttributesType.PartitionAttributes.PartitionListener }
+ * {@link DeclarableType }
*
*
*/
- public List<RegionAttributesType.PartitionAttributes.PartitionListener> getPartitionListener() {
+ public List<DeclarableType> getPartitionListener() {
if (partitionListener == null) {
- partitionListener =
- new ArrayList<RegionAttributesType.PartitionAttributes.PartitionListener>();
+ partitionListener = new ArrayList<DeclarableType>();
}
return this.partitionListener;
}
@@ -2944,206 +2661,6 @@ public class RegionAttributesType {
}
}
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class PartitionListener {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class PartitionResolver {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
- @XmlAttribute(name = "name")
- protected String name;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- /**
- * Gets the value of the name property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) {
- this.name = value;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java
index eef353b..3a60ba1 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java
@@ -424,18 +424,18 @@ public class RegionConfig implements CacheElement {
public static class Entry {
@XmlElement(namespace = "http://geode.apache.org/schema/cache", required = true)
- protected RegionConfig.Entry.Type key;
+ protected ObjectType key;
@XmlElement(namespace = "http://geode.apache.org/schema/cache", required = true)
- protected RegionConfig.Entry.Type value;
+ protected ObjectType value;
public Entry() {};
public Entry(String key, String value) {
- this.key = new Type(key);
- this.value = new Type(value);
+ this.key = new ObjectType(key);
+ this.value = new ObjectType(value);
}
- public Entry(Type key, Type value) {
+ public Entry(ObjectType key, ObjectType value) {
this.key = key;
this.value = value;
}
@@ -444,10 +444,10 @@ public class RegionConfig implements CacheElement {
* Gets the value of the key property.
*
* possible object is
- * {@link RegionConfig.Entry.Type }
+ * {@link ObjectType }
*
*/
- public RegionConfig.Entry.Type getKey() {
+ public ObjectType getKey() {
return key;
}
@@ -455,10 +455,10 @@ public class RegionConfig implements CacheElement {
* Sets the value of the key property.
*
* allowed object is
- * {@link RegionConfig.Entry.Type }
+ * {@link ObjectType }
*
*/
- public void setKey(RegionConfig.Entry.Type value) {
+ public void setKey(ObjectType value) {
this.key = value;
}
@@ -466,10 +466,10 @@ public class RegionConfig implements CacheElement {
* Gets the value of the value property.
*
* possible object is
- * {@link RegionConfig.Entry.Type }
+ * {@link ObjectType }
*
*/
- public RegionConfig.Entry.Type getValue() {
+ public ObjectType getValue() {
return value;
}
@@ -477,99 +477,13 @@ public class RegionConfig implements CacheElement {
* Sets the value of the value property.
*
* allowed object is
- * {@link RegionConfig.Entry.Type }
+ * {@link ObjectType }
*
*/
- public void setValue(RegionConfig.Entry.Type value) {
+ public void setValue(ObjectType value) {
this.value = value;
}
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <choice>
- * <element name="string" type="{http://geode.apache.org/schema/cache}string-type"/>
- * <element name="declarable" type="{http://geode.apache.org/schema/cache}declarable-type"/>
- * </choice>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"string", "declarable"})
- public static class Type {
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected StringType string;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected DeclarableType declarable;
-
- public Type() {}
-
- public Type(String string) {
- this.string = new StringType(string);
- }
-
- public Type(DeclarableType declarable) {
- this.declarable = declarable;
- }
-
- /**
- * Gets the value of the string property.
- *
- * possible object is
- * {@link StringType }
- *
- */
- public StringType getString() {
- return string;
- }
-
- /**
- * Sets the value of the string property.
- *
- * allowed object is
- * {@link StringType }
- *
- */
- public void setString(String value) {
- this.string = new StringType(value);
- }
-
- /**
- * Gets the value of the declarable property.
- *
- * possible object is
- * {@link DeclarableType }
- *
- */
- public DeclarableType getDeclarable() {
- return declarable;
- }
-
- /**
- * Sets the value of the declarable property.
- *
- * allowed object is
- * {@link DeclarableType }
- *
- */
- public void setDeclarable(DeclarableType value) {
- this.declarable = value;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/ServerType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/ServerType.java
index d7bf7d5..220b66e 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/ServerType.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/configuration/ServerType.java
@@ -106,7 +106,7 @@ public class ServerType {
@XmlElement(name = "client-subscription", namespace = "http://geode.apache.org/schema/cache")
protected ServerType.ClientSubscription clientSubscription;
@XmlElement(name = "custom-load-probe", namespace = "http://geode.apache.org/schema/cache")
- protected ServerType.CustomLoadProbe customLoadProbe;
+ protected DeclarableType customLoadProbe;
@XmlAttribute(name = "bind-address")
protected String bindAddress;
@XmlAttribute(name = "hostname-for-clients")
@@ -185,22 +185,16 @@ public class ServerType {
/**
* Gets the value of the customLoadProbe property.
*
- * possible object is
- * {@link ServerType.CustomLoadProbe }
- *
*/
- public ServerType.CustomLoadProbe getCustomLoadProbe() {
+ public DeclarableType getCustomLoadProbe() {
return customLoadProbe;
}
/**
* Sets the value of the customLoadProbe property.
*
- * allowed object is
- * {@link ServerType.CustomLoadProbe }
- *
*/
- public void setCustomLoadProbe(ServerType.CustomLoadProbe value) {
+ public void setCustomLoadProbe(DeclarableType value) {
this.customLoadProbe = value;
}
@@ -578,92 +572,4 @@ public class ServerType {
}
}
-
-
- /**
- * <p>
- * Java class for anonymous complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="class-name" type="{http://geode.apache.org/schema/cache}class-name-type"/>
- * <element name="parameter" type="{http://geode.apache.org/schema/cache}parameter-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = {"className", "parameter"})
- public static class CustomLoadProbe {
-
- @XmlElement(name = "class-name", namespace = "http://geode.apache.org/schema/cache",
- required = true)
- protected String className;
- @XmlElement(namespace = "http://geode.apache.org/schema/cache")
- protected List<ParameterType> parameter;
-
- /**
- * Gets the value of the className property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getClassName() {
- return className;
- }
-
- /**
- * Sets the value of the className property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setClassName(String value) {
- this.className = value;
- }
-
- /**
- * Gets the value of the parameter property.
- *
- * <p>
- * This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the
- * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the parameter property.
- *
- * <p>
- * For example, to add a new item, do as follows:
- *
- * <pre>
- * getParameter().add(newItem);
- * </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link ParameterType }
- *
- *
- */
- public List<ParameterType> getParameter() {
- if (parameter == null) {
- parameter = new ArrayList<ParameterType>();
- }
- return this.parameter;
- }
-
- }
-
}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/configuration/StringType.java b/geode-core/src/main/java/org/apache/geode/cache/configuration/StringType.java
deleted file mode 100644
index f95dd0e..0000000
--- a/geode-core/src/main/java/org/apache/geode/cache/configuration/StringType.java
+++ /dev/null
@@ -1,88 +0,0 @@
-
-/*
- * 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.geode.cache.configuration;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlValue;
-
-import org.apache.geode.annotations.Experimental;
-
-
-/**
- *
- * A "string" element specifies a String to be placed in a Region entry.
- *
- *
- * <p>
- * Java class for string-type complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="string-type">
- * <simpleContent>
- * <extension base="<http://www.w3.org/2001/XMLSchema>string">
- * </extension>
- * </simpleContent>
- * </complexType>
- * </pre>
- *
- *
- */
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "string-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"value"})
-@Experimental
-public class StringType {
-
- @XmlValue
- protected String value;
-
- public StringType() {}
-
- public StringType(String value) {
- this.value = value;
- }
-
- /**
- * Gets the value of the value property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getValue() {
- return value;
- }
-
- /**
- * Sets the value of the value property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-
-}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java
index d2e5965..dc73b5a 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java
@@ -22,6 +22,7 @@ import java.util.stream.Collectors;
import org.springframework.shell.core.annotation.CliCommand;
import org.springframework.shell.core.annotation.CliOption;
+import org.apache.geode.cache.configuration.DeclarableType;
import org.apache.geode.cache.configuration.ParameterType;
import org.apache.geode.cache.configuration.PdxType;
import org.apache.geode.distributed.ConfigurationPersistenceService;
@@ -115,7 +116,7 @@ public class ConfigurePDXCommand extends InternalGfshCommand {
config.getPdx().setPersistent(diskStore != null);
if (portableClassesPatterns != null || nonPortableClassesPatterns != null) {
- PdxType.PdxSerializer pdxSerializer = new PdxType.PdxSerializer();
+ DeclarableType pdxSerializer = new DeclarableType();
pdxSerializer.setClassName(ReflectionBasedAutoSerializer.class.getName());
List<ParameterType> parameters =
diff --git a/geode-core/src/test/java/org/apache/geode/cache/configuration/CacheConfigTest.java b/geode-core/src/test/java/org/apache/geode/cache/configuration/CacheConfigTest.java
index ee0bdfa..9a4ee7a 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/configuration/CacheConfigTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/configuration/CacheConfigTest.java
@@ -34,73 +34,143 @@ public class CacheConfigTest {
private CacheConfig cacheConfig;
private JAXBService service;
private RegionConfig regionConfig;
+ private String regionXml;
+ private DeclarableType declarableWithString;
+ private String declarableWithStringXml;
+ private ClassNameType classNameType;
+ private String classNameTypeXml;
+ private DeclarableType declarableWithParam;
+ private String declarableWithParamXml;
+ private String stringTypeXml;
+ private String cacheXml;
@Before
public void setUp() throws Exception {
cacheConfig = new CacheConfig("1.0");
+ cacheXml =
+ "<cache version=\"1.0\" xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\" xmlns=\"http://geode.apache.org/schema/cache\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">";
service = new JAXBService(CacheConfig.class);
service.validateWithLocalCacheXSD();
regionConfig = new RegionConfig();
regionConfig.setName("regionA");
regionConfig.setRefid("REPLICATE");
+ regionXml = "<region name=\"regionA\" refid=\"REPLICATE\">";
+
+ classNameType = new ClassNameType("my.className");
+ classNameTypeXml = "<class-name>my.className</class-name>";
+ declarableWithString = new DeclarableType("my.className", "{'key':'value'}");
+ declarableWithStringXml =
+ classNameTypeXml + "<parameter name=\"key\"><string>value</string></parameter>";
+
+ declarableWithParam = new DeclarableType("my.className");
+ ParameterType param = new ParameterType("key");
+ param.setDeclarable(declarableWithString);
+ declarableWithParam.getParameter().add(param);
+ declarableWithParamXml = classNameTypeXml + "<parameter name=\"key\"><declarable>"
+ + declarableWithStringXml + "</declarable></parameter>";
+
+ stringTypeXml = "<string>string value</string>";
}
@After
public void tearDown() throws Exception {
+ // make sure the marshalled xml passed validation
System.out.println(service.marshall(cacheConfig));
}
@Test
- public void validateIndexType() {
- RegionConfig.Index index = new RegionConfig.Index();
- cacheConfig.getRegion().add(regionConfig);
- index.setName("indexName");
- index.setKeyIndex(true);
- index.setExpression("expression");
- regionConfig.getIndex().add(index);
+ public void indexType() {
+ String xml = cacheXml + regionXml
+ + "<index name=\"indexName\" expression=\"expression\" key-index=\"true\"/>"
+ + "</region></cache>";
+
+ cacheConfig = service.unMarshall(xml);
+ RegionConfig.Index index = cacheConfig.getRegion().get(0).getIndex().get(0);
+ assertThat(index.isKeyIndex()).isTrue();
+ assertThat(index.getName()).isEqualTo("indexName");
+ assertThat(index.getExpression()).isEqualTo("expression");
+ assertThat(index.getType()).isEqualTo("range");
}
@Test
- public void stringType() {
- String xml =
- "<cache version=\"1.0\" xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\" xmlns=\"http://geode.apache.org/schema/cache\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
- + " <region name=\"regionA\" refid=\"REPLICATE\">\n" + " <entry>\n"
- + " <key>\n" + " <string>myKey</string>\n"
- + " </key>\n" + " <value>\n" + " <declarable>\n"
- + " <class-name>org.apache.geode.management.internal.cli.domain.MyCacheListener</class-name>\n"
- + " <parameter name=\"name\">\n"
- + " <string>value</string>\n"
- + " </parameter>\n" + " </declarable>\n"
- + " </value>\n" + " </entry>\n" + " </region>\n" + "</cache>";
- cacheConfig.getRegion().add(regionConfig);
- RegionConfig.Entry entry = new RegionConfig.Entry();
- RegionConfig.Entry.Type key = new RegionConfig.Entry.Type("myKey");
- RegionConfig.Entry.Type value = new RegionConfig.Entry.Type(new DeclarableType(
- "org.apache.geode.management.internal.cli.domain.MyCacheListener", "{'name':'value'}"));
-
- entry.setKey(key);
- entry.setValue(value);
- regionConfig.getEntry().add(entry);
-
- // make sure the POJO can marshall to the expected xml
- assertThat(service.marshall(cacheConfig)).contains(xml);
- // make sure the xml can be unmarshalled.
- service.unMarshall(xml);
+ public void regionEntry() {
+ String xml = cacheXml + regionXml + "<entry>" + "<key><string>key1</string></key>"
+ + "<value><declarable>" + declarableWithStringXml + "</declarable></value>" + "</entry>"
+ + "<entry>" + "<key><string>key2</string></key>" + "<value><declarable>"
+ + declarableWithParamXml + "</declarable></value>" + "</entry>" + "</region></cache>";
+
+ cacheConfig = service.unMarshall(xml);
+ RegionConfig.Entry entry = cacheConfig.getRegion().get(0).getEntry().get(0);
+ assertThat(entry.getKey().toString()).isEqualTo("key1");
+ assertThat(entry.getValue().getDeclarable()).isEqualTo(declarableWithString);
+
+ entry = cacheConfig.getRegion().get(0).getEntry().get(1);
+ assertThat(entry.getKey().toString()).isEqualTo("key2");
+ assertThat(entry.getValue().getDeclarable()).isEqualTo(declarableWithParam);
+ }
+
+ @Test
+ public void cacheTransactionManager() {
+ String xml = cacheXml + "<cache-transaction-manager>" + "<transaction-listener>"
+ + declarableWithStringXml + "</transaction-listener>" + "<transaction-writer>"
+ + declarableWithStringXml + "</transaction-writer>"
+ + "</cache-transaction-manager></cache>";
+
+ cacheConfig = service.unMarshall(xml);
+ assertThat(cacheConfig.getCacheTransactionManager().getTransactionWriter())
+ .isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getCacheTransactionManager().getTransactionListener().get(0))
+ .isEqualTo(declarableWithString);
}
@Test
- public void entry() {
- String xml =
- "<cache version=\"1.0\" xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\" xmlns=\"http://geode.apache.org/schema/cache\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n"
- + " <region name=\"regionA\" refid=\"REPLICATE\">\n" + " <entry>\n"
- + " <key>\n" + " <string>key</string>\n"
- + " </key>\n" + " <value>\n"
- + " <string>value</string>\n" + " </value>\n"
- + " </entry>\n" + " </region>\n" + "</cache>";
- cacheConfig.getRegion().add(regionConfig);
- regionConfig.getEntry().add(new RegionConfig.Entry("key", "value"));
- assertThat(service.marshall(cacheConfig)).contains(xml);
- service.unMarshall(xml);
+ public void declarables() {
+ String xml = cacheXml + "<region-attributes>" + "<cache-loader>" + declarableWithStringXml
+ + "</cache-loader>" + "<cache-listener>" + declarableWithStringXml + "</cache-listener>"
+ + "<cache-writer>" + declarableWithStringXml + "</cache-writer>" + "<compressor>"
+ + classNameTypeXml + "</compressor>"
+ + "<region-time-to-live><expiration-attributes timeout=\"0\"><custom-expiry>"
+ + declarableWithStringXml + "</custom-expiry></expiration-attributes></region-time-to-live>"
+ + "</region-attributes>" + "<function-service><function>" + declarableWithStringXml
+ + "</function></function-service>" + "<initializer>" + declarableWithStringXml
+ + "</initializer>" + "<pdx><pdx-serializer>" + declarableWithStringXml
+ + "</pdx-serializer></pdx>" + "<cache-server><custom-load-probe>" + declarableWithStringXml
+ + "</custom-load-probe></cache-server>" + "<gateway-conflict-resolver>"
+ + declarableWithStringXml + "</gateway-conflict-resolver>"
+ + "<gateway-receiver><gateway-transport-filter>" + declarableWithStringXml
+ + "</gateway-transport-filter></gateway-receiver>" + "<async-event-queue id=\"queue\">"
+ + "<gateway-event-substitution-filter>" + declarableWithStringXml
+ + "</gateway-event-substitution-filter>" + "<gateway-event-filter>"
+ + declarableWithStringXml + "</gateway-event-filter>" + "<async-event-listener>"
+ + declarableWithStringXml + "</async-event-listener>" + "</async-event-queue>"
+ + "<gateway-hub id=\"hub\"><gateway id=\"gateway\"><gateway-listener>"
+ + declarableWithStringXml + "</gateway-listener></gateway></gateway-hub>" + "</cache>";
+
+ cacheConfig = service.unMarshall(xml);
+
+ assertThat(cacheConfig.getInitializer()).isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getFunctionService().getFunction().get(0))
+ .isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getPdx().getPdxSerializer()).isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getCacheServer().get(0).getCustomLoadProbe())
+ .isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getGatewayConflictResolver()).isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getGatewayReceiver().getGatewayTransportFilter().get(0))
+ .isEqualTo(declarableWithString);
+ assertThat(cacheConfig.getGatewayHub().get(0).getGateway().get(0).getGatewayListener().get(0))
+ .isEqualTo(declarableWithString);
+
+ CacheConfig.AsyncEventQueue asyncEventQueue = cacheConfig.getAsyncEventQueue().get(0);
+ assertThat(asyncEventQueue.getAsyncEventListener()).isEqualTo(declarableWithString);
+ assertThat(asyncEventQueue.getGatewayEventFilter().get(0)).isEqualTo(declarableWithString);
+ assertThat(asyncEventQueue.getGatewayEventSubstitutionFilter()).isEqualTo(declarableWithString);
+
+ RegionAttributesType regionAttributes = cacheConfig.getRegionAttributes().get(0);
+ assertThat(regionAttributes.getCacheListener().get(0)).isEqualTo(declarableWithString);
+ assertThat(regionAttributes.getCacheLoader()).isEqualTo(declarableWithString);
+ assertThat(regionAttributes.getCacheWriter()).isEqualTo(declarableWithString);
+ assertThat(regionAttributes.getRegionTimeToLive().getExpirationAttributes().getCustomExpiry())
+ .isEqualTo(declarableWithString);
}
}
diff --git a/geode-core/src/test/java/org/apache/geode/cache/configuration/DeclarableTypeTest.java b/geode-core/src/test/java/org/apache/geode/cache/configuration/DeclarableTypeTest.java
new file mode 100644
index 0000000..f14124d
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/cache/configuration/DeclarableTypeTest.java
@@ -0,0 +1,78 @@
+/*
+ * 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.geode.cache.configuration;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+
+import org.apache.geode.test.junit.categories.UnitTest;
+
+
+@Category(UnitTest.class)
+public class DeclarableTypeTest {
+
+ @Test
+ public void declarableWithStringParam() {
+ DeclarableType declarable = new DeclarableType("className");
+ assertThat(declarable).isEqualTo(declarable);
+ assertThat(declarable).isEqualTo(new DeclarableType("className"));
+ assertThat(declarable).isNotEqualTo(new DeclarableType("anotherClassName"));
+
+ ParameterType parameter = new ParameterType("name", "value");
+ declarable.getParameter().add(parameter);
+
+ DeclarableType d2 = new DeclarableType("className");
+ assertThat(declarable).isNotEqualTo(d2);
+ d2.getParameter().add(parameter);
+ assertThat(declarable).isEqualTo(d2);
+
+ // has one common parameter, but d2 has additional param
+ d2.getParameter().add(new ParameterType("name1", "value1"));
+ assertThat(declarable).isNotEqualTo(d2);
+
+ // same size, but different param value
+ DeclarableType d3 = new DeclarableType("className");
+ d3.getParameter().add(new ParameterType("name", "value1"));
+ assertThat(declarable).isNotEqualTo(d3);
+
+ assertThat(declarable.toString()).isEqualTo("className{name:value}");
+ }
+
+ @Test
+ public void declarableWithDeclarableParam() {
+ DeclarableType declarable = new DeclarableType("className");
+ ParameterType param = new ParameterType("param1");
+ param.setDeclarable(new DeclarableType("anotherClassName", "{'k':'v'}"));
+ declarable.getParameter().add(param);
+ assertThat(declarable.toString()).isEqualTo("className{param1:anotherClassName{k:v}}");
+
+ DeclarableType d2 = new DeclarableType("className");
+ ParameterType p2 = new ParameterType("param1");
+ p2.setDeclarable(new DeclarableType("anotherClassName", "{'k':'v'}"));
+ d2.getParameter().add(p2);
+ assertThat(declarable).isEqualTo(d2);
+
+ DeclarableType d3 = new DeclarableType("className");
+ ParameterType p3 = new ParameterType("param1");
+ p3.setDeclarable(new DeclarableType("anotherClassName", "{'k':'v2'}"));
+ d3.getParameter().add(p3);
+ assertThat(declarable).isNotEqualTo(d3);
+ }
+}
--
To stop receiving notification emails like this one, please contact
jinmeiliao@apache.org.