VMware GemFire Native C++ Reference  9.1
PoolFactory.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_POOLFACTORY_H_
4 #define GEODE_POOLFACTORY_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 "geode_globals.hpp"
24 #include "SharedBase.hpp"
25 #include "geode_types.hpp"
26 #include "Pool.hpp"
27 
32 namespace apache {
33 namespace geode {
34 namespace client {
35 
36 class CacheImpl;
37 class PoolAttributes;
38 
67  public:
73  static const int DEFAULT_FREE_CONNECTION_TIMEOUT = 10000;
74 
81  static const int DEFAULT_LOAD_CONDITIONING_INTERVAL = 1000 * 60 * 5;
82 
88  static const int DEFAULT_SOCKET_BUFFER_SIZE = 32768;
89 
95  static const int DEFAULT_READ_TIMEOUT = 10000;
96 
101  static const int DEFAULT_MIN_CONNECTIONS = 1;
102 
107  static const int DEFAULT_MAX_CONNECTIONS = -1;
108 
114  static const long DEFAULT_IDLE_TIMEOUT = 5000;
115 
121  static const int DEFAULT_RETRY_ATTEMPTS = -1;
122 
127  static const long DEFAULT_PING_INTERVAL = 10000;
128 
133  static const long DEFAULT_UPDATE_LOCATOR_LIST_INTERVAL = 5000;
134 
140  static const int DEFAULT_STATISTIC_INTERVAL = -1;
141 
148  // static const bool DEFAULT_THREAD_LOCAL_CONNECTIONS = false;
149 
154  static const bool DEFAULT_SUBSCRIPTION_ENABLED = false;
155 
162  static const int DEFAULT_SUBSCRIPTION_REDUNDANCY = 0;
163 
170  static const int DEFAULT_SUBSCRIPTION_MESSAGE_TRACKING_TIMEOUT = 900000;
171 
178  static const int DEFAULT_SUBSCRIPTION_ACK_INTERVAL = 100;
179 
184  static const char* DEFAULT_SERVER_GROUP;
189  static const bool DEFAULT_THREAD_LOCAL_CONN = false;
190 
195  static const bool DEFAULT_MULTIUSER_SECURE_MODE = false;
196 
201  static const bool DEFAULT_PR_SINGLE_HOP_ENABLED = true;
202 
217  void setFreeConnectionTimeout(int connectionTimeout);
229  void setLoadConditioningInterval(int loadConditioningInterval);
241  void setSocketBufferSize(int bufferSize);
242 
260  void setThreadLocalConnections(bool threadLocalConnections);
261 
271  void setReadTimeout(int timeout);
272 
285  void setMinConnections(int minConnections);
286 
300  void setMaxConnections(int maxConnections);
301 
317  void setIdleTimeout(long idleTimeout);
318 
328  void setRetryAttempts(int retryAttempts);
329 
347  void setPingInterval(long pingInterval);
348 
357  void setUpdateLocatorListInterval(long updateLocatorListInterval);
358 
371  void setStatisticInterval(int statisticInterval);
372 
381  void setServerGroup(const char* group);
382 
400  void addLocator(const char* host, int port);
401 
417  void addServer(const char* host, int port);
418 
427  void setSubscriptionEnabled(bool enabled);
441  void setSubscriptionRedundancy(int redundancy);
456  void setSubscriptionMessageTrackingTimeout(int messageTrackingTimeout);
457 
470  void setSubscriptionAckInterval(int ackInterval);
471 
478  void setMultiuserAuthentication(bool multiuserAuthentication);
479 
484  void reset();
485 
497  PoolPtr create(const char* name);
498 
519  void setPRSingleHopEnabled(bool enabled);
520 
521  ~PoolFactory();
522 
523  private:
524  PoolFactory();
525  PoolFactory(const PoolFactory&);
526  void addCheck(const char* host, int port);
527  PoolAttributesPtr m_attrs;
528  bool m_isSubscriptionRedundancy;
529  bool m_addedServerOrLocator;
530  friend class Cache;
531  friend class PoolManager;
532  friend class CacheFactory;
533  friend class CacheXmlCreation;
534 };
535 } // namespace client
536 } // namespace geode
537 } // namespace apache
538 
539 #endif // GEODE_POOLFACTORY_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
Top level class for configuring and using Geode on a client.This should be called once to create Cach...
Definition: CacheFactory.hpp:48
Defines a reference counted shared pointer.
Definition: SharedPtr.hpp:52
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:40
Manages creation and access to connection pools for clients.
Definition: PoolManager.hpp:45
static const char * DEFAULT_SERVER_GROUP
The default server group.
Definition: PoolFactory.hpp:184
This interface provides for the configuration and creation of instances of Pool.
Definition: PoolFactory.hpp:66
This namespace contains all the Geode C++ API classes, enumerations and globals.
Cache are obtained from create method on the CacheFactory#create class.
Definition: Cache.hpp:59

Pivotal GemFire C++ Cache API Documentation