build-artifacts/win/product/include/gfcpp/RegionFactory.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_REGIONFACTORY_H__
00002 #define __GEMFIRE_REGIONFACTORY_H__
00003 /*=========================================================================
00004  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00005  * This product is protected by U.S. and international copyright
00006  * and intellectual property laws. Pivotal products are covered by
00007  * more patents listed at http://www.pivotal.io/patents.
00008  *========================================================================
00009  */
00010 
00011 #include "gfcpp_globals.hpp"
00012 #include "gf_types.hpp"
00013 #include "AttributesFactory.hpp"
00018 namespace gemfire {
00019   class CacheImpl;
00020 class CPPCACHE_EXPORT RegionFactory: public SharedBase{
00021   public:
00022 
00023  /*
00024   * To create the (@link Region}.
00025   * @param name
00026   *        the name of the Region.
00027   * @throws RegionExistsException if a region is already in
00028   * this cache
00029   * @throws CacheClosedException if the cache is closed
00030   */
00031   RegionPtr create(const char* name);
00032     
00037   RegionFactoryPtr setCacheLoader(const CacheLoaderPtr& cacheLoader);
00038 
00043   RegionFactoryPtr setCacheWriter(const CacheWriterPtr& cacheWriter);
00044 
00049   RegionFactoryPtr setCacheListener(const CacheListenerPtr& aListener);
00050 
00055   RegionFactoryPtr setPartitionResolver(const PartitionResolverPtr& aResolver);
00056 
00061   RegionFactoryPtr setCacheLoader(const char* libpath, const char* factoryFuncName);
00062 
00067   RegionFactoryPtr setCacheWriter(const char* libpath, const char* factoryFuncName);
00068 
00073   RegionFactoryPtr setCacheListener(const char* libpath, const char* factoryFuncName);
00074 
00079   RegionFactoryPtr setPartitionResolver(const char* libpath, const char* factoryFuncName);
00080 
00081   // EXPIRATION ATTRIBUTES
00082 
00089   RegionFactoryPtr setEntryIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
00090 
00097   RegionFactoryPtr setEntryTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
00098 
00099 
00106   RegionFactoryPtr setRegionIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
00107 
00114   RegionFactoryPtr setRegionTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
00115 
00116   // PERSISTENCE
00123   RegionFactoryPtr setPersistenceManager(const char* libpath, const char* factoryFuncName,
00124       const PropertiesPtr& config = NULLPTR);
00125 
00130   RegionFactoryPtr setPersistenceManager(const PersistenceManagerPtr& persistenceManager, 
00131       const PropertiesPtr& config = NULLPTR);
00132 
00133   // MAP ATTRIBUTES
00141   RegionFactoryPtr setInitialCapacity( int initialCapacity);
00142 
00150   RegionFactoryPtr setLoadFactor( float loadFactor);
00151 
00158   RegionFactoryPtr setConcurrencyLevel(uint8_t concurrencyLevel);
00159 
00168   RegionFactoryPtr setLruEntriesLimit( const uint32_t entriesLimit );
00169 
00175   RegionFactoryPtr setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
00176 
00186    RegionFactoryPtr setCachingEnabled( bool cachingEnabled );
00187 
00188   /*
00189    * Set the PoolName to attach the Region with that Pool.
00190    * Use only when Cache ha more than one Pool
00191    * @param name 
00192    *        the name of the Pool to which region will be attached. 
00193    * @return a reference to <code>this</code>
00194    */
00195    RegionFactoryPtr setPoolName( const char * name );
00196 
00197   /*
00198    * Set boolean to enable/disable cloning while applying delta.
00199    * @param isClonable whether to enable cloning or not.
00200    * @return a reference to <code>this</code>
00201    */
00202    RegionFactoryPtr setCloningEnabled( bool isClonable );
00203    
00210    RegionFactoryPtr setConcurrencyChecksEnabled( bool enable );
00211    
00218    RegionFactoryPtr setTombstoneTimeout( uint32_t tombstoneTimeoutInMSec);
00219 
00220   private :
00221     RegionFactory(gemfire::RegionShortcut preDefinedRegion);
00222 
00223     RegionShortcut m_preDefinedRegion;
00224 
00225     AttributesFactoryPtr m_attributeFactory;
00226 
00227     void setRegionShortcut();
00228 
00229   ~RegionFactory();
00230   friend class CacheImpl;
00231 };
00232 }; //namespace gemfire
00233 
00234 #endif //ifndef __GEMFIRE_REGIONFACTORY_H__

GemFire C++ Cache API Documentation