Kinetic C/C++ Client
 All Classes Functions Variables Pages
Public Member Functions | List of all members
kinetic::KineticConnectionFactory Class Reference

Factory class that builds KineticConnection instances. Rather than use the constructor developers should use NewKineticConnectionFactory. More...

#include <kinetic_connection_factory.h>

Public Member Functions

 KineticConnectionFactory (HmacProvider hmac_provider)
 
Status NewNonblockingConnection (const ConnectionOptions &options, unique_ptr< NonblockingKineticConnection > &connection)
 Creates and opens a new nonblocking connection using the given options. If the returned Status indicates success then the connection is ready to perform actions and the caller should delete it when done using it. If the Status indicates failure, then no connection will be created and the caller must not attempt to use or delete it. More...
 
Status NewNonblockingConnection (const ConnectionOptions &options, shared_ptr< NonblockingKineticConnection > &connection)
 
Status NewThreadsafeNonblockingConnection (const ConnectionOptions &options, unique_ptr< ThreadsafeNonblockingKineticConnection > &connection)
 Like NewNonblockingConnection, except the connection is safe for use by multiple threads.
 
Status NewThreadsafeNonblockingConnection (const ConnectionOptions &options, shared_ptr< ThreadsafeNonblockingKineticConnection > &connection)
 
Status NewBlockingConnection (const ConnectionOptions &options, unique_ptr< BlockingKineticConnection > &connection, unsigned int network_timeout_seconds)
 Creates and opens a new blocking connection using the given options. If the returned Status indicates success then the connection is ready to perform actions and the caller should delete it when done using it. If the Status indicates failure, then no connection will be created and the caller must not attempt to use or delete it. More...
 
Status NewBlockingConnection (const ConnectionOptions &options, shared_ptr< BlockingKineticConnection > &connection, unsigned int network_timeout_seconds)
 
Status NewThreadsafeBlockingConnection (const ConnectionOptions &options, unique_ptr< ThreadsafeBlockingKineticConnection > &connection, unsigned int network_timeout_seconds)
 Like NewBlockingConnection, except the connection is safe for use by multiple threads.
 
Status NewThreadsafeBlockingConnection (const ConnectionOptions &options, shared_ptr< ThreadsafeBlockingKineticConnection > &connection, unsigned int network_timeout_seconds)
 

Detailed Description

Factory class that builds KineticConnection instances. Rather than use the constructor developers should use NewKineticConnectionFactory.

Definition at line 39 of file kinetic_connection_factory.h.

Member Function Documentation

Status kinetic::KineticConnectionFactory::NewBlockingConnection ( const ConnectionOptions options,
unique_ptr< BlockingKineticConnection > &  connection,
unsigned int  network_timeout_seconds 
)

Creates and opens a new blocking connection using the given options. If the returned Status indicates success then the connection is ready to perform actions and the caller should delete it when done using it. If the Status indicates failure, then no connection will be created and the caller must not attempt to use or delete it.

Parameters
[in]optionsSpecifies host, port, user id, etc
[in]network_timeout_secondsIf an operation goes more than this many seconds without data the operation fails
[out]connectionPopulated with a BlockingKineticConnection if the request succeeds

Definition at line 75 of file kinetic_connection_factory.cc.

78  {
79  unique_ptr<NonblockingKineticConnection> nbc(nullptr);
80  Status status = doNewConnection(options, nbc);
81  if(status.ok())
82  connection.reset(new BlockingKineticConnection(std::move(nbc), network_timeout_seconds));
83  return status;
84 }
Status kinetic::KineticConnectionFactory::NewNonblockingConnection ( const ConnectionOptions options,
unique_ptr< NonblockingKineticConnection > &  connection 
)

Creates and opens a new nonblocking connection using the given options. If the returned Status indicates success then the connection is ready to perform actions and the caller should delete it when done using it. If the Status indicates failure, then no connection will be created and the caller must not attempt to use or delete it.

Parameters
[in]optionsSpecifies host, port, user id, etc
[in]network_timeout_secondsIf an operation goes more than this many seconds without data the operation fails
[out]connectionPopulated with a NonblockingKineticConnection if the request succeeds

Definition at line 39 of file kinetic_connection_factory.cc.

41  {
42  return doNewConnection(options, connection);
43 }

The documentation for this class was generated from the following files: