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

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_ATTRIBUTESFACTORY_H__
00002 #define __GEMFIRE_ATTRIBUTESFACTORY_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 "ExceptionTypes.hpp"
00014 #include "ExpirationAction.hpp"
00015 #include "CacheLoader.hpp"
00016 #include "CacheWriter.hpp"
00017 #include "CacheListener.hpp"
00018 #include "PartitionResolver.hpp"
00019 #include "RegionAttributes.hpp"
00020 #include "ScopeType.hpp"
00021 #include "DiskPolicyType.hpp"
00022 #include "Pool.hpp"
00023 
00028 namespace gemfire {
00029 
00139 class CPPCACHE_EXPORT AttributesFactory: public SharedBase {
00140 
00144  public:
00152   AttributesFactory();
00153 
00159   AttributesFactory(const RegionAttributesPtr& regionAttributes);
00160 
00164   virtual ~AttributesFactory();
00165 
00166   // CALLBACKS
00167 
00171   void setCacheLoader(const CacheLoaderPtr& cacheLoader);
00172 
00176   void setCacheWriter(const CacheWriterPtr& cacheWriter);
00177 
00181   void setCacheListener(const CacheListenerPtr& aListener);
00182 
00186   void setPartitionResolver(const PartitionResolverPtr& aResolver);
00187 
00188 
00192   void setCacheLoader(const char* libpath, const char* factoryFuncName);
00193 
00198   void setCacheWriter(const char* libpath, const char* factoryFuncName);
00199 
00203   void setCacheListener(const char* libpath, const char* factoryFuncName);
00204 
00208   void setPartitionResolver(const char* libpath, const char* factoryFuncName);
00209 
00210 
00211 
00212   // EXPIRATION ATTRIBUTES
00213 
00219   void setEntryIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
00220 
00226   void setEntryTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
00227 
00228 
00234   void setRegionIdleTimeout(ExpirationAction::Action action, int32_t idleTimeout);
00235 
00241   void setRegionTimeToLive(ExpirationAction::Action action, int32_t timeToLive);
00242 
00243 
00244   // PERSISTENCE
00250   void setPersistenceManager(const char* libpath, const char* factoryFuncName,
00251       const PropertiesPtr& config = NULLPTR);
00252   
00256   void setPersistenceManager(const PersistenceManagerPtr& persistenceManager, 
00257     const PropertiesPtr& config = NULLPTR);
00258   
00259 
00260  public:
00261 
00262   // DISTRIBUTION ATTRIBUTES
00263 
00269   void setScope(const ScopeType::Scope scopeType);
00270 
00276   void setClientNotificationEnabled( bool clientNotificationEnabled);
00277 
00278 
00279   // MAP ATTRIBUTES
00286   void setInitialCapacity( int initialCapacity);
00287 
00294   void setLoadFactor( float loadFactor);
00295 
00301   void setConcurrencyLevel(uint8_t concurrencyLevel);
00302 
00309   void setLruEntriesLimit( const uint32_t entriesLimit );
00310 
00315   void setDiskPolicy(const DiskPolicyType::PolicyType diskPolicy);
00316 
00325    void setCachingEnabled( bool cachingEnabled );
00326 
00335    void setEndpoints( const char * endpoints );
00336 
00352    void setPoolName( const char * name );
00353 
00359    void setCloningEnabled( bool isClonable );
00360 
00366    void setConcurrencyChecksEnabled( bool concurrencyChecksEnabled );
00367 
00368   // FACTORY METHOD
00369 
00375   RegionAttributesPtr createRegionAttributes();
00376 
00377 
00378 private:
00379   RegionAttributes m_regionAttributes;
00380   bool m_useDefaultClientNotification;
00381   static void validateAttributes(RegionAttributes& attrs) ;
00382 };
00383 } //namespace gemfire
00384 #endif //ifndef __GEMFIRE_ATTRIBUTESFACTORY_H__

GemFire C++ Cache API Documentation