VMware GemFire Native C++ Reference  9.2.4
SystemProperties.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_SYSTEMPROPERTIES_H_
4 #define GEODE_SYSTEMPROPERTIES_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include "Properties.hpp"
24 #include "Log.hpp"
25 #include "AuthInitialize.hpp"
26 
30 namespace apache {
31 namespace geode {
32 namespace client {
33 
40 // Factory function typedefs to register the managed authInitialize
41 typedef AuthInitialize* (*LibraryAuthInitializeFn)(const char* assemblyPath,
42  const char* factFuncName);
43 
51  public:
60  SystemProperties(const PropertiesPtr& propertiesPtr,
61  const char* configFile = NULL);
62 
67 
69  void logSettings();
70 
71  const uint32_t threadPoolSize() const { return m_threadPoolSize; }
72 
77  const uint32_t statisticsSampleInterval() const {
78  return m_statisticsSampleInterval;
79  }
80 
84  bool statisticsEnabled() const { return m_statisticsEnabled; }
85 
89  bool sslEnabled() const { return m_sslEnabled; }
90 
94  bool sslStrictMode() const { return m_sslStrictMode; }
95 
99  bool getEnableTimeStatistics() const /*timestatisticsEnabled()*/
100  {
101  return m_timestatisticsEnabled;
102  } /*m_timestatisticsEnabled*/
103 
107  const char* sslKeyStore() const { return m_sslKeyStore; }
108 
112  const char* sslKeystorePassword() const { return m_sslKeystorePassword; }
113 
117  const char* sslTrustStore() const { return m_sslTrustStore; }
118 
123  const char* statisticsArchiveFile() const { return m_statisticsArchiveFile; }
124 
129  const char* logFilename() const { return m_logFilename; }
130 
134  Log::LogLevel logLevel() const { return m_logLevel; }
135 
145  const bool heapLRULimitEnabled() const { return (m_heapLRULimit > 0); }
146 
154  const size_t heapLRULimit() const { return m_heapLRULimit; }
155 
161  const int32_t heapLRUDelta() const { return m_heapLRUDelta; }
165  const int32_t maxSocketBufferSize() const { return m_maxSocketBufferSize; }
166 
170  const int32_t pingInterval() const { return m_pingInterval; }
174  const int32_t redundancyMonitorInterval() const {
175  return m_redundancyMonitorInterval;
176  }
177 
181  const int32_t notifyAckInterval() const { return m_notifyAckInterval; }
182 
187  const int32_t notifyDupCheckLife() const { return m_notifyDupCheckLife; }
188 
192  const char* durableClientId() const { return m_durableClientId; }
193 
197  const uint32_t durableTimeout() const { return m_durableTimeout; }
198 
202  const uint32_t connectTimeout() const { return m_connectTimeout; }
203 
208  const uint32_t connectWaitTimeout() const { return m_connectWaitTimeout; }
209 
214  const uint32_t bucketWaitTimeout() const { return m_bucketWaitTimeout; }
215 
219  char* conflateEvents() { return m_conflateEvents; }
220 
224  const bool debugStackTraceEnabled() const { return m_debugStackTraceEnabled; }
225 
235  inline const bool crashDumpEnabled() const { return m_crashDumpEnabled; }
236 
237  const char* name() const { return m_name; }
238 
239  const char* cacheXMLFile() const { return m_cacheXMLFile; }
240 
244  const uint32_t logFileSizeLimit() const { return m_logFileSizeLimit; }
245 
249  const uint32_t logDiskSpaceLimit() const { return m_logDiskSpaceLimit; }
250 
254  const uint32_t statsFileSizeLimit() const { return m_statsFileSizeLimit; }
255 
259  const uint32_t statsDiskSpaceLimit() const { return m_statsDiskSpaceLimit; }
260 
261  const uint32_t maxQueueSize() { return m_maxQueueSize; }
262 
263  const uint32_t javaConnectionPoolSize() const {
264  return m_javaConnectionPoolSize;
265  }
266  void setjavaConnectionPoolSize(uint32_t size) {
267  m_javaConnectionPoolSize = size;
268  }
269 
274  bool disableChunkHandlerThread() const { return m_disableChunkHandlerThread; }
275 
279  bool readTimeoutUnitInMillis() const { return m_readTimeoutUnitInMillis; }
280 
286  m_disableChunkHandlerThread = set;
287  }
288 
294  return m_onClientDisconnectClearPdxTypeIds;
295  }
296 
302  m_onClientDisconnectClearPdxTypeIds = set;
303  }
304 
306  inline const char* authInitLibrary() const {
307  return (m_AuthIniLoaderLibrary == NULLPTR
308  ? ""
309  : m_AuthIniLoaderLibrary->asChar());
310  }
311 
313  inline const char* authInitFactory() const {
314  return (m_AuthIniLoaderFactory == NULLPTR
315  ? ""
316  : m_AuthIniLoaderFactory->asChar());
317  }
318 
320  const char* securityClientDhAlgo() {
321  return (m_securityClientDhAlgo == NULLPTR
322  ? ""
323  : m_securityClientDhAlgo->asChar());
324  }
325 
327  const char* securityClientKsPath() {
328  return (m_securityClientKsPath == NULLPTR
329  ? ""
330  : m_securityClientKsPath->asChar());
331  }
332 
337  return m_securityPropertiesPtr;
338  }
339 
343  inline bool isSecurityOn() const {
344  return (m_AuthIniLoaderFactory != NULLPTR &&
345  m_AuthIniLoaderLibrary != NULLPTR);
346  }
347 
351  inline bool isEndpointShufflingDisabled() const {
352  return m_disableShufflingEndpoint;
353  }
354 
359  bool isDhOn() {
360  return isSecurityOn() && m_securityClientDhAlgo != NULLPTR &&
361  m_securityClientDhAlgo->length() > 0;
362  }
363 
379  inline bool isGridClient() const { return m_gridClient; }
380 
386  inline bool isAppDomainEnabled() const { return m_appDomainEnabled; }
387 
397  inline bool autoReadyForEvents() const { return m_autoReadyForEvents; }
398 
402  const uint32_t suspendedTxTimeout() const { return m_suspendedTxTimeout; }
403 
407  const uint32_t tombstoneTimeoutInMSec() const {
408  return m_tombstoneTimeoutInMSec;
409  }
410 
411  private:
412  uint32_t m_statisticsSampleInterval;
413 
414  bool m_statisticsEnabled;
415 
416  bool m_appDomainEnabled;
417 
418  char* m_statisticsArchiveFile;
419 
420  char* m_logFilename;
421 
422  Log::LogLevel m_logLevel;
423 
424  int m_sessions;
425 
426  char* m_name;
427 
428  bool m_debugStackTraceEnabled;
429 
430  bool m_crashDumpEnabled;
431 
432  bool m_disableShufflingEndpoint;
433 
434  char* m_cacheXMLFile;
435 
436  uint32_t m_logFileSizeLimit;
437  uint32_t m_logDiskSpaceLimit;
438 
439  uint32_t m_statsFileSizeLimit;
440  uint32_t m_statsDiskSpaceLimit;
441 
442  uint32_t m_maxQueueSize;
443  uint32_t m_javaConnectionPoolSize;
444 
445  int32_t m_heapLRULimit;
446  int32_t m_heapLRUDelta;
447  int32_t m_maxSocketBufferSize;
448  int32_t m_pingInterval;
449  int32_t m_redundancyMonitorInterval;
450 
451  int32_t m_notifyAckInterval;
452  int32_t m_notifyDupCheckLife;
453 
454  PropertiesPtr m_securityPropertiesPtr;
455  CacheableStringPtr m_AuthIniLoaderLibrary;
456  CacheableStringPtr m_AuthIniLoaderFactory;
457  CacheableStringPtr m_securityClientDhAlgo;
458  CacheableStringPtr m_securityClientKsPath;
459  AuthInitializePtr m_authInitializer;
460 
461  char* m_durableClientId;
462  uint32_t m_durableTimeout;
463 
464  uint32_t m_connectTimeout;
465  uint32_t m_connectWaitTimeout;
466  uint32_t m_bucketWaitTimeout;
467 
468  bool m_gridClient;
469 
470  bool m_autoReadyForEvents;
471 
472  bool m_sslEnabled;
473  bool m_sslStrictMode;
474  bool m_timestatisticsEnabled;
475  char* m_sslKeyStore;
476  char* m_sslTrustStore;
477 
478  char* m_sslKeystorePassword;
479 
480  char* m_conflateEvents;
481 
482  uint32_t m_threadPoolSize;
483  uint32_t m_suspendedTxTimeout;
484  uint32_t m_tombstoneTimeoutInMSec;
485  bool m_disableChunkHandlerThread;
486  bool m_readTimeoutUnitInMillis;
487  bool m_onClientDisconnectClearPdxTypeIds;
488 
489  private:
494  void processProperty(const char* property, const char* value);
495 
501  AuthInitializePtr getAuthLoader();
502 
503  private:
504  SystemProperties(const SystemProperties& rhs); // never defined
505  void operator=(const SystemProperties& rhs); // never defined
506 
507  void throwError(const char* msg);
508 
509  public:
510  static LibraryAuthInitializeFn managedAuthInitializeFn;
511 
512  friend class DistributedSystemImpl;
513 };
514 } // namespace client
515 } // namespace geode
516 } // namespace apache
517 
518 #endif // GEODE_SYSTEMPROPERTIES_H_
apache::geode::client::SystemProperties::sslStrictMode
bool sslStrictMode() const
Whether SSL certificate verification is required.
Definition: SystemProperties.hpp:94
apache::geode::client::SystemProperties::crashDumpEnabled
const bool crashDumpEnabled() const
Returns true if crash dump generation for unhandled fatal errors is enabled, false otherwise.
Definition: SystemProperties.hpp:235
apache::geode::client::SystemProperties::debugStackTraceEnabled
const bool debugStackTraceEnabled() const
Returns true if the stack trace is enabled ,false otherwise.
Definition: SystemProperties.hpp:224
apache
Each enum represents a predefined RegionAttributes in a {}.
Definition: Assert.hpp:31
Properties.hpp
apache::geode::client::SystemProperties::statisticsEnabled
bool statisticsEnabled() const
Tells whether statistics needs to be archived or not.
Definition: SystemProperties.hpp:84
apache::geode::client::SystemProperties::durableClientId
const char * durableClientId() const
Returns the durable client ID.
Definition: SystemProperties.hpp:192
apache::geode::client::SystemProperties::logFileSizeLimit
const uint32_t logFileSizeLimit() const
Returns the log-file-size-limit.
Definition: SystemProperties.hpp:244
apache::geode::client::SystemProperties::logFilename
const char * logFilename() const
Returns the name of the filename into which logging would be done.
Definition: SystemProperties.hpp:129
apache::geode::client::SystemProperties::sslKeystorePassword
const char * sslKeystorePassword() const
Returns the client keystore password.
Definition: SystemProperties.hpp:112
apache::geode::client::SystemProperties::connectWaitTimeout
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:208
apache::geode::client::SystemProperties::readTimeoutUnitInMillis
bool readTimeoutUnitInMillis() const
This can be call to know whether read timeout unit is in milli second.
Definition: SystemProperties.hpp:279
apache::geode::client::SystemProperties::statisticsSampleInterval
const uint32_t statisticsSampleInterval() const
Returns the sampling interval of the sampling thread.
Definition: SystemProperties.hpp:77
apache::geode::client::SystemProperties::bucketWaitTimeout
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:214
apache::geode::client::SystemProperties::isEndpointShufflingDisabled
bool isEndpointShufflingDisabled() const
Checks whether list of endpoint is shuffeled or not.
Definition: SystemProperties.hpp:351
apache::geode::client::SystemProperties::authInitFactory
const char * authInitFactory() const
Return the security auth factory.
Definition: SystemProperties.hpp:313
apache::geode::client::SystemProperties::sslTrustStore
const char * sslTrustStore() const
Returns the path of the public key file for SSL use.
Definition: SystemProperties.hpp:117
apache::geode::client::SystemProperties::logDiskSpaceLimit
const uint32_t logDiskSpaceLimit() const
Returns the log-disk-space-limit.
Definition: SystemProperties.hpp:249
apache::geode::client::SystemProperties::authInitLibrary
const char * authInitLibrary() const
Return the security auth library.
Definition: SystemProperties.hpp:306
apache::geode::client::SystemProperties
A class for internal use, that encapsulates the properties that can be set from DistributedSystem::co...
Definition: SystemProperties.hpp:50
apache::geode::client::SystemProperties::suspendedTxTimeout
const uint32_t suspendedTxTimeout() const
Returns the timeout after which suspended transactions are rolled back.
Definition: SystemProperties.hpp:402
apache::geode::client::SystemProperties::heapLRULimitEnabled
const bool heapLRULimitEnabled() const
Returns a boolean that specifies if heapLRULimit has been enabled for the process.
Definition: SystemProperties.hpp:145
apache::geode::client::SystemProperties::maxSocketBufferSize
const int32_t maxSocketBufferSize() const
Returns the maximum socket buffer size to use.
Definition: SystemProperties.hpp:165
geode
apache::geode::client::SystemProperties::getSecurityProperties
PropertiesPtr getSecurityProperties() const
Returns securityPropertiesPtr.
Definition: SystemProperties.hpp:336
apache::geode::client::SystemProperties::isSecurityOn
bool isSecurityOn() const
Checks whether Security is on or off.
Definition: SystemProperties.hpp:343
apache::geode::client::SystemProperties::disableChunkHandlerThread
bool disableChunkHandlerThread() const
This can be call to know whether chunkhandler thread is disable for that opertaion.
Definition: SystemProperties.hpp:274
apache::geode::client::SystemProperties::conflateEvents
char * conflateEvents()
Returns client Queueconflation option.
Definition: SystemProperties.hpp:219
CPPCACHE_EXPORT
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
apache::geode::client::SystemProperties::redundancyMonitorInterval
const int32_t redundancyMonitorInterval() const
Returns the time between two consecutive checks for redundancy for HA.
Definition: SystemProperties.hpp:174
apache::geode::client::SystemProperties::isAppDomainEnabled
bool isAppDomainEnabled() const
This property checks whether C# client is running in multiple appdoamin or not.
Definition: SystemProperties.hpp:386
apache::geode::client::SystemProperties::notifyDupCheckLife
const int32_t notifyDupCheckLife() const
Returns the expiry time of an idle event id map entry for duplicate notification checking.
Definition: SystemProperties.hpp:187
apache::geode::client::SystemProperties::onClientDisconnectClearPdxTypeIds
bool onClientDisconnectClearPdxTypeIds() const
returns true if app want to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:293
apache::geode::client::LibraryAuthInitializeFn
AuthInitialize *(* LibraryAuthInitializeFn)(const char *assemblyPath, const char *factFuncName)
The SystemProperties class.
Definition: SystemProperties.hpp:41
apache::geode::client::SystemProperties::getEnableTimeStatistics
bool getEnableTimeStatistics() const
Whether time stats are enabled for the statistics.
Definition: SystemProperties.hpp:99
apache::geode::client::SystemProperties::heapLRUDelta
const int32_t heapLRUDelta() const
Returns the HeapLRUDelta value (a percent value).
Definition: SystemProperties.hpp:161
apache::geode::client::SystemProperties::durableTimeout
const uint32_t durableTimeout() const
Returns the durable timeout.
Definition: SystemProperties.hpp:197
apache::geode::client::SystemProperties::connectTimeout
const uint32_t connectTimeout() const
Returns the connect timeout used for server and locator handshakes.
Definition: SystemProperties.hpp:202
apache::geode::client::SystemProperties::autoReadyForEvents
bool autoReadyForEvents() const
Whether a non durable client starts to receive and process subscription events automatically.
Definition: SystemProperties.hpp:397
apache::geode::client::SystemProperties::setDisableChunkHandlerThread
void setDisableChunkHandlerThread(bool set)
This can be call multiple time to disable chunkhandler thread for those operations.
Definition: SystemProperties.hpp:285
apache::geode::client::SystemProperties::securityClientKsPath
const char * securityClientKsPath()
Return the keystore (.pem file ) path.
Definition: SystemProperties.hpp:327
apache::geode::client::SystemProperties::sslEnabled
bool sslEnabled() const
Whether SSL is enabled for socket connections.
Definition: SystemProperties.hpp:89
apache::geode::client::SystemProperties::statsDiskSpaceLimit
const uint32_t statsDiskSpaceLimit() const
Returns the stat-disk-size-limit.
Definition: SystemProperties.hpp:259
apache::geode::client::SystemProperties::isGridClient
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:379
Log.hpp
apache::geode::client::SystemProperties::statisticsArchiveFile
const char * statisticsArchiveFile() const
Returns the name of the filename into which statistics would be archived.
Definition: SystemProperties.hpp:123
apache::geode::client::SystemProperties::statsFileSizeLimit
const uint32_t statsFileSizeLimit() const
Returns the stat-file-space-limit.
Definition: SystemProperties.hpp:254
apache::geode::client::SystemProperties::notifyAckInterval
const int32_t notifyAckInterval() const
Returns the periodic notify ack interval.
Definition: SystemProperties.hpp:181
apache::geode::client::SystemProperties::tombstoneTimeoutInMSec
const uint32_t tombstoneTimeoutInMSec() const
Returns the tombstone timeout .
Definition: SystemProperties.hpp:407
apache::geode::client::SystemProperties::setOnClientDisconnectClearPdxTypeIds
void setOnClientDisconnectClearPdxTypeIds(bool set)
Set to true if app want to clear pdx type ids when client disconnect.
Definition: SystemProperties.hpp:301
apache::geode::client::SystemProperties::sslKeyStore
const char * sslKeyStore() const
Returns the path of the private key file for SSL use.
Definition: SystemProperties.hpp:107
AuthInitialize.hpp
apache::geode::client::SystemProperties::heapLRULimit
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:154
apache::geode::client::SystemProperties::isDhOn
bool isDhOn()
Check whether Diffie-Hellman based credentials encryption is on.
Definition: SystemProperties.hpp:359
apache::geode::client::AuthInitialize
Definition: AuthInitialize.hpp:45
apache::geode::client::SharedPtr< Properties >
apache::geode::client::SystemProperties::securityClientDhAlgo
const char * securityClientDhAlgo()
Return the security diffie hellman secret key algo.
Definition: SystemProperties.hpp:320
apache::geode::client::SystemProperties::pingInterval
const int32_t pingInterval() const
Returns the time between two consecutive ping to servers.
Definition: SystemProperties.hpp:170
apache::geode::client::SystemProperties::logLevel
Log::LogLevel logLevel() const
Returns the log level at which logging would be done.
Definition: SystemProperties.hpp:134

Pivotal GemFire C++ Cache API Documentation