VMware GemFire Native Client Cache Reference  9.0.6
SystemProperties.hpp
Go to the documentation of this file.
1 #ifndef _GEMFIRE_SYSTEMPROPERTIES_HPP_
2 #define _GEMFIRE_SYSTEMPROPERTIES_HPP_
3 
4 
5 /*=========================================================================
6  * Copyright (c) 2004-2014 Pivotal Software, Inc. All Rights Reserved.
7  * This product is protected by U.S. and international copyright
8  * and intellectual property laws. Pivotal products are covered by
9  * more patents listed at http://www.pivotal.io/patents.
10  *=========================================================================
11  */
12 
13 
14 #include "Properties.hpp"
15 #include "Log.hpp"
16 #include "AuthInitialize.hpp"
17 
21 namespace gemfire {
22 
23 
30 // Factory function typedefs to register the managed authInitialize
31 typedef AuthInitialize* ( *LibraryAuthInitializeFn ) ( const char* assemblyPath,
32  const char* factFuncName );
33 
41 
42 public:
43 
44 
52  SystemProperties(const PropertiesPtr& propertiesPtr,
53  const char* configFile = NULL);
54 
55 
60 
62  void logSettings( );
63 
64  const uint32_t threadPoolSize() const
65  { return m_threadPoolSize; }
66 
67 
72  const uint32_t statisticsSampleInterval() const
73  { return m_statisticsSampleInterval; }
74 
75 
79  bool statisticsEnabled() const
80  { return m_statisticsEnabled; }
81 
85  bool sslEnabled() const
86  { return m_sslEnabled; }
87 
91  bool getEnableTimeStatistics() const /*timestatisticsEnabled()*/
92  { return m_timestatisticsEnabled; } /*m_timestatisticsEnabled*/
93 
97  const char* sslKeyStore() const
98  { return m_sslKeyStore; }
99 
103  const char* sslKeystorePassword() const
104  { return m_sslKeystorePassword; }
105 
109  const char* sslTrustStore() const
110  { return m_sslTrustStore; }
111 
112 
117  const char* statisticsArchiveFile() const
118  { return m_statisticsArchiveFile; }
119 
120 
125  const char* logFilename() const
126  { return m_logFilename; }
127 
128 
132  Log::LogLevel logLevel() const
133  { return m_logLevel; }
134 
143  const bool heapLRULimitEnabled() const
144  { return (m_heapLRULimit > 0); }
145 
153  const size_t heapLRULimit() const
154  { return m_heapLRULimit; }
155 
156 
162  const int32_t heapLRUDelta() const
163  { return m_heapLRUDelta; }
167  const int32_t maxSocketBufferSize() const { return m_maxSocketBufferSize; }
168 
172  const int32_t pingInterval() const { return m_pingInterval; }
176  const int32_t redundancyMonitorInterval() const { return m_redundancyMonitorInterval; }
177 
181  const int32_t notifyAckInterval() const { return m_notifyAckInterval; }
182 
186  const int32_t notifyDupCheckLife() const { return m_notifyDupCheckLife; }
187 
191  const char* durableClientId() const { return m_durableClientId; }
192 
196  const uint32_t durableTimeout() const { return m_durableTimeout; }
197 
201  const uint32_t connectTimeout() const { return m_connectTimeout; }
202 
207  const uint32_t connectWaitTimeout() const { return m_connectWaitTimeout; }
208 
213  const uint32_t bucketWaitTimeout() const { return m_bucketWaitTimeout; }
214 
215 
219  char* conflateEvents(){ return m_conflateEvents; }
220 
224  const bool debugStackTraceEnabled() const
225  { return m_debugStackTraceEnabled; }
226 
236  inline const bool crashDumpEnabled() const
237  {
238  return m_crashDumpEnabled;
239  }
240 
241  const char* name() const
242  {return m_name;}
243 
244  const char* cacheXMLFile() const
245  {return m_cacheXMLFile;}
246 
250  const uint32_t logFileSizeLimit() const
251  {return m_logFileSizeLimit;}
252 
256  const uint32_t logDiskSpaceLimit() const
257  {return m_logDiskSpaceLimit;}
258 
262  const uint32_t statsFileSizeLimit() const
263  {return m_statsFileSizeLimit;}
264 
268  const uint32_t statsDiskSpaceLimit() const
269  {return m_statsDiskSpaceLimit;}
270 
271  const uint32_t maxQueueSize()
272  {return m_maxQueueSize;}
273 
274  const uint32_t javaConnectionPoolSize() const
275  { return m_javaConnectionPoolSize;}
276  void setjavaConnectionPoolSize(uint32_t size) {
277  m_javaConnectionPoolSize = size ;
278  }
279 
284  {
285  return m_disableChunkHandlerThread;
286  }
287 
292  {
293  return m_readTimeoutUnitInMillis;
294  }
295 
300  m_disableChunkHandlerThread = set ;
301  }
302 
308  {
309  return m_onClientDisconnectClearPdxTypeIds;
310  }
311 
317  m_onClientDisconnectClearPdxTypeIds = set ;
318  }
319 
321  inline const char* authInitLibrary() const
322  {
323  return (m_AuthIniLoaderLibrary == NULLPTR ? "" :
324  m_AuthIniLoaderLibrary->asChar());
325  }
326 
328  inline const char* authInitFactory() const
329  {
330  return (m_AuthIniLoaderFactory == NULLPTR ? "" :
331  m_AuthIniLoaderFactory->asChar());
332  }
333 
335  const char* securityClientDhAlgo( ) {
336  return (m_securityClientDhAlgo == NULLPTR ? "" :
337  m_securityClientDhAlgo->asChar());
338  }
339 
341  const char* securityClientKsPath( ) {
342  return (m_securityClientKsPath == NULLPTR ? "" :
343  m_securityClientKsPath->asChar());
344  }
345 
350  {
351  return m_securityPropertiesPtr;
352  }
353 
357  inline bool isSecurityOn() const
358  {
359  return (m_AuthIniLoaderFactory != NULLPTR &&
360  m_AuthIniLoaderLibrary != NULLPTR);
361  }
362 
366  inline bool isEndpointShufflingDisabled() const
367  {
368  return m_disableShufflingEndpoint;
369  }
370 
375  bool isDhOn() {
376  return isSecurityOn() && m_securityClientDhAlgo != NULLPTR &&
377  m_securityClientDhAlgo->length() > 0;
378  }
379 
395  inline bool isGridClient() const
396  {
397  return m_gridClient;
398  }
399 
404  inline bool isAppDomainEnabled() const
405  {
406  return m_appDomainEnabled;
407  }
408 
418  inline bool autoReadyForEvents() const
419  {
420  return m_autoReadyForEvents;
421  }
422 
426  const uint32_t suspendedTxTimeout() const { return m_suspendedTxTimeout; }
427 
431  const uint32_t tombstoneTimeoutInMSec() const { return m_tombstoneTimeoutInMSec; }
432 
433 private:
434 
435  uint32_t m_statisticsSampleInterval;
436 
437  bool m_statisticsEnabled;
438 
439  bool m_appDomainEnabled;
440 
441  char* m_statisticsArchiveFile;
442 
443  char* m_logFilename;
444 
445  Log::LogLevel m_logLevel;
446 
447  int m_sessions;
448 
449  char* m_name;
450 
451  bool m_debugStackTraceEnabled;
452 
453  bool m_crashDumpEnabled;
454 
455  bool m_disableShufflingEndpoint;
456 
457  char* m_cacheXMLFile;
458 
459  uint32_t m_logFileSizeLimit;
460  uint32_t m_logDiskSpaceLimit;
461 
462  uint32_t m_statsFileSizeLimit;
463  uint32_t m_statsDiskSpaceLimit;
464 
465  uint32_t m_maxQueueSize;
466  uint32_t m_javaConnectionPoolSize;
467 
468  int32_t m_heapLRULimit;
469  int32_t m_heapLRUDelta;
470  int32_t m_maxSocketBufferSize;
471  int32_t m_pingInterval;
472  int32_t m_redundancyMonitorInterval;
473 
474  int32_t m_notifyAckInterval;
475  int32_t m_notifyDupCheckLife;
476 
477 
478 
479  PropertiesPtr m_securityPropertiesPtr;
480  CacheableStringPtr m_AuthIniLoaderLibrary;
481  CacheableStringPtr m_AuthIniLoaderFactory;
482  CacheableStringPtr m_securityClientDhAlgo;
483  CacheableStringPtr m_securityClientKsPath;
484  AuthInitializePtr m_authInitializer;
485 
486  char * m_durableClientId;
487  uint32_t m_durableTimeout;
488 
489  uint32_t m_connectTimeout;
490  uint32_t m_connectWaitTimeout;
491  uint32_t m_bucketWaitTimeout;
492 
493  bool m_gridClient;
494 
495  bool m_autoReadyForEvents;
496 
497  bool m_sslEnabled;
498  bool m_timestatisticsEnabled;
499  char * m_sslKeyStore;
500  char * m_sslTrustStore;
501 
502  char *m_sslKeystorePassword;
503 
504  char * m_conflateEvents;
505 
506  uint32_t m_threadPoolSize;
507  uint32_t m_suspendedTxTimeout;
508  uint32_t m_tombstoneTimeoutInMSec;
509  bool m_disableChunkHandlerThread;
510  bool m_readTimeoutUnitInMillis;
511  bool m_onClientDisconnectClearPdxTypeIds;
512 private:
513 
514 
519  void processProperty( const char* property, const char* value );
520 
526  AuthInitializePtr getAuthLoader() ;
527 
528 private:
529  SystemProperties(const SystemProperties& rhs); // never defined
530  void operator = (const SystemProperties& rhs); // never defined
531 
532  void throwError( const char* msg );
533 
534 public:
535  static LibraryAuthInitializeFn managedAuthInitializeFn;
536  static LibraryAuthInitializeFn managedAuthInitializeFnGeneric;
537 
538 friend class DistributedSystemImpl;
539 };
540 
541 
542 } // namespace
543 
544 
545 #endif
bool getEnableTimeStatistics() const
Whether time stats are enabled for the statistics.
Definition: SystemProperties.hpp:91
const uint32_t statisticsSampleInterval() const
Returns the sampling interval of the sampling thread.
Definition: SystemProperties.hpp:72
const char * securityClientKsPath()
Return the keystore (.pem file ) path.
Definition: SystemProperties.hpp:341
const int32_t notifyAckInterval() const
Returns the periodic notify ack interval.
Definition: SystemProperties.hpp:181
const uint32_t statsFileSizeLimit() const
Returns the stat-file-space-limit.
Definition: SystemProperties.hpp:262
const char * authInitFactory() const
Return the security auth factory.
Definition: SystemProperties.hpp:328
const bool crashDumpEnabled() const
Returns true if crash dump generation for unhandled fatal errors is enabled, false otherwise...
Definition: SystemProperties.hpp:236
const char * authInitLibrary() const
Return the security auth library.
Definition: SystemProperties.hpp:321
const bool debugStackTraceEnabled() const
Returns true if the stack trace is enabled ,false otherwise.
Definition: SystemProperties.hpp:224
const int32_t notifyDupCheckLife() const
Returns the expiry time of an idle event id map entry for duplicate notification checking.
Definition: SystemProperties.hpp:186
const int32_t redundancyMonitorInterval() const
Returns the time between two consecutive checks for redundancy for HA.
Definition: SystemProperties.hpp:176
const uint32_t connectWaitTimeout() const
Returns the connect wait timeout(in millis) used for to connect to server This is only applicable for...
Definition: SystemProperties.hpp:207
const char * statisticsArchiveFile() const
Returns the name of the filename into which statistics would be archived.
Definition: SystemProperties.hpp:117
PropertiesPtr getSecurityProperties() const
Returns securityPropertiesPtr.
Definition: SystemProperties.hpp:349
Log::LogLevel logLevel() const
Returns the log level at which logging would be done.
Definition: SystemProperties.hpp:132
const size_t heapLRULimit() const
Returns the HeapLRULimit value (in bytes), the maximum memory that values in a cache can use to store...
Definition: SystemProperties.hpp:153
const char * durableClientId() const
Returns the durable client ID.
Definition: SystemProperties.hpp:191
const uint32_t suspendedTxTimeout() const
Returns the timeout after which suspended transactions are rolled back.
Definition: SystemProperties.hpp:426
bool statisticsEnabled() const
Tells whether statistics needs to be archived or not.
Definition: SystemProperties.hpp:79
const char * sslTrustStore() const
Returns the path of the public key file for SSL use.
Definition: SystemProperties.hpp:109
bool disableChunkHandlerThread() const
This can be call to know whether chunkhandler thread is disable for that opertaion.
Definition: SystemProperties.hpp:283
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
const int32_t pingInterval() const
Returns the time between two consecutive ping to servers.
Definition: SystemProperties.hpp:172
char * conflateEvents()
Returns client Queueconflation option.
Definition: SystemProperties.hpp:219
bool autoReadyForEvents() const
Whether a non durable client starts to receive and process subscription events automatically.
Definition: SystemProperties.hpp:418
const char * sslKeystorePassword() const
Returns the client keystore password.
Definition: SystemProperties.hpp:103
const char * sslKeyStore() const
Returns the path of the private key file for SSL use.
Definition: SystemProperties.hpp:97
bool onClientDisconnectClearPdxTypeIds() const
returns true if app want to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:307
bool isEndpointShufflingDisabled() const
Checks whether list of endpoint is shuffeled or not.
Definition: SystemProperties.hpp:366
const uint32_t logDiskSpaceLimit() const
Returns the log-disk-space-limit.
Definition: SystemProperties.hpp:256
const bool heapLRULimitEnabled() const
Returns a boolean that specifies if heapLRULimit has been enabled for the process.
Definition: SystemProperties.hpp:143
bool sslEnabled() const
Whether SSL is enabled for socket connections.
Definition: SystemProperties.hpp:85
const uint32_t tombstoneTimeoutInMSec() const
Returns the tombstone timeout .
Definition: SystemProperties.hpp:431
const char * securityClientDhAlgo()
Return the security diffie hellman secret key algo.
Definition: SystemProperties.hpp:335
AuthInitialize *(* LibraryAuthInitializeFn)(const char *assemblyPath, const char *factFuncName)
The SystemProperties class.
Definition: SystemProperties.hpp:31
bool isAppDomainEnabled() const
This property checks whether C# client is running in multiple appdoamin or not.
Definition: SystemProperties.hpp:404
void setOnClientDisconnectClearPdxTypeIds(bool set)
Set to true if app want to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:316
bool isDhOn()
Check whether Diffie-Hellman based credentials encryption is on.
Definition: SystemProperties.hpp:375
const uint32_t connectTimeout() const
Returns the connect timeout used for server and locator handshakes.
Definition: SystemProperties.hpp:201
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51
const uint32_t durableTimeout() const
Returns the durable timeout.
Definition: SystemProperties.hpp:196
bool isGridClient() const
Checks to see if this native client is being invoked as part of small grid jobs; use this setting to ...
Definition: SystemProperties.hpp:395
void setDisableChunkHandlerThread(bool set)
This can be call multiple time to disable chunkhandler thread for those operations.
Definition: SystemProperties.hpp:299
bool isSecurityOn() const
Checks whether Security is on or off.
Definition: SystemProperties.hpp:357
const uint32_t bucketWaitTimeout() const
Returns the connect wait timeout(in millis) used for to connect to server This is only applicable for...
Definition: SystemProperties.hpp:213
const uint32_t statsDiskSpaceLimit() const
Returns the stat-disk-size-limit.
Definition: SystemProperties.hpp:268
A class for internal use, that encapsulates the properties that can be set from DistributedSystem::co...
Definition: SystemProperties.hpp:40
const uint32_t logFileSizeLimit() const
Returns the log-file-size-limit.
Definition: SystemProperties.hpp:250
bool readTimeoutUnitInMillis() const
This can be call to know whether read timeout unit is in milli second.
Definition: SystemProperties.hpp:291
const int32_t heapLRUDelta() const
Returns the HeapLRUDelta value (a percent value).
Definition: SystemProperties.hpp:162
const char * logFilename() const
Returns the name of the filename into which logging would be done.
Definition: SystemProperties.hpp:125
Specifies the mechanism to obtain credentials for a client.
Definition: AuthInitialize.hpp:32
const int32_t maxSocketBufferSize() const
Returns the maximum socket buffer size to use.
Definition: SystemProperties.hpp:167

GemFire C++ Cache API Documentation