org.springframework.session.data.gemfire.support

## Class GemFireUtils

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

    public abstract class GemFireUtils
    extends java.lang.Object

GemFireUtils is an abstract, extensible utility class for working with GemFire types and functionality and is used by Spring Session's GemFire adapter support classes.

Since:
  1.1.0

### Constructor Summary

Constructors
Constructor and Description
`GemFireUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static boolean` `close(java.io.Closeable obj)` Null-safe method to close the given `Closeable` object.
`static boolean` `isClient(org.apache.geode.cache.GemFireCache gemFireCache)` Determines whether the 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` `isPeer(org.apache.geode.cache.GemFireCache gemFireCache)` Determines whether the GemFire cache is a peer.
`static boolean` `isProxy(org.apache.geode.cache.client.ClientRegionShortcut shortcut)` Determines whether the client `ClientRegionShortcut` is a proxy-based shortcut.
`static boolean` `isProxy(org.apache.geode.cache.Region<?,?> region)` Determines whether the given `Region` is a PROXY, which would be indicated by the `Region` having a `DataPolicy` of `DataPolicy.EMPTY`.
`static boolean` `isProxy(org.apache.geode.cache.RegionShortcut shortcut)` Determines whether the peer `RegionShortcut` is a proxy-based shortcut.
`static java.lang.String` `toRegionPath(java.lang.String regionName)` Converts a `Region` name to a `Region` path.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GemFireUtils

    public GemFireUtils()

### Method Detail

#### close

    public static boolean close(java.io.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:
  `Closeable`

#### isClient

    public static boolean isClient(org.apache.geode.cache.GemFireCache gemFireCache)

Determines whether the GemFire cache is a client.

Parameters:
  `gemFireCache` - a reference to the GemFire cache.
Returns:
  a boolean value indicating whether the GemFire cache is a client.
See Also:
  `ClientCache`, `GemFireCache`

#### isPeer

    public static boolean isPeer(org.apache.geode.cache.GemFireCache gemFireCache)

Determines whether the GemFire cache is a peer.

Parameters:
  `gemFireCache` - a reference to the GemFire cache.
Returns:
  a boolean value indicating whether the GemFire cache is a peer.
See Also:
  `Cache`, `GemFireCache`

#### isLocal

    public static boolean isLocal(org.apache.geode.cache.client.ClientRegionShortcut shortcut)

Determines whether the given `ClientRegionShortcut` is local only.

Parameters:
  `shortcut` - the ClientRegionShortcut to evaluate.
Returns:
  a boolean value indicating if the `ClientRegionShortcut` is local or not.
See Also:
  `ClientRegionShortcut`

#### isProxy

    public static boolean isProxy(org.apache.geode.cache.client.ClientRegionShortcut shortcut)

Determines whether the client `ClientRegionShortcut` is a proxy-based shortcut. NOTE: "proxy"-based Regions keep no local state.

Parameters:
  `shortcut` - the client `ClientRegionShortcut` to evaluate.
Returns:
  a boolean value indicating whether the client `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, which would be indicated by the `Region` having a `DataPolicy` of `DataPolicy.EMPTY`.

Parameters:
  `region` - `Region` to evaluate.
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 peer `RegionShortcut` is a proxy-based shortcut. NOTE: "proxy"-based Regions keep no local state.

Parameters:
  `shortcut` - the peer `RegionShortcut` to evaluate.
Returns:
  a boolean value indicating whether the peer `RegionShortcut` refers to a proxy-based shortcut.
See Also:
  `RegionShortcut`

#### toRegionPath

    public static java.lang.String toRegionPath(java.lang.String regionName)

Converts a `Region` name to a `Region` path.

Parameters:
  `regionName` - a String specifying the name of the `Region`.
Returns:
  a String path for the given `Region` by name.
See Also:
  `Region.getFullPath()`, `Region.getName()`