geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sai_boorlaga...@apache.org
Subject [geode] branch develop updated: GEODE-4859: Preparing GfshCommand to be public interface (#1647)
Date Wed, 21 Mar 2018 23:54:41 GMT
This is an automated email from the ASF dual-hosted git repository.

sai_boorlagadda 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 9104dac  GEODE-4859: Preparing GfshCommand to be public interface (#1647)
9104dac is described below

commit 9104dac54a1d18f9b385569c3b309dd7ba16456f
Author: Sai Boorlagadda <sai.boorlagadda@gmail.com>
AuthorDate: Wed Mar 21 16:54:38 2018 -0700

    GEODE-4859: Preparing GfshCommand to be public interface (#1647)
    
    * GfshCommand class to return Cache instead of InternalCache
    * Exposed authorize methods to delegate to underlying security service.
    
    Signed-off-by: Jens Deppe <jdeppe@pivotal.io>
---
 .../jdbc/internal/cli/AlterConnectionCommand.java  |  2 +-
 .../jdbc/internal/cli/AlterMappingCommand.java     |  2 +-
 .../jdbc/internal/cli/CreateConnectionCommand.java |  2 +-
 .../jdbc/internal/cli/CreateMappingCommand.java    |  2 +-
 .../internal/cli/DestroyConnectionCommand.java     |  2 +-
 .../jdbc/internal/cli/DestroyMappingCommand.java   |  2 +-
 .../geode/management/internal/cli/CliUtil.java     |  4 +--
 .../cli/commands/AlterAsyncEventQueueCommand.java  |  2 +-
 .../internal/cli/commands/AlterRegionCommand.java  |  7 ++--
 .../cli/commands/AlterRuntimeConfigCommand.java    |  2 +-
 .../cli/commands/BackupDiskStoreCommand.java       |  6 ++--
 .../cli/commands/ChangeLogLevelCommand.java        |  4 +--
 .../cli/commands/CompactDiskStoreCommand.java      |  5 ++-
 .../internal/cli/commands/ConfigurePDXCommand.java |  2 +-
 .../cli/commands/CreateAsyncEventQueueCommand.java |  6 ++--
 .../cli/commands/CreateDefinedIndexesCommand.java  |  2 +-
 .../cli/commands/CreateDiskStoreCommand.java       |  2 +-
 .../cli/commands/CreateGatewayReceiverCommand.java |  4 +--
 .../cli/commands/CreateGatewaySenderCommand.java   |  4 +--
 .../internal/cli/commands/CreateIndexCommand.java  |  2 +-
 .../cli/commands/CreateJndiBindingCommand.java     |  2 +-
 .../internal/cli/commands/CreateRegionCommand.java | 22 ++++++-------
 .../internal/cli/commands/DeployCommand.java       |  2 +-
 .../cli/commands/DescribeClientCommand.java        |  4 +--
 .../cli/commands/DescribeRegionCommand.java        |  2 --
 .../commands/DestroyAsyncEventQueueCommand.java    |  2 +-
 .../cli/commands/DestroyDiskStoreCommand.java      |  2 +-
 .../cli/commands/DestroyFunctionCommand.java       |  7 ++--
 .../cli/commands/DestroyGatewaySenderCommand.java  |  4 +--
 .../internal/cli/commands/DestroyIndexCommand.java |  2 +-
 .../cli/commands/DestroyJndiBindingCommand.java    |  2 +-
 .../cli/commands/DestroyRegionCommand.java         |  2 +-
 .../cli/commands/ExecuteFunctionCommand.java       |  2 +-
 .../internal/cli/commands/ExportDataCommand.java   |  2 +-
 .../internal/cli/commands/ExportLogsCommand.java   |  2 +-
 .../cli/commands/ExportStackTraceCommand.java      |  3 +-
 .../internal/cli/commands/GCCommand.java           |  3 +-
 .../internal/cli/commands/GetCommand.java          | 10 +++---
 .../internal/cli/commands/GfshCommand.java         | 37 ++++++++++++++++------
 .../internal/cli/commands/ImportDataCommand.java   |  2 +-
 .../internal/cli/commands/ListClientCommand.java   |  4 +--
 .../cli/commands/ListDiskStoresCommand.java        |  4 ++-
 .../internal/cli/commands/ListGatewayCommand.java  |  6 +---
 .../cli/commands/ListJndiBindingCommand.java       |  2 +-
 .../commands/LoadBalanceGatewaySenderCommand.java  |  8 ++---
 .../internal/cli/commands/LocateEntryCommand.java  |  2 +-
 .../cli/commands/PauseGatewaySenderCommand.java    |  8 ++---
 .../internal/cli/commands/PutCommand.java          |  7 ++--
 .../internal/cli/commands/QueryCommand.java        |  9 +++---
 .../internal/cli/commands/RebalanceCommand.java    |  4 +--
 .../internal/cli/commands/RemoveCommand.java       | 10 +++---
 .../cli/commands/ResumeGatewaySenderCommand.java   |  8 ++---
 .../internal/cli/commands/ShowDeadlockCommand.java |  3 --
 .../internal/cli/commands/ShowLogCommand.java      | 15 +++------
 .../internal/cli/commands/ShowMetricsCommand.java  | 13 +++-----
 .../cli/commands/ShowMissingDiskStoreCommand.java  |  4 ++-
 .../internal/cli/commands/ShutdownCommand.java     |  2 +-
 .../cli/commands/StartGatewayReceiverCommand.java  |  6 +---
 .../cli/commands/StartGatewaySenderCommand.java    |  8 ++---
 .../StatusClusterConfigServiceCommand.java         |  2 +-
 .../cli/commands/StatusGatewayReceiverCommand.java |  6 +---
 .../cli/commands/StatusGatewaySenderCommand.java   |  8 ++---
 .../cli/commands/StopGatewayReceiverCommand.java   |  6 +---
 .../cli/commands/StopGatewaySenderCommand.java     |  5 ++-
 .../internal/cli/commands/UndeployCommand.java     |  2 +-
 .../commands/AlterAsyncEventQueueCommandTest.java  |  4 +--
 .../cli/commands/ConfigurePDXCommandTest.java      |  2 +-
 .../commands/CreateAsyncEventQueueCommandTest.java |  4 +--
 .../commands/CreateDefinedIndexesCommandTest.java  |  6 ++--
 .../commands/CreateGatewayReceiverCommandTest.java |  8 ++---
 .../commands/CreateGatewaySenderCommandTest.java   |  8 ++---
 .../cli/commands/CreateJndiBindingCommandTest.java | 16 +++++-----
 .../cli/commands/CreateRegionCommandTest.java      |  2 +-
 .../commands/DestroyGatewaySenderCommandTest.java  |  8 ++---
 .../commands/DestroyJndiBindingCommandTest.java    |  6 ++--
 .../cli/commands/DestroyRegionCommandTest.java     |  2 +-
 .../cli/commands/DiskStoreCommandsJUnitTest.java   |  5 +--
 .../cli/commands/GfshCommandJUnitTest.java         |  4 +--
 .../cli/commands/ListIndexCommandJUnitTest.java    |  3 +-
 .../cli/commands/ShowLogCommandDUnitTest.java      |  8 ++---
 .../lucene/internal/cli/LuceneIndexCommands.java   | 19 ++++++-----
 .../internal/cli/LuceneIndexCommandsJUnitTest.java |  9 ++----
 82 files changed, 210 insertions(+), 234 deletions(-)

diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterConnectionCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterConnectionCommand.java
index b86e2d8..f4713cf 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterConnectionCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterConnectionCommand.java
@@ -136,7 +136,7 @@ public class AlterConnectionCommand extends GfshCommand {
   private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     }
   }
 }
diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterMappingCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterMappingCommand.java
index 8071386..8735c92 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterMappingCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/AlterMappingCommand.java
@@ -145,7 +145,7 @@ public class AlterMappingCommand extends GfshCommand {
   private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     }
   }
 }
diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateConnectionCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateConnectionCommand.java
index 93e8cf9..032606a 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateConnectionCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateConnectionCommand.java
@@ -143,7 +143,7 @@ public class CreateConnectionCommand extends GfshCommand {
   private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     }
   }
 
diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
index 86037bd..6ea3c98 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommand.java
@@ -146,7 +146,7 @@ public class CreateMappingCommand extends GfshCommand {
   private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     }
   }
 }
diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyConnectionCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyConnectionCommand.java
index 021d82e..b96214e 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyConnectionCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyConnectionCommand.java
@@ -107,7 +107,7 @@ public class DestroyConnectionCommand extends GfshCommand {
   private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     }
   }
 }
diff --git a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyMappingCommand.java b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyMappingCommand.java
index 9882dd1..f3b1e99 100644
--- a/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyMappingCommand.java
+++ b/geode-connectors/src/main/java/org/apache/geode/connectors/jdbc/internal/cli/DestroyMappingCommand.java
@@ -104,7 +104,7 @@ public class DestroyMappingCommand extends GfshCommand {
   private void updateClusterConfiguration(final Result result, final XmlEntity xmlEntity) {
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     }
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
index a406378..7403ce2 100755
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/CliUtil.java
@@ -179,8 +179,8 @@ public class CliUtil {
    */
   @SuppressWarnings("unchecked")
   public static Set<DistributedMember> getAllNormalMembers(InternalCache cache) {
-    return new HashSet<DistributedMember>(cache.getInternalDistributedSystem()
-        .getDistributionManager().getNormalDistributionManagerIds());
+    return new HashSet<DistributedMember>(
+        cache.getDistributionManager().getNormalDistributionManagerIds());
   }
 
   /**
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommand.java
index c1f5a5a..5a4af4b 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommand.java
@@ -85,7 +85,7 @@ public class AlterAsyncEventQueueCommand extends GfshCommand {
 
     // need not check if any running servers has this async-event-queue. A server with this queue id
     // may be shutdown, but we still need to update Cluster Configuration.
-    InternalClusterConfigurationService service = getSharedConfiguration();
+    InternalClusterConfigurationService service = getConfigurationService();
 
     if (service == null) {
       return ResultBuilder.createUserErrorResult("Cluster Configuration Service is not available. "
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRegionCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRegionCommand.java
index 2ec5e50..1cc4e30 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRegionCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRegionCommand.java
@@ -91,9 +91,10 @@ public class AlterRegionCommand extends GfshCommand {
       @CliOption(key = CliStrings.ALTER_REGION__EVICTIONMAX, specifiedDefaultValue = "0",
           help = CliStrings.ALTER_REGION__EVICTIONMAX__HELP) Integer evictionMax) {
     Result result;
-    getSecurityService().authorize(Resource.DATA, Operation.MANAGE, regionPath);
 
-    InternalCache cache = getCache();
+    authorize(Resource.DATA, Operation.MANAGE, regionPath);
+
+    InternalCache cache = (InternalCache) getCache();
 
     if (groups != null) {
       RegionCommandsUtils.validateGroups(cache, groups);
@@ -136,7 +137,7 @@ public class AlterRegionCommand extends GfshCommand {
     XmlEntity xmlEntity = findXmlEntity(regionAlterResults);
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, groups));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, groups));
     }
     return result;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeConfigCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeConfigCommand.java
index aa00183..372cbdb 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeConfigCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/AlterRuntimeConfigCommand.java
@@ -216,7 +216,7 @@ public class AlterRuntimeConfigCommand extends GfshCommand {
       final XmlEntity xmlEntity = XmlEntity.builder().withType(CacheXml.CACHE)
           .withAttributes(rumTimeCacheAttributes).build();
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().modifyXmlAndProperties(properties, xmlEntity, group));
+          () -> getConfigurationService().modifyXmlAndProperties(properties, xmlEntity, group));
       return result;
     } else {
       StringBuilder errorMessageBuilder = new StringBuilder();
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/BackupDiskStoreCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/BackupDiskStoreCommand.java
index 22cd4d7..b5bd50f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/BackupDiskStoreCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/BackupDiskStoreCommand.java
@@ -51,11 +51,11 @@ public class BackupDiskStoreCommand extends GfshCommand {
       @CliOption(key = CliStrings.BACKUP_DISK_STORE__BASELINEDIR,
           help = CliStrings.BACKUP_DISK_STORE__BASELINEDIR__HELP) String baselineDir) {
 
-    getSecurityService().authorize(ResourcePermission.Resource.CLUSTER,
-        ResourcePermission.Operation.WRITE, ResourcePermission.Target.DISK);
+    authorize(ResourcePermission.Resource.CLUSTER, ResourcePermission.Operation.WRITE,
+        ResourcePermission.Target.DISK);
     Result result;
     try {
-      InternalCache cache = getCache();
+      InternalCache cache = (InternalCache) getCache();
       DistributionManager dm = cache.getDistributionManager();
       BackupStatus backupStatus;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommand.java
index aeeb2da..7efec84 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ChangeLogLevelCommand.java
@@ -25,11 +25,11 @@ import org.apache.logging.log4j.Logger;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.internal.logging.log4j.LogLevel;
 import org.apache.geode.management.cli.CliMetaData;
@@ -67,7 +67,7 @@ public class ChangeLogLevelCommand extends GfshCommand {
           .createUserErrorResult(CliStrings.CHANGE_LOGLEVEL__MSG__SPECIFY_GRP_OR_MEMBER);
     }
 
-    InternalCache cache = getCache();
+    Cache cache = getCache();
 
     Set<DistributedMember> dsMembers = new HashSet<>();
     Set<DistributedMember> ds = getAllMembers();
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CompactDiskStoreCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CompactDiskStoreCommand.java
index a7b381e..f942517 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CompactDiskStoreCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CompactDiskStoreCommand.java
@@ -65,7 +65,7 @@ public class CompactDiskStoreCommand extends GfshCommand {
             CliStrings.format(CliStrings.COMPACT_DISK_STORE__DISKSTORE_0_DOES_NOT_EXIST,
                 new Object[] {diskStoreName}));
       } else {
-        InternalDistributedSystem ds = getCache().getInternalDistributedSystem();
+        InternalDistributedSystem ds = ((InternalCache) getCache()).getInternalDistributedSystem();
 
         Map<DistributedMember, PersistentID> overallCompactInfo = new HashMap<>();
 
@@ -167,8 +167,7 @@ public class CompactDiskStoreCommand extends GfshCommand {
   }
 
   private boolean diskStoreExists(String diskStoreName) {
-    InternalCache cache = getCache();
-    ManagementService managementService = ManagementService.getExistingManagementService(cache);
+    ManagementService managementService = getManagementService();
     DistributedSystemMXBean dsMXBean = managementService.getDistributedSystemMXBean();
     Map<String, String[]> diskstore = dsMXBean.listMemberDiskstore();
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java
index 1868c15..2c534a9 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommand.java
@@ -151,7 +151,7 @@ public class ConfigurePDXCommand extends GfshCommand {
     XmlEntity xmlEntity = createXmlEntity(cache);
     result = ResultBuilder.buildResult(ird);
     persistClusterConfiguration(result,
-        () -> getSharedConfiguration().addXmlEntity(xmlEntity, null));
+        () -> getConfigurationService().addXmlEntity(xmlEntity, null));
     return result;
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommand.java
index bf560aa..a7dc2f0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommand.java
@@ -89,8 +89,8 @@ public class CreateAsyncEventQueueCommand extends GfshCommand {
           help = CliStrings.CREATE_ASYNC_EVENT_QUEUE__LISTENER_PARAM_AND_VALUE__HELP) String[] listenerParamsAndValues) {
 
     if (persistent) {
-      getSecurityService().authorize(ResourcePermission.Resource.CLUSTER,
-          ResourcePermission.Operation.WRITE, ResourcePermission.Target.DISK);
+      authorize(ResourcePermission.Resource.CLUSTER, ResourcePermission.Operation.WRITE,
+          ResourcePermission.Target.DISK);
     }
     Properties listenerProperties = new Properties();
 
@@ -124,7 +124,7 @@ public class CreateAsyncEventQueueCommand extends GfshCommand {
     XmlEntity xmlEntity = findXmlEntity(results);
     if (xmlEntity != null) {
       persistClusterConfiguration(commandResult,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, groups));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, groups));
     }
     return commandResult;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommand.java
index db3bbfe..5aa829b 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommand.java
@@ -153,7 +153,7 @@ public class CreateDefinedIndexesCommand extends GfshCommand {
 
     for (XmlEntity xmlEntity : xmlEntities) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, group));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, group));
     }
 
     return result;
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDiskStoreCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDiskStoreCommand.java
index 46d81ef..cdd8779 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDiskStoreCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateDiskStoreCommand.java
@@ -119,7 +119,7 @@ public class CreateDiskStoreCommand extends GfshCommand {
 
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, groups));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, groups));
     }
 
     return result;
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommand.java
index d03f953..239dac3 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommand.java
@@ -96,13 +96,13 @@ public class CreateGatewayReceiverCommand extends GfshCommand {
     }
 
     // has xml but unable to persist to cluster config, need to print warning message and return
-    if (onMember != null || getSharedConfiguration() == null) {
+    if (onMember != null || getConfigurationService() == null) {
       result.setCommandPersisted(false);
       return result;
     }
 
     // update cluster config
-    getSharedConfiguration().addXmlEntity(xmlEntity, onGroups);
+    getConfigurationService().addXmlEntity(xmlEntity, onGroups);
     return result;
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
index b132852..175f782 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommand.java
@@ -137,13 +137,13 @@ public class CreateGatewaySenderCommand extends GfshCommand {
     }
 
     // has xml but unable to persist to cluster config, need to print warning message and return
-    if (onMember != null || getSharedConfiguration() == null) {
+    if (onMember != null || getConfigurationService() == null) {
       result.setCommandPersisted(false);
       return result;
     }
 
     // update cluster config
-    getSharedConfiguration().addXmlEntity(xmlEntity, onGroups);
+    getConfigurationService().addXmlEntity(xmlEntity, onGroups);
     return result;
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java
index 0ea1ac3..112aed6 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateIndexCommand.java
@@ -80,7 +80,7 @@ public class CreateIndexCommand extends GfshCommand {
 
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, group));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, group));
     }
     return result;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommand.java
index 00220a1..b525a70 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommand.java
@@ -147,7 +147,7 @@ public class CreateJndiBindingCommand extends GfshCommand {
 
     Result result;
     boolean persisted = false;
-    InternalClusterConfigurationService service = getSharedConfiguration();
+    InternalClusterConfigurationService service = getConfigurationService();
 
     if (service != null) {
       CacheConfig cacheConfig = service.getCacheConfig("cluster");
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommand.java
index ea4f5e5..b88b389 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommand.java
@@ -193,7 +193,7 @@ public class CreateRegionCommand extends GfshCommand {
           CliStrings.CREATE_REGION__MSG__ONE_OF_REGIONSHORTCUT_AND_USEATTRIBUTESFROM_IS_REQUIRED);
     }
 
-    InternalCache cache = getCache();
+    InternalCache cache = (InternalCache) getCache();
 
     /*
      * Adding name collision check for regions created with regionShortcut only.
@@ -351,11 +351,11 @@ public class CreateRegionCommand extends GfshCommand {
       functionArgs.setValueConstraint(valueConstraint);
     }
 
-    DistributedSystemMXBean dsMBean = getDSMBean(cache);
+    DistributedSystemMXBean dsMBean = getDSMBean();
     // validating colocation
     if (functionArgs.hasPartitionAttributes()) {
       if (prColocatedWith != null) {
-        ManagementService mgmtService = ManagementService.getExistingManagementService(cache);
+        ManagementService mgmtService = getManagementService();
         DistributedRegionMXBean distributedRegionMXBean =
             mgmtService.getDistributedRegionMXBean(prColocatedWith);
         if (distributedRegionMXBean == null) {
@@ -417,8 +417,8 @@ public class CreateRegionCommand extends GfshCommand {
     if ((functionArgs.getRegionShortcut() != null
         && functionArgs.getRegionShortcut().isPersistent())
         || isAttributePersistent(functionArgs.getRegionAttributes())) {
-      getSecurityService().authorize(ResourcePermission.Resource.CLUSTER,
-          ResourcePermission.Operation.WRITE, ResourcePermission.Target.DISK);
+      authorize(ResourcePermission.Resource.CLUSTER, ResourcePermission.Operation.WRITE,
+          ResourcePermission.Target.DISK);
     }
 
     // validating the groups
@@ -441,7 +441,7 @@ public class CreateRegionCommand extends GfshCommand {
     if (xmlEntity != null) {
       verifyDistributedRegionMbean(cache, regionPath);
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().addXmlEntity(xmlEntity, groups));
+          () -> getConfigurationService().addXmlEntity(xmlEntity, groups));
     }
     return result;
   }
@@ -522,7 +522,7 @@ public class CreateRegionCommand extends GfshCommand {
   }
 
   private boolean isClusterWideSameConfig(InternalCache cache, String regionPath) {
-    ManagementService managementService = ManagementService.getExistingManagementService(cache);
+    ManagementService managementService = getManagementService();
 
     DistributedSystemMXBean dsMXBean = managementService.getDistributedSystemMXBean();
 
@@ -559,7 +559,7 @@ public class CreateRegionCommand extends GfshCommand {
       return false;
     }
 
-    ManagementService managementService = ManagementService.getExistingManagementService(cache);
+    ManagementService managementService = getManagementService();
     DistributedSystemMXBean dsMBean = managementService.getDistributedSystemMXBean();
 
     String[] allRegionPaths = dsMBean.listAllRegionPaths();
@@ -567,7 +567,7 @@ public class CreateRegionCommand extends GfshCommand {
   }
 
   private boolean diskStoreExists(InternalCache cache, String diskStoreName) {
-    ManagementService managementService = ManagementService.getExistingManagementService(cache);
+    ManagementService managementService = getManagementService();
     DistributedSystemMXBean dsMXBean = managementService.getDistributedSystemMXBean();
     Map<String, String[]> diskstore = dsMXBean.listMemberDiskstore();
 
@@ -588,8 +588,8 @@ public class CreateRegionCommand extends GfshCommand {
         && attributes.getDataPolicy().toString().contains("PERSISTENT");
   }
 
-  DistributedSystemMXBean getDSMBean(InternalCache cache) {
-    ManagementService managementService = ManagementService.getExistingManagementService(cache);
+  DistributedSystemMXBean getDSMBean() {
+    ManagementService managementService = getManagementService();
     return managementService.getDistributedSystemMXBean();
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
index f71fa64..bd27aa8 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DeployCommand.java
@@ -136,7 +136,7 @@ public class DeployCommand extends GfshCommand {
     }
 
     Result result = ResultBuilder.buildResult(tabularData);
-    InternalClusterConfigurationService sc = getSharedConfiguration();
+    InternalClusterConfigurationService sc = getConfigurationService();
     if (sc == null) {
       result.setCommandPersisted(false);
     } else {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommand.java
index 4ea2d48..71752a7 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeClientCommand.java
@@ -28,7 +28,6 @@ import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.CacheServerMXBean;
 import org.apache.geode.management.ClientHealthStatus;
 import org.apache.geode.management.ManagementService;
@@ -68,9 +67,8 @@ public class DescribeClientCommand extends GfshCommand {
     CompositeResultData compositeResultData = ResultBuilder.createCompositeResultData();
     CompositeResultData.SectionResultData sectionResult =
         compositeResultData.addSection("InfoSection");
-    InternalCache cache = getCache();
 
-    ManagementService service = ManagementService.getExistingManagementService(cache);
+    ManagementService service = getManagementService();
     ObjectName[] cacheServers = service.getDistributedSystemMXBean().listCacheServerObjectNames();
     if (cacheServers.length == 0) {
       return ResultBuilder.createGemFireErrorResult(
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeRegionCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeRegionCommand.java
index ce216d8..8111843 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeRegionCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DescribeRegionCommand.java
@@ -28,7 +28,6 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.cache.execute.ResultCollector;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
@@ -101,7 +100,6 @@ public class DescribeRegionCommand extends GfshCommand {
   }
 
   List<?> getFunctionResultFromMembers(String regionName) {
-    InternalCache cache = getCache();
     ResultCollector<?, ?> rc =
         executeFunction(getRegionDescription, regionName, getAllNormalMembers());
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyAsyncEventQueueCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyAsyncEventQueueCommand.java
index f7699d2..dcd6a0f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyAsyncEventQueueCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyAsyncEventQueueCommand.java
@@ -72,7 +72,7 @@ public class DestroyAsyncEventQueueCommand extends GfshCommand {
     XmlEntity xmlEntity = findXmlEntity(functionResults);
     if (xmlEntity != null) {
       persistClusterConfiguration(commandResult,
-          () -> getSharedConfiguration().deleteXmlEntity(xmlEntity, onGroups));
+          () -> getConfigurationService().deleteXmlEntity(xmlEntity, onGroups));
     }
     return commandResult;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java
index 51888ef..f2a2b07 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyDiskStoreCommand.java
@@ -64,7 +64,7 @@ public class DestroyDiskStoreCommand extends GfshCommand {
 
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().deleteXmlEntity(xmlEntity, groups));
+          () -> getConfigurationService().deleteXmlEntity(xmlEntity, groups));
     }
 
     return result;
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyFunctionCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyFunctionCommand.java
index 6d79a81..3b612b0a 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyFunctionCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyFunctionCommand.java
@@ -23,12 +23,12 @@ import java.util.Set;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionException;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -57,7 +57,7 @@ public class DestroyFunctionCommand extends GfshCommand {
       @CliOption(key = CliStrings.MEMBER, optionContext = ConverterHint.MEMBERIDNAME,
           help = CliStrings.DESTROY_FUNCTION__ONMEMBER__HELP) String memberId) {
     try {
-      InternalCache cache = getCache();
+      Cache cache = getCache();
       Set<DistributedMember> dsMembers = new HashSet<>();
       if (groups != null && memberId != null) {
         return ResultBuilder
@@ -89,8 +89,7 @@ public class DestroyFunctionCommand extends GfshCommand {
     }
   }
 
-  private Result executeFunction(InternalCache cache, Set<DistributedMember> DsMembers,
-      String functionId) {
+  private Result executeFunction(Cache cache, Set<DistributedMember> DsMembers, String functionId) {
     // unregister on a set of of members
     Function unregisterFunction = new UnregisterFunction();
     FunctionService.registerFunction(unregisterFunction);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommand.java
index 976efd5..4f984cd 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommand.java
@@ -75,13 +75,13 @@ public class DestroyGatewaySenderCommand extends GfshCommand {
     }
 
     // has xml but unable to persist to cluster config, need to print warning message and return
-    if (onMember != null || getSharedConfiguration() == null) {
+    if (onMember != null || getConfigurationService() == null) {
       result.setCommandPersisted(false);
       return result;
     }
 
     // update cluster config
-    getSharedConfiguration().deleteXmlEntity(xmlEntity, onGroups);
+    getConfigurationService().deleteXmlEntity(xmlEntity, onGroups);
     return result;
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyIndexCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyIndexCommand.java
index 676288a..3fbee0f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyIndexCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyIndexCommand.java
@@ -82,7 +82,7 @@ public class DestroyIndexCommand extends GfshCommand {
 
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().deleteXmlEntity(xmlEntity, group));
+          () -> getConfigurationService().deleteXmlEntity(xmlEntity, group));
     }
     return result;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommand.java
index f4800b4..b65b0ef 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommand.java
@@ -55,7 +55,7 @@ public class DestroyJndiBindingCommand extends GfshCommand {
 
     Result result;
     boolean persisted = false;
-    InternalClusterConfigurationService service = getSharedConfiguration();
+    InternalClusterConfigurationService service = getConfigurationService();
     if (service != null) {
       service.updateCacheConfig("cluster", cc -> {
         List<JndiBindingsType.JndiBinding> bindings = cc.getJndiBindings();
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommand.java
index f1f729e..868ffaa 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommand.java
@@ -70,7 +70,7 @@ public class DestroyRegionCommand extends GfshCommand {
     // if at least one member returns with successful deletion, we will need to update cc
     if (xmlEntity != null) {
       persistClusterConfiguration(result,
-          () -> getSharedConfiguration().deleteXmlEntity(xmlEntity, null));
+          () -> getConfigurationService().deleteXmlEntity(xmlEntity, null));
     }
     return result;
   }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommand.java
index 2f23028..ec72030 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExecuteFunctionCommand.java
@@ -101,7 +101,7 @@ public class ExecuteFunctionCommand extends GfshCommand {
     }
     args[4] = onRegion;
 
-    Subject currentUser = getSecurityService().getSubject();
+    Subject currentUser = getSubject();
     if (currentUser != null) {
       args[5] = currentUser.getSession().getAttribute(CREDENTIALS_SESSION_ATTRIBUTE);
     } else {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportDataCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportDataCommand.java
index 701f47b..6511206 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportDataCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportDataCommand.java
@@ -55,7 +55,7 @@ public class ExportDataCommand extends GfshCommand {
           specifiedDefaultValue = "true",
           help = CliStrings.EXPORT_DATA__PARALLEL_HELP) boolean parallel) {
 
-    getSecurityService().authorize(Resource.DATA, Operation.READ, regionName);
+    authorize(Resource.DATA, Operation.READ, regionName);
     final DistributedMember targetMember = getMember(memberNameOrId);
 
     Optional<Result> validationResult = validatePath(filePath, dirPath, parallel);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
index 5aeb85d..5634d36 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportLogsCommand.java
@@ -101,7 +101,7 @@ public class ExportLogsCommand extends GfshCommand {
 
     long totalEstimatedExportSize = 0;
     Result result;
-    InternalCache cache = getCache();
+    InternalCache cache = (InternalCache) getCache();
     try {
       Set<DistributedMember> targetMembers = getMembersIncludingLocators(groups, memberIds);
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportStackTraceCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportStackTraceCommand.java
index 6b95d9a..88c63da 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportStackTraceCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ExportStackTraceCommand.java
@@ -34,6 +34,7 @@ import org.springframework.shell.core.annotation.CliOption;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -98,7 +99,7 @@ public class ExportStackTraceCommand extends GfshCommand {
       }
     }
 
-    InternalDistributedSystem ads = getCache().getInternalDistributedSystem();
+    InternalDistributedSystem ads = ((InternalCache) getCache()).getInternalDistributedSystem();
     String filePath = writeStacksToFile(dumps, fileName);
     resultData.addLine(CliStrings.format(CliStrings.EXPORT_STACKTRACE__SUCCESS, filePath));
     resultData.addLine(CliStrings.EXPORT_STACKTRACE__HOST + ads.getDistributedMember().getHost());
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GCCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GCCommand.java
index 3763929..af392e0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GCCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GCCommand.java
@@ -23,6 +23,7 @@ import java.util.Set;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.cache.InternalCache;
@@ -49,7 +50,7 @@ public class GCCommand extends GfshCommand {
           help = CliStrings.GC__GROUP__HELP) String[] groups,
       @CliOption(key = CliStrings.MEMBER, optionContext = ConverterHint.ALL_MEMBER_IDNAME,
           help = CliStrings.GC__MEMBER__HELP) String memberId) {
-    InternalCache cache = getCache();
+    Cache cache = getCache();
     Result result;
     CompositeResultData gcResultTable = ResultBuilder.createCompositeResultData();
     TabularResultData resultTable = gcResultTable.addSection().addTable("Table1");
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GetCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GetCommand.java
index b1f7d43..16b3c2f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GetCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GetCommand.java
@@ -25,6 +25,7 @@ import org.apache.shiro.subject.Subject;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.cache.InternalCache;
@@ -55,8 +56,8 @@ public class GetCommand extends GfshCommand {
           specifiedDefaultValue = "true",
           help = CliStrings.GET__LOAD__HELP) Boolean loadOnCacheMiss) {
 
-    InternalCache cache = getCache();
-    cache.getSecurityService().authorize(Resource.DATA, Operation.READ, regionPath, key);
+    Cache cache = getCache();
+    authorize(Resource.DATA, Operation.READ, regionPath, key);
     DataCommandResult dataResult;
 
     @SuppressWarnings("rawtypes")
@@ -72,7 +73,7 @@ public class GetCommand extends GfshCommand {
         request.setRegionName(regionPath);
         request.setValueClass(valueClass);
         request.setLoadOnCacheMiss(loadOnCacheMiss);
-        Subject subject = cache.getSecurityService().getSubject();
+        Subject subject = getSubject();
         if (subject != null) {
           request.setPrincipal(subject.getPrincipal());
         }
@@ -83,7 +84,8 @@ public class GetCommand extends GfshCommand {
             false);
       }
     } else {
-      dataResult = getfn.get(null, key, keyClass, valueClass, regionPath, loadOnCacheMiss, cache);
+      dataResult = getfn.get(null, key, keyClass, valueClass, regionPath, loadOnCacheMiss,
+          (InternalCache) cache);
     }
     dataResult.setKeyClass(keyClass);
     if (valueClass != null) {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GfshCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GfshCommand.java
index 2beeb7a..91fa157 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GfshCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/GfshCommand.java
@@ -19,6 +19,7 @@ import java.util.List;
 import java.util.Objects;
 import java.util.Set;
 
+import org.apache.shiro.subject.Subject;
 import org.springframework.shell.core.CommandMarker;
 
 import org.apache.geode.cache.Cache;
@@ -26,11 +27,11 @@ import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.Function;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.cache.execute.ResultCollector;
+import org.apache.geode.distributed.ClusterConfigurationService;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.distributed.internal.InternalClusterConfigurationService;
 import org.apache.geode.distributed.internal.InternalLocator;
 import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.internal.security.SecurityService;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.CliUtil;
@@ -39,6 +40,7 @@ import org.apache.geode.management.internal.cli.functions.CliFunctionResult;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
 import org.apache.geode.management.internal.cli.shell.Gfsh;
 import org.apache.geode.management.internal.configuration.domain.XmlEntity;
+import org.apache.geode.security.ResourcePermission;
 
 /**
  * Encapsulates common functionality for implementing command classes for the Geode shell (gfsh).
@@ -55,7 +57,7 @@ public abstract class GfshCommand implements CommandMarker {
     this.cache = (InternalCache) cache;
   }
 
-  public InternalCache getCache() {
+  public Cache getCache() {
     return cache;
   }
 
@@ -65,7 +67,7 @@ public abstract class GfshCommand implements CommandMarker {
     return getGfsh() != null && getGfsh().isConnectedAndReady();
   }
 
-  public InternalClusterConfigurationService getSharedConfiguration() {
+  public InternalClusterConfigurationService getConfigurationService() {
     InternalLocator locator = InternalLocator.getLocator();
     return locator == null ? null : locator.getSharedConfiguration();
   }
@@ -74,7 +76,7 @@ public abstract class GfshCommand implements CommandMarker {
     if (result == null) {
       throw new IllegalArgumentException("Result should not be null");
     }
-    InternalClusterConfigurationService sc = getSharedConfiguration();
+    InternalClusterConfigurationService sc = getConfigurationService();
     if (sc == null) {
       result.setCommandPersisted(false);
     } else {
@@ -96,8 +98,23 @@ public abstract class GfshCommand implements CommandMarker {
     return getGfsh() != null;
   }
 
-  public SecurityService getSecurityService() {
-    return getCache().getSecurityService();
+  public void authorize(ResourcePermission.Resource resource,
+      ResourcePermission.Operation operation, ResourcePermission.Target target) {
+    cache.getSecurityService().authorize(resource, operation, target);
+  }
+
+  public void authorize(ResourcePermission.Resource resource,
+      ResourcePermission.Operation operation, String target) {
+    cache.getSecurityService().authorize(resource, operation, target);
+  }
+
+  public void authorize(ResourcePermission.Resource resource,
+      ResourcePermission.Operation operation, String target, String key) {
+    cache.getSecurityService().authorize(resource, operation, target, key);
+  }
+
+  public Subject getSubject() {
+    return cache.getSecurityService().getSubject();
   }
 
   public Gfsh getGfsh() {
@@ -121,7 +138,7 @@ public abstract class GfshCommand implements CommandMarker {
    * this will return the member found or null if no member with that name
    */
   public DistributedMember findMember(final String memberName) {
-    return CliUtil.getDistributedMemberByNameOrId(memberName, getCache());
+    return CliUtil.getDistributedMemberByNameOrId(memberName, (InternalCache) getCache());
   }
 
   /**
@@ -146,7 +163,7 @@ public abstract class GfshCommand implements CommandMarker {
    * if no members matches these names, an empty set would return, this does not include locators
    */
   public Set<DistributedMember> findMembers(String[] groups, String[] members) {
-    return CliUtil.findMembers(groups, members, getCache());
+    return CliUtil.findMembers(groups, members, (InternalCache) getCache());
   }
 
   /**
@@ -164,7 +181,7 @@ public abstract class GfshCommand implements CommandMarker {
    * if no members matches these names, an empty set would return
    */
   public Set<DistributedMember> findMembersIncludingLocators(String[] groups, String[] members) {
-    return CliUtil.findMembersIncludingLocators(groups, members, getCache());
+    return CliUtil.findMembersIncludingLocators(groups, members, (InternalCache) getCache());
   }
 
   /**
@@ -207,6 +224,6 @@ public abstract class GfshCommand implements CommandMarker {
   }
 
   public Set<DistributedMember> findMembersWithAsyncEventQueue(String queueId) {
-    return CliUtil.getMembersWithAsyncEventQueue(getCache(), queueId);
+    return CliUtil.getMembersWithAsyncEventQueue((InternalCache) getCache(), queueId);
   }
 }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ImportDataCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ImportDataCommand.java
index 985f0de..31e5c4d 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ImportDataCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ImportDataCommand.java
@@ -55,7 +55,7 @@ public class ImportDataCommand extends GfshCommand {
           specifiedDefaultValue = "true",
           help = CliStrings.IMPORT_DATA__PARALLEL_HELP) boolean parallel) {
 
-    getSecurityService().authorize(Resource.DATA, Operation.WRITE, regionName);
+    authorize(Resource.DATA, Operation.WRITE, regionName);
 
     final DistributedMember targetMember = getMember(memberNameOrId);
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListClientCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListClientCommand.java
index d169faa..b413aec 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListClientCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListClientCommand.java
@@ -24,7 +24,6 @@ import javax.management.ObjectName;
 
 import org.springframework.shell.core.annotation.CliCommand;
 
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.CacheServerMXBean;
 import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
@@ -51,8 +50,7 @@ public class ListClientCommand extends GfshCommand {
     String headerText = "ClientList";
     resultTable = resultTable.setHeader(headerText);
 
-    InternalCache cache = getCache();
-    ManagementService service = ManagementService.getExistingManagementService(cache);
+    ManagementService service = getManagementService();
     ObjectName[] cacheServers = service.getDistributedSystemMXBean().listCacheServerObjectNames();
 
     if (cacheServers.length == 0) {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDiskStoresCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDiskStoresCommand.java
index cdb6a94..ca0bbba 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDiskStoresCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListDiskStoresCommand.java
@@ -25,6 +25,7 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.Result;
@@ -43,7 +44,8 @@ public class ListDiskStoresCommand extends GfshCommand {
   @ResourceOperation(resource = ResourcePermission.Resource.CLUSTER,
       operation = ResourcePermission.Operation.READ)
   public Result listDiskStores() {
-    Set<DistributedMember> dataMembers = DiskStoreCommandsUtils.getNormalMembers(getCache());
+    Set<DistributedMember> dataMembers =
+        DiskStoreCommandsUtils.getNormalMembers((InternalCache) getCache());
 
     if (dataMembers.isEmpty()) {
       return ResultBuilder.createInfoResult(CliStrings.NO_CACHING_MEMBERS_FOUND_MESSAGE);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListGatewayCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListGatewayCommand.java
index 793a48a..293746e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListGatewayCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ListGatewayCommand.java
@@ -25,11 +25,9 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.DistributedSystemMXBean;
 import org.apache.geode.management.GatewayReceiverMXBean;
 import org.apache.geode.management.GatewaySenderMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -57,9 +55,7 @@ public class ListGatewayCommand extends GfshCommand {
       throws Exception {
 
     Result result;
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     Set<DistributedMember> dsMembers = findMembers(onGroup, onMember);
 
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 f7b775b..ba4afd6 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
@@ -54,7 +54,7 @@ public class ListJndiBindingCommand extends GfshCommand {
     TabularResultData configTable = null;
     TabularResultData memberTable = null;
 
-    InternalClusterConfigurationService ccService = getSharedConfiguration();
+    InternalClusterConfigurationService ccService = getConfigurationService();
     if (ccService != null) {
       configTable = resultSection.addTable();
       configTable.setHeader("Configured JNDI bindings: ");
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LoadBalanceGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LoadBalanceGatewaySenderCommand.java
index cf14a7b..ed7b000 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LoadBalanceGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LoadBalanceGatewaySenderCommand.java
@@ -22,10 +22,9 @@ import javax.management.ObjectName;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewaySenderMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -52,9 +51,8 @@ public class LoadBalanceGatewaySenderCommand extends GfshCommand {
       senderId = senderId.trim();
     }
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    Cache cache = getCache();
+    SystemManagementService service = (SystemManagementService) getManagementService();
     TabularResultData resultData = ResultBuilder.createTabularResultData();
     Set<DistributedMember> dsMembers = getAllNormalMembers();
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LocateEntryCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LocateEntryCommand.java
index 5ff5817..c1fe343 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LocateEntryCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/LocateEntryCommand.java
@@ -52,7 +52,7 @@ public class LocateEntryCommand extends GfshCommand {
           help = CliStrings.LOCATE_ENTRY__RECURSIVE__HELP, specifiedDefaultValue = "true",
           unspecifiedDefaultValue = "false") boolean recursive) {
 
-    getSecurityService().authorize(Resource.DATA, Operation.READ, regionPath, key);
+    authorize(Resource.DATA, Operation.READ, regionPath, key);
 
     DataCommandResult dataResult;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PauseGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PauseGatewaySenderCommand.java
index ad17ba3..e3a28d0 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PauseGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PauseGatewaySenderCommand.java
@@ -22,10 +22,9 @@ import javax.management.ObjectName;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewaySenderMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -59,9 +58,8 @@ public class PauseGatewaySenderCommand extends GfshCommand {
       senderId = senderId.trim();
     }
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    Cache cache = getCache();
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     GatewaySenderMXBean bean;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PutCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PutCommand.java
index d792078..1340618 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PutCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/PutCommand.java
@@ -24,6 +24,7 @@ import org.apache.commons.collections.CollectionUtils;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.cache.InternalCache;
@@ -58,8 +59,8 @@ public class PutCommand extends GfshCommand {
           specifiedDefaultValue = "true",
           unspecifiedDefaultValue = "false") boolean putIfNotExists) {
 
-    InternalCache cache = getCache();
-    cache.getSecurityService().authorize(Resource.DATA, Operation.WRITE, regionPath);
+    Cache cache = getCache();
+    authorize(Resource.DATA, Operation.WRITE, regionPath);
     DataCommandResult dataResult;
 
     @SuppressWarnings("rawtypes")
@@ -84,7 +85,7 @@ public class PutCommand extends GfshCommand {
       }
     } else {
       dataResult = putfn.put(key, value, putIfNotExists || putIfAbsent, keyClass, valueClass,
-          regionPath, cache);
+          regionPath, (InternalCache) cache);
     }
     dataResult.setKeyClass(keyClass);
     if (valueClass != null) {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommand.java
index 69d6985..c57174d 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/QueryCommand.java
@@ -27,6 +27,7 @@ import org.apache.shiro.subject.Subject;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.FunctionService;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.query.QueryInvalidException;
@@ -67,7 +68,7 @@ public class QueryCommand extends GfshCommand {
   }
 
   private DataCommandResult select(String query) {
-    InternalCache cache = getCache();
+    Cache cache = getCache();
     DataCommandResult dataResult;
 
     if (StringUtils.isEmpty(query)) {
@@ -94,19 +95,19 @@ public class QueryCommand extends GfshCommand {
 
       // authorize data read on these regions
       for (String region : regions) {
-        cache.getSecurityService().authorize(Resource.DATA, Operation.READ, region);
+        authorize(Resource.DATA, Operation.READ, region);
       }
 
       regionsInQuery = Collections.unmodifiableSet(regions);
       if (regionsInQuery.size() > 0) {
         Set<DistributedMember> members =
-            CliUtil.getQueryRegionsAssociatedMembers(regionsInQuery, cache, false);
+            CliUtil.getQueryRegionsAssociatedMembers(regionsInQuery, (InternalCache) cache, false);
         if (members != null && members.size() > 0) {
           DataCommandFunction function = new DataCommandFunction();
           DataCommandRequest request = new DataCommandRequest();
           request.setCommand(CliStrings.QUERY);
           request.setQuery(query);
-          Subject subject = cache.getSecurityService().getSubject();
+          Subject subject = getSubject();
           if (subject != null) {
             request.setPrincipal(subject.getPrincipal());
           }
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RebalanceCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RebalanceCommand.java
index d5a66b0..7b643ca 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RebalanceCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RebalanceCommand.java
@@ -81,8 +81,8 @@ public class RebalanceCommand extends GfshCommand {
     List<Future<Result>> commandResult = new ArrayList<>();
     Result result;
     try {
-      commandResult.add(commandExecutors.submit(
-          new ExecuteRebalanceWithTimeout(includeRegions, excludeRegions, simulate, getCache())));
+      commandResult.add(commandExecutors.submit(new ExecuteRebalanceWithTimeout(includeRegions,
+          excludeRegions, simulate, (InternalCache) getCache())));
 
       Future<Result> fs = commandResult.get(0);
       if (timeout > 0) {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RemoveCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RemoveCommand.java
index 4f76684..f7b9724 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RemoveCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/RemoveCommand.java
@@ -25,6 +25,7 @@ import org.apache.commons.collections.CollectionUtils;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.Region;
 import org.apache.geode.distributed.DistributedMember;
 import org.apache.geode.internal.cache.InternalCache;
@@ -53,16 +54,16 @@ public class RemoveCommand extends GfshCommand {
           specifiedDefaultValue = "true", unspecifiedDefaultValue = "false") boolean removeAllKeys,
       @CliOption(key = {CliStrings.REMOVE__KEYCLASS},
           help = CliStrings.REMOVE__KEYCLASS__HELP) String keyClass) {
-    InternalCache cache = getCache();
+    Cache cache = getCache();
 
     if (!removeAllKeys && (key == null)) {
       return createUserErrorResult(CliStrings.REMOVE__MSG__KEY_EMPTY);
     }
 
     if (removeAllKeys) {
-      cache.getSecurityService().authorize(Resource.DATA, Operation.WRITE, regionPath);
+      authorize(Resource.DATA, Operation.WRITE, regionPath);
     } else {
-      cache.getSecurityService().authorize(Resource.DATA, Operation.WRITE, regionPath, key);
+      authorize(Resource.DATA, Operation.WRITE, regionPath, key);
     }
 
     Region region = cache.getRegion(regionPath);
@@ -83,7 +84,8 @@ public class RemoveCommand extends GfshCommand {
       request.setRegionName(regionPath);
       dataResult = callFunctionForRegion(request, removefn, memberList);
     } else {
-      dataResult = removefn.remove(key, keyClass, regionPath, removeAllKeys ? "ALL" : null, cache);
+      dataResult = removefn.remove(key, keyClass, regionPath, removeAllKeys ? "ALL" : null,
+          (InternalCache) cache);
     }
 
     dataResult.setKeyClass(keyClass);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ResumeGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ResumeGatewaySenderCommand.java
index d95c7b8..991f77f 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ResumeGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ResumeGatewaySenderCommand.java
@@ -22,10 +22,9 @@ import javax.management.ObjectName;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewaySenderMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -58,9 +57,8 @@ public class ResumeGatewaySenderCommand extends GfshCommand {
       senderId = senderId.trim();
     }
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    Cache cache = getCache();
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     GatewaySenderMXBean bean;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockCommand.java
index e06a59e..7d4a464 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowDeadlockCommand.java
@@ -27,7 +27,6 @@ import org.apache.geode.distributed.internal.deadlock.DeadlockDetector;
 import org.apache.geode.distributed.internal.deadlock.Dependency;
 import org.apache.geode.distributed.internal.deadlock.DependencyGraph;
 import org.apache.geode.distributed.internal.deadlock.GemFireDeadlockDetector;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.i18n.CliStrings;
@@ -51,8 +50,6 @@ public class ShowDeadlockCommand extends GfshCommand {
         return ResultBuilder
             .createUserErrorResult(CliStrings.format(CliStrings.INVALID_FILE_EXTENSION, ".txt"));
       }
-      InternalCache cache = getCache();
-
       Set<DistributedMember> allMembers = getAllMembers();
       GemFireDeadlockDetector gfeDeadLockDetector = new GemFireDeadlockDetector(allMembers);
       DependencyGraph dependencyGraph = gfeDeadLockDetector.find();
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowLogCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowLogCommand.java
index 838f49a..b42b387 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowLogCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowLogCommand.java
@@ -20,9 +20,8 @@ import javax.management.ObjectName;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.MemberMXBean;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
@@ -46,11 +45,8 @@ public class ShowLogCommand extends GfshCommand {
           help = CliStrings.SHOW_LOG_MEMBER_HELP, mandatory = true) String memberNameOrId,
       @CliOption(key = CliStrings.SHOW_LOG_LINE_NUM, unspecifiedDefaultValue = "0",
           help = CliStrings.SHOW_LOG_LINE_NUM_HELP) int numberOfLines) {
-    Result result;
-
-    InternalCache cache = getCache();
     DistributedMember targetMember = getMember(memberNameOrId);
-    MemberMXBean targetMemberMXBean = getMemberMxBean(cache, targetMember);
+    MemberMXBean targetMemberMXBean = getMemberMxBean(targetMember);
 
     if (numberOfLines > ManagementConstants.MAX_SHOW_LOG_LINES) {
       numberOfLines = ManagementConstants.MAX_SHOW_LOG_LINES;
@@ -76,11 +72,10 @@ public class ShowLogCommand extends GfshCommand {
     return ResultBuilder.buildResult(resultData);
   }
 
-  public MemberMXBean getMemberMxBean(InternalCache cache, DistributedMember targetMember) {
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+  public MemberMXBean getMemberMxBean(DistributedMember targetMember) {
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
-    if (cache.getDistributedSystem().getDistributedMember().equals(targetMember)) {
+    if (getCache().getDistributedSystem().getDistributedMember().equals(targetMember)) {
       return service.getMemberMXBean();
     } else {
       ObjectName objectName = service.getMemberMBeanName(targetMember);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMetricsCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMetricsCommand.java
index e1d35b9..1322b75 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMetricsCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMetricsCommand.java
@@ -30,7 +30,6 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.CacheServerMXBean;
 import org.apache.geode.management.DistributedRegionMXBean;
 import org.apache.geode.management.DistributedSystemMXBean;
@@ -143,8 +142,7 @@ public class ShowMetricsCommand extends GfshCommand {
    */
   private ResultData getSystemWideMetrics(String export_to_report_to, String[] categoriesArr,
       StringBuilder csvBuilder) {
-    final InternalCache cache = getCache();
-    final ManagementService managementService = ManagementService.getManagementService(cache);
+    final ManagementService managementService = getManagementService();
     DistributedSystemMXBean dsMxBean = managementService.getDistributedSystemMXBean();
     if (dsMxBean == null) {
       String errorMessage =
@@ -180,9 +178,8 @@ public class ShowMetricsCommand extends GfshCommand {
   private ResultData getMemberMetrics(DistributedMember distributedMember,
       String export_to_report_to, String[] categoriesArr, int cacheServerPort,
       StringBuilder csvBuilder) throws ResultDataException {
-    final InternalCache cache = getCache();
     final SystemManagementService managementService =
-        (SystemManagementService) ManagementService.getManagementService(cache);
+        (SystemManagementService) getManagementService();
 
     ObjectName memberMBeanName = managementService.getMemberMBeanName(distributedMember);
     MemberMXBean memberMxBean =
@@ -243,8 +240,7 @@ public class ShowMetricsCommand extends GfshCommand {
   private ResultData getDistributedRegionMetrics(String regionName, String export_to_report_to,
       String[] categoriesArr, StringBuilder csvBuilder) throws ResultDataException {
 
-    final InternalCache cache = getCache();
-    final ManagementService managementService = ManagementService.getManagementService(cache);
+    final ManagementService managementService = getManagementService();
 
     DistributedRegionMXBean regionMxBean = managementService.getDistributedRegionMXBean(regionName);
 
@@ -285,9 +281,8 @@ public class ShowMetricsCommand extends GfshCommand {
       DistributedMember distributedMember, String export_to_report_to, String[] categoriesArr,
       StringBuilder csvBuilder) throws ResultDataException {
 
-    final InternalCache cache = getCache();
     final SystemManagementService managementService =
-        (SystemManagementService) ManagementService.getManagementService(cache);
+        (SystemManagementService) getManagementService();
 
     ObjectName regionMBeanName =
         managementService.getRegionMBeanName(distributedMember, regionName);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommand.java
index e637fb1..472cb41 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShowMissingDiskStoreCommand.java
@@ -26,6 +26,7 @@ import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.cache.execute.AbstractExecution;
 import org.apache.geode.internal.cache.partitioned.ColocatedRegionDetails;
 import org.apache.geode.internal.cache.persistence.PersistentMemberPattern;
@@ -49,7 +50,8 @@ public class ShowMissingDiskStoreCommand extends GfshCommand {
   public Result showMissingDiskStore() {
 
     try {
-      Set<DistributedMember> dataMembers = DiskStoreCommandsUtils.getNormalMembers(getCache());
+      Set<DistributedMember> dataMembers =
+          DiskStoreCommandsUtils.getNormalMembers((InternalCache) getCache());
 
       if (dataMembers.isEmpty()) {
         return ResultBuilder.createInfoResult(CliStrings.NO_CACHING_MEMBERS_FOUND_MESSAGE);
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShutdownCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShutdownCommand.java
index 2848423..2f874d3 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShutdownCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/ShutdownCommand.java
@@ -68,7 +68,7 @@ public class ShutdownCommand extends GfshCommand {
 
       // convert to milliseconds
       long timeout = userSpecifiedTimeout * 1000;
-      InternalCache cache = getCache();
+      InternalCache cache = (InternalCache) getCache();
       int numDataNodes = getAllNormalMembers().size();
       Set<DistributedMember> locators = getAllMembers();
       Set<DistributedMember> dataNodes = getAllNormalMembers();
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewayReceiverCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewayReceiverCommand.java
index 58d0a3c..8cbdc73 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewayReceiverCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewayReceiverCommand.java
@@ -23,9 +23,7 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewayReceiverMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -54,9 +52,7 @@ public class StartGatewayReceiverCommand extends GfshCommand {
       throws Exception {
     Result result;
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     GatewayReceiverMXBean receiverBean;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
index edc733d..e7ab86c 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StartGatewaySenderCommand.java
@@ -32,10 +32,9 @@ import javax.management.ObjectName;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewaySenderMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -67,9 +66,8 @@ public class StartGatewaySenderCommand extends GfshCommand {
     Result result;
     final String id = senderId.trim();
 
-    final InternalCache cache = getCache();
-    final SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    final Cache cache = getCache();
+    final SystemManagementService service = (SystemManagementService) getManagementService();
 
     TabularResultData resultData = ResultBuilder.createTabularResultData();
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusClusterConfigServiceCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusClusterConfigServiceCommand.java
index cf4d232..e9940b7 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusClusterConfigServiceCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusClusterConfigServiceCommand.java
@@ -46,7 +46,7 @@ public class StatusClusterConfigServiceCommand extends GfshCommand {
   @CliMetaData(relatedTopic = CliStrings.TOPIC_GEODE_LOCATOR)
   @ResourceOperation(resource = Resource.CLUSTER, operation = Operation.READ)
   public Result statusSharedConfiguration() {
-    final InternalCache cache = getCache();
+    final InternalCache cache = (InternalCache) getCache();
     final Set<DistributedMember> locators = new HashSet<>(
         cache.getDistributionManager().getAllHostedLocatorsWithSharedConfiguration().keySet());
     if (locators.isEmpty()) {
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewayReceiverCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewayReceiverCommand.java
index ae65535..c4fa0e2 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewayReceiverCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewayReceiverCommand.java
@@ -23,9 +23,7 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewayReceiverMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -54,9 +52,7 @@ public class StatusGatewayReceiverCommand extends GfshCommand {
 
     Result result;
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     CompositeResultData crd = ResultBuilder.createCompositeResultData();
     TabularResultData availableReceiverData =
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewaySenderCommand.java
index fe76a3a..3854644 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StatusGatewaySenderCommand.java
@@ -22,10 +22,9 @@ import javax.management.ObjectName;
 import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewaySenderMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -59,9 +58,8 @@ public class StatusGatewaySenderCommand extends GfshCommand {
       senderId = senderId.trim();
     }
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    Cache cache = getCache();
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     GatewaySenderMXBean bean;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewayReceiverCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewayReceiverCommand.java
index 5f711b5..ee63419 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewayReceiverCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewayReceiverCommand.java
@@ -23,9 +23,7 @@ import org.springframework.shell.core.annotation.CliCommand;
 import org.springframework.shell.core.annotation.CliOption;
 
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.management.GatewayReceiverMXBean;
-import org.apache.geode.management.ManagementService;
 import org.apache.geode.management.cli.CliMetaData;
 import org.apache.geode.management.cli.ConverterHint;
 import org.apache.geode.management.cli.Result;
@@ -53,9 +51,7 @@ public class StopGatewayReceiverCommand extends GfshCommand {
 
     Result result;
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     GatewayReceiverMXBean receiverBean;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewaySenderCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewaySenderCommand.java
index 1769e38..3652391 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewaySenderCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/StopGatewaySenderCommand.java
@@ -59,9 +59,8 @@ public class StopGatewaySenderCommand extends GfshCommand {
       senderId = senderId.trim();
     }
 
-    InternalCache cache = getCache();
-    SystemManagementService service =
-        (SystemManagementService) ManagementService.getExistingManagementService(cache);
+    InternalCache cache = (InternalCache) getCache();
+    SystemManagementService service = (SystemManagementService) getManagementService();
 
     GatewaySenderMXBean bean;
 
diff --git a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/UndeployCommand.java b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/UndeployCommand.java
index f45f008..929645e 100644
--- a/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/UndeployCommand.java
+++ b/geode-core/src/main/java/org/apache/geode/management/internal/cli/commands/UndeployCommand.java
@@ -99,7 +99,7 @@ public class UndeployCommand extends GfshCommand {
       Result result = ResultBuilder.buildResult(tabularData);
       if (tabularData.getStatus().equals(Result.Status.OK)) {
         persistClusterConfiguration(result,
-            () -> getSharedConfiguration().removeJars(jars, groups));
+            () -> getConfigurationService().removeJars(jars, groups));
       }
       return result;
     } catch (VirtualMachineError e) {
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommandTest.java
index d5658e7..2eaf7cb 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/AlterAsyncEventQueueCommandTest.java
@@ -61,7 +61,7 @@ public class AlterAsyncEventQueueCommandTest {
   public void before() throws Exception {
     command = spy(AlterAsyncEventQueueCommand.class);
     service = mock(InternalClusterConfigurationService.class);
-    doReturn(service).when(command).getSharedConfiguration();
+    doReturn(service).when(command).getConfigurationService();
     configRegion = mock(Region.class);
     when(service.getConfigurationRegion()).thenReturn(configRegion);
     when(service.lockSharedConfiguration()).thenReturn(true);
@@ -111,7 +111,7 @@ public class AlterAsyncEventQueueCommandTest {
 
   @Test
   public void cluster_config_service_not_available() throws Exception {
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     gfsh.executeAndAssertThat(command, "alter async-event-queue --id=test --batch-size=100")
         .statusIsError().containsOutput("Cluster Configuration Service is not available");
   }
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommandTest.java
index f448e6e..85a73f5 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ConfigurePDXCommandTest.java
@@ -74,7 +74,7 @@ public class ConfigurePDXCommandTest {
     doReturn(xmlEntity).when(command).createXmlEntity(any());
     doReturn(cacheCreation).when(command).getCacheCreation(anyBoolean());
     doReturn(Collections.emptySet()).when(command).getAllNormalMembers();
-    doReturn(clusterConfigurationService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigurationService).when(command).getConfigurationService();
   }
 
   @Test
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommandTest.java
index 206a2c7..6465d7b 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateAsyncEventQueueCommandTest.java
@@ -68,7 +68,7 @@ public class CreateAsyncEventQueueCommandTest {
   public void before() throws Exception {
     command = spy(CreateAsyncEventQueueCommand.class);
     service = mock(InternalClusterConfigurationService.class);
-    doReturn(service).when(command).getSharedConfiguration();
+    doReturn(service).when(command).getConfigurationService();
   }
 
   @Test
@@ -188,7 +188,7 @@ public class CreateAsyncEventQueueCommandTest {
 
   @Test
   public void command_succeeded_but_no_cluster_config_service() throws Exception {
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     doReturn(Collections.emptySet()).when(command).getMembers(any(), any());
 
     List<CliFunctionResult> functionResults = new ArrayList<>();
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
index 99f5718..002d254 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateDefinedIndexesCommandTest.java
@@ -89,7 +89,7 @@ public class CreateDefinedIndexesCommandTest {
     InternalClusterConfigurationService mockService =
         mock(InternalClusterConfigurationService.class);
 
-    doReturn(mockService).when(command).getSharedConfiguration();
+    doReturn(mockService).when(command).getConfigurationService();
     doReturn(Collections.singleton(member)).when(command).findMembers(any(), any());
     doReturn(Arrays.asList(new CliFunctionResult(member.getId(), new Exception("MockException"),
         "Exception Message."))).when(resultCollector).getResult();
@@ -110,7 +110,7 @@ public class CreateDefinedIndexesCommandTest {
     InternalClusterConfigurationService mockService =
         mock(InternalClusterConfigurationService.class);
 
-    doReturn(mockService).when(command).getSharedConfiguration();
+    doReturn(mockService).when(command).getConfigurationService();
     doReturn(Collections.singleton(member)).when(command).findMembers(any(), any());
     doReturn(Arrays.asList(new CliFunctionResult(member.getId(), xmlEntity))).when(resultCollector)
         .getResult();
@@ -145,7 +145,7 @@ public class CreateDefinedIndexesCommandTest {
     CliFunctionResult member2Region2Result =
         new CliFunctionResult(member2.getId(), xmlEntityRegion2);
 
-    doReturn(mockService).when(command).getSharedConfiguration();
+    doReturn(mockService).when(command).getConfigurationService();
     doReturn(new HashSet<>(Arrays.asList(new DistributedMember[] {member1, member2}))).when(command)
         .findMembers(any(), any());
     doReturn(Arrays.asList(new CliFunctionResult[] {member1Region1Result, member1Region2Result,
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommandTest.java
index 384bcbb..49ef4e0 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewayReceiverCommandTest.java
@@ -61,7 +61,7 @@ public class CreateGatewayReceiverCommandTest {
     xmlEntity = mock(XmlEntity.class);
     cache = mock(InternalCache.class);
     doReturn(cache).when(command).getCache();
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     functionResults = new ArrayList<>();
     doReturn(functionResults).when(command).executeAndGetFunctionResult(any(), any(),
         any(Set.class));
@@ -92,7 +92,7 @@ public class CreateGatewayReceiverCommandTest {
   @Test
   public void whenNoCCService() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", xmlEntity, "result1");
     functionResults.add(result1);
     gfsh.executeAndAssertThat(command, "create gateway-receiver").statusIsSuccess()
@@ -103,7 +103,7 @@ public class CreateGatewayReceiverCommandTest {
   @Test
   public void whenCommandOnMember() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", xmlEntity, "result1");
     functionResults.add(result1);
     gfsh.executeAndAssertThat(command, "create gateway-receiver --member=xyz").statusIsSuccess()
@@ -114,7 +114,7 @@ public class CreateGatewayReceiverCommandTest {
   @Test
   public void whenNoXml() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", false, "result1");
     functionResults.add(result1);
 
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommandTest.java
index b24792f..6456354 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateGatewaySenderCommandTest.java
@@ -65,7 +65,7 @@ public class CreateGatewaySenderCommandTest {
     xmlEntity = mock(XmlEntity.class);
     cache = mock(InternalCache.class);
     doReturn(cache).when(command).getCache();
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     functionResults = new ArrayList<>();
     doReturn(functionResults).when(command).executeAndGetFunctionResult(any(), any(),
         any(Set.class));
@@ -119,7 +119,7 @@ public class CreateGatewaySenderCommandTest {
   @Test
   public void whenNoCCService() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", xmlEntity, "result1");
     functionResults.add(result1);
     gfsh.executeAndAssertThat(command,
@@ -131,7 +131,7 @@ public class CreateGatewaySenderCommandTest {
   @Test
   public void whenCommandOnMember() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", xmlEntity, "result1");
     functionResults.add(result1);
     gfsh.executeAndAssertThat(command,
@@ -143,7 +143,7 @@ public class CreateGatewaySenderCommandTest {
   @Test
   public void whenNoXml() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", false, "result1");
     functionResults.add(result1);
 
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommandTest.java
index 8e0de90..5f0e4ff 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateJndiBindingCommandTest.java
@@ -103,7 +103,7 @@ public class CreateJndiBindingCommandTest {
     CacheConfig cacheConfig = mock(CacheConfig.class);
     JndiBindingsType.JndiBinding existingBinding = mock(JndiBindingsType.JndiBinding.class);
 
-    doReturn(clusterConfigService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigService).when(command).getConfigurationService();
     doReturn(cacheConfig).when(clusterConfigService).getCacheConfig(any());
     doReturn(existingBinding).when(clusterConfigService).findIdentifiable(any(), any());
 
@@ -120,7 +120,7 @@ public class CreateJndiBindingCommandTest {
     CacheConfig cacheConfig = mock(CacheConfig.class);
     JndiBindingsType.JndiBinding existingBinding = mock(JndiBindingsType.JndiBinding.class);
 
-    doReturn(clusterConfigService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigService).when(command).getConfigurationService();
     doReturn(cacheConfig).when(clusterConfigService).getCacheConfig(any());
     doReturn(existingBinding).when(clusterConfigService).findIdentifiable(any(), any());
 
@@ -138,7 +138,7 @@ public class CreateJndiBindingCommandTest {
     CacheConfig cacheConfig = mock(CacheConfig.class);
     JndiBindingsType.JndiBinding existingBinding = mock(JndiBindingsType.JndiBinding.class);
 
-    doReturn(clusterConfigService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigService).when(command).getConfigurationService();
     doReturn(cacheConfig).when(clusterConfigService).getCacheConfig(any());
     doReturn(existingBinding).when(clusterConfigService).findIdentifiable(any(), any());
 
@@ -155,7 +155,7 @@ public class CreateJndiBindingCommandTest {
     CacheConfig cacheConfig = mock(CacheConfig.class);
     JndiBindingsType.JndiBinding existingBinding = mock(JndiBindingsType.JndiBinding.class);
 
-    doReturn(clusterConfigService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigService).when(command).getConfigurationService();
     doReturn(cacheConfig).when(clusterConfigService).getCacheConfig(any());
     doReturn(existingBinding).when(clusterConfigService).findIdentifiable(any(), any());
 
@@ -169,7 +169,7 @@ public class CreateJndiBindingCommandTest {
   public void whenNoMembersFoundAndNoClusterConfigServiceRunningThenError() {
 
     doReturn(Collections.emptySet()).when(command).findMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
 
     gfsh.executeAndAssertThat(command,
         COMMAND + " --type=SIMPLE --name=name --jdbc-driver-class=driver --connection-url=url")
@@ -183,7 +183,7 @@ public class CreateJndiBindingCommandTest {
     CacheConfig cacheConfig = mock(CacheConfig.class);
 
     doReturn(Collections.emptySet()).when(command).findMembers(any(), any());
-    doReturn(clusterConfigService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigService).when(command).getConfigurationService();
     doReturn(cacheConfig).when(clusterConfigService).getCacheConfig(any());
     doReturn(null).when(clusterConfigService).findIdentifiable(any(), any());
 
@@ -208,7 +208,7 @@ public class CreateJndiBindingCommandTest {
     results.add(result);
 
     doReturn(members).when(command).findMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     doReturn(results).when(command).executeAndGetFunctionResult(any(), any(), any());
 
     gfsh.executeAndAssertThat(command,
@@ -248,7 +248,7 @@ public class CreateJndiBindingCommandTest {
     CacheConfig cacheConfig = mock(CacheConfig.class);
 
     doReturn(members).when(command).findMembers(any(), any());
-    doReturn(clusterConfigService).when(command).getSharedConfiguration();
+    doReturn(clusterConfigService).when(command).getConfigurationService();
     doReturn(results).when(command).executeAndGetFunctionResult(any(), any(), any());
     doReturn(cacheConfig).when(clusterConfigService).getCacheConfig(any());
     doReturn(null).when(clusterConfigService).findIdentifiable(any(), any());
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommandTest.java
index 6bb511f..089646b 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/CreateRegionCommandTest.java
@@ -157,7 +157,7 @@ public class CreateRegionCommandTest {
     doReturn(resultCollector).when(command).executeFunction(any(), any(), any(Set.class));
     when(resultCollector.getResult()).thenReturn(Collections.emptyList());
     DistributedSystemMXBean dsMBean = mock(DistributedSystemMXBean.class);
-    doReturn(dsMBean).when(command).getDSMBean(any());
+    doReturn(dsMBean).when(command).getDSMBean();
     doReturn(Collections.singleton(mock(DistributedMember.class))).when(command).findMembers(any(),
         any());
     doReturn(true).when(command).verifyDistributedRegionMbean(any(), any());
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommandTest.java
index 1fe2b12..2a16347 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyGatewaySenderCommandTest.java
@@ -60,7 +60,7 @@ public class DestroyGatewaySenderCommandTest {
     xmlEntity = mock(XmlEntity.class);
     cache = mock(InternalCache.class);
     doReturn(cache).when(command).getCache();
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     functionResults = new ArrayList<>();
     doReturn(functionResults).when(command).executeAndGetFunctionResult(any(), any(),
         any(Set.class));
@@ -115,7 +115,7 @@ public class DestroyGatewaySenderCommandTest {
   @Test
   public void whenNoCCService() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", xmlEntity, "result1");
     functionResults.add(result1);
     parser.executeAndAssertThat(command, "destroy gateway-sender --id=1").statusIsSuccess()
@@ -126,7 +126,7 @@ public class DestroyGatewaySenderCommandTest {
   @Test
   public void whenCommandOnMember() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", xmlEntity, "result1");
     functionResults.add(result1);
     parser.executeAndAssertThat(command, "destroy gateway-sender --member=xyz --id=1")
@@ -137,7 +137,7 @@ public class DestroyGatewaySenderCommandTest {
   @Test
   public void whenNoXml() {
     doReturn(mock(Set.class)).when(command).getMembers(any(), any());
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     result1 = new CliFunctionResult("member", false, "result1");
     functionResults.add(result1);
 
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommandTest.java
index dc4fe8e..62c93c2 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyJndiBindingCommandTest.java
@@ -69,7 +69,7 @@ public class DestroyJndiBindingCommandTest {
     doReturn(cache).when(command).getCache();
     cacheConfig = mock(CacheConfig.class);
     ccService = mock(InternalClusterConfigurationService.class);
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     when(ccService.getCacheConfig(any())).thenReturn(cacheConfig);
     doCallRealMethod().when(ccService).updateCacheConfig(any(), any());
     when(ccService.getConfigurationRegion()).thenReturn(mock(Region.class));
@@ -112,7 +112,7 @@ public class DestroyJndiBindingCommandTest {
   @Test
   public void whenNoMembersFoundAndNoClusterConfigServiceRunningThenError() {
     doReturn(Collections.emptySet()).when(command).findMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
 
     gfsh.executeAndAssertThat(command, COMMAND + " --name=name").statusIsSuccess()
         .containsOutput("No members found").hasFailToPersistError();
@@ -143,7 +143,7 @@ public class DestroyJndiBindingCommandTest {
     results.add(result);
 
     doReturn(members).when(command).findMembers(any(), any());
-    doReturn(null).when(command).getSharedConfiguration();
+    doReturn(null).when(command).getConfigurationService();
     doReturn(results).when(command).executeAndGetFunctionResult(any(), any(), any());
 
     gfsh.executeAndAssertThat(command, COMMAND + " --name=name").statusIsSuccess()
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommandTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommandTest.java
index 2c7a774..62db86a 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommandTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DestroyRegionCommandTest.java
@@ -61,7 +61,7 @@ public class DestroyRegionCommandTest {
     xmlEntity = mock(XmlEntity.class);
     command = spy(DestroyRegionCommand.class);
     ccService = mock(InternalClusterConfigurationService.class);
-    doReturn(ccService).when(command).getSharedConfiguration();
+    doReturn(ccService).when(command).getConfigurationService();
     doReturn(mock(InternalCache.class)).when(command).getCache();
 
     List<CliFunctionResult> functionResults = new ArrayList<>();
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
index 7ad3564..fd59094 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/DiskStoreCommandsJUnitTest.java
@@ -35,6 +35,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
@@ -381,7 +382,7 @@ public class DiskStoreCommandsJUnitTest {
     }
 
     @Override
-    public InternalCache getCache() {
+    public Cache getCache() {
       return this.cache;
     }
 
@@ -418,7 +419,7 @@ public class DiskStoreCommandsJUnitTest {
     }
 
     @Override
-    public InternalCache getCache() {
+    public Cache getCache() {
       return this.cache;
     }
 
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GfshCommandJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GfshCommandJUnitTest.java
index c281752..6194147 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GfshCommandJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/GfshCommandJUnitTest.java
@@ -64,14 +64,14 @@ public class GfshCommandJUnitTest {
 
   @Test
   public void persistClusterConfiguration() throws Exception {
-    when(command.getSharedConfiguration()).thenReturn(null);
+    when(command.getConfigurationService()).thenReturn(null);
     Result result = ResultBuilder.createInfoResult("info");
     Runnable runnable = mock(Runnable.class);
 
     command.persistClusterConfiguration(result, runnable);
     assertThat(result.failedToPersist()).isTrue();
 
-    when(command.getSharedConfiguration()).thenReturn(clusterConfigurationService);
+    when(command.getConfigurationService()).thenReturn(clusterConfigurationService);
     command.persistClusterConfiguration(result, runnable);
     assertThat(result.failedToPersist()).isFalse();
   }
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandJUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandJUnitTest.java
index a7ce9d3..0a0576c 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ListIndexCommandJUnitTest.java
@@ -34,6 +34,7 @@ import org.junit.Before;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.FunctionInvocationTargetException;
 import org.apache.geode.cache.execute.ResultCollector;
@@ -204,7 +205,7 @@ public class ListIndexCommandJUnitTest {
     }
 
     @Override
-    public InternalCache getCache() {
+    public Cache getCache() {
       return this.cache;
     }
 
diff --git a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
index 0a66d25..38cc43a 100644
--- a/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/management/internal/cli/commands/ShowLogCommandDUnitTest.java
@@ -34,9 +34,7 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 
-import org.apache.geode.cache.CacheFactory;
 import org.apache.geode.distributed.DistributedMember;
-import org.apache.geode.internal.cache.InternalCache;
 import org.apache.geode.internal.logging.LogService;
 import org.apache.geode.management.cli.Result;
 import org.apache.geode.management.internal.cli.CliUtil;
@@ -162,16 +160,16 @@ public class ShowLogCommandDUnitTest implements Serializable {
 
   private static boolean allMembersAreConnected() {
     return manager.getVM().invoke(() -> {
-      InternalCache cache = (InternalCache) CacheFactory.getAnyInstance();
       DistributedMember server1 =
           CliUtil.getDistributedMemberByNameOrId(SERVER1_NAME, ClusterStartupRule.getCache());
       DistributedMember server2 =
           CliUtil.getDistributedMemberByNameOrId(SERVER2_NAME, ClusterStartupRule.getCache());
 
       ShowLogCommand showLogCommand = new ShowLogCommand();
+      showLogCommand.setCache(ClusterStartupRule.getCache());
 
-      boolean server1isConnected = showLogCommand.getMemberMxBean(cache, server1) != null;
-      boolean server2isConnected = showLogCommand.getMemberMxBean(cache, server2) != null;
+      boolean server1isConnected = showLogCommand.getMemberMxBean(server1) != null;
+      boolean server2isConnected = showLogCommand.getMemberMxBean(server2) != null;
       return server1isConnected && server2isConnected;
     });
   }
diff --git a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
index 52cc1a2..56cecbb 100755
--- a/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
+++ b/geode-lucene/src/main/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommands.java
@@ -85,7 +85,7 @@ public class LuceneIndexCommands extends GfshCommand {
       specifiedDefaultValue = "true", unspecifiedDefaultValue = "false",
       help = LuceneCliStrings.LUCENE_LIST_INDEX__STATS__HELP) final boolean stats) {
 
-    getSecurityService().authorize(Resource.CLUSTER, Operation.READ, LucenePermission.TARGET);
+    authorize(Resource.CLUSTER, Operation.READ, LucenePermission.TARGET);
     return toTabularResult(getIndexListing(), stats);
   }
 
@@ -171,9 +171,9 @@ public class LuceneIndexCommands extends GfshCommand {
 
     Result result;
     // Every lucene index potentially writes to disk.
-    getSecurityService().authorize(Resource.CLUSTER, Operation.MANAGE, LucenePermission.TARGET);
+    authorize(Resource.CLUSTER, Operation.MANAGE, LucenePermission.TARGET);
 
-    final InternalCache cache = getCache();
+    final InternalCache cache = (InternalCache) getCache();
 
     // trim fields for any leading trailing spaces.
     String[] trimmedFields = Arrays.stream(fields).map(String::trim).toArray(String[]::new);
@@ -199,7 +199,7 @@ public class LuceneIndexCommands extends GfshCommand {
     result = ResultBuilder.buildResult(tabularResult);
     if (xmlEntity != null) {
       persistClusterConfiguration(result, () -> {
-        getSharedConfiguration().addXmlEntity(xmlEntity, null);
+        getConfigurationService().addXmlEntity(xmlEntity, null);
       });
     }
     return result;
@@ -217,7 +217,7 @@ public class LuceneIndexCommands extends GfshCommand {
           help = LuceneCliStrings.LUCENE_DESCRIBE_INDEX__REGION_HELP) final String regionPath)
       throws Exception {
 
-    getSecurityService().authorize(Resource.CLUSTER, Operation.READ, LucenePermission.TARGET);
+    authorize(Resource.CLUSTER, Operation.READ, LucenePermission.TARGET);
     LuceneIndexInfo indexInfo = new LuceneIndexInfo(indexName, regionPath);
     return toTabularResult(getIndexDetails(indexInfo), true);
   }
@@ -259,7 +259,7 @@ public class LuceneIndexCommands extends GfshCommand {
           unspecifiedDefaultValue = "false",
           help = LuceneCliStrings.LUCENE_SEARCH_INDEX__KEYSONLY__HELP) boolean keysOnly)
       throws Exception {
-    getSecurityService().authorize(Resource.DATA, Operation.READ, regionPath);
+    authorize(Resource.DATA, Operation.READ, regionPath);
     LuceneQueryInfo queryInfo =
         new LuceneQueryInfo(indexName, regionPath, queryString, defaultField, limit, keysOnly);
     int pageSize = Integer.MAX_VALUE;
@@ -283,7 +283,7 @@ public class LuceneIndexCommands extends GfshCommand {
           CliStrings.format(LuceneCliStrings.LUCENE_DESTROY_INDEX__MSG__INDEX_CANNOT_BE_EMPTY));
     }
 
-    getSecurityService().authorize(Resource.CLUSTER, Operation.MANAGE, LucenePermission.TARGET);
+    authorize(Resource.CLUSTER, Operation.MANAGE, LucenePermission.TARGET);
     Result result;
     List<CliFunctionResult> accumulatedResults = new ArrayList<>();
     final XmlEntity xmlEntity =
@@ -292,7 +292,7 @@ public class LuceneIndexCommands extends GfshCommand {
     if (xmlEntity != null) {
       persistClusterConfiguration(result, () -> {
         // Delete the xml entity to remove the index(es) in all groups
-        getSharedConfiguration().deleteXmlEntity(xmlEntity, null);
+        getConfigurationService().deleteXmlEntity(xmlEntity, null);
       });
     }
 
@@ -316,7 +316,6 @@ public class LuceneIndexCommands extends GfshCommand {
     // region members. Then send the function to the remaining members to handle the case where
     // the index has been created, but not the region
     XmlEntity xmlEntity = null;
-    InternalCache cache = getCache();
     Set<DistributedMember> regionMembers = findMembersForRegion(regionPath);
     Set<DistributedMember> normalMembers = getAllNormalMembers();
     LuceneDestroyIndexInfo indexInfo = new LuceneDestroyIndexInfo(indexName, regionPath);
@@ -497,7 +496,7 @@ public class LuceneIndexCommands extends GfshCommand {
   protected ResultCollector<?, ?> executeFunctionOnRegion(Function function,
       LuceneFunctionSerializable functionArguments, boolean returnAllMembers) {
     Set<DistributedMember> targetMembers = CliUtil.getRegionAssociatedMembers(
-        functionArguments.getRegionPath(), getCache(), returnAllMembers);
+        functionArguments.getRegionPath(), (InternalCache) getCache(), returnAllMembers);
     if (targetMembers.isEmpty()) {
       throw new UserErrorException(CliStrings.format(
           LuceneCliStrings.LUCENE_DESTROY_INDEX__MSG__COULDNOT_FIND_MEMBERS_FOR_REGION_0,
diff --git a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
index 07f1953..5bc5f0f 100644
--- a/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
+++ b/geode-lucene/src/test/java/org/apache/geode/cache/lucene/internal/cli/LuceneIndexCommandsJUnitTest.java
@@ -48,6 +48,7 @@ import org.junit.experimental.categories.Category;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
 
+import org.apache.geode.cache.Cache;
 import org.apache.geode.cache.execute.Execution;
 import org.apache.geode.cache.execute.ResultCollector;
 import org.apache.geode.cache.lucene.LuceneSerializer;
@@ -649,21 +650,15 @@ public class LuceneIndexCommandsJUnitTest {
 
   private static class LuceneTestIndexCommands extends LuceneIndexCommands {
 
-    private final InternalCache cache;
     private final Execution functionExecutor;
 
     protected LuceneTestIndexCommands(final InternalCache cache, final Execution functionExecutor) {
       assert cache != null : "The InternalCache cannot be null!";
-      this.cache = cache;
+      setCache(cache);
       this.functionExecutor = functionExecutor;
     }
 
     @Override
-    public InternalCache getCache() {
-      return this.cache;
-    }
-
-    @Override
     public Set<DistributedMember> getAllMembers() {
       return Collections.emptySet();
     }

-- 
To stop receiving notification emails like this one, please contact
sai_boorlagadda@apache.org.

Mime
View raw message