Source:
<code>private RestResponse getDetailResponse(NettyRestResponse.Builder responseBuilder, Cache<?, ?> cache) { Stats stats = cache.getAdvancedCache().getStats(); Configuration configuration = cache.getCacheConfiguration(); boolean statistics = configuration.statistics().enabled(); int size = cache.getAdvancedCache().size(); DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager(); InfinispanQueryStatisticsInfo.IndexStatistics indexStatistics = getIndexStatistics(cache); boolean rehashInProgress = distributionManager != null && distributionManager.isRehashInProgress(); boolean indexingInProgress = indexStatistics != null && indexStatistics.getReindexing(); boolean indexed = configuration.indexing().enabled(); boolean query = indexed || <START> cache.getCacheConfiguration().encoding().valueDataType().mediaType() == MediaType.APPLICATION_PROTOSTREAM; <END> try { CacheFullDetail fullDetail = new CacheFullDetail(); fullDetail.stats = stats; fullDetail.configuration = invocationHelper.getJsonWriter().toJSON(configuration); fullDetail.size = size; fullDetail.rehashInProgress = rehashInProgress; fullDetail.indexingInProgress = indexingInProgress; fullDetail.persistent = configuration.persistence().usingStores(); fullDetail.bounded = configuration.memory().evictionStrategy().isEnabled(); fullDetail.indexed = indexed; fullDetail.hasRemoteBackup = configuration.sites().hasEnabledBackups(); fullDetail.secured = configuration.security().authorization().enabled(); fullDetail.transactional = configuration.transaction().transactionMode().isTransactional(); fullDetail.statistics = statistics; fullDetail.query = query; byte[] detailsResponse = invocationHelper.getMapper().writeValueAsBytes(fullDetail); responseBuilder.contentType(APPLICATION_JSON) .entity(detailsResponse) .status(OK); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return responseBuilder.build(); }</code><technical_language>* test for MediaType.APPLICATION_PROTOSTREAM MediaType.APPLICATION_OBJECT * Instead of == .match() * cache.getCacheConfiguration().encoding().valueDataType() null if mistaken</technical_language>

Target:
private RestResponse getDetailResponse(NettyRestResponse.Builder responseBuilder, Cache<?, ?> cache) { Stats stats = cache.getAdvancedCache().getStats(); Configuration configuration = cache.getCacheConfiguration(); boolean statistics = configuration.statistics().enabled(); int size = cache.getAdvancedCache().size(); DistributionManager distributionManager = cache.getAdvancedCache().getDistributionManager(); InfinispanQueryStatisticsInfo.IndexStatistics indexStatistics = getIndexStatistics(cache); boolean rehashInProgress = distributionManager != null && distributionManager.isRehashInProgress(); boolean indexingInProgress = indexStatistics != null && indexStatistics.getReindexing(); boolean indexed = configuration.indexing().enabled(); ContentTypeConfiguration valueDataType = cache.getCacheConfiguration().encoding().valueDataType(); boolean queryable = indexed || (valueDataType != null && valueDataType.mediaType()!= null && (valueDataType.mediaType().match(MediaType.APPLICATION_PROTOSTREAM) || valueDataType.mediaType().match(MediaType.APPLICATION_OBJECT))); try { CacheFullDetail fullDetail = new CacheFullDetail(); fullDetail.stats = stats; fullDetail.configuration = invocationHelper.getJsonWriter().toJSON(configuration); fullDetail.size = size; fullDetail.rehashInProgress = rehashInProgress; fullDetail.indexingInProgress = indexingInProgress; fullDetail.persistent = configuration.persistence().usingStores(); fullDetail.bounded = configuration.memory().evictionStrategy().isEnabled(); fullDetail.indexed = indexed; fullDetail.hasRemoteBackup = configuration.sites().hasEnabledBackups(); fullDetail.secured = configuration.security().authorization().enabled(); fullDetail.transactional = configuration.transaction().transactionMode().isTransactional(); fullDetail.statistics = statistics; fullDetail.queryable = queryable; byte[] detailsResponse = invocationHelper.getMapper().writeValueAsBytes(fullDetail); responseBuilder.contentType(APPLICATION_JSON) .entity(detailsResponse) .status(OK); } catch (JsonProcessingException e) { responseBuilder.status(HttpResponseStatus.INTERNAL_SERVER_ERROR); } return responseBuilder.build(); }