com::softwareag::umtransport::ClientSHMTransportContext::Builder Class Reference

This Builder object is used to build a ClientSHMTransportContext. The ClientSHMTransportContext is configured using the builder so that once build() is called, the ClientSHMTransportContext is only returned if it is valid. You can use the Builder to create simple readable code like this: More...

#include <ClientSHMTransportContext.h>

Inheritance diagram for com::softwareag::umtransport::ClientSHMTransportContext::Builder:
com::softwareag::umtransport::ClientContextBuilder com::softwareag::umtransport::ContextBuilder

Public Member Functions

std::unique_ptr
< ClientTransportContext
build ()
 Builds the ClientSHMTransportContext based on the configuration that has been set on the Builder. More...
 
 Builder ()
 Construct a new instance of this Builder object. More...
 
std::string getFilePath ()
 Get the file path that is currently set. The path will be used to store the memory mapped files required by the SHM Transport. More...
 
int getLockWait ()
 Get the current wait time for yielding a spin lock. Advanced option for SHM transports only. More...
 
longlong getSpinCount ()
 Gets the current active spin count. Advanced option for SHM transports only. More...
 
bool isLowLatency ()
 Determines whether low latency mode is enabled. More...
 
BuilderwithFilePath (const std::string &path)
 Set the path to the directory which will be used to store the memory mapped files used by the SHM Transport. More...
 
BuilderwithLockWait (const int count)
 Sets the waiting time (in nanoseconds) for yielding a spin lock. Advanced configuration option, use judiciously. More...
 
BuilderwithLowLatency (bool flag)
 Used to disable/enable low latency mode (on by default). If low latency mode is true then the application will be very CPU intensive and ideally consume an core of the machine. This allows the Transport to respond as fast as possible when new data arrives. If this mode is set to false then the Transport will be less CPU intensive but latency will be increased slightly as a consequence. More...
 
BuilderwithSpinCount (const longlong count)
 Sets the spin count for reading data from an SHM input stream. Advanced configuration option, use judiciously. More...
 

Additional Inherited Members

- Protected Member Functions inherited from com::softwareag::umtransport::ClientContextBuilder
std::string getCiphers ()
 Get the value that is currently set for the OpenSSL formatted cipher string list More...
 
std::string getFilePath ()
 Get the file path that is currently set. The path will be used to store the memory mapped files required by the SHM Transport. More...
 
std::string getHost ()
 Returns the current value that has been set for the host name More...
 
int getLockWait ()
 Get the current wait time for yielding a spin lock. Advanced option for SHM transports only. More...
 
int getPort ()
 Returns the current value that has been set for the port More...
 
longlong getSpinCount ()
 Gets the current active spin count. Advanced option for SHM transports only. More...
 
std::string getTrustStore ()
 Get the value that is currently set for the path to the trust store on the local machine More...
 
bool isLowLatency ()
 Determines whether low latency mode is enabled. More...
 
ClientContextBuilderwithCiphers (const std::string &ciphers)
 Set the cipher list to use for SSL, the format of the string is OpenSSL formatted cipher string More...
 
ClientContextBuilderwithFilePath (const std::string &path)
 Set the path to the directory which will be used to store the memory mapped files used by the SHM Transport. More...
 
ClientContextBuilderwithHost (const std::string &host)
 Sets the host of the server that you want to connect to e.g. um.terracotta.org More...
 
ClientContextBuilderwithLockWait (const int count)
 Sets the waiting time (in nanoseconds) for yielding a spin lock. Advanced configuration option, use judiciously. More...
 
ClientContextBuilderwithLowLatency (bool flag)
 Used to disable/enable low latency mode (on by default). If low latency mode is true then the application will be very CPU intensive and ideally consume an core of the machine. This allows the Transport to respond as fast as possible when new data arrives. If this mode is set to false then the Transport will be less CPU intensive but latency will be increased slightly as a consequence. More...
 
ClientContextBuilderwithPort (int port)
 Sets the port of the server that you want to connect to e.g. 9000 More...
 
ClientContextBuilderwithSpinCount (const longlong count)
 Sets the spin count for reading data from an SHM input stream. Advanced configuration option, use judiciously. More...
 
ClientContextBuilderwithTrustStore (const std::string &trustStore)
 Set the path the the trust store that will be used to validate the server provided certificate More...
 

Detailed Description

This Builder object is used to build a ClientSHMTransportContext. The ClientSHMTransportContext is configured using the builder so that once build() is called, the ClientSHMTransportContext is only returned if it is valid. You can use the Builder to create simple readable code like this:

context = ClientSHMTransportContext::Builder()
.withFilePath("/path/to/directory")
.build();

Constructor & Destructor Documentation

com::softwareag::umtransport::ClientSHMTransportContext::Builder::Builder ( )

Construct a new instance of this Builder object.

Member Function Documentation

std::unique_ptr<ClientTransportContext> com::softwareag::umtransport::ClientSHMTransportContext::Builder::build ( )

Builds the ClientSHMTransportContext based on the configuration that has been set on the Builder.

Exceptions
IllegalStateExceptionif the Builder has not be configured with the required/correct information to construct the ClientTransportContext;
Returns
ClientSHMTransportContext used by the TransportFactory.connect method to construct Transports
std::string com::softwareag::umtransport::ClientSHMTransportContext::Builder::getFilePath ( )

Get the file path that is currently set. The path will be used to store the memory mapped files required by the SHM Transport.

Returns
the file path that will be used by the Transport
int com::softwareag::umtransport::ClientSHMTransportContext::Builder::getLockWait ( )

Get the current wait time for yielding a spin lock. Advanced option for SHM transports only.

Returns
the wait time (in nanoseconds) used by the SHM Transport. Returns 0 if the value is not set, or could not be converted/translated.
longlong com::softwareag::umtransport::ClientSHMTransportContext::Builder::getSpinCount ( )

Gets the current active spin count. Advanced option for SHM transports only.

Returns
the spin count used by the SHM Transport. Returns 0 if the value is not set, or could not be converted/translated.
bool com::softwareag::umtransport::ClientSHMTransportContext::Builder::isLowLatency ( )

Determines whether low latency mode is enabled.

Returns
true if low latency is enabled for this Builder; false otherwise
Builder& com::softwareag::umtransport::ClientSHMTransportContext::Builder::withFilePath ( const std::string &  path)

Set the path to the directory which will be used to store the memory mapped files used by the SHM Transport.

Parameters
pathof the directory used for communication
Returns
this Builder object to allow methods to be chained
Builder& com::softwareag::umtransport::ClientSHMTransportContext::Builder::withLockWait ( const int  count)

Sets the waiting time (in nanoseconds) for yielding a spin lock. Advanced configuration option, use judiciously.

Parameters
countthe time (in nanoseconds) to yield a spin lock
Returns
this Builder object to allow methods to be chained
Builder& com::softwareag::umtransport::ClientSHMTransportContext::Builder::withLowLatency ( bool  flag)

Used to disable/enable low latency mode (on by default). If low latency mode is true then the application will be very CPU intensive and ideally consume an core of the machine. This allows the Transport to respond as fast as possible when new data arrives. If this mode is set to false then the Transport will be less CPU intensive but latency will be increased slightly as a consequence.

Parameters
flagtrue if you want to enable low latency mode
Returns
this Builder object so that method calls can be chained.
Builder& com::softwareag::umtransport::ClientSHMTransportContext::Builder::withSpinCount ( const longlong  count)

Sets the spin count for reading data from an SHM input stream. Advanced configuration option, use judiciously.

Parameters
countthe number of times to spin waiting for data to arrive
Returns
this Builder object to allow methods to be chained