Apache Geode Native .NET Reference 1.15.0
Apache::Geode::Client::Cache Class Reference

Provides a distributed cache. More...

#include <Cache.hpp>

Inherits Apache::Geode::Client::IGeodeCache.

Public Member Functions

virtual void Close ()
 Terminates this object cache and releases all the local resources. More...
 
virtual void Close (bool keepalive)
 Terminates this object cache and releases all the local resources. More...
 
IRegionServiceCreateAuthenticatedView (Properties< String^, Object^>^ credentials)
 Returns the instance of IRegionService to do the operation on Cache with different Credential. More...
 
IRegionServiceCreateAuthenticatedView (Properties< String^, Object^>^ credentials, String^ poolName)
 Returns the instance of IRegionService to do the operation on Cache with different Credential. More...
 
virtual IPdxInstanceFactoryCreatePdxInstanceFactory (String^ className)
 Returns a factory that can create a PdxInstance. More...
 
RegionFactoryCreateRegionFactory (RegionShortcut regionShortcut)
 Returns the instance of RegionFactory to create the region More...
 
virtual bool GetPdxIgnoreUnreadFields ()
 summary> Returns whether PdxInstance is preferred for PDX types instead of .NET object. More...
 
virtual PoolFactoryGetPoolFactory ()
 Returns a PoolFactory that can be used to create a Pool and that provides access to all Pool attributes. More...
 
virtual PoolManagerGetPoolManager ()
 Returns a PoolManager that provides for the configuration and creation of instances of PoolFactory. More...
 
virtual Client::QueryServiceGetQueryService ()
 Get a query service object to be able to query the cache. More...
 
virtual Client::QueryServiceGetQueryService (String^ poolName)
 Get a query service object to be able to query the cache. More...
 
template<class TKey , class TValue >
virtual IRegion< TKey, TValue > ^ GetRegion (String^ path)
 Returns an existing region given the full path from root, or null if no such region exists. More...
 
virtual void InitializeDeclarativeCache (String^ cacheXml)
 Initializes the cache from an XML file. More...
 
virtual void ReadyForEvents ()
 Send the client-ready message to the server for a durable client. More...
 
template<class TKey , class TValue >
virtual array< IRegion< TKey, TValue >^> ^ RootRegions ()
 Returns an array of root regions in the cache. More...
 

Properties

virtual Apache::Geode::Client::CacheTransactionManagerCacheTransactionManager [get]
 Returns the cache transaction manager of CacheFactory.Create this cache. More...
 
virtual bool IsClosed [get]
 True if this cache has been closed. More...
 
virtual String^ Name [get]
 Returns the name of this cache. More...
 

Detailed Description

Provides a distributed cache.

Caches are obtained from Create methods on the CacheFactory.Create class.

When a cache will no longer be used, call Cache.Close. Once it Cache.IsClosed any attempt to use it will cause a CacheClosedException to be thrown.

A cache can have multiple root regions, each with a different name.

Member Function Documentation

◆ Close() [1/2]

virtual void Apache::Geode::Client::Cache::Close ( )
virtual

Terminates this object cache and releases all the local resources.

After this cache is closed, any further method call on this cache or any region object will throw CacheClosedException, unless otherwise noted.

Exceptions
CacheClosedExceptionif the cache is already closed.

Implements Apache::Geode::Client::IRegionService.

◆ Close() [2/2]

virtual void Apache::Geode::Client::Cache::Close ( bool  keepalive)
virtual

Terminates this object cache and releases all the local resources.

After this cache is closed, any further method call on this cache or any region object will throw CacheClosedException, unless otherwise noted.

Parameters
keepalivewhether to keep a durable client's queue alive
Exceptions
CacheClosedExceptionif the cache is already closed.

◆ CreateAuthenticatedView() [1/2]

IRegionService ^ Apache::Geode::Client::Cache::CreateAuthenticatedView ( Properties< String^, Object^>^  credentials)

Returns the instance of IRegionService to do the operation on Cache with different Credential.

Default pool should be in multiuser mode CacheFactory.SetMultiuserAuthentication

Parameters
credentialsthe user Credentials.
Returns
Instance of IRegionService

◆ CreateAuthenticatedView() [2/2]

IRegionService ^ Apache::Geode::Client::Cache::CreateAuthenticatedView ( Properties< String^, Object^>^  credentials,
String^  poolName 
)

Returns the instance of IRegionService to do the operation on Cache with different Credential.

Default pool should be in multiuser mode CacheFactory.SetMultiuserAuthentication

Parameters
credentialsthe user Credentials.
poolNamePool, which is in multiuser mode.
Returns
Instance of IRegionService

summary> Returns whether Cache saves unread fields for Pdx types. /summary>

