class AlterQueryServiceCommand extends SingleGfshCommand {

  QueryConfigService getQueryConfigService() {
    ConfigurationPersistenceService configService = getConfigurationPersistenceService();

    if (configService != null) {
      CacheConfig cacheConfig = configService.getCacheConfig(null);

      if (cacheConfig != null) {
        QueryConfigService queryConfigService = cacheConfig
            .findCustomCacheElement(QueryConfigService.ELEMENT_ID, QueryConfigService.class);

        if (queryConfigService != null) {
          return queryConfigService;
        }
      }
    }

    return new QueryConfigService();
  }

}