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 2019/04/09 19:10:46 UTC
[geode] branch develop updated: GEODE-6612: move attributes that
can not be configured in v2 api out of RegionConfig (#3425)
This is an automated email from the ASF dual-hosted git repository.
jinmeiliao pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/develop by this push:
new 2402cac GEODE-6612: move attributes that can not be configured in v2 api out of RegionConfig (#3425)
2402cac is described below
commit 2402cac0e2c5e50b72e0ded3e8dc17d111265b2f
Author: jinmeiliao <ji...@pivotal.io>
AuthorDate: Tue Apr 9 12:10:24 2019 -0700
GEODE-6612: move attributes that can not be configured in v2 api out of RegionConfig (#3425)
---
.../ManagementClientTestCreateRegion.java | 4 +-
.../rest/ClientClusterManagementSSLTest.java | 8 +-
.../ClientClusterManagementServiceDunitTest.java | 10 +-
...ClusterManagementLocatorReconnectDunitTest.java | 4 +-
.../rest/ClusterManagementServiceOnServerTest.java | 6 +-
.../rest/ManagementRequestLoggingDUnitTest.java | 4 +-
.../internal/rest/RegionManagementDunitTest.java | 8 +-
.../RegionManagementRestSecurityDUnitTest.java | 4 +-
.../integrationTest/resources/assembly_content.txt | 1 +
.../internal/CacheConfigDAODUnitTest.java | 6 +-
.../internal/api/RegionAPIDUnitTest.java | 10 +-
.../RegionConfigMutatorIntegrationTest.java | 6 +-
.../RegionConfigRealizerIntegrationTest.java | 6 +-
.../api/LocatorClusterManagementService.java | 6 +-
.../cli/functions/UpdateCacheFunction.java | 4 +-
.../mutators/RegionConfigManager.java | 14 +-
.../realizers/RegionConfigRealizer.java | 14 +-
.../validators/RegionConfigValidator.java | 8 +-
.../sanctioned-geode-core-serializables.txt | 1 +
.../cache/configuration/RegionConfigTest.java | 3 +-
.../api/LocatorClusterManagementServiceTest.java | 8 +-
.../cache/configuration/BasicRegionConfig.java | 286 ++++++++++++++
.../geode/cache/configuration/CacheConfig.java | 4 +
.../geode/cache/configuration/RegionConfig.java | 409 ++-------------------
.../configuration/CacheElementJsonMappingTest.java | 8 +-
.../ClientClusterManagementServiceDUnitTest.java | 4 +-
.../rest/RegionManagementIntegrationTest.java | 6 +-
.../RegionManagementSecurityIntegrationTest.java | 6 +-
.../controllers/RegionManagementController.java | 6 +-
29 files changed, 407 insertions(+), 457 deletions(-)
diff --git a/geode-assembly/src/acceptanceTest/resources/ManagementClientTestCreateRegion.java b/geode-assembly/src/acceptanceTest/resources/ManagementClientTestCreateRegion.java
index 0a8b8a5..2e99273 100644
--- a/geode-assembly/src/acceptanceTest/resources/ManagementClientTestCreateRegion.java
+++ b/geode-assembly/src/acceptanceTest/resources/ManagementClientTestCreateRegion.java
@@ -15,7 +15,7 @@
import javax.net.ssl.SSLContext;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.management.api.ClusterManagementService;
@@ -35,7 +35,7 @@ public class ManagementClientCreateRegion {
cms = ClusterManagementServiceProvider.getService("localhost", 7070);
}
- RegionConfig config = new RegionConfig();
+ BasicRegionConfig config = new BasicRegionConfig();
config.setName(regionName);
config.setType(RegionType.REPLICATE);
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementSSLTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementSSLTest.java
index 6ef47cf..c65435a 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementSSLTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementSSLTest.java
@@ -37,9 +37,9 @@ import org.junit.Test;
import org.junit.contrib.java.lang.system.RestoreSystemProperties;
import org.springframework.web.client.ResourceAccessException;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.internal.security.SecurableCommunicationChannel;
import org.apache.geode.management.api.ClusterManagementResult;
@@ -55,7 +55,7 @@ public class ClientClusterManagementSSLTest {
private static MemberVM locator, server;
private ClusterManagementService cmsClient;
- private RegionConfig region;
+ private BasicRegionConfig region;
private static SSLContext sslContext;
private static HostnameVerifier hostnameVerifier;
@@ -92,7 +92,7 @@ public class ClientClusterManagementSSLTest {
@Before
public void before() throws Exception {
- region = new RegionConfig();
+ region = new BasicRegionConfig();
region.setName("customer");
}
@@ -163,7 +163,7 @@ public class ClientClusterManagementSSLTest {
// when getting the service from the server, we don't need to provide the host information
ClusterManagementService cmsClient =
ClusterManagementServiceProvider.getService("dataManage", "dataManage");
- RegionConfig region = new RegionConfig();
+ BasicRegionConfig region = new BasicRegionConfig();
region.setName("orders");
cmsClient.create(region);
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementServiceDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementServiceDunitTest.java
index e8eb0d5..ccaaad2 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementServiceDunitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClientClusterManagementServiceDunitTest.java
@@ -7,9 +7,9 @@ import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.distributed.internal.InternalConfigurationPersistenceService;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.management.api.ClusterManagementService;
@@ -53,7 +53,7 @@ public class ClientClusterManagementServiceDunitTest {
@Test
public void createRegion() {
- RegionConfig region = new RegionConfig();
+ BasicRegionConfig region = new BasicRegionConfig();
region.setName("customer");
ClusterManagementResult result = cmsClient.create(region, "");
@@ -69,7 +69,7 @@ public class ClientClusterManagementServiceDunitTest {
@Test
public void createRegionWithNullGroup() {
- RegionConfig region = new RegionConfig();
+ BasicRegionConfig region = new BasicRegionConfig();
region.setName("orders");
ClusterManagementResult result = cmsClient.create(region, null);
@@ -82,7 +82,7 @@ public class ClientClusterManagementServiceDunitTest {
@Test
public void createRegionWithInvalidName() throws Exception {
- RegionConfig region = new RegionConfig();
+ BasicRegionConfig region = new BasicRegionConfig();
region.setName("__test");
ClusterManagementResult result = cmsClient.create(region, "");
@@ -93,7 +93,7 @@ public class ClientClusterManagementServiceDunitTest {
@Test
public void createRegionWithGroup() {
- RegionConfig region = new RegionConfig();
+ BasicRegionConfig region = new BasicRegionConfig();
region.setName("company");
ClusterManagementResult result = cmsClient.create(region, groupA);
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementLocatorReconnectDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementLocatorReconnectDunitTest.java
index 4dea93a..6ead606 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementLocatorReconnectDunitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementLocatorReconnectDunitTest.java
@@ -25,9 +25,9 @@ import org.junit.Rule;
import org.junit.Test;
import org.apache.geode.cache.Region;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.test.dunit.IgnoredException;
@@ -67,7 +67,7 @@ public class ClusterManagementLocatorReconnectDunitTest {
}
private void makeRestCallAndVerifyResult(String regionName) throws Exception {
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName(regionName);
regionConfig.setType(RegionType.REPLICATE);
ObjectMapper mapper = new ObjectMapper();
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementServiceOnServerTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementServiceOnServerTest.java
index 95449a4..5873aa3 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementServiceOnServerTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ClusterManagementServiceOnServerTest.java
@@ -33,7 +33,7 @@ import org.junit.Rule;
import org.junit.Test;
import org.springframework.web.client.ResourceAccessException;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.internal.security.SecurableCommunicationChannel;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.management.api.ClusterManagementService;
@@ -51,7 +51,7 @@ public class ClusterManagementServiceOnServerTest implements Serializable {
private MemberVM locator, server;
private Properties sslProps;
- private RegionConfig regionConfig;
+ private BasicRegionConfig regionConfig;
@Before
public void before() throws Exception {
@@ -62,7 +62,7 @@ public class ClusterManagementServiceOnServerTest implements Serializable {
sslProps.setProperty(SSL_TRUSTSTORE_PASSWORD, "password");
sslProps.setProperty(SSL_ENABLED_COMPONENTS, SecurableCommunicationChannel.WEB.getConstant());
- regionConfig = new RegionConfig();
+ regionConfig = new BasicRegionConfig();
regionConfig.setName("test");
}
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ManagementRequestLoggingDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ManagementRequestLoggingDUnitTest.java
index 8b2adcf..02d563b 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ManagementRequestLoggingDUnitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/ManagementRequestLoggingDUnitTest.java
@@ -29,7 +29,7 @@ import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.management.api.ClusterManagementService;
@@ -60,7 +60,7 @@ public class ManagementRequestLoggingDUnitTest {
listAppender.start();
});
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("customers");
regionConfig.setType(RegionType.REPLICATE);
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementDunitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementDunitTest.java
index 60cdcc0..9594e32 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementDunitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementDunitTest.java
@@ -24,9 +24,9 @@ import org.junit.Test;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.test.dunit.IgnoredException;
@@ -53,7 +53,7 @@ public class RegionManagementDunitTest {
@Test
public void createsRegion() throws Exception {
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("customers");
regionConfig.setType(RegionType.REPLICATE);
ObjectMapper mapper = new ObjectMapper();
@@ -83,7 +83,7 @@ public class RegionManagementDunitTest {
@Test
public void createsRegionUsingClusterManagementClient() throws Exception {
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("customers2");
regionConfig.setType(RegionType.REPLICATE);
ObjectMapper mapper = new ObjectMapper();
@@ -148,7 +148,7 @@ public class RegionManagementDunitTest {
CacheConfig cacheConfig =
ClusterStartupRule.getLocator().getConfigurationPersistenceService()
.getCacheConfig("cluster");
- RegionConfig regionConfig = CacheElement.findElement(cacheConfig.getRegions(), regionName);
+ BasicRegionConfig regionConfig = CacheElement.findElement(cacheConfig.getRegions(), regionName);
assertThat(regionConfig.getType()).isEqualTo(type);
}
diff --git a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementRestSecurityDUnitTest.java b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementRestSecurityDUnitTest.java
index 2b28cc0..4c569cc 100644
--- a/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementRestSecurityDUnitTest.java
+++ b/geode-assembly/src/distributedTest/java/org/apache/geode/management/internal/rest/RegionManagementRestSecurityDUnitTest.java
@@ -23,7 +23,7 @@ import org.junit.BeforeClass;
import org.junit.ClassRule;
import org.junit.Test;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.examples.SimpleSecurityManager;
import org.apache.geode.management.api.ClusterManagementResult;
@@ -56,7 +56,7 @@ public class RegionManagementRestSecurityDUnitTest {
restClient =
new GeodeDevRestClient("/geode-management/v2", "localhost", locator.getHttpPort(), false);
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("customers");
regionConfig.setType(RegionType.REPLICATE);
ObjectMapper mapper = new ObjectMapper();
diff --git a/geode-assembly/src/integrationTest/resources/assembly_content.txt b/geode-assembly/src/integrationTest/resources/assembly_content.txt
index 9b2a4a1..b4d93ef 100644
--- a/geode-assembly/src/integrationTest/resources/assembly_content.txt
+++ b/geode-assembly/src/integrationTest/resources/assembly_content.txt
@@ -286,6 +286,7 @@ javadoc/org/apache/geode/cache/client/SubscriptionNotEnabledException.html
javadoc/org/apache/geode/cache/client/package-frame.html
javadoc/org/apache/geode/cache/client/package-summary.html
javadoc/org/apache/geode/cache/client/package-tree.html
+javadoc/org/apache/geode/cache/configuration/BasicRegionConfig.html
javadoc/org/apache/geode/cache/configuration/CacheConfig.AsyncEventQueue.html
javadoc/org/apache/geode/cache/configuration/CacheConfig.CacheServer.html
javadoc/org/apache/geode/cache/configuration/CacheConfig.GatewayHub.Gateway.GatewayEndpoint.html
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/CacheConfigDAODUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/CacheConfigDAODUnitTest.java
index 287737e..687249b 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/CacheConfigDAODUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/distributed/internal/CacheConfigDAODUnitTest.java
@@ -22,7 +22,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import org.junit.Rule;
import org.junit.Test;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.distributed.ConfigurationPersistenceService;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
@@ -44,10 +44,10 @@ public class CacheConfigDAODUnitTest {
ConfigurationPersistenceService ccService =
ClusterStartupRule.getLocator().getConfigurationPersistenceService();
ccService.updateCacheConfig("cluster", cc -> {
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("regionB");
regionConfig.setType(RegionType.REPLICATE);
- cc.getRegions().add(regionConfig);
+ cc.addRegion(regionConfig);
return cc;
});
});
diff --git a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/api/RegionAPIDUnitTest.java b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/api/RegionAPIDUnitTest.java
index fb60da7..6d451b6 100644
--- a/geode-core/src/distributedTest/java/org/apache/geode/management/internal/api/RegionAPIDUnitTest.java
+++ b/geode-core/src/distributedTest/java/org/apache/geode/management/internal/api/RegionAPIDUnitTest.java
@@ -25,9 +25,9 @@ import org.junit.rules.TestName;
import org.apache.geode.cache.Cache;
import org.apache.geode.cache.Region;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.test.dunit.rules.ClusterStartupRule;
@@ -61,7 +61,7 @@ public class RegionAPIDUnitTest {
public void createsPartitionedRegion() {
String regionName = testName.getMethodName();
locator.invoke(() -> {
- RegionConfig config = new RegionConfig();
+ BasicRegionConfig config = new BasicRegionConfig();
config.setName(regionName);
config.setType(RegionType.PARTITION);
ClusterManagementResult result = ClusterStartupRule.getLocator().getClusterManagementService()
@@ -86,7 +86,7 @@ public class RegionAPIDUnitTest {
public void createsReplicatedRegion() {
String regionName = testName.getMethodName();
locator.invoke(() -> {
- RegionConfig config = new RegionConfig();
+ BasicRegionConfig config = new BasicRegionConfig();
config.setName(regionName);
config.setType(RegionType.REPLICATE);
ClusterManagementResult result = ClusterStartupRule.getLocator().getClusterManagementService()
@@ -103,7 +103,7 @@ public class RegionAPIDUnitTest {
public void defaultTypeIsPartition() throws Exception {
String regionName = testName.getMethodName();
locator.invoke(() -> {
- RegionConfig config = new RegionConfig();
+ BasicRegionConfig config = new BasicRegionConfig();
config.setName(regionName);
ClusterManagementResult result = ClusterStartupRule.getLocator().getClusterManagementService()
.create(config, "cluster");
@@ -118,7 +118,7 @@ public class RegionAPIDUnitTest {
CacheConfig cacheConfig =
ClusterStartupRule.getLocator().getConfigurationPersistenceService()
.getCacheConfig("cluster");
- RegionConfig regionConfig = CacheElement.findElement(cacheConfig.getRegions(), regionName);
+ BasicRegionConfig regionConfig = CacheElement.findElement(cacheConfig.getRegions(), regionName);
assertThat(regionConfig.getType()).isEqualTo(type);
}
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigMutatorIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigMutatorIntegrationTest.java
index 30d4140..80f1a15 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigMutatorIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigMutatorIntegrationTest.java
@@ -20,9 +20,9 @@ import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.test.junit.rules.LocatorStarterRule;
@@ -32,11 +32,11 @@ public class RegionConfigMutatorIntegrationTest {
public LocatorStarterRule locator = new LocatorStarterRule().withAutoStart();
private RegionConfigManager mutator;
- private RegionConfig config;
+ private BasicRegionConfig config;
@Before
public void before() throws Exception {
- config = new RegionConfig();
+ config = new BasicRegionConfig();
mutator = new RegionConfigManager();
}
diff --git a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizerIntegrationTest.java b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizerIntegrationTest.java
index 26d6212..82e7003 100644
--- a/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizerIntegrationTest.java
+++ b/geode-core/src/integrationTest/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizerIntegrationTest.java
@@ -23,7 +23,7 @@ import org.junit.Test;
import org.apache.geode.cache.DataPolicy;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.Scope;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.test.junit.rules.ServerStarterRule;
@@ -33,11 +33,11 @@ public class RegionConfigRealizerIntegrationTest {
public ServerStarterRule server = new ServerStarterRule().withAutoStart();
private RegionConfigRealizer realizer;
- private RegionConfig config;
+ private BasicRegionConfig config;
@Before
public void setup() {
- config = new RegionConfig();
+ config = new BasicRegionConfig();
realizer = new RegionConfigRealizer();
}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/api/LocatorClusterManagementService.java b/geode-core/src/main/java/org/apache/geode/management/internal/api/LocatorClusterManagementService.java
index c8997b6..5c231c3 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/api/LocatorClusterManagementService.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/api/LocatorClusterManagementService.java
@@ -29,9 +29,9 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.Logger;
import org.apache.geode.annotations.VisibleForTesting;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.execute.Function;
import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.ConfigurationPersistenceService;
@@ -62,11 +62,11 @@ public class LocatorClusterManagementService implements ClusterManagementService
ConfigurationPersistenceService persistenceService) {
this(cache, persistenceService, new HashMap(), new HashMap());
// initialize the list of managers
- managers.put(RegionConfig.class, new RegionConfigManager());
+ managers.put(BasicRegionConfig.class, new RegionConfigManager());
managers.put(MemberConfig.class, new MemberConfigManager(cache));
// initialize the list of validators
- validators.put(RegionConfig.class, new RegionConfigValidator());
+ validators.put(BasicRegionConfig.class, new RegionConfigValidator());
}
@VisibleForTesting
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UpdateCacheFunction.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UpdateCacheFunction.java
index 9749732..38d8c4e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UpdateCacheFunction.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/functions/UpdateCacheFunction.java
@@ -24,8 +24,8 @@ import org.apache.commons.collections.map.HashedMap;
import org.apache.geode.annotations.Immutable;
import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.execute.FunctionContext;
import org.apache.geode.management.cli.CliFunction;
import org.apache.geode.management.internal.configuration.realizers.ConfigurationRealizer;
@@ -35,7 +35,7 @@ public class UpdateCacheFunction extends CliFunction<List> {
@Immutable
private static final Map<Class, ConfigurationRealizer> realizers = new HashedMap();
static {
- realizers.put(RegionConfig.class, new RegionConfigRealizer());
+ realizers.put(BasicRegionConfig.class, new RegionConfigRealizer());
}
public enum CacheElementOperation {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigManager.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigManager.java
index cc34220..cbb4d0b 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigManager.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/mutators/RegionConfigManager.java
@@ -21,30 +21,30 @@ import java.util.List;
import org.apache.commons.lang3.NotImplementedException;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
-import org.apache.geode.cache.configuration.RegionConfig;
-public class RegionConfigManager implements ConfigurationManager<RegionConfig> {
+public class RegionConfigManager implements ConfigurationManager<BasicRegionConfig> {
public RegionConfigManager() {}
@Override
- public void add(RegionConfig configElement, CacheConfig existingConfig) {
- existingConfig.getRegions().add(configElement);
+ public void add(BasicRegionConfig configElement, CacheConfig existingConfig) {
+ existingConfig.addRegion(configElement);
}
@Override
- public void update(RegionConfig config, CacheConfig existing) {
+ public void update(BasicRegionConfig config, CacheConfig existing) {
throw new NotImplementedException("Not implemented yet");
}
@Override
- public void delete(RegionConfig config, CacheConfig existing) {
+ public void delete(BasicRegionConfig config, CacheConfig existing) {
throw new NotImplementedException("Not implemented yet");
}
@Override
- public List<RegionConfig> list(RegionConfig config, CacheConfig existing) {
+ public List<BasicRegionConfig> list(BasicRegionConfig config, CacheConfig existing) {
throw new NotImplementedException("Not implemented yet");
}
}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizer.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizer.java
index e1c6263..eb2b974 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizer.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/realizers/RegionConfigRealizer.java
@@ -28,9 +28,9 @@ import org.apache.geode.cache.ExpirationAttributes;
import org.apache.geode.cache.Region;
import org.apache.geode.cache.RegionFactory;
import org.apache.geode.cache.Scope;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.DeclarableType;
import org.apache.geode.cache.configuration.RegionAttributesType;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.internal.cache.EvictionAttributesImpl;
import org.apache.geode.internal.cache.PartitionAttributesImpl;
import org.apache.geode.management.internal.cli.CliUtil;
@@ -38,7 +38,7 @@ import org.apache.geode.management.internal.cli.i18n.CliStrings;
import org.apache.geode.management.internal.cli.util.RegionPath;
import org.apache.geode.management.internal.configuration.domain.DeclarableTypeInstantiator;
-public class RegionConfigRealizer implements ConfigurationRealizer<RegionConfig> {
+public class RegionConfigRealizer implements ConfigurationRealizer<BasicRegionConfig> {
public RegionConfigRealizer() {}
/**
@@ -47,7 +47,7 @@ public class RegionConfigRealizer implements ConfigurationRealizer<RegionConfig>
* @param regionConfig the name in the regionConfig can not contain sub-regions.
*/
@Override
- public void create(RegionConfig regionConfig, Cache cache) {
+ public void create(BasicRegionConfig regionConfig, Cache cache) {
RegionFactory factory = getRegionFactory(cache, regionConfig.getRegionAttributes());
factory.create(regionConfig.getName());
}
@@ -60,7 +60,7 @@ public class RegionConfigRealizer implements ConfigurationRealizer<RegionConfig>
* @param regionConfig the name in regionConfig is ignored.
* @param regionPath this is the full path of the region
*/
- public void create(RegionConfig regionConfig, String regionPath, Cache cache) {
+ public void create(BasicRegionConfig regionConfig, String regionPath, Cache cache) {
RegionFactory factory = getRegionFactory(cache, regionConfig.getRegionAttributes());
RegionPath regionPathData = new RegionPath(regionPath);
String regionName = regionPathData.getName();
@@ -285,15 +285,15 @@ public class RegionConfigRealizer implements ConfigurationRealizer<RegionConfig>
}
@Override
- public boolean exists(RegionConfig config, Cache cache) {
+ public boolean exists(BasicRegionConfig config, Cache cache) {
return false;
}
@Override
- public void update(RegionConfig config, Cache cache) {}
+ public void update(BasicRegionConfig config, Cache cache) {}
@Override
- public void delete(RegionConfig config, Cache cache) {}
+ public void delete(BasicRegionConfig config, Cache cache) {}
}
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/validators/RegionConfigValidator.java b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/validators/RegionConfigValidator.java
index 1b411e8..40b7e03 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/configuration/validators/RegionConfigValidator.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/configuration/validators/RegionConfigValidator.java
@@ -15,16 +15,16 @@
package org.apache.geode.management.internal.configuration.validators;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
import org.apache.geode.cache.configuration.CacheElement;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.internal.cache.RegionNameValidation;
-public class RegionConfigValidator implements ConfigurationValidator<RegionConfig> {
+public class RegionConfigValidator implements ConfigurationValidator<BasicRegionConfig> {
@Override
- public void validate(RegionConfig config)
+ public void validate(BasicRegionConfig config)
throws IllegalArgumentException {
if (config.getName() == null) {
throw new IllegalArgumentException("Name of the region has to be specified.");
@@ -50,7 +50,7 @@ public class RegionConfigValidator implements ConfigurationValidator<RegionConfi
}
@Override
- public boolean exists(RegionConfig config, CacheConfig existing) {
+ public boolean exists(BasicRegionConfig config, CacheConfig existing) {
return CacheElement.exists(existing.getRegions(), config.getId());
}
}
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 74c7c87..bf8f741 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
@@ -120,6 +120,7 @@ org/apache/geode/cache/client/SubscriptionNotEnabledException,true,-821244673777
org/apache/geode/cache/client/internal/ContainsKeyOp$MODE,false
org/apache/geode/cache/client/internal/TXSynchronizationOp$CompletionType,false
org/apache/geode/cache/client/internal/pooling/ConnectionDestroyedException,true,-6918516787578041316
+org/apache/geode/cache/configuration/BasicRegionConfig,false,name:java/lang/String,refid:java/lang/String,regionAttributes:org/apache/geode/cache/configuration/RegionAttributesType
org/apache/geode/cache/configuration/CacheConfig$AsyncEventQueue,false,asyncEventListener:org/apache/geode/cache/configuration/DeclarableType,batchSize:java/lang/String,batchTimeInterval:java/lang/String,diskStoreName:java/lang/String,diskSynchronous:java/lang/Boolean,dispatcherThreads:java/lang/String,enableBatchConflation:java/lang/Boolean,forwardExpirationDestroy:java/lang/Boolean,gatewayEventFilters:java/util/List,gatewayEventSubstitutionFilter:org/apache/geode/cache/configuration/De [...]
org/apache/geode/cache/configuration/ClassNameType,false,className:java/lang/String
org/apache/geode/cache/configuration/DeclarableType,false,parameters:java/util/List
diff --git a/geode-core/src/test/java/org/apache/geode/cache/configuration/RegionConfigTest.java b/geode-core/src/test/java/org/apache/geode/cache/configuration/RegionConfigTest.java
index c04739f..99310b8 100644
--- a/geode-core/src/test/java/org/apache/geode/cache/configuration/RegionConfigTest.java
+++ b/geode-core/src/test/java/org/apache/geode/cache/configuration/RegionConfigTest.java
@@ -68,7 +68,8 @@ public class RegionConfigTest {
RegionConfig config = new RegionConfig();
config.setType(shortcut.name());
config.setName(shortcut.name());
- RegionConfig masterRegion = CacheElement.findElement(master.getRegions(), shortcut.name());
+ RegionConfig masterRegion =
+ CacheElement.findElement(master.getRegions(), shortcut.name());
assertThat(config).isEqualToComparingFieldByFieldRecursively(masterRegion);
}
}
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/api/LocatorClusterManagementServiceTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/api/LocatorClusterManagementServiceTest.java
index fdcde89..d17a1bf 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/api/LocatorClusterManagementServiceTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/api/LocatorClusterManagementServiceTest.java
@@ -30,8 +30,8 @@ import java.util.List;
import org.junit.Before;
import org.junit.Test;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.CacheConfig;
-import org.apache.geode.cache.configuration.RegionConfig;
import org.apache.geode.distributed.ConfigurationPersistenceService;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.internal.cache.InternalCache;
@@ -44,7 +44,7 @@ public class LocatorClusterManagementServiceTest {
private LocatorClusterManagementService service;
private InternalCache cache;
private ConfigurationPersistenceService persistenceService;
- private RegionConfig regionConfig;
+ private BasicRegionConfig regionConfig;
private ClusterManagementResult result;
@Before
@@ -52,7 +52,7 @@ public class LocatorClusterManagementServiceTest {
cache = mock(InternalCache.class);
persistenceService = mock(ConfigurationPersistenceService.class);
service = spy(new LocatorClusterManagementService(cache, persistenceService));
- regionConfig = new RegionConfig();
+ regionConfig = new BasicRegionConfig();
}
@Test
@@ -68,7 +68,7 @@ public class LocatorClusterManagementServiceTest {
public void elementAlreadyExist() throws Exception {
regionConfig.setName("test");
CacheConfig cacheConfig = new CacheConfig();
- cacheConfig.getRegions().add(regionConfig);
+ cacheConfig.addRegion(regionConfig);
when(persistenceService.getCacheConfig("cluster", true)).thenReturn(cacheConfig);
assertThatThrownBy(() -> service.create(regionConfig, "cluster"))
diff --git a/geode-management/src/main/java/org/apache/geode/cache/configuration/BasicRegionConfig.java b/geode-management/src/main/java/org/apache/geode/cache/configuration/BasicRegionConfig.java
new file mode 100644
index 0000000..3932057
--- /dev/null
+++ b/geode-management/src/main/java/org/apache/geode/cache/configuration/BasicRegionConfig.java
@@ -0,0 +1,286 @@
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+ * agreements. See the NOTICE file distributed with this work for additional information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ */
+
+package org.apache.geode.cache.configuration;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+import org.apache.geode.annotations.Experimental;
+import org.apache.geode.management.api.RestfulEndpoint;
+
+
+/**
+ *
+ * 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).
+ *
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(propOrder = {"regionAttributes"})
+@Experimental
+public class BasicRegionConfig implements CacheElement, RestfulEndpoint {
+
+ public static final String REGION_CONFIG_ENDPOINT = "/regions";
+
+ @XmlElement(name = "region-attributes", namespace = "http://geode.apache.org/schema/cache")
+ protected RegionAttributesType regionAttributes;
+ @XmlAttribute(name = "name", required = true)
+ protected String name;
+ @XmlAttribute(name = "refid")
+ protected String type;
+
+ public BasicRegionConfig() {}
+
+ public BasicRegionConfig(String name, String refid) {
+ this.name = name;
+ this.type = refid;
+ }
+
+ @Override
+ public String getEndpoint() {
+ return REGION_CONFIG_ENDPOINT;
+ }
+
+ public RegionAttributesType getRegionAttributes() {
+ return regionAttributes;
+ }
+
+ public void setRegionAttributes(RegionAttributesType regionAttributes) {
+ this.regionAttributes = regionAttributes;
+ }
+
+ /**
+ * Gets the value of the name property.
+ *
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) throws IllegalArgumentException {
+ if (value == null) {
+ return;
+ }
+
+ boolean regionPrefixedWithSlash = value.startsWith("/");
+ String[] regionSplit = value.split("/");
+
+ boolean hasSubRegions =
+ regionPrefixedWithSlash ? regionSplit.length > 2 : regionSplit.length > 1;
+ if (hasSubRegions) {
+ throw new IllegalArgumentException("Sub-regions are unsupported");
+ }
+
+ this.name = regionPrefixedWithSlash ? regionSplit[1] : value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(RegionType regionType) {
+ if (regionType != null) {
+ setType(regionType.name());
+ }
+ }
+
+ public void setType(String regionType) {
+ if (regionType != null) {
+ this.type = regionType.toUpperCase();
+ setShortcutAttributes();
+ }
+ }
+
+ private void setShortcutAttributes() {
+ if (regionAttributes == null) {
+ regionAttributes = new RegionAttributesType();
+ }
+
+ switch (type) {
+ case "PARTITION": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ break;
+ }
+ case "REPLICATE": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.REPLICATE);
+ regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
+ break;
+ }
+ case "PARTITION_REDUNDANT": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setRedundantCopy("1");
+ break;
+ }
+ case "PARTITION_PERSISTENT": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
+ break;
+ }
+ case "PARTITION_REDUNDANT_PERSISTENT": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
+ regionAttributes.setRedundantCopy("1");
+ break;
+ }
+ case "PARTITION_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "PARTITION_REDUNDANT_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setRedundantCopy("1");
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "PARTITION_PERSISTENT_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "PARTITION_REDUNDANT_PERSISTENT_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
+ regionAttributes.setRedundantCopy("1");
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "PARTITION_HEAP_LRU": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
+ break;
+
+ }
+ case "PARTITION_REDUNDANT_HEAP_LRU": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setRedundantCopy("1");
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
+ break;
+ }
+
+ case "REPLICATE_PERSISTENT": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
+ regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
+ break;
+ }
+ case "REPLICATE_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.REPLICATE);
+ regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+
+ }
+ case "REPLICATE_PERSISTENT_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
+ regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "REPLICATE_HEAP_LRU": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PRELOADED);
+ regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
+ regionAttributes.setInterestPolicy("all");
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
+ break;
+ }
+ case "LOCAL": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.NORMAL);
+ regionAttributes.setScope(RegionAttributesScope.LOCAL);
+ break;
+ }
+ case "LOCAL_PERSISTENT": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
+ regionAttributes.setScope(RegionAttributesScope.LOCAL);
+ break;
+ }
+ case "LOCAL_HEAP_LRU": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.NORMAL);
+ regionAttributes.setScope(RegionAttributesScope.LOCAL);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
+ break;
+ }
+ case "LOCAL_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.NORMAL);
+ regionAttributes.setScope(RegionAttributesScope.LOCAL);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "LOCAL_PERSISTENT_OVERFLOW": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
+ regionAttributes.setScope(RegionAttributesScope.LOCAL);
+ regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
+ break;
+ }
+ case "PARTITION_PROXY": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setLocalMaxMemory("0");
+ break;
+ }
+ case "PARTITION_PROXY_REDUNDANT": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
+ regionAttributes.setLocalMaxMemory("0");
+ regionAttributes.setRedundantCopy("1");
+ break;
+ }
+ case "REPLICATE_PROXY": {
+ regionAttributes.setDataPolicy(RegionAttributesDataPolicy.EMPTY);
+ regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
+ break;
+ }
+ default:
+ throw new IllegalArgumentException("invalid type " + type);
+ }
+ }
+
+ @Override
+ @JsonIgnore
+ public String getId() {
+ return getName();
+ }
+}
diff --git a/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java b/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
index de48201..6d5f94b 100644
--- a/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
+++ b/geode-management/src/main/java/org/apache/geode/cache/configuration/CacheConfig.java
@@ -719,6 +719,10 @@ public class CacheConfig {
return this.regions;
}
+ public void addRegion(BasicRegionConfig regionConfig) {
+ getRegions().add(new RegionConfig(regionConfig));
+ }
+
/**
* Gets the value of the functionService property.
*
diff --git a/geode-management/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java b/geode-management/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java
index d339cc9..1e582e6 100644
--- a/geode-management/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java
+++ b/geode-management/src/main/java/org/apache/geode/cache/configuration/RegionConfig.java
@@ -29,166 +29,41 @@ import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-
import org.apache.geode.annotations.Experimental;
-import org.apache.geode.management.api.RestfulEndpoint;
/**
*
- * 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).
- *
- *
- * <p>
- * Java class for region-type complex type.
- *
- * <p>
- * The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * <complexType name="region-type">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="region-attributes" type="{http://geode.apache.org/schema/cache}region-attributes-type" maxOccurs="unbounded" minOccurs="0"/>
- * <element name="index" maxOccurs="unbounded" minOccurs="0">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <choice minOccurs="0">
- * <element name="functional">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="expression" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="from-clause" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="imports" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * <element name="primary-key">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <attribute name="field" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * </choice>
- * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="expression" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="from-clause" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="imports" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="key-index" type="{http://www.w3.org/2001/XMLSchema}boolean" />
- * <attribute name="type" default="range">
- * <simpleType>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
- * <enumeration value="range"/>
- * <enumeration value="hash"/>
- * </restriction>
- * </simpleType>
- * </attribute>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * <element name="entry" maxOccurs="unbounded" minOccurs="0">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="key">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <choice>
- * <element name="string" type="{http://geode.apache.org/schema/cache}string-type"/>
- * <element name="declarable" type="{http://geode.apache.org/schema/cache}declarable-type"/>
- * </choice>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * <element name="value">
- * <complexType>
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <choice>
- * <element name="string" type="{http://geode.apache.org/schema/cache}string-type"/>
- * <element name="declarable" type="{http://geode.apache.org/schema/cache}declarable-type"/>
- * </choice>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
- * </element>
- * <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
- * <element name="region" type="{http://geode.apache.org/schema/cache}region-type" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
- * <attribute name="refid" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
- * </pre>
- *
- *
+ * this holds the attributes that belongs to region element in cache.xml, but can not be
+ * configured through manage v2 API (yet)
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "region-type", namespace = "http://geode.apache.org/schema/cache",
- propOrder = {"regionAttributes", "indexes", "entries", "regionElements", "regions"})
+ propOrder = {"indexes", "regionElements", "entries", "regions"})
@Experimental
-public class RegionConfig implements CacheElement, RestfulEndpoint {
-
- public static final String REGION_CONFIG_ENDPOINT = "/regions";
-
- @XmlElement(name = "region-attributes", namespace = "http://geode.apache.org/schema/cache")
- protected RegionAttributesType regionAttributes;
+public class RegionConfig extends BasicRegionConfig {
@XmlElement(name = "index", namespace = "http://geode.apache.org/schema/cache")
protected List<Index> indexes;
- @XmlElement(name = "entry", namespace = "http://geode.apache.org/schema/cache")
- protected List<Entry> entries;
@XmlAnyElement(lax = true)
protected List<CacheElement> regionElements;
+
+ @XmlElement(name = "entry", namespace = "http://geode.apache.org/schema/cache")
+ protected List<Entry> entries;
+
@XmlElement(name = "region", namespace = "http://geode.apache.org/schema/cache")
protected List<RegionConfig> regions;
- @XmlAttribute(name = "name", required = true)
- protected String name;
- @XmlAttribute(name = "refid")
- protected String type;
public RegionConfig() {}
- public RegionConfig(String name, String refid) {
- this.name = name;
- this.type = refid;
- }
-
- @Override
- public String getEndpoint() {
- return REGION_CONFIG_ENDPOINT;
- }
-
- public RegionAttributesType getRegionAttributes() {
- return regionAttributes;
+ public RegionConfig(String name, String type) {
+ super(name, type);
}
- public void setRegionAttributes(RegionAttributesType regionAttributes) {
- this.regionAttributes = regionAttributes;
+ // a convenience constructor to turn a BasicRegionConfig into RegionConfig
+ public RegionConfig(BasicRegionConfig regionConfig) {
+ this.name = regionConfig.getName();
+ this.type = regionConfig.getType();
+ this.regionAttributes = regionConfig.getRegionAttributes();
}
/**
@@ -206,13 +81,6 @@ public class RegionConfig implements CacheElement, RestfulEndpoint {
* <pre>
* getIndexes().add(newItem);
* </pre>
- *
- *
- * <p>
- * Objects of the following type(s) are allowed in the list
- * {@link RegionConfig.Index }
- *
- *
*/
public List<Index> getIndexes() {
if (indexes == null) {
@@ -222,60 +90,61 @@ public class RegionConfig implements CacheElement, RestfulEndpoint {
}
/**
- * Gets the value of the entry property.
+ * Gets the value of the any property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the entry property.
+ * This is why there is not a <CODE>set</CODE> method for the any property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
- * getEntries().add(newItem);
+ * getCustomRegionElements().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
- * {@link RegionConfig.Entry }
- *
- *
*/
- public List<Entry> getEntries() {
- if (entries == null) {
- entries = new ArrayList<Entry>();
+ public List<CacheElement> getCustomRegionElements() {
+ if (regionElements == null) {
+ regionElements = new ArrayList<>();
}
- return this.entries;
+ return this.regionElements;
}
+
/**
- * Gets the value of the any property.
+ * Gets the value of the entry property.
*
* <p>
* This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the any property.
+ * This is why there is not a <CODE>set</CODE> method for the entry property.
*
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
- * getCustomRegionElements().add(newItem);
+ * getEntries().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
+ * {@link RegionConfig.Entry }
+ *
+ *
*/
- public List<CacheElement> getCustomRegionElements() {
- if (regionElements == null) {
- regionElements = new ArrayList<>();
+ public List<Entry> getEntries() {
+ if (entries == null) {
+ entries = new ArrayList<Entry>();
}
- return this.regionElements;
+ return this.entries;
}
/**
@@ -309,217 +178,6 @@ public class RegionConfig implements CacheElement, RestfulEndpoint {
}
/**
- * Gets the value of the name property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setName(String value) throws IllegalArgumentException {
- if (value == null) {
- return;
- }
-
- boolean regionPrefixedWithSlash = value.startsWith("/");
- String[] regionSplit = value.split("/");
-
- boolean hasSubRegions =
- regionPrefixedWithSlash ? regionSplit.length > 2 : regionSplit.length > 1;
- if (hasSubRegions) {
- throw new IllegalArgumentException("Sub-regions are unsupported");
- }
-
- this.name = regionPrefixedWithSlash ? regionSplit[1] : value;
- }
-
- /**
- * Gets the value of the type property.
- *
- * possible object is
- * {@link String }
- *
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the value of the type property.
- *
- * allowed object is
- * {@link String }
- *
- */
- public void setType(RegionType regionType) {
- if (regionType != null) {
- setType(regionType.name());
- }
- }
-
- public void setType(String regionType) {
- if (regionType != null) {
- this.type = regionType.toUpperCase();
- setShortcutAttributes();
- }
- }
-
- private void setShortcutAttributes() {
- if (regionAttributes == null) {
- regionAttributes = new RegionAttributesType();
- }
-
- switch (type) {
- case "PARTITION": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- break;
- }
- case "REPLICATE": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.REPLICATE);
- regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
- break;
- }
- case "PARTITION_REDUNDANT": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setRedundantCopy("1");
- break;
- }
- case "PARTITION_PERSISTENT": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
- break;
- }
- case "PARTITION_REDUNDANT_PERSISTENT": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
- regionAttributes.setRedundantCopy("1");
- break;
- }
- case "PARTITION_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "PARTITION_REDUNDANT_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setRedundantCopy("1");
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "PARTITION_PERSISTENT_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "PARTITION_REDUNDANT_PERSISTENT_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_PARTITION);
- regionAttributes.setRedundantCopy("1");
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "PARTITION_HEAP_LRU": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
- break;
-
- }
- case "PARTITION_REDUNDANT_HEAP_LRU": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setRedundantCopy("1");
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
- break;
- }
-
- case "REPLICATE_PERSISTENT": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
- regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
- break;
- }
- case "REPLICATE_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.REPLICATE);
- regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
-
- }
- case "REPLICATE_PERSISTENT_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
- regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "REPLICATE_HEAP_LRU": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PRELOADED);
- regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
- regionAttributes.setInterestPolicy("all");
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
- break;
- }
- case "LOCAL": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.NORMAL);
- regionAttributes.setScope(RegionAttributesScope.LOCAL);
- break;
- }
- case "LOCAL_PERSISTENT": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
- regionAttributes.setScope(RegionAttributesScope.LOCAL);
- break;
- }
- case "LOCAL_HEAP_LRU": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.NORMAL);
- regionAttributes.setScope(RegionAttributesScope.LOCAL);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.LOCAL_DESTROY);
- break;
- }
- case "LOCAL_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.NORMAL);
- regionAttributes.setScope(RegionAttributesScope.LOCAL);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "LOCAL_PERSISTENT_OVERFLOW": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PERSISTENT_REPLICATE);
- regionAttributes.setScope(RegionAttributesScope.LOCAL);
- regionAttributes.setLruHeapPercentage(EnumActionDestroyOverflow.OVERFLOW_TO_DISK);
- break;
- }
- case "PARTITION_PROXY": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setLocalMaxMemory("0");
- break;
- }
- case "PARTITION_PROXY_REDUNDANT": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.PARTITION);
- regionAttributes.setLocalMaxMemory("0");
- regionAttributes.setRedundantCopy("1");
- break;
- }
- case "REPLICATE_PROXY": {
- regionAttributes.setDataPolicy(RegionAttributesDataPolicy.EMPTY);
- regionAttributes.setScope(RegionAttributesScope.DISTRIBUTED_ACK);
- break;
- }
- default:
- throw new IllegalArgumentException("invalid type " + type);
- }
- }
-
- @Override
- @JsonIgnore
- public String getId() {
- return getName();
- }
-
-
- /**
* <p>
* Java class for anonymous complex type.
*
@@ -850,5 +508,4 @@ public class RegionConfig implements CacheElement, RestfulEndpoint {
return getName();
}
}
-
}
diff --git a/geode-management/src/test/java/org/apache/geode/cache/configuration/CacheElementJsonMappingTest.java b/geode-management/src/test/java/org/apache/geode/cache/configuration/CacheElementJsonMappingTest.java
index 297fd47..8187c28 100644
--- a/geode-management/src/test/java/org/apache/geode/cache/configuration/CacheElementJsonMappingTest.java
+++ b/geode-management/src/test/java/org/apache/geode/cache/configuration/CacheElementJsonMappingTest.java
@@ -32,7 +32,7 @@ public class CacheElementJsonMappingTest {
private static ObjectMapper mapper = GeodeJsonMapper.getMapper();
private static MemberConfig member;
- private static RegionConfig region;
+ private static BasicRegionConfig region;
@BeforeClass
public static void beforeClass() throws Exception {
@@ -40,7 +40,7 @@ public class CacheElementJsonMappingTest {
member.setId("server");
member.setPid("123");
- region = new RegionConfig();
+ region = new BasicRegionConfig();
region.setName("test");
}
@@ -50,7 +50,7 @@ public class CacheElementJsonMappingTest {
System.out.println(json);
assertThat(json).contains("class").contains("\"name\":\"test\"");
- RegionConfig config = mapper.readValue(json, RegionConfig.class);
+ BasicRegionConfig config = mapper.readValue(json, BasicRegionConfig.class);
assertThat(config.getName()).isEqualTo(region.getName());
}
@@ -82,7 +82,7 @@ public class CacheElementJsonMappingTest {
@Test
public void deserializeWithoutTypeInfo() throws Exception {
String json = "{'name':'test'}";
- RegionConfig config = mapper.readValue(json, RegionConfig.class);
+ BasicRegionConfig config = mapper.readValue(json, BasicRegionConfig.class);
assertThat(config.getName()).isEqualTo("test");
}
}
diff --git a/geode-web-management/src/distributedTest/java/org/apache/geode/management/client/ClientClusterManagementServiceDUnitTest.java b/geode-web-management/src/distributedTest/java/org/apache/geode/management/client/ClientClusterManagementServiceDUnitTest.java
index bbf3e73..3e1e9d2 100644
--- a/geode-web-management/src/distributedTest/java/org/apache/geode/management/client/ClientClusterManagementServiceDUnitTest.java
+++ b/geode-web-management/src/distributedTest/java/org/apache/geode/management/client/ClientClusterManagementServiceDUnitTest.java
@@ -29,7 +29,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.context.WebApplicationContext;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
import org.apache.geode.management.api.ClusterManagementResult;
import org.apache.geode.management.api.ClusterManagementService;
@@ -65,7 +65,7 @@ public class ClientClusterManagementServiceDUnitTest {
@Test
@WithMockUser
public void createRegion() {
- RegionConfig region = new RegionConfig();
+ BasicRegionConfig region = new BasicRegionConfig();
region.setName("customer");
region.setType(RegionType.REPLICATE);
diff --git a/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementIntegrationTest.java b/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementIntegrationTest.java
index 1036f23..e9891e9 100644
--- a/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementIntegrationTest.java
+++ b/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementIntegrationTest.java
@@ -33,7 +33,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.context.WebApplicationContext;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
@RunWith(SpringRunner.class)
@@ -56,7 +56,7 @@ public class RegionManagementIntegrationTest {
@Test
@WithMockUser
public void sanityCheck() throws Exception {
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("customers");
regionConfig.setType(RegionType.REPLICATE);
@@ -73,7 +73,7 @@ public class RegionManagementIntegrationTest {
@Test
@WithMockUser
public void invalidType() throws Exception {
- RegionConfig regionConfig = new RegionConfig();
+ BasicRegionConfig regionConfig = new BasicRegionConfig();
regionConfig.setName("customers");
regionConfig.setType("LOCAL");
diff --git a/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementSecurityIntegrationTest.java b/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementSecurityIntegrationTest.java
index 8e90922..caf9642 100644
--- a/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementSecurityIntegrationTest.java
+++ b/geode-web-management/src/integrationTest/java/org/apache/geode/management/internal/rest/RegionManagementSecurityIntegrationTest.java
@@ -32,7 +32,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.web.context.WebApplicationContext;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.cache.configuration.RegionType;
@RunWith(SpringRunner.class)
@@ -46,12 +46,12 @@ public class RegionManagementSecurityIntegrationTest {
private LocatorWebContext context;
- private RegionConfig regionConfig;
+ private BasicRegionConfig regionConfig;
private String json;
@Before
public void before() throws JsonProcessingException {
- regionConfig = new RegionConfig();
+ regionConfig = new BasicRegionConfig();
regionConfig.setName("customers");
regionConfig.setType(RegionType.REPLICATE);
ObjectMapper mapper = new ObjectMapper();
diff --git a/geode-web-management/src/main/java/org/apache/geode/management/internal/rest/controllers/RegionManagementController.java b/geode-web-management/src/main/java/org/apache/geode/management/internal/rest/controllers/RegionManagementController.java
index aec585c..ac510ad 100644
--- a/geode-web-management/src/main/java/org/apache/geode/management/internal/rest/controllers/RegionManagementController.java
+++ b/geode-web-management/src/main/java/org/apache/geode/management/internal/rest/controllers/RegionManagementController.java
@@ -15,7 +15,7 @@
package org.apache.geode.management.internal.rest.controllers;
-import static org.apache.geode.cache.configuration.RegionConfig.REGION_CONFIG_ENDPOINT;
+import static org.apache.geode.cache.configuration.BasicRegionConfig.REGION_CONFIG_ENDPOINT;
import static org.apache.geode.management.internal.rest.controllers.AbstractManagementController.MANAGEMENT_API_VERSION;
import org.springframework.http.HttpStatus;
@@ -27,7 +27,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
-import org.apache.geode.cache.configuration.RegionConfig;
+import org.apache.geode.cache.configuration.BasicRegionConfig;
import org.apache.geode.management.api.ClusterManagementResult;
@Controller("regionManagement")
@@ -37,7 +37,7 @@ public class RegionManagementController extends AbstractManagementController {
@PreAuthorize("@securityService.authorize('DATA', 'MANAGE')")
@RequestMapping(method = RequestMethod.POST, value = REGION_CONFIG_ENDPOINT)
public ResponseEntity<ClusterManagementResult> createRegion(
- @RequestBody RegionConfig regionConfig,
+ @RequestBody BasicRegionConfig regionConfig,
@RequestParam(required = false) String group) {
ClusterManagementResult result =
clusterManagementService.create(regionConfig, group);