◆ CreatePdxInstanceFactory()

virtual IPdxInstanceFactory ^ Apache::Geode::Client::Cache::CreatePdxInstanceFactory ( String^  className)
virtual

Returns a factory that can create a PdxInstance.

Parameters
classNamethe fully qualified class name that the PdxInstance will become when it is fully deserialized.
Returns
the factory

Implements Apache::Geode::Client::IRegionService.

◆ CreateRegionFactory()

RegionFactory ^ Apache::Geode::Client::Cache::CreateRegionFactory ( RegionShortcut  regionShortcut)

Returns the instance of RegionFactory to create the region

Pass the RegionShortcut to set the default region attributes

Parameters
regionShortcutthe regionShortcut to set the default region attributes
Returns
Instance of RegionFactory

◆ GetPdxIgnoreUnreadFields()

virtual bool Apache::Geode::Client::Cache::GetPdxIgnoreUnreadFields ( )
virtual

summary> Returns whether PdxInstance is preferred for PDX types instead of .NET object.

/summary>

Implements Apache::Geode::Client::IGeodeCache.

◆ GetPoolFactory()

virtual PoolFactory ^ Apache::Geode::Client::Cache::GetPoolFactory ( )
virtual

Returns a PoolFactory that can be used to create a Pool and that provides access to all Pool attributes.

Returns
the PoolFactory

◆ GetPoolManager()

virtual PoolManager ^ Apache::Geode::Client::Cache::GetPoolManager ( )
virtual

Returns a PoolManager that provides for the configuration and creation of instances of PoolFactory.

Returns
the PoolManager

◆ GetQueryService() [1/2]

virtual Client::QueryService ^ Apache::Geode::Client::Cache::GetQueryService ( )
virtual

Get a query service object to be able to query the cache.

Supported only when cache is created from Pool(pool is in multiuserSecure mode)

Currently only works against the java server in native mode, and at least some endpoints must have been defined in some regions before actually firing a query.

Implements Apache::Geode::Client::IRegionService.

◆ GetQueryService() [2/2]

virtual Client::QueryService ^ Apache::Geode::Client::Cache::GetQueryService ( String^  poolName)
virtual

Get a query service object to be able to query the cache.

Use only when Cache has more than one Pool.

Currently only works against the java server in native mode, and at least some endpoints must have been defined in some regions before actually firing a query.

◆ GetRegion()

template<class TKey , class TValue >
virtual IRegion< TKey, TValue > ^ Apache::Geode::Client::Cache::GetRegion ( String^  path)
virtual

Returns an existing region given the full path from root, or null if no such region exists.

If Pool attached with Region is in multiusersecure mode then don't use return instance of region as no credential are attached with this instance. Get region from RegionService instance of Cache.Cache.CreateAuthenticatedView(std::shared_ptr<PropertiesPtr>).

Parameters
paththe pathname of the region
Returns
the region

Implements Apache::Geode::Client::IRegionService.

◆ InitializeDeclarativeCache()

virtual void Apache::Geode::Client::Cache::InitializeDeclarativeCache ( String^  cacheXml)
virtual

Initializes the cache from an XML file.

Parameters
cacheXmlpathname of a cache.xml file

Implements Apache::Geode::Client::IGeodeCache.

◆ ReadyForEvents()

virtual void Apache::Geode::Client::Cache::ReadyForEvents ( )
virtual

Send the client-ready message to the server for a durable client.


This method should only be called for durable clients and with a cache server version 5.5 onwards.

Exceptions
IllegalStateExceptionif there was a problem sending the message to the server.

◆ RootRegions()

template<class TKey , class TValue >
virtual array< IRegion< TKey, TValue >^> ^ Apache::Geode::Client::Cache::RootRegions ( )
virtual

Returns an array of root regions in the cache.

This set is a snapshot and is not backed by the cache.

It is not supported when Cache is created from Pool.

Returns
array of regions

Implements Apache::Geode::Client::IRegionService.

Property Documentation

◆ CacheTransactionManager

virtual Apache:: Geode:: Client:: CacheTransactionManager^ Apache::Geode::Client::Cache::CacheTransactionManager
get

Returns the cache transaction manager of CacheFactory.Create this cache.

◆ IsClosed

virtual bool Apache::Geode::Client::Cache::IsClosed
get

True if this cache has been closed.

After a new cache object is created, this method returns false. After Close is called on this cache object, this method returns true.

Returns
true if this cache is closed, otherwise false

◆ Name

virtual String^ Apache::Geode::Client::Cache::Name
get

Returns the name of this cache.

This method does not throw CacheClosedException if the cache is closed.

Returns
the string name of this cache

Apache Geode C++ Cache .NET API Documentation