java.lang.Object
org.springframework.session.data.gemfire.support.GemFireUtils

public abstract class GemFireUtils extends Object
GemFireUtils is an abstract, extensible utility class for working with Apache Geode and Pivotal GemFire objects and types.
Since:
1.1.0
See Also:
  • Cache
  • GemFireCache
  • Region
  • ClientCache
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Null-safe method to close the given Closeable object.
    static boolean
    isClient(org.apache.geode.cache.GemFireCache gemfireCache)
    Determines whether the Pivotal GemFire cache is a client.
    static boolean
    isLocal(org.apache.geode.cache.client.ClientRegionShortcut shortcut)
    Determines whether the given ClientRegionShortcut is local only.
    static boolean
    isNonLocalClientRegion(org.apache.geode.cache.Region<?,?> region)
    Determines whether the given Region is a non-local, client Region, a Region for which a corresponding server Region exists.
    static boolean
    isPeer(org.apache.geode.cache.GemFireCache gemFireCache)
    Determines whether the Pivotal GemFire cache is a peer.
    static boolean
    isProxy(org.apache.geode.cache.client.ClientRegionShortcut shortcut)
    Determines whether the given ClientRegionShortcut is a proxy-based shortcut.
    static boolean
    isProxy(org.apache.geode.cache.Region<?,?> region)
    Determines whether the given Region is a PROXY.
    static boolean
    isProxy(org.apache.geode.cache.RegionShortcut shortcut)
    Determines whether the RegionShortcut is a Proxy-based shortcut.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GemFireUtils

      public GemFireUtils()
  • Method Details

    • close

      public static boolean close(Closeable obj)
      Null-safe method to close the given Closeable object.
      Parameters:
      obj - the Closeable object to close.
      Returns:
      true if the Closeable object is not null and was successfully closed, otherwise return false.
      See Also:
    • isClient

      public static boolean isClient(@Nullable org.apache.geode.cache.GemFireCache gemfireCache)
      Determines whether the Pivotal GemFire cache is a client.
      Parameters:
      gemfireCache - a reference to the Pivotal GemFire cache.
      Returns:
      a boolean value indicating whether the Pivotal GemFire cache is a client.
      See Also:
      • ClientCache
      • GemFireCache
    • isPeer

      public static boolean isPeer(@Nullable org.apache.geode.cache.GemFireCache gemFireCache)
      Determines whether the Pivotal GemFire cache is a peer.
      Parameters:
      gemFireCache - a reference to the Pivotal GemFire cache.
      Returns:
      a boolean value indicating whether the Pivotal GemFire cache is a peer.
      See Also:
      • Cache
      • GemFireCache
    • isLocal

      public static boolean isLocal(@Nullable org.apache.geode.cache.client.ClientRegionShortcut shortcut)
      Determines whether the given ClientRegionShortcut is local only.
      Parameters:
      shortcut - ClientRegionShortcut to evaluate.
      Returns:
      a boolean value indicating whether the ClientRegionShortcut is local or not.
      See Also:
      • ClientRegionShortcut
    • isNonLocalClientRegion

      public static boolean isNonLocalClientRegion(@Nullable org.apache.geode.cache.Region<?,?> region)
      Determines whether the given Region is a non-local, client Region, a Region for which a corresponding server Region exists.
      Parameters:
      region - Region to evaluate.
      Returns:
      a boolean value indicating whether the given Region is a non-local, client Region, a Region for which a corresponding server Region exists.
      See Also:
      • Region
      • isPoolConfiguredOrHasServerProxy(Region)
    • isProxy

      public static boolean isProxy(org.apache.geode.cache.client.ClientRegionShortcut shortcut)
      Determines whether the given ClientRegionShortcut is a proxy-based shortcut. "Proxy"-based Regions keep no local state.
      Parameters:
      shortcut - ClientRegionShortcut to evaluate.
      Returns:
      a boolean value indicating whether the ClientRegionShortcut refers to a Proxy-based shortcut.
      See Also:
      • ClientRegionShortcut
    • isProxy

      public static boolean isProxy(org.apache.geode.cache.Region<?,?> region)
      Determines whether the given Region is a PROXY.
      Parameters:
      region - Region to evaluate as a PROXY; must not be null.
      Returns:
      a boolean value indicating whether the Region is a PROXY.
      See Also:
      • DataPolicy
      • Region
    • isProxy

      public static boolean isProxy(org.apache.geode.cache.RegionShortcut shortcut)
      Determines whether the RegionShortcut is a Proxy-based shortcut. "Proxy"-based Regions keep no local state.
      Parameters:
      shortcut - RegionShortcut to evaluate.
      Returns:
      a boolean value indicating whether the RegionShortcut refers to a Proxy-based shortcut.
      See Also:
      • RegionShortcut