Spring Boot for VMware GemFire
Package org.springframework.geode.util
Class CacheUtils
java.lang.Object
org.springframework.geode.util.CacheUtils
Abstract utility class for working with Apache Geode cache instances, such as
ClientCache
and peer Cache instances.- Since:
- 1.3.0
- See Also:
-
CacheDataPolicyRegionRegionAttributesRegionServiceClientCachePool
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Collection<T>collectValues(org.apache.geode.cache.Region<?, T> region) Collects allvaluesfrom the givenRegion.static booleanisClientCache(org.apache.geode.cache.RegionService regionService) Null-safe method to determine whether the givenRegionServiceis an instance ofClientCache.static booleanisClientRegion(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionis a clientRegionin aClientCache.static booleanisPeerCache(org.apache.geode.cache.RegionService regionService) Null-safe method to determine whether the givenRegionServiceis an instance of a peerCache.static booleanisPeerRegion(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionis a peerRegionin a peerCache.static booleanisProxyRegion(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionis a [client] PROXYRegion.static booleanisRegionWithPool(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionwas configured with aPool.
-
Constructor Details
-
CacheUtils
public CacheUtils()
-
-
Method Details
-
collectValues
Collects allvaluesfrom the givenRegion. This method is capable of pullingvaluesfrom either client or peerRegions.- Type Parameters:
T-typeof theRegionvalues.- Parameters:
region-Regionfrom which to collect thevalues.- Returns:
- a
Collectionof allvaluesfrom the givenRegion. - Throws:
IllegalArgumentException- ifRegionis null.- See Also:
-
RegionCollection
-
isClientCache
public static boolean isClientCache(org.apache.geode.cache.RegionService regionService) Null-safe method to determine whether the givenRegionServiceis an instance ofClientCache. The problem is,GemFireCacheImplimplements both the (peer)CacheandClientCacheinterfaces. #sigh- Parameters:
regionService-RegionServiceto evaluate.- Returns:
- a boolean value indicating whether the
RegionServicean instance ofClientCache. - See Also:
-
ClientCacheRegionService
-
isClientRegion
public static boolean isClientRegion(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionis a clientRegionin aClientCache.- Parameters:
region-Regionto evaluate.- Returns:
- a boolean value indicating whether the given
Regionis a clientRegion. - See Also:
-
RegionisClientCache(RegionService)
-
isPeerCache
public static boolean isPeerCache(org.apache.geode.cache.RegionService regionService) Null-safe method to determine whether the givenRegionServiceis an instance of a peerCache. The problem is,GemFireCacheImplimplements both the (peer)CacheandClientCacheinterfaces. #sigh- Parameters:
regionService-RegionServiceto evaluate.- Returns:
- a boolean value indicating whether the
RegionServiceis an instance of a peerCache. - See Also:
-
RegionServiceCache
-
isPeerRegion
public static boolean isPeerRegion(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionis a peerRegionin a peerCache.- Parameters:
region-Regionto evaluate.- Returns:
- a boolean value indicating whether the given
Regionis a peerRegion. - See Also:
-
RegionisPeerCache(RegionService)
-
isProxyRegion
public static boolean isProxyRegion(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionis a [client] PROXYRegion. TheRegionis a PROXY if theDataPolicyisDataPolicy.EMPTYor theRegionhas a configuredPool.- Parameters:
region-Regionto evaluate.- Returns:
- a boolean value to determine whether the
Regionis a [client] PROXYRegion. - See Also:
-
RegionisRegionWithPool(Region)
-
isRegionWithPool
public static boolean isRegionWithPool(org.apache.geode.cache.Region<?, ?> region) Null-safe method to determine whether the givenRegionwas configured with aPool. ARegionconfigured with aPool(bynamespecified in theRegionAttributes) is a strong indicator that theRegionis a clientRegion.- Parameters:
region-Regionto evaluate.- Returns:
- a boolean to determine whether the given
Regionwas configured with aPool. - See Also:
-
PoolRegion
-