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/03/16 15:11:11 UTC
[geode] 02/02: GEODE-4830: use CacheConfig to access the jndi list
in ListJNDIBindingCommand
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
commit 7f8eedcc5f495e6da2fb5e01d9855929d6df49fa
Author: Jinmei Liao <ji...@pivotal.io>
AuthorDate: Wed Mar 14 13:52:47 2018 -0700
GEODE-4830: use CacheConfig to access the jndi list in ListJNDIBindingCommand
* updated the CacheConfig to hold only one JNDIBindingsType instead of a list
* make sure xml created by those POJOs can be used to start a server
* the service will keep a list of bind classes for clearer xml generation.
* the service will keep a reference to the marshaer/unmarsher for faster operation
---
.../internal/ClusterConfigurationService.java | 73 +-
.../internal/cache/configuration/CacheConfig.java | 9 +-
.../cache/configuration/ObjectFactory.java | 661 ---------
.../internal/cache/configuration/cache-1.0.xsd | 1411 --------------------
.../cli/commands/ListJndiBindingCommand.java | 44 +-
.../cli/functions/ListJndiBindingFunction.java | 3 -
.../sanctioned-geode-core-serializables.txt | 6 +
.../internal/CacheConfigIntegrationTest.java | 55 +
.../InternalClusterConfigurationServiceTest.java | 40 +-
.../commands/ListJndiBindingCommandDUnitTest.java | 29 +-
10 files changed, 204 insertions(+), 2127 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterConfigurationService.java b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterConfigurationService.java
index e02ee81..13ba45c 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterConfigurationService.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/ClusterConfigurationService.java
@@ -28,7 +28,6 @@ import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringReader;
import java.io.StringWriter;
-import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@@ -36,6 +35,7 @@ import java.nio.file.StandardCopyOption;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
@@ -49,15 +49,12 @@ import java.util.concurrent.atomic.AtomicReference;
import java.util.function.UnaryOperator;
import java.util.stream.Collectors;
-import javax.xml.XMLConstants;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactoryConfigurationError;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
import com.healthmarketscience.rmiio.RemoteInputStream;
import com.healthmarketscience.rmiio.RemoteInputStreamClient;
@@ -94,6 +91,7 @@ import org.apache.geode.internal.cache.persistence.PersistentMemberManager;
import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
import org.apache.geode.internal.cache.xmlcache.CacheXmlGenerator;
import org.apache.geode.internal.logging.LogService;
+import org.apache.geode.lang.Identifiable;
import org.apache.geode.management.internal.beans.FileUploader;
import org.apache.geode.management.internal.cli.CliUtil;
import org.apache.geode.management.internal.configuration.callbacks.ConfigurationChangeListener;
@@ -149,6 +147,8 @@ public class ClusterConfigurationService {
configDirPath = null;
configDiskDirPath = null;
cache = null;
+ bindClasses.add(CacheConfig.class);
+ initJaxbContext();
}
public ClusterConfigurationService(InternalCache cache) throws IOException {
@@ -176,6 +176,8 @@ public class ClusterConfigurationService {
this.configDiskDirPath = FilenameUtils.concat(clusterConfigRootDir, configDiskDirName);
this.sharedConfigLockingService = getSharedConfigLockService(cache.getDistributedSystem());
this.status.set(SharedConfigurationStatus.NOT_STARTED);
+ bindClasses.add(CacheConfig.class);
+ initJaxbContext();
}
/**
@@ -821,6 +823,47 @@ public class ClusterConfigurationService {
return configDir;
}
+ private Collection<Class> bindClasses = new ArrayList<>();
+ private Marshaller marshaller;
+ private Unmarshaller unmarshaller;
+
+ private void initJaxbContext() {
+ try {
+ JAXBContext jaxbContext =
+ JAXBContext.newInstance(bindClasses.toArray(new Class[bindClasses.size()]));
+ marshaller = jaxbContext.createMarshaller();
+ // currently we are generating the xml from jabx object so we don't need schema validation.
+ // but in the future, we will need to add the various xsd for schema validation. and these
+ // xsd needs to be local (no network access)
+ marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION,
+ "http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd");
+ marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ unmarshaller = jaxbContext.createUnmarshaller();
+ } catch (Exception e) {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ }
+
+ private Marshaller getMarshaller(Class... additionBindClass) {
+ if (bindClasses.containsAll(Arrays.asList(additionBindClass))) {
+ return marshaller;
+ }
+
+ bindClasses.addAll(Arrays.asList(additionBindClass));
+ initJaxbContext();
+ return marshaller;
+ }
+
+ private Unmarshaller getUnmarshaller(Class... additionBindClass) {
+ if (bindClasses.containsAll(Arrays.asList(additionBindClass))) {
+ return unmarshaller;
+ }
+
+ bindClasses.addAll(Arrays.asList(additionBindClass));
+ initJaxbContext();
+ return unmarshaller;
+ }
+
public CacheConfig getCacheConfig(String group, Class... additionalBindClass) {
return unMarshall(getConfiguration(group).getCacheXmlContent(), additionalBindClass);
}
@@ -843,20 +886,14 @@ public class ClusterConfigurationService {
}
}
+ public <T extends Identifiable<String>> T findElement(List<T> list, String id) {
+ return list.stream().filter(o -> o.getId().equals(id)).findFirst().orElse(null);
+ }
+
String marshall(CacheConfig config, Class... additionalClass) {
- List<Class> classes = new ArrayList<>(Arrays.asList(additionalClass));
- classes.add(0, CacheConfig.class);
StringWriter sw = new StringWriter();
try {
- JAXBContext jaxbContext = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]));
- Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
- SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Schema schema =
- factory.newSchema(new URL("http://geode.apache.org/schema/cache/cache-1.0.xsd"));
- jaxbMarshaller.setSchema(schema);
-
- jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- jaxbMarshaller.marshal(config, sw);
+ getMarshaller(additionalClass).marshal(config, sw);
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
@@ -864,12 +901,8 @@ public class ClusterConfigurationService {
}
CacheConfig unMarshall(String xml, Class... additionalClass) {
- List<Class> classes = new ArrayList<>(Arrays.asList(additionalClass));
- classes.add(0, CacheConfig.class);
try {
- JAXBContext jaxbContext = JAXBContext.newInstance(classes.toArray(new Class[classes.size()]));
- Unmarshaller jaxUnmarshaller = jaxbContext.createUnmarshaller();
- return (CacheConfig) jaxUnmarshaller.unmarshal(new StringReader(xml));
+ return (CacheConfig) getUnmarshaller(additionalClass).unmarshal(new StringReader(xml));
} catch (Exception e) {
throw new RuntimeException(e.getMessage(), e);
}
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/CacheConfig.java b/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/CacheConfig.java
index d4f5161..4edfff7 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/CacheConfig.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/CacheConfig.java
@@ -292,7 +292,7 @@ public class CacheConfig {
@XmlElement(name = "region-attributes", namespace = "http://geode.apache.org/schema/cache")
protected List<RegionAttributesType> regionAttributes;
@XmlElement(name = "jndi-bindings", namespace = "http://geode.apache.org/schema/cache")
- protected List<JndiBindingsType> jndiBindings;
+ protected JndiBindingsType jndiBindings;
@XmlElement(namespace = "http://geode.apache.org/schema/cache")
protected List<RegionConfig> region;
@XmlElement(name = "function-service", namespace = "http://geode.apache.org/schema/cache")
@@ -677,13 +677,14 @@ public class CacheConfig {
*
*
*/
- public List<JndiBindingsType> getJndiBindings() {
+ public List<JndiBindingsType.JndiBinding> getJndiBindings() {
if (jndiBindings == null) {
- jndiBindings = new ArrayList<JndiBindingsType>();
+ jndiBindings = new JndiBindingsType();
}
- return this.jndiBindings;
+ return jndiBindings.getJndiBinding();
}
+
/**
* Gets the value of the region property.
*
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/ObjectFactory.java b/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/ObjectFactory.java
deleted file mode 100644
index 0b82e28..0000000
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/ObjectFactory.java
+++ /dev/null
@@ -1,661 +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.internal.cache.configuration;
-
-import javax.xml.bind.JAXBElement;
-import javax.xml.bind.annotation.XmlElementDecl;
-import javax.xml.bind.annotation.XmlRegistry;
-import javax.xml.namespace.QName;
-
-
-/**
- * This object contains factory methods for each
- * Java content interface and Java element interface
- * generated in the org.apache.geode.cache.domain.internal package.
- * <p>
- * An ObjectFactory allows you to programatically
- * construct new instances of the Java representation
- * for XML content. The Java representation of XML
- * content can consist of schema derived interfaces
- * and classes representing the binding of schema
- * type definitions, element declarations and model
- * groups. Factory methods for each of these are
- * provided in this class.
- *
- */
-@XmlRegistry
-public class ObjectFactory {
-
- private static final QName _CacheJndiBindings_QNAME =
- new QName("http://geode.apache.org/schema/cache", "jndi-bindings");
- private static final QName _CacheVmRootRegion_QNAME =
- new QName("http://geode.apache.org/schema/cache", "vm-root-region");
- private static final QName _CacheRegion_QNAME =
- new QName("http://geode.apache.org/schema/cache", "region");
-
- /**
- * Create a new ObjectFactory that can be used to create new instances of schema derived classes
- * for package: org.apache.geode.cache.domain.internal
- *
- */
- public ObjectFactory() {}
-
- /**
- * Create an instance of {@link CacheConfig }
- *
- */
- public CacheConfig createCache() {
- return new CacheConfig();
- }
-
- /**
- * Create an instance of {@link ExpirationAttributesType }
- *
- */
- public ExpirationAttributesType createExpirationAttributesType() {
- return new ExpirationAttributesType();
- }
-
- /**
- * Create an instance of {@link ServerType }
- *
- */
- public ServerType createServerType() {
- return new ServerType();
- }
-
- /**
- * Create an instance of {@link SerializationRegistrationType }
- *
- */
- public SerializationRegistrationType createSerializationRegistrationType() {
- return new SerializationRegistrationType();
- }
-
- /**
- * Create an instance of {@link FunctionServiceType }
- *
- */
- public FunctionServiceType createFunctionServiceType() {
- return new FunctionServiceType();
- }
-
- /**
- * Create an instance of {@link RegionConfig }
- *
- */
- public RegionConfig createRegionType() {
- return new RegionConfig();
- }
-
- /**
- * Create an instance of {@link RegionConfig.Entry }
- *
- */
- public RegionConfig.Entry createRegionTypeEntry() {
- return new RegionConfig.Entry();
- }
-
- /**
- * Create an instance of {@link RegionConfig.Index }
- *
- */
- public RegionConfig.Index createRegionTypeIndex() {
- return new RegionConfig.Index();
- }
-
- /**
- * Create an instance of {@link JndiBindingsType }
- *
- */
- public JndiBindingsType createJndiBindingsType() {
- return new JndiBindingsType();
- }
-
- /**
- * Create an instance of {@link JndiBindingsType.JndiBinding }
- *
- */
- public JndiBindingsType.JndiBinding createJndiBindingsTypeJndiBinding() {
- return new JndiBindingsType.JndiBinding();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType }
- *
- */
- public RegionAttributesType createRegionAttributesType() {
- return new RegionAttributesType();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.EvictionAttributes }
- *
- */
- public RegionAttributesType.EvictionAttributes createRegionAttributesTypeEvictionAttributes() {
- return new RegionAttributesType.EvictionAttributes();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.MembershipAttributes }
- *
- */
- public RegionAttributesType.MembershipAttributes createRegionAttributesTypeMembershipAttributes() {
- return new RegionAttributesType.MembershipAttributes();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.PartitionAttributes }
- *
- */
- public RegionAttributesType.PartitionAttributes createRegionAttributesTypePartitionAttributes() {
- return new RegionAttributesType.PartitionAttributes();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.DiskWriteAttributes }
- *
- */
- public RegionAttributesType.DiskWriteAttributes createRegionAttributesTypeDiskWriteAttributes() {
- return new RegionAttributesType.DiskWriteAttributes();
- }
-
- /**
- * Create an instance of {@link PdxType }
- *
- */
- public PdxType createPdxType() {
- return new PdxType();
- }
-
- /**
- * Create an instance of {@link PoolType }
- *
- */
- public PoolType createPoolType() {
- return new PoolType();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayHub }
- *
- */
- public CacheConfig.GatewayHub createCacheGatewayHub() {
- return new CacheConfig.GatewayHub();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayHub.Gateway }
- *
- */
- public CacheConfig.GatewayHub.Gateway createCacheGatewayHubGateway() {
- return new CacheConfig.GatewayHub.Gateway();
- }
-
- /**
- * Create an instance of {@link CacheTransactionManagerType }
- *
- */
- public CacheTransactionManagerType createCacheTransactionManagerType() {
- return new CacheTransactionManagerType();
- }
-
- /**
- * Create an instance of {@link DynamicRegionFactoryType }
- *
- */
- public DynamicRegionFactoryType createDynamicRegionFactoryType() {
- return new DynamicRegionFactoryType();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewaySender }
- *
- */
- public CacheConfig.GatewaySender createCacheGatewaySender() {
- return new CacheConfig.GatewaySender();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayReceiver }
- *
- */
- public CacheConfig.GatewayReceiver createCacheGatewayReceiver() {
- return new CacheConfig.GatewayReceiver();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayConflictResolver }
- *
- */
- public CacheConfig.GatewayConflictResolver createCacheGatewayConflictResolver() {
- return new CacheConfig.GatewayConflictResolver();
- }
-
- /**
- * Create an instance of {@link CacheConfig.AsyncEventQueue }
- *
- */
- public CacheConfig.AsyncEventQueue createCacheAsyncEventQueue() {
- return new CacheConfig.AsyncEventQueue();
- }
-
- /**
- * Create an instance of {@link CacheConfig.CacheServer }
- *
- */
- public CacheConfig.CacheServer createCacheCacheServer() {
- return new CacheConfig.CacheServer();
- }
-
- /**
- * Create an instance of {@link DiskStoreType }
- *
- */
- public DiskStoreType createDiskStoreType() {
- return new DiskStoreType();
- }
-
- /**
- * Create an instance of {@link ResourceManagerType }
- *
- */
- public ResourceManagerType createResourceManagerType() {
- return new ResourceManagerType();
- }
-
- /**
- * Create an instance of {@link InitializerType }
- *
- */
- public InitializerType createInitializerType() {
- return new InitializerType();
- }
-
- /**
- * Create an instance of {@link CacheWriterType }
- *
- */
- public CacheWriterType createCacheWriterType() {
- return new CacheWriterType();
- }
-
- /**
- * Create an instance of {@link DiskDirsType }
- *
- */
- public DiskDirsType createDiskDirsType() {
- return new DiskDirsType();
- }
-
- /**
- * Create an instance of {@link StringType }
- *
- */
- public StringType createStringType() {
- return new StringType();
- }
-
- /**
- * Create an instance of {@link ParameterType }
- *
- */
- public ParameterType createParameterType() {
- return new ParameterType();
- }
-
- /**
- * Create an instance of {@link ClassWithParametersType }
- *
- */
- public ClassWithParametersType createClassWithParametersType() {
- return new ClassWithParametersType();
- }
-
- /**
- * Create an instance of {@link DeclarableType }
- *
- */
- public DeclarableType createDeclarableType() {
- return new DeclarableType();
- }
-
- /**
- * Create an instance of {@link CacheLoaderType }
- *
- */
- public CacheLoaderType createCacheLoaderType() {
- return new CacheLoaderType();
- }
-
- /**
- * Create an instance of {@link DiskDirType }
- *
- */
- public DiskDirType createDiskDirType() {
- return new DiskDirType();
- }
-
- /**
- * Create an instance of {@link ExpirationAttributesType.CustomExpiry }
- *
- */
- public ExpirationAttributesType.CustomExpiry createExpirationAttributesTypeCustomExpiry() {
- return new ExpirationAttributesType.CustomExpiry();
- }
-
- /**
- * Create an instance of {@link ServerType.ClientSubscription }
- *
- */
- public ServerType.ClientSubscription createServerTypeClientSubscription() {
- return new ServerType.ClientSubscription();
- }
-
- /**
- * Create an instance of {@link ServerType.CustomLoadProbe }
- *
- */
- public ServerType.CustomLoadProbe createServerTypeCustomLoadProbe() {
- return new ServerType.CustomLoadProbe();
- }
-
- /**
- * Create an instance of {@link SerializationRegistrationType.Serializer }
- *
- */
- public SerializationRegistrationType.Serializer createSerializationRegistrationTypeSerializer() {
- return new SerializationRegistrationType.Serializer();
- }
-
- /**
- * Create an instance of {@link SerializationRegistrationType.Instantiator }
- *
- */
- public SerializationRegistrationType.Instantiator createSerializationRegistrationTypeInstantiator() {
- return new SerializationRegistrationType.Instantiator();
- }
-
- /**
- * Create an instance of {@link FunctionServiceType.Function }
- *
- */
- public FunctionServiceType.Function createFunctionServiceTypeFunction() {
- return new FunctionServiceType.Function();
- }
-
- /**
- * Create an instance of {@link RegionConfig.Entry.Key }
- *
- */
- public RegionConfig.Entry.Key createRegionTypeEntryKey() {
- return new RegionConfig.Entry.Key();
- }
-
- /**
- * Create an instance of {@link RegionConfig.Entry.Value }
- *
- */
- public RegionConfig.Entry.Value createRegionTypeEntryValue() {
- return new RegionConfig.Entry.Value();
- }
-
- /**
- * Create an instance of {@link RegionConfig.Index.Functional }
- *
- */
- public RegionConfig.Index.Functional createRegionTypeIndexFunctional() {
- return new RegionConfig.Index.Functional();
- }
-
- /**
- * Create an instance of {@link RegionConfig.Index.PrimaryKey }
- *
- */
- public RegionConfig.Index.PrimaryKey createRegionTypeIndexPrimaryKey() {
- return new RegionConfig.Index.PrimaryKey();
- }
-
- /**
- * Create an instance of {@link JndiBindingsType.JndiBinding.ConfigProperty }
- *
- */
- public JndiBindingsType.JndiBinding.ConfigProperty createJndiBindingsTypeJndiBindingConfigProperty() {
- return new JndiBindingsType.JndiBinding.ConfigProperty();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.RegionTimeToLive }
- *
- */
- public RegionAttributesType.RegionTimeToLive createRegionAttributesTypeRegionTimeToLive() {
- return new RegionAttributesType.RegionTimeToLive();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.RegionIdleTime }
- *
- */
- public RegionAttributesType.RegionIdleTime createRegionAttributesTypeRegionIdleTime() {
- return new RegionAttributesType.RegionIdleTime();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.EntryTimeToLive }
- *
- */
- public RegionAttributesType.EntryTimeToLive createRegionAttributesTypeEntryTimeToLive() {
- return new RegionAttributesType.EntryTimeToLive();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.EntryIdleTime }
- *
- */
- public RegionAttributesType.EntryIdleTime createRegionAttributesTypeEntryIdleTime() {
- return new RegionAttributesType.EntryIdleTime();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.SubscriptionAttributes }
- *
- */
- public RegionAttributesType.SubscriptionAttributes createRegionAttributesTypeSubscriptionAttributes() {
- return new RegionAttributesType.SubscriptionAttributes();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.CacheListener }
- *
- */
- public RegionAttributesType.CacheListener createRegionAttributesTypeCacheListener() {
- return new RegionAttributesType.CacheListener();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.Compressor }
- *
- */
- public RegionAttributesType.Compressor createRegionAttributesTypeCompressor() {
- return new RegionAttributesType.Compressor();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.EvictionAttributes.LruEntryCount }
- *
- */
- public RegionAttributesType.EvictionAttributes.LruEntryCount createRegionAttributesTypeEvictionAttributesLruEntryCount() {
- return new RegionAttributesType.EvictionAttributes.LruEntryCount();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.EvictionAttributes.LruHeapPercentage }
- *
- */
- public RegionAttributesType.EvictionAttributes.LruHeapPercentage createRegionAttributesTypeEvictionAttributesLruHeapPercentage() {
- return new RegionAttributesType.EvictionAttributes.LruHeapPercentage();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.EvictionAttributes.LruMemorySize }
- *
- */
- public RegionAttributesType.EvictionAttributes.LruMemorySize createRegionAttributesTypeEvictionAttributesLruMemorySize() {
- return new RegionAttributesType.EvictionAttributes.LruMemorySize();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.MembershipAttributes.RequiredRole }
- *
- */
- public RegionAttributesType.MembershipAttributes.RequiredRole createRegionAttributesTypeMembershipAttributesRequiredRole() {
- return new RegionAttributesType.MembershipAttributes.RequiredRole();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.PartitionAttributes.PartitionResolver }
- *
- */
- public RegionAttributesType.PartitionAttributes.PartitionResolver createRegionAttributesTypePartitionAttributesPartitionResolver() {
- return new RegionAttributesType.PartitionAttributes.PartitionResolver();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.PartitionAttributes.PartitionListener }
- *
- */
- public RegionAttributesType.PartitionAttributes.PartitionListener createRegionAttributesTypePartitionAttributesPartitionListener() {
- return new RegionAttributesType.PartitionAttributes.PartitionListener();
- }
-
- /**
- * Create an instance of
- * {@link RegionAttributesType.PartitionAttributes.FixedPartitionAttributes }
- *
- */
- public RegionAttributesType.PartitionAttributes.FixedPartitionAttributes createRegionAttributesTypePartitionAttributesFixedPartitionAttributes() {
- return new RegionAttributesType.PartitionAttributes.FixedPartitionAttributes();
- }
-
- /**
- * Create an instance of {@link RegionAttributesType.DiskWriteAttributes.AsynchronousWrites }
- *
- */
- public RegionAttributesType.DiskWriteAttributes.AsynchronousWrites createRegionAttributesTypeDiskWriteAttributesAsynchronousWrites() {
- return new RegionAttributesType.DiskWriteAttributes.AsynchronousWrites();
- }
-
- /**
- * Create an instance of {@link PdxType.PdxSerializer }
- *
- */
- public PdxType.PdxSerializer createPdxTypePdxSerializer() {
- return new PdxType.PdxSerializer();
- }
-
- /**
- * Create an instance of {@link PoolType.Locator }
- *
- */
- public PoolType.Locator createPoolTypeLocator() {
- return new PoolType.Locator();
- }
-
- /**
- * Create an instance of {@link PoolType.Server }
- *
- */
- public PoolType.Server createPoolTypeServer() {
- return new PoolType.Server();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayHub.Gateway.GatewayEndpoint }
- *
- */
- public CacheConfig.GatewayHub.Gateway.GatewayEndpoint createCacheGatewayHubGatewayGatewayEndpoint() {
- return new CacheConfig.GatewayHub.Gateway.GatewayEndpoint();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayHub.Gateway.GatewayListener }
- *
- */
- public CacheConfig.GatewayHub.Gateway.GatewayListener createCacheGatewayHubGatewayGatewayListener() {
- return new CacheConfig.GatewayHub.Gateway.GatewayListener();
- }
-
- /**
- * Create an instance of {@link CacheConfig.GatewayHub.Gateway.GatewayQueue }
- *
- */
- public CacheConfig.GatewayHub.Gateway.GatewayQueue createCacheGatewayHubGatewayGatewayQueue() {
- return new CacheConfig.GatewayHub.Gateway.GatewayQueue();
- }
-
- /**
- * Create an instance of {@link CacheTransactionManagerType.TransactionListener }
- *
- */
- public CacheTransactionManagerType.TransactionListener createCacheTransactionManagerTypeTransactionListener() {
- return new CacheTransactionManagerType.TransactionListener();
- }
-
- /**
- * Create an instance of {@link CacheTransactionManagerType.TransactionWriter }
- *
- */
- public CacheTransactionManagerType.TransactionWriter createCacheTransactionManagerTypeTransactionWriter() {
- return new CacheTransactionManagerType.TransactionWriter();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link JndiBindingsType }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://geode.apache.org/schema/cache", name = "jndi-bindings",
- scope = CacheConfig.class)
- public JAXBElement<JndiBindingsType> createCacheJndiBindings(JndiBindingsType value) {
- return new JAXBElement<JndiBindingsType>(_CacheJndiBindings_QNAME, JndiBindingsType.class,
- CacheConfig.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link RegionConfig }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://geode.apache.org/schema/cache", name = "vm-root-region",
- scope = CacheConfig.class)
- public JAXBElement<RegionConfig> createCacheVmRootRegion(RegionConfig value) {
- return new JAXBElement<RegionConfig>(_CacheVmRootRegion_QNAME, RegionConfig.class,
- CacheConfig.class, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link RegionConfig }{@code >}}
- *
- */
- @XmlElementDecl(namespace = "http://geode.apache.org/schema/cache", name = "region",
- scope = CacheConfig.class)
- public JAXBElement<RegionConfig> createCacheRegion(RegionConfig value) {
- return new JAXBElement<RegionConfig>(_CacheRegion_QNAME, RegionConfig.class, CacheConfig.class,
- value);
- }
-
-}
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/cache-1.0.xsd b/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/cache-1.0.xsd
deleted file mode 100644
index d09c2f3..0000000
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/configuration/cache-1.0.xsd
+++ /dev/null
@@ -1,1411 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- ~ 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.
- -->
-<xsd:schema
- targetNamespace="http://geode.apache.org/schema/cache"
- xmlns:gf="http://geode.apache.org/schema/cache"
- xmlns:xsd="http://www.w3.org/2001/XMLSchema"
- elementFormDefault="qualified"
- attributeFormDefault="unqualified"
- version="1.0">
- <xsd:annotation>
- <xsd:documentation><![CDATA[
-This is the XML Schema for the Geode distributed cache declarative
-caching XML file. All declarative cache files must include a schema
-of the following form:
-
- <cache
- xmlns="http://geode.apache.org/schema/cache"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://geode.apache.org/schema/cache
- http://geode.apache.org/schema/cache/cache-1.0.xsd"
- version="1.0">
-
-If you are declaring a client cache then use this schema:
-
- <client-cache
- xmlns="http://geode.apache.org/schema/cache"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://geode.apache.org/schema/cache
- http://geode.apache.org/schema/cache/cache-1.0.xsd"
- version="1.0">
-
-The contents of a declarative XML file correspond to APIs found in the
-org.apache.geode.cache and org.apache.geode.cache.client
-packages. A declarative caching XML file is used to populate a Cache
-or a ClientCache when it is created.
-
-The top-level element in this syntax is "cache" or "client-cache".
-All elements are listed here in alphabetical order.
-
-The following conventions apply to all Geode distributed cache
-declarative caching XML file elements unless indicated otherwise.
-
-- In elements that contain PCDATA, leading and trailing whitespace in
- the data may be ignored.
-
-- In elements whose value is an "enumerated type", the value is case
- sensitive.
-
- ]]></xsd:documentation>
- </xsd:annotation>
-
- <!--
--->
- <xsd:element name="cache">
- <xsd:annotation>
- <xsd:documentation>
- The "cache" element is the root element of the declarative cache file on a peer or server.
- This element configures a Geode Cache and describes the root regions it contains, if any.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="cache-transaction-manager" type="gf:cache-transaction-manager-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="dynamic-region-factory" type="gf:dynamic-region-factory-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway-hub">
- <xsd:annotation>
- <xsd:documentation>
- The "gateway-hub" element specifies a Gateway Hub that is
- initialized when the Cache is declaratively initialized.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway">
- <xsd:annotation>
- <xsd:documentation>
- The "gateway" element specifies a Gateway that is
- initialized when a GatewayHub is declaratively initialized.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:choice>
- <xsd:element maxOccurs="unbounded" minOccurs="1" name="gateway-endpoint">
- <xsd:annotation>
- <xsd:documentation>
- The "gateway-endpoint" element specifies an endpoint that is
- initialized when a Gateway is declaratively initialized.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="host" type="xsd:string" use="required" />
- <xsd:attribute name="id" type="xsd:string" use="required" />
- <xsd:attribute name="port" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="unbounded" minOccurs="1" name="gateway-listener">
- <xsd:annotation>
- <xsd:documentation>
- The "gateway-listener" element specifies a listener that is
- initialized when a Gateway is declaratively initialized.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:element maxOccurs="1" minOccurs="0" name="gateway-queue">
- <xsd:annotation>
- <xsd:documentation>
- The "gateway-queue" element specifies a queue that is initialized when a
- Gateway is declaratively initialized. As of 6.5 overflow-directory is
- deprecated. Use disk-store-name instead. As of 6.5 roll-oplogs is
- deprecated. Use disk-store-name instead.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="alert-threshold" type="xsd:string" use="optional" />
- <xsd:attribute name="batch-conflation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="batch-size" type="xsd:string" use="optional" />
- <xsd:attribute name="batch-time-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="enable-persistence" type="xsd:boolean" use="optional" />
- <xsd:attribute name="disk-store-name" type="xsd:string" use="optional" />
- <xsd:attribute name="roll-oplogs" type="xsd:boolean" use="optional" />
- <xsd:attribute name="maximum-queue-memory" type="xsd:string" use="optional" />
- <xsd:attribute name="overflow-directory" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="early-ack" type="xsd:boolean" use="optional" />
- <xsd:attribute name="id" type="xsd:string" use="required" />
- <xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-read-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="concurrency-level" type="xsd:string" use="optional" />
- <xsd:attribute name="order-policy" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" use="required" />
- <xsd:attribute name="bind-address" type="xsd:string" use="optional" />
- <xsd:attribute name="maximum-time-between-pings" type="xsd:string" use="optional" />
- <xsd:attribute name="port" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="startup-policy" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="primary" />
- <xsd:enumeration value="secondary" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="manual-start" type="xsd:boolean" use="optional" />
- <xsd:attribute name="max-connections" type="xsd:integer" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway-sender">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway-event-filter" type="gf:class-with-parameters-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="gateway-event-substitution-filter" type="gf:class-with-parameters-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway-transport-filter" type="gf:class-with-parameters-type" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" use="required" />
- <xsd:attribute name="remote-distributed-system-id" type="xsd:string" use="required" />
- <xsd:attribute name="parallel" type="xsd:boolean" use="optional" />
- <xsd:attribute name="manual-start" type="xsd:boolean" use="optional" >
- <xsd:annotation>
- <xsd:appinfo>deprecated</xsd:appinfo>
- <xsd:documentation>Manual start of senders is deprecated and will be removed in a later release.</xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- <xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-read-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="enable-batch-conflation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="batch-size" type="xsd:string" use="optional" />
- <xsd:attribute name="batch-time-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="enable-persistence" type="xsd:boolean" use="optional" />
- <xsd:attribute name="disk-store-name" type="xsd:string" use="optional" />
- <xsd:attribute name="disk-synchronous" type="xsd:boolean" use="optional" />
- <xsd:attribute name="maximum-queue-memory" type="xsd:string" use="optional" />
- <xsd:attribute name="alert-threshold" type="xsd:string" use="optional" />
- <xsd:attribute name="dispatcher-threads" type="xsd:string" use="optional" />
- <xsd:attribute name="order-policy" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="gateway-receiver">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway-transport-filter" type="gf:class-with-parameters-type" />
- </xsd:sequence>
- <xsd:attribute name="start-port" type="xsd:string" use="optional" />
- <xsd:attribute name="end-port" type="xsd:string" use="optional" />
- <xsd:attribute name="bind-address" type="xsd:string" use="optional" />
- <xsd:attribute name="maximum-time-between-pings" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="hostname-for-senders" type="xsd:string" use="optional" />
- <xsd:attribute name="manual-start" type="xsd:boolean" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="gateway-conflict-resolver">
- <xsd:annotation>
- <xsd:documentation>
- A "gateway-conflict-resolver" element describes a region's GatewayConflictResolver.
- It is used to resolve inter-system concurrency conflicts.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="async-event-queue">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="gateway-event-filter" type="gf:class-with-parameters-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="gateway-event-substitution-filter" type="gf:class-with-parameters-type" />
- <xsd:element name="async-event-listener" type="gf:class-with-parameters-type">
- <xsd:annotation>
- <xsd:documentation>
- A "async-event-listener" element describes a region's AsyncEventListener.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" use="required" />
- <xsd:attribute name="parallel" type="xsd:boolean" use="optional" />
- <xsd:attribute name="batch-size" type="xsd:string" use="optional" />
- <xsd:attribute name="batch-time-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="enable-batch-conflation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="maximum-queue-memory" type="xsd:string" use="optional" />
- <xsd:attribute name="persistent" type="xsd:boolean" use="optional" />
- <xsd:attribute name="disk-store-name" type="xsd:string" use="optional" />
- <xsd:attribute name="disk-synchronous" type="xsd:boolean" use="optional" />
- <xsd:attribute name="dispatcher-threads" type="xsd:string" use="optional" />
- <xsd:attribute name="order-policy" type="xsd:string" use="optional" />
- <xsd:attribute default="false" name="forward-expiration-destroy" type="xsd:boolean" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="cache-server">
- <xsd:annotation>
- <xsd:documentation>
- The "cache-server" element specifies a Cache Server that will accept requests from
- clients and that is started when the Cache is declaratively initialized.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:complexContent>
- <xsd:extension base="gf:server-type">
- <xsd:attribute name="tcp-no-delay" type="xsd:boolean" use="optional" />
- </xsd:extension>
- </xsd:complexContent>
- </xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="pool" type="gf:pool-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="disk-store" type="gf:disk-store-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="pdx" type="gf:pdx-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="region-attributes" type="gf:region-attributes-type" />
-
- <xsd:element name="jndi-bindings" type="gf:jndi-bindings-type" maxOccurs="unbounded" minOccurs="0" />
- <xsd:element name="region" type="gf:region-type" maxOccurs="unbounded" minOccurs="0"/>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="function-service" type="gf:function-service-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="resource-manager" type="gf:resource-manager-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="serialization-registration" type="gf:serialization-registration-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="backup" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- The backup element defines files or directories that should be backed up when the
- system wide backup command is invoked. Disk stores with persistent data are
- automatically backed up, they do not need to be listed with this element.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="initializer" type="gf:initializer-type" />
- </xsd:sequence>
- <xsd:attribute name="copy-on-read" type="xsd:boolean" use="optional" />
- <xsd:attribute name="is-server" type="xsd:boolean" use="optional" />
- <xsd:attribute name="lock-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="lock-lease" type="xsd:string" use="optional" />
- <xsd:attribute name="message-sync-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="search-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="version" type="gf:versionType" use="required" fixed="1.0" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:complexType name="region-type">
- <xsd:annotation>
- <xsd:documentation>
- A "region" element describes a region (and its entries) in Geode distributed cache.
- It may be used to create a new region or may be used to add new entries to an existing
- region. Note that the "name" attribute specifies the simple name of the region; it
- cannot contain a "/". If "refid" is set then it defines the default region attributes
- to use for this region. A nested "region-attributes" element can override these defaults.
- If the nested "region-attributes" element has its own "refid" then it will cause the
- "refid" on the region to be ignored. "refid" can be set to the name of a RegionShortcut
- or a ClientRegionShortcut (see the javadocs of those enum classes for their names).
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="region-attributes" type="gf:region-attributes-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="index">
- <xsd:annotation>
- <xsd:documentation>
- An "index" element describes an index to be created on a region.
- The index node, if any, should all come immediately after the
- "region-attributes" node. There can be any number of functional types
- of index on a Region, but only at max one index of type "primary-key". The
- "name" attribute is a required field which identifies the name of the index.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:choice minOccurs="0">
- <xsd:element name="functional">
- <xsd:annotation>
- <xsd:documentation>
- A functional type of index needs a from-clause, expression which are mandatory.
- The import string is used for specifying the type of Object in the region or
- the type of Object which the indexed expression evaluates to.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="expression" type="xsd:string" use="required" />
- <xsd:attribute name="from-clause" type="xsd:string" use="required" />
- <xsd:attribute name="imports" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="primary-key">
- <xsd:annotation>
- <xsd:documentation>
- A primary-key type of index needs a field attribute which is mandatory.
- There should be only one or zero primary-index defined for a region
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="field" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- <xsd:attribute name="expression" type="xsd:string" use="optional" />
- <xsd:attribute name="from-clause" type="xsd:string" use="optional" />
- <xsd:attribute name="imports" type="xsd:string" use="optional" />
- <xsd:attribute name="key-index" type="xsd:boolean" use="optional" />
- <xsd:attribute default="range" name="type" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="range" />
- <xsd:enumeration value="hash" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="entry">
- <xsd:annotation>
- <xsd:documentation>
- An "entry" element desribes an entry to be added to a region. Note
- that if an entry with the given key already exists in the region,
- it will be replaced.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="key">
- <xsd:annotation>
- <xsd:documentation>
- A "key" element describes the key in a Region entry.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name="string" type="gf:string-type" />
- <xsd:element name="declarable" type="gf:declarable-type" />
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="value">
- <xsd:annotation>
- <xsd:documentation>
- A "value" element describes the value in a Region entry
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name="string" type="gf:string-type" />
- <xsd:element name="declarable" type="gf:declarable-type" />
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="region" type="gf:region-type" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- <xsd:attribute name="refid" type="xsd:string" use="optional" />
- </xsd:complexType>
- <!-- ======================================================= -->
- <!--
-A "region-attributes" element describes the attributes of a region to
-be created.
-As of 6.5 disk-dirs is deprecated on region-attributes. Use disk-store-name instead.
--->
- <xsd:complexType name="region-attributes-type">
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="key-constraint">
- <xsd:annotation>
- <xsd:documentation>
- A "key-constraint" element specifies the name of a class to which the
- keys of a region are constrained.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="value-constraint" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- A "value-constraint" element specifies the name of a class to which the
- values of a region are constrained.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="region-time-to-live">
- <xsd:annotation>
- <xsd:documentation>
- A "region-time-to-live" element specifies a Region's time to live.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="expiration-attributes" type="gf:expiration-attributes-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="region-idle-time">
- <xsd:annotation>
- <xsd:documentation>
- A "region-idle-time" element specifies a Region's idle time.
- Note that the APIs that correspond to this element add "out" to their
- name. See getRegionIdleTimeout and setRegionIdleTimeout.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="expiration-attributes" type="gf:expiration-attributes-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="entry-time-to-live">
- <xsd:annotation>
- <xsd:documentation>
- A "entry-time-to-live" element specifies a Region's entries' time to
- live.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="expiration-attributes" type="gf:expiration-attributes-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="entry-idle-time">
- <xsd:annotation>
- <xsd:documentation>
- A "entry-idle-time" element specifies a Region's entries' idle time.
- Note that the APIs that correspond to this element add "out" to
- their name. See getEntryIdleTimeout and setEntryIdleTimeout.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="expiration-attributes" type="gf:expiration-attributes-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="disk-write-attributes">
- <xsd:annotation>
- <xsd:documentation>
- A "disk-write-attributes" element describes how entry data is written
- to disk. Deprecated as of 6.5 use disk-store instead.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name="asynchronous-writes">
- <xsd:annotation>
- <xsd:documentation>
- An "asynchronous-writes" element specifies how entry data should be
- written to disk asynchronous. Deprecated as of 6.5 use disk-store instead.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="bytes-threshold" type="xsd:string" use="required" />
- <xsd:attribute name="time-interval" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element name="synchronous-writes">
- <xsd:annotation>
- <xsd:documentation>
- A "synchronous-writes" element specifies that entry data should be
- written to disk synchronously.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- </xsd:choice>
- <xsd:attribute name="max-oplog-size" type="xsd:string" use="optional" />
- <xsd:attribute name="roll-oplogs" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="disk-dirs" type="gf:disk-dirs-type" />
-
- <xsd:element maxOccurs="1" minOccurs="0" name="partition-attributes">
- <xsd:annotation>
- <xsd:documentation>
- A "partition-attributes" element configures a region for partitioned
- data storage.
-
- local-max-memory attribute added to partition-attributes in release 5.1
- total-max-memory attribute added to partition-attributes in release 5.1
- total-num-buckets attribute added to partition-attributes in release 5.1
- partition-resolver attribute added to partition-attributes in release 5.7
- partition-listener attribute added to partition-attributes in release 6.1
- colocated-with attribute added to partition-attributes in release 5.7
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="partition-resolver">
- <xsd:annotation>
- <xsd:documentation>
- A "partition-resolver" element describes a partitioned region's custom
- PartitionResolver.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="partition-listener">
- <xsd:annotation>
- <xsd:documentation>
- A "partition-listener" element describes a partitioned region's custom
- PartitionListener.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="fixed-partition-attributes">
- <xsd:annotation>
- <xsd:documentation>
- A "fixed-partition-attributes" element describes characteristics of a
- partition in a Fixed Partitioned Region.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="partition-name" type="xsd:string" use="required" />
- <xsd:attribute name="is-primary" type="xsd:boolean" use="optional" />
- <xsd:attribute name="num-buckets" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="local-max-memory" type="xsd:string" use="optional" />
- <xsd:attribute name="recovery-delay" type="xsd:string" use="optional" />
- <xsd:attribute name="redundant-copies" type="xsd:string" use="optional" />
- <xsd:attribute name="startup-recovery-delay" type="xsd:string" use="optional" />
- <xsd:attribute name="total-max-memory" type="xsd:string" use="optional" />
- <xsd:attribute name="total-num-buckets" type="xsd:string" use="optional" />
- <xsd:attribute name="colocated-with" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="membership-attributes">
- <xsd:annotation>
- <xsd:documentation>
- A "membership-attributes" element configures a region for membership
- constraints based on required roles. Deprecated - this feature is scheduled to be removed.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="required-role">
- <xsd:annotation>
- <xsd:documentation>
- A "required-role" element specifies a role that is required for reliable
- access to the region. Deprecated - this feature is scheduled to be removed.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="loss-action" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="full-access" />
- <xsd:enumeration value="limited-access" />
- <xsd:enumeration value="no-access" />
- <xsd:enumeration value="reconnect" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="resumption-action" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="none" />
- <xsd:enumeration value="reinitialize" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="subscription-attributes">
- <xsd:annotation>
- <xsd:documentation>
- A "subscription-attributes" element configures how a region subscribes
- to remote distributed regions.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="interest-policy" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="all" />
- <xsd:enumeration value="cache-content" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="cache-loader" type="gf:cache-loader-type" />
- <xsd:element maxOccurs="1" minOccurs="0" name="cache-writer" type="gf:cache-writer-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="cache-listener">
- <xsd:annotation>
- <xsd:documentation>
- A "cache-listener" element describes a region's CacheListener.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="compressor">
- <xsd:annotation>
- <xsd:documentation>
- A compressor registers a custom class which extends Compressor to support compression on a region.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="1" minOccurs="0" name="eviction-attributes">
- <xsd:annotation>
- <xsd:documentation>
- Create eviction attributes that monitor and control the size of the Region.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:choice>
- <xsd:element name="lru-entry-count">
- <xsd:annotation>
- <xsd:documentation>
- Create an LRU eviction controller which performs the action if the
- Region has more than the maximum number of Entries in the Region.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="action" type="gf:enum-action-destroy-overflow" use="optional" />
- <xsd:attribute name="maximum" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="lru-heap-percentage">
- <xsd:annotation>
- <xsd:documentation>
- Create an LRU which evicts entries using the specified action
- when the heap is over the resource manager critical heap/off-heap percentage.
- When the threshold has been exceeded each create or put operation
- is required to evict the same size of data which was added. The
- optional class-name and parameters allow for the declaration
- of an ObjectSizer, which will be used to determine data size.
- The class must implement the ObjectSizer interface.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence minOccurs="0">
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- <xsd:attribute name="action" type="gf:enum-action-destroy-overflow" use="optional" />
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element name="lru-memory-size">
- <xsd:annotation>
- <xsd:documentation>
- Create an LRU that performs the action when the memory size of the Region is
- over the maximum. The optional class-name and parameters allow for the
- declaration an ObjectSizer, which is used to measure the size of each Object
- in the Region. The class must implement the ObjectSizer interface.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence minOccurs="0">
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- <xsd:attribute name="action" type="gf:enum-action-destroy-overflow" use="optional" />
- <xsd:attribute name="maximum" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="concurrency-level" type="xsd:string" use="optional" />
- <xsd:attribute name="data-policy" type="gf:region-attributesData-policy" use="optional" />
- <xsd:attribute name="early-ack" type="xsd:boolean" use="optional" />
- <xsd:attribute name="enable-async-conflation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="enable-gateway" type="xsd:boolean" use="optional" />
- <xsd:attribute name="enable-subscription-conflation" type="xsd:boolean" use="optional" />
- <xsd:attribute name="gateway-sender-ids" type="xsd:string" use="optional" />
- <xsd:attribute name="async-event-queue-ids" type="xsd:string" use="optional" />
- <xsd:attribute name="hub-id" type="xsd:string" use="optional" />
- <xsd:attribute name="id" type="xsd:string" use="optional" />
- <xsd:attribute name="ignore-jta" type="xsd:boolean" use="optional" />
- <xsd:attribute name="index-update-type" type="gf:region-attributesIndex-update-type" use="optional" />
- <xsd:attribute name="initial-capacity" type="xsd:string" use="optional" />
- <xsd:attribute name="is-lock-grantor" type="xsd:boolean" use="optional" />
- <xsd:attribute name="load-factor" type="xsd:string" use="optional" />
- <xsd:attribute name="mirror-type" type="gf:region-attributesMirror-type" use="optional" />
- <xsd:attribute name="multicast-enabled" type="xsd:boolean" use="optional" />
- <xsd:attribute name="persist-backup" type="xsd:boolean" use="optional" />
- <xsd:attribute name="pool-name" type="xsd:string" use="optional" />
- <xsd:attribute name="disk-store-name" type="xsd:string" use="optional" />
- <xsd:attribute name="disk-synchronous" type="xsd:boolean" use="optional" />
- <xsd:attribute name="publisher" type="xsd:boolean" use="optional" />
- <xsd:attribute name="refid" type="xsd:string" use="optional" />
- <xsd:attribute name="scope" type="gf:region-attributesScope" use="optional" />
- <xsd:attribute name="statistics-enabled" type="xsd:boolean" use="optional" />
- <xsd:attribute name="cloning-enabled" type="xsd:boolean" use="optional" />
- <xsd:attribute default="true" name="concurrency-checks-enabled" type="xsd:boolean" use="optional" />
- <xsd:attribute name="off-heap" type="xsd:boolean" use="optional" />
- </xsd:complexType>
- <xsd:simpleType name="region-attributesData-policy">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="empty" />
- <xsd:enumeration value="normal" />
- <xsd:enumeration value="partition" />
- <xsd:enumeration value="persistent-replicate" />
- <xsd:enumeration value="preloaded" />
- <xsd:enumeration value="replicate" />
- <xsd:enumeration value="persistent-partition" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="region-attributesIndex-update-type">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="asynchronous" />
- <xsd:enumeration value="synchronous" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="region-attributesMirror-type">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="keys" />
- <xsd:enumeration value="keys-values" />
- <xsd:enumeration value="none" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="region-attributesScope">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="distributed-ack" />
- <xsd:enumeration value="distributed-no-ack" />
- <xsd:enumeration value="global" />
- <xsd:enumeration value="local" />
- </xsd:restriction>
- </xsd:simpleType>
- <xsd:simpleType name="enum-readable-writable">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="readable" />
- <xsd:enumeration value="writable" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <!-- ======================================================= -->
- <!--
--->
- <!-- ======================================================= -->
- <!--
--->
- <!-- ======================================================= -->
- <!--
--->
- <!-- ======================================================= -->
- <!--
--->
- <!-- ======================================================= -->
- <!--
--->
- <!-- ======================================================= -->
- <!--
--->
- <!-- ======================================================= -->
- <!-- ======================================================= -->
-
- <xsd:complexType name="server-type">
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="group" type="xsd:string">
- <xsd:annotation>
- <xsd:documentation>
- A "group" element specifies a single server group.
- Deprecated as of 7.0 use the groups Geode property instead.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="client-subscription">
- <xsd:annotation>
- <xsd:documentation>
- A "client-subscription" element describes the eviction policy, capacity and
- overflow-directory for client subscription config. The overflow-directory attribute
- is deprecated as of 6.5 use disk-store-name instead.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="eviction-policy" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="entry" />
- <xsd:enumeration value="mem" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="capacity" type="xsd:string" use="required" />
- <xsd:attribute name="disk-store-name" type="xsd:string" use="optional" />
- <xsd:attribute name="overflow-directory" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="custom-load-probe">
- <xsd:annotation>
- <xsd:documentation>
- A "custom-load-probe" element describes a callback that reports the load on a cache-server.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- <xsd:attribute name="bind-address" type="xsd:string" use="optional" />
- <xsd:attribute name="hostname-for-clients" type="xsd:string" use="optional" />
- <xsd:attribute name="max-connections" type="xsd:string" use="optional" />
- <xsd:attribute name="maximum-message-count" type="xsd:string" use="optional" />
- <xsd:attribute name="maximum-time-between-pings" type="xsd:string" use="optional" />
- <xsd:attribute name="max-threads" type="xsd:string" use="optional" />
- <xsd:attribute name="message-time-to-live" type="xsd:string" use="optional" />
- <xsd:attribute name="notify-by-subscription" type="xsd:boolean" use="optional" />
- <xsd:attribute name="port" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="load-poll-interval" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="resource-manager-type">
- <xsd:annotation>
- <xsd:appinfo>deprecated</xsd:appinfo>
- <xsd:documentation>
- The "resource manager" element configures the behavior of the resource manager.
- The resource manager provides support for resource management of its associated Cache.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="critical-heap-percentage" type="xsd:string" use="optional" />
- <xsd:attribute name="eviction-heap-percentage" type="xsd:string" use="optional" />
- <xsd:attribute name="critical-off-heap-percentage" type="xsd:string" use="optional" />
- <xsd:attribute name="eviction-off-heap-percentage" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="function-service-type">
- <xsd:annotation>
- <xsd:documentation>
- The "function service" element configures the behavior of the function service.
- The function service allows users to execute functions on data stored in Geode.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="function">
- <xsd:annotation>
- <xsd:documentation>
- The "function" element defines a function for registration in the function service.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="cache-loader-type">
- <xsd:annotation>
- <xsd:documentation>
- A "cache-loader" element describes a region's CacheLoader.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="cache-transaction-manager-type">
- <xsd:annotation>
- <xsd:documentation>
- A "cache-transaction-manager" element allows insertion of cache-level transaction listeners.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="transaction-listener">
- <xsd:annotation>
- <xsd:documentation>
- A "transaction-listener" describes a TransactionListener.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="1" minOccurs="0" name="transaction-writer">
- <xsd:annotation>
- <xsd:documentation>
- A "transaction-writer" describes a TransactionWriter.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="cache-writer-type">
- <xsd:annotation>
- <xsd:documentation>
- A "cache-writer" element describes a region's CacheWriter.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="serialization-registration-type">
- <xsd:annotation>
- <xsd:documentation>
- A serialization-registration contains a set of serializer or instantiator tags to
- register customer DataSerializer extensions or DataSerializable implementations respectively.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="serializer">
- <xsd:annotation>
- <xsd:documentation>
- A serializer registers a custom class which extends DataSerializer to support custom
- serialization of non-modifiable object types inside Geode. The class must have a
- public zero-arg constructor.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="instantiator">
- <xsd:annotation>
- <xsd:documentation>
- An instantiator registers a custom class which implements the DataSerializable interface
- to support custom object serialization inside Geode. The class must have a public
- zero-arg constructor.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- </xsd:sequence>
- <xsd:attribute name="id" type="xsd:string" use="required">
- <xsd:annotation>
- <xsd:documentation>
- The id that the instantiator should associate with the DataSerializable type.
- </xsd:documentation>
- </xsd:annotation>
- </xsd:attribute>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name="class-name-type">
- <xsd:annotation>
- <xsd:documentation>
- A "class-name" element specifies the name of a class, an instance of which is created
- when a declarative cache XML file is read.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:string">
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="disk-store-type">
- <xsd:annotation>
- <xsd:documentation>
- A "disk-store" element specifies a DiskStore for persistence.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="disk-dirs" type="gf:disk-dirs-type" />
- </xsd:sequence>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- <xsd:attribute name="auto-compact" type="xsd:boolean" use="optional" />
- <xsd:attribute name="compaction-threshold" type="xsd:string" use="optional" />
- <xsd:attribute name="allow-force-compaction" type="xsd:boolean" use="optional" />
- <xsd:attribute name="max-oplog-size" type="xsd:string" use="optional" />
- <xsd:attribute name="time-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="write-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="queue-size" type="xsd:string" use="optional" />
- <xsd:attribute name="disk-usage-warning-percentage" type="xsd:string" use="optional" />
- <xsd:attribute name="disk-usage-critical-percentage" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="pdx-type">
- <xsd:annotation>
- <xsd:documentation>
- A "pdx" element specifies the configuration for the portable data exchange (PDX) method of
- serialization. The "read-serialized" attribute is "early access".
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="pdx-serializer">
- <xsd:annotation>
- <xsd:documentation>
- A "pdx-serializer" element describes a serializer used to serialize objects in the
- portable data exchange format.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="read-serialized" type="xsd:boolean" use="optional" />
- <xsd:attribute name="ignore-unread-fields" type="xsd:boolean" use="optional" />
- <xsd:attribute name="persistent" type="xsd:boolean" use="optional" />
- <xsd:attribute name="disk-store-name" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="pool-type">
- <xsd:annotation>
- <xsd:documentation>
- A "pool" element specifies a client to server connection pool.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element maxOccurs="unbounded" minOccurs="1" name="locator">
- <xsd:annotation>
- <xsd:documentation>
- A "locator" element specifies the host and port that a server locator is listening on
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="host" type="xsd:string" use="required" />
- <xsd:attribute name="port" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- <xsd:element maxOccurs="unbounded" minOccurs="1" name="server">
- <xsd:annotation>
- <xsd:documentation>
- A "server" element specifies the host and port that a cache server is listening on
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:attribute name="host" type="xsd:string" use="required" />
- <xsd:attribute name="port" type="xsd:string" use="required" />
- </xsd:complexType>
- </xsd:element>
- </xsd:choice>
- <xsd:attribute name="subscription-timeout-multiplier" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-connect-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="free-connection-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="load-conditioning-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="min-connections" type="xsd:string" use="optional" />
- <xsd:attribute name="max-connections" type="xsd:string" use="optional" />
- <xsd:attribute name="retry-attempts" type="xsd:string" use="optional" />
- <xsd:attribute name="idle-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="ping-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="name" type="xsd:string" use="required" />
- <xsd:attribute name="read-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="server-group" type="xsd:string" use="optional" />
- <xsd:attribute name="socket-buffer-size" type="xsd:string" use="optional" />
- <xsd:attribute name="subscription-enabled" type="xsd:boolean" use="optional" />
- <xsd:attribute name="subscription-message-tracking-timeout" type="xsd:string" use="optional" />
- <xsd:attribute name="subscription-ack-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="subscription-redundancy" type="xsd:string" use="optional" />
- <xsd:attribute name="statistic-interval" type="xsd:string" use="optional" />
- <xsd:attribute name="thread-local-connections" type="xsd:boolean" use="optional" />
- <xsd:attribute name="pr-single-hop-enabled" type="xsd:boolean" use="optional" />
- <xsd:attribute name="multiuser-authentication" type="xsd:boolean" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="declarable-type">
- <xsd:annotation>
- <xsd:documentation>
- A "declarable" element specifies a Declarable object to be placed in a Region entry.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="disk-dir-type" mixed="true">
- <xsd:annotation>
- <xsd:documentation>
- A "disk-dir" element specifies one of a region or diskstore's disk directories.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:attribute name="dir-size" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="disk-dirs-type">
- <xsd:annotation>
- <xsd:documentation>
- A "disk-dirs" element specifies the region's disk directories.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="1" name="disk-dir" type="gf:disk-dir-type" />
- </xsd:sequence>
- </xsd:complexType>
- <xsd:complexType name="dynamic-region-factory-type">
- <xsd:annotation>
- <xsd:appinfo>deprecated</xsd:appinfo>
- <xsd:documentation>
- dynamic-region-factory is deprecated. Use functions to create regions dynamically
- instead.
-
- A "dynamic-region-factory" element configures a dynamic region factory for
- this cache. If this optional element is missing then the cache does not
- support dynamic regions.
-
- The optional "disk-dir" sub-element can be used to specify the directory to
- store the persistent files that are used for dynamic region bookkeeping.
- It defaults to the current directory.
-
- The pool-name attribute can be used to set the name of the connection pool used
- by client applications in a client/server cache configuration. It should not be
- specified in servers or peers.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="disk-dir" type="gf:disk-dir-type" />
- </xsd:sequence>
- <xsd:attribute name="disable-persist-backup" type="xsd:boolean" use="optional" />
- <xsd:attribute name="disable-register-interest" type="xsd:boolean" use="optional" />
- <xsd:attribute name="pool-name" type="xsd:string" use="optional" />
- </xsd:complexType>
-
- <xsd:complexType name="expiration-attributes-type">
- <xsd:annotation>
- <xsd:documentation>
- An "expiration-attributes" element describes expiration.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="1" minOccurs="0" name="custom-expiry">
- <xsd:annotation>
- <xsd:documentation>
- The "custom-expiry" element specifies a callback that specifies
- custom expiration attributes. See the CustomExpiry class.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
-
- <xsd:attribute name="action" use="optional">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="destroy" />
- <xsd:enumeration value="invalidate" />
- <xsd:enumeration value="local-destroy" />
- <xsd:enumeration value="local-invalidate" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="timeout" type="xsd:string" use="required" />
- </xsd:complexType>
-
- <xsd:complexType name="initializer-type">
- <xsd:annotation>
- <xsd:documentation>
- A "initializer" element specifies a Declarable object whose init method
- will be called after all other cache.xml initialization is
- complete.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="class-with-parameters-type">
- <xsd:sequence>
- <xsd:element name="class-name" type="gf:class-name-type" />
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="parameter" type="gf:parameter-type" />
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:complexType name="jndi-bindings-type">
- <xsd:annotation>
- <xsd:documentation>
- A jndi-bindings element will contain the jndi-binding for each of the
- datasources which are to be bound with the JNDI Context.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="jndi-binding">
- <xsd:annotation>
- <xsd:documentation>
- For every datasource which is bound to the JNDI tree, there will exist one
- jndi-binding tag. This tag will describe the property and configuration of the
- datasource. The attributes of jndi-binding are used for configuration by
- Geode, while the property element is used to configure the custom property
- for the datasource.
-
- The "xa-datasource-class" must be set when type is XAPooledDataSource,
- "conn-pooled-datasource-class" must be set when type is PooledDataSource,
- and "jdbc-driver-class" msut be set when the type is SimpleDataSource. It is
- advisable to set the user-name and password as attributes rather than as a
- property element. Alternatively, they may both be set as attributes of the
- jndi-binding tag as well as an attribute of the property tag.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element maxOccurs="unbounded" minOccurs="0" name="config-property">
- <xsd:complexType>
- <xsd:sequence>
- <xsd:element name="config-property-name" type="xsd:string" />
- <xsd:element name="config-property-type" type="xsd:string" />
- <xsd:element name="config-property-value" type="xsd:string" />
- </xsd:sequence>
- </xsd:complexType>
- </xsd:element>
-
- </xsd:sequence>
- <xsd:attribute name="blocking-timeout-seconds" type="xsd:string" use="optional" />
- <xsd:attribute name="conn-pooled-datasource-class" type="xsd:string" use="optional" />
- <xsd:attribute name="connection-url" type="xsd:string" use="optional" />
- <xsd:attribute name="idle-timeout-seconds" type="xsd:string" use="optional" />
- <xsd:attribute name="init-pool-size" type="xsd:string" use="optional" />
- <xsd:attribute name="jdbc-driver-class" type="xsd:string" use="optional" />
- <xsd:attribute name="jndi-name" type="xsd:string" use="required" />
- <xsd:attribute name="login-timeout-seconds" type="xsd:string" use="optional" />
- <xsd:attribute name="managed-conn-factory-class" type="xsd:string" use="optional" />
- <xsd:attribute name="max-pool-size" type="xsd:string" use="optional" />
- <xsd:attribute name="password" type="xsd:string" use="optional" />
- <xsd:attribute name="transaction-type" type="xsd:string" use="optional" />
- <xsd:attribute name="type" use="required">
- <xsd:simpleType>
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="ManagedDataSource" />
- <xsd:enumeration value="SimpleDataSource" />
- <xsd:enumeration value="PooledDataSource" />
- <xsd:enumeration value="XAPooledDataSource" />
- </xsd:restriction>
- </xsd:simpleType>
- </xsd:attribute>
- <xsd:attribute name="user-name" type="xsd:string" use="optional" />
- <xsd:attribute name="xa-datasource-class" type="xsd:string" use="optional" />
- </xsd:complexType>
- </xsd:element>
- </xsd:sequence>
- </xsd:complexType>
-
- <xsd:simpleType name="enum-action-destroy-overflow">
- <xsd:restriction base="xsd:string">
- <xsd:enumeration value="local-destroy" />
- <xsd:enumeration value="overflow-to-disk" />
- </xsd:restriction>
- </xsd:simpleType>
-
- <xsd:complexType name="parameter-type">
- <xsd:annotation>
- <xsd:documentation>
- A "parameter" element describes a parameter used to initialize a Declarable object.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:choice>
- <xsd:element name="string" type="gf:string-type" />
- <xsd:element name="declarable" type="gf:declarable-type" />
- </xsd:choice>
- <xsd:attribute name="name" type="xsd:string" use="required" />
- </xsd:complexType>
-
- <xsd:complexType name="string-type">
- <xsd:annotation>
- <xsd:documentation>
- A "string" element specifies a String to be placed in a Region entry.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:simpleContent>
- <xsd:extension base="xsd:string"></xsd:extension>
- </xsd:simpleContent>
- </xsd:complexType>
-
- <xsd:simpleType name="versionType">
- <xsd:annotation>
- <xsd:documentation>
- Decimal version type.
- </xsd:documentation>
- </xsd:annotation>
- <xsd:restriction base="xsd:token">
- <xsd:pattern value="\.?[0-9]+(\.[0-9]+)*" />
- </xsd:restriction>
- </xsd:simpleType>
-
-<!-- TODO -->
- <!-- Will put refid later.....refid IDREF #IMPLIED -->
-
-</xsd:schema>
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java
index 4f69f2c..b2658ae 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommand.java
@@ -24,10 +24,14 @@ import org.springframework.shell.core.annotation.CliCommand;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.ClusterConfigurationService;
+import org.apache.geode.internal.cache.configuration.CacheConfig;
+import org.apache.geode.internal.cache.configuration.JndiBindingsType;
import org.apache.geode.internal.logging.LogService;
import org.apache.geode.management.cli.Result;
import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
import org.apache.geode.management.internal.cli.functions.ListJndiBindingFunction;
+import org.apache.geode.management.internal.cli.result.CompositeResultData;
import org.apache.geode.management.internal.cli.result.ResultBuilder;
import org.apache.geode.management.internal.cli.result.TabularResultData;
import org.apache.geode.management.internal.security.ResourceOperation;
@@ -38,33 +42,53 @@ public class ListJndiBindingCommand extends GfshCommand {
private static final String LIST_JNDIBINDING = "list jndi-binding";
private static final String LIST_JNDIBINDING__HELP =
- "List all active jndi bindings. An active binding is one that is bound to the server's jndi context.";
+ "List all jndi bindings, active and configured. An active binding is one that is bound to the server's jndi context (and also listed in the cluster config). A configured binding is one that is listed in the cluster config, but may not be active on the servers.";
private static final Function LIST_BINDING_FUNCTION = new ListJndiBindingFunction();
@CliCommand(value = LIST_JNDIBINDING, help = LIST_JNDIBINDING__HELP)
@ResourceOperation(resource = ResourcePermission.Resource.CLUSTER,
operation = ResourcePermission.Operation.READ)
public Result listJndiBinding() {
- Result result = null;
- TabularResultData tabularData = ResultBuilder.createTabularResultData();
+ CompositeResultData resultData = ResultBuilder.createCompositeResultData();
+ CompositeResultData.SectionResultData resultSection = resultData.addSection();
+ TabularResultData configTable = null;
+ TabularResultData memberTable = null;
+
+ ClusterConfigurationService ccService = getSharedConfiguration();
+ if (ccService != null) {
+ configTable = resultSection.addTable();
+ configTable.setHeader("Configured JNDI bindings: ");
+ // we don't support creating jndi binding with random group name yet
+ CacheConfig cacheConfig = ccService.getCacheConfig("cluster");
+ List<JndiBindingsType.JndiBinding> jndiBindings = cacheConfig.getJndiBindings();
+ for (JndiBindingsType.JndiBinding jndiBinding : jndiBindings) {
+ configTable.accumulate("Group Name", "cluster");
+ configTable.accumulate("JNDI Name", jndiBinding.getJndiName());
+ configTable.accumulate("JDBC Driver Class", jndiBinding.getJdbcDriverClass());
+ }
+ }
Set<DistributedMember> members = findMembers(null, null);
+
if (members.size() == 0) {
- return ResultBuilder.createUserErrorResult("No members found");
+ if (configTable == null) {
+ return ResultBuilder.createUserErrorResult("No members found");
+ }
+ return ResultBuilder.buildResult(resultData);
}
+ memberTable = resultSection.addTable();
+ memberTable.setHeader("Active JNDI bindings found on each member: ");
List<CliFunctionResult> rc = executeAndGetFunctionResult(LIST_BINDING_FUNCTION, null, members);
for (CliFunctionResult oneResult : rc) {
Serializable[] serializables = oneResult.getSerializables();
for (int i = 0; i < serializables.length; i += 2) {
- tabularData.accumulate("Member", oneResult.getMemberIdOrName());
- tabularData.accumulate("Name", serializables[i]);
- tabularData.accumulate("Class", serializables[i + 1]);
+ memberTable.accumulate("Member", oneResult.getMemberIdOrName());
+ memberTable.accumulate("JNDI Name", serializables[i]);
+ memberTable.accumulate("JDBC Driver Class", serializables[i + 1]);
}
}
- result = ResultBuilder.buildResult(tabularData);
-
- return result;
+ return ResultBuilder.buildResult(resultData);
}
}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListJndiBindingFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListJndiBindingFunction.java
index 1f17ff4..b79edbe 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListJndiBindingFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/ListJndiBindingFunction.java
@@ -16,14 +16,12 @@
package org.apache.geode.management.internal.cli.functions;
import java.io.Serializable;
-import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.naming.Context;
-import javax.naming.NameClassPair;
import org.apache.geode.cache.execute.FunctionContext;
import org.apache.geode.cache.execute.ResultSender;
@@ -36,7 +34,6 @@ public class ListJndiBindingFunction implements InternalFunction {
@Override
public void execute(FunctionContext context) {
- List<NameClassPair> namePairs = new ArrayList<>();
CliFunctionResult result;
try {
diff --git a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
index 55ea33a..8a6410e 100644
--- a/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
+++ b/geode-core/src/main/resources/org/apache/geode/internal/sanctioned-geode-core-serializables.txt
@@ -291,6 +291,12 @@ org/apache/geode/internal/cache/RemoteOperationException,true,-59598896567920490
org/apache/geode/internal/cache/SearchLoadAndWriteProcessor$TryAgainException,false
org/apache/geode/internal/cache/TXCommitMessage$CommitExceptionCollectingException,true,589384721273797822,cacheExceptions:java/util/Set,fatalExceptions:java/util/Map,id:org/apache/geode/internal/cache/TXId,regionExceptions:java/util/Map
org/apache/geode/internal/cache/TXCommitMessage$RegionCommitList,true,-8910813949027683641
+org/apache/geode/internal/cache/configuration/EnumActionDestroyOverflow,false,value:java/lang/String
+org/apache/geode/internal/cache/configuration/EnumReadableWritable,false,value:java/lang/String
+org/apache/geode/internal/cache/configuration/RegionAttributesDataPolicy,false,value:java/lang/String
+org/apache/geode/internal/cache/configuration/RegionAttributesIndexUpdateType,false,value:java/lang/String
+org/apache/geode/internal/cache/configuration/RegionAttributesMirrorType,false,value:java/lang/String
+org/apache/geode/internal/cache/configuration/RegionAttributesScope,false,value:java/lang/String
org/apache/geode/internal/cache/control/InternalResourceManager$ResourceType,false,id:int
org/apache/geode/internal/cache/control/MemoryThresholds$MemoryState,false
org/apache/geode/internal/cache/control/PartitionRebalanceDetailsImpl,true,5880667005758250156,bucketCreateBytes:long,bucketCreateTime:long,bucketCreatesCompleted:int,bucketRemoveBytes:long,bucketRemoveTime:long,bucketRemovesCompleted:int,bucketTransferBytes:long,bucketTransferTime:long,bucketTransfersCompleted:int,partitionMemberDetailsAfter:java/util/Set,partitionMemberDetailsBefore:java/util/Set,primaryTransferTime:long,primaryTransfersCompleted:int,time:long
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/CacheConfigIntegrationTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/CacheConfigIntegrationTest.java
new file mode 100644
index 0000000..3e13846
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/CacheConfigIntegrationTest.java
@@ -0,0 +1,55 @@
+/*
+ * 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.distributed.internal;
+
+import java.io.File;
+
+import org.apache.commons.io.FileUtils;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.rules.TemporaryFolder;
+
+import org.apache.geode.internal.cache.configuration.CacheConfig;
+import org.apache.geode.test.junit.categories.IntegrationTest;
+import org.apache.geode.test.junit.rules.ServerStarterRule;
+
+@Category(IntegrationTest.class)
+public class CacheConfigIntegrationTest {
+ @Rule
+ public ServerStarterRule server = new ServerStarterRule();
+
+ @Rule
+ public TemporaryFolder temporaryFolder = new TemporaryFolder();
+
+ private File xmlFile;
+
+ @Test
+ public void testXmlCreatedByCacheConfigCanBeUsedToStartupServer() throws Exception {
+ xmlFile = temporaryFolder.newFile("cache.xml");
+ CacheConfig cacheConfig = new CacheConfig();
+ cacheConfig.setVersion("1.0");
+ ClusterConfigurationService service = new ClusterConfigurationService();
+ String xml = service.marshall(cacheConfig);
+ FileUtils.writeStringToFile(xmlFile, xml, "UTF-8");
+
+ server.withProperty("cache-xml-file", xmlFile.getAbsolutePath());
+ server.startServer();
+ }
+
+}
diff --git a/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalClusterConfigurationServiceTest.java b/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalClusterConfigurationServiceTest.java
index b12c20e..a409885 100644
--- a/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalClusterConfigurationServiceTest.java
+++ b/geode-core/src/test/java/org/apache/geode/distributed/internal/InternalClusterConfigurationServiceTest.java
@@ -26,7 +26,9 @@ import static org.mockito.Mockito.spy;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlSchema;
import javax.xml.bind.annotation.XmlType;
import org.junit.Before;
@@ -36,6 +38,7 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.cache.Region;
import org.apache.geode.internal.cache.configuration.CacheConfig;
import org.apache.geode.internal.cache.configuration.CacheElement;
+import org.apache.geode.internal.cache.configuration.JndiBindingsType;
import org.apache.geode.internal.cache.configuration.RegionConfig;
import org.apache.geode.internal.cache.configuration.RegionElement;
import org.apache.geode.management.internal.configuration.domain.Configuration;
@@ -45,7 +48,7 @@ import org.apache.geode.test.junit.categories.UnitTest;
@Category(UnitTest.class)
public class InternalClusterConfigurationServiceTest {
private String xml;
- private Object unmarshalled;
+ private CacheConfig unmarshalled;
private ClusterConfigurationService service;
private Configuration configuration;
@@ -60,7 +63,7 @@ public class InternalClusterConfigurationServiceTest {
}
@Test
- public void testCacheMarshall() throws Exception {
+ public void testCacheMarshall() {
CacheConfig cacheConfig = new CacheConfig();
setBasicValues(cacheConfig);
@@ -68,8 +71,11 @@ public class InternalClusterConfigurationServiceTest {
System.out.println(xml);
assertThat(xml).contains("</cache>");
+ assertThat(xml).contains("xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"");
+ assertThat(xml).contains(
+ "xsi:schemaLocation=\"http://geode.apache.org/schema/cache http://geode.apache.org/schema/cache/cache-1.0.xsd\"");
+
unmarshalled = service.unMarshall(xml);
- assertThat(unmarshalled).isInstanceOf(CacheConfig.class);
}
@Test
@@ -81,9 +87,6 @@ public class InternalClusterConfigurationServiceTest {
xml = service.marshall(cache, ElementOne.class);
System.out.println(xml);
assertThat(xml).contains("custom-one>");
-
- unmarshalled = service.unMarshall(xml);
- assertThat(unmarshalled).isInstanceOf(CacheConfig.class);
}
@Test
@@ -98,15 +101,16 @@ public class InternalClusterConfigurationServiceTest {
// xml generated with CacheConfigOne marshaller can be unmarshalled by CacheConfigTwo
unmarshalled = service.unMarshall(xml);
- assertThat(unmarshalled).isInstanceOf(CacheConfig.class);
- CacheConfig cacheTwo = (CacheConfig) unmarshalled;
- cacheTwo.getCustomCacheElements().add(new ElementTwo("testTwo"));
+ unmarshalled.getCustomCacheElements().add(new ElementTwo("testTwo"));
// xml generated wtih CacheConfigTwo has both elements in there.
- xml = service.marshall(cacheTwo, ElementTwo.class);
+ xml = service.marshall(unmarshalled, ElementTwo.class);
System.out.println(xml);
assertThat(xml).contains("custom-one>");
assertThat(xml).contains("custom-two>");
+ assertThat(xml).containsPattern("xmlns:ns\\d=\"http://geode.apache.org/schema/cache\"");
+ assertThat(xml).containsPattern("xmlns:ns\\d=\"http://geode.apache.org/schema/CustomOne\"");
+ assertThat(xml).containsPattern("xmlns:ns\\d=\"http://geode.apache.org/schema/CustomTwo\"");
}
@Test
@@ -140,6 +144,22 @@ public class InternalClusterConfigurationServiceTest {
cache.getRegion().add(region);
}
+ @Test
+ public void jndiBindings() {
+ service.updateCacheConfig("cluster", cacheConfig -> {
+ JndiBindingsType.JndiBinding jndiBinding = new JndiBindingsType.JndiBinding();
+ jndiBinding.setJndiName("jndiOne");
+ jndiBinding.setJdbcDriverClass("com.sun.ABC");
+ jndiBinding.setType("SimpleDataSource");
+ cacheConfig.getJndiBindings().add(jndiBinding);
+ return cacheConfig;
+ });
+
+ assertThat(configuration.getCacheXmlContent()).containsOnlyOnce("</jndi-bindings>");
+ assertThat(configuration.getCacheXmlContent()).contains(
+ "<jndi-binding jdbc-driver-class=\"com.sun.ABC\" jndi-name=\"jndiOne\" type=\"SimpleDataSource\"/>");
+ }
+
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {"id", "value"})
@XmlRootElement(name = "custom-one", namespace = "http://geode.apache.org/schema/CustomOne")
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
index 36ae73e..214ea7c 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListJndiBindingCommandDUnitTest.java
@@ -15,6 +15,8 @@
package org.apache.geode.management.internal.cli.commands;
+import static org.assertj.core.api.Assertions.assertThat;
+
import java.util.Properties;
import org.junit.BeforeClass;
@@ -24,8 +26,12 @@ import org.junit.experimental.categories.Category;
import org.apache.geode.distributed.ConfigurationProperties;
import org.apache.geode.management.internal.cli.functions.ListJndiBindingFunction;
+import org.apache.geode.management.internal.cli.json.GfJsonArray;
+import org.apache.geode.management.internal.cli.json.GfJsonException;
+import org.apache.geode.management.internal.cli.json.GfJsonObject;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.assertions.CommandResultAssert;
import org.apache.geode.test.junit.categories.DistributedTest;
import org.apache.geode.test.junit.rules.GfshCommandRule;
@@ -53,17 +59,24 @@ public class ListJndiBindingCommandDUnitTest {
}
@Test
- public void listJndiBinding() {
+ public void listJndiBinding() throws GfJsonException {
gfsh.executeAndAssertThat(
"create jndi-binding --name=jndi1 --type=SIMPLE --jdbc-driver-class=org.apache.derby.jdbc.EmbeddedDriver --connection-url=\"jdbc:derby:newDB;create=true\"")
.statusIsSuccess().tableHasColumnOnlyWithValues("Member", "server-1");
- gfsh.executeAndAssertThat("list jndi-binding").statusIsSuccess()
- .tableHasColumnWithExactValuesInAnyOrder("Name", "java:jndi1", "java:UserTransaction",
- "java:TransactionManager")
- .tableHasColumnWithExactValuesInAnyOrder("Class",
- "org.apache.geode.internal.datasource.GemFireBasicDataSource",
- "org.apache.geode.internal.jta.UserTransactionImpl",
- "org.apache.geode.internal.jta.TransactionManagerImpl");
+ CommandResultAssert commandResultAssert =
+ gfsh.executeAndAssertThat("list jndi-binding").statusIsSuccess();
+
+ // cluster configuration table
+ commandResultAssert.tableHasRowWithValues("Group Name", "JNDI Name", "JDBC Driver Class",
+ "cluster", "jndi1", "org.apache.derby.jdbc.EmbeddedDriver")
+ .tableHasRowCount("Group Name", 1);
+
+ // member table
+ GfJsonObject memberTableContent = commandResultAssert.getCommandResult().getTableContent(0, 1);
+ GfJsonArray jndi_names = memberTableContent.getJSONArray("JNDI Name");
+ assertThat(jndi_names.size()).isEqualTo(3);
+ assertThat(GfJsonArray.toStringArray(jndi_names)).containsExactlyInAnyOrder("java:jndi1",
+ "java:UserTransaction", "java:TransactionManager");
}
}
--
To stop receiving notification emails like this one, please contact
jinmeiliao@apache.org.