com::pcbsys::nirvana::client::nSessionAttributes Class Reference

This class is a container for the attributes necessary to create a Nirvana session. More...

#include <nSessionAttributes.h>

Inherits Countable.

Public Member Functions

const std::string getConnectionDetail (int idx)
 Returns the rname indexed by idx. More...
 
long getInitialConnectionRetryCount ()
 Gets the initial connection retry count. More...
 
int getNumberOfConnections ()
 Returns the number of protocols used by this nSession. More...
 
UM_DEPRECATED bool isRequestPriorityConnection ()
 Queries the property which requests a priority connection to the server. More...
 
bool isRequestUnthrottledConnection ()
 Queries the property which requests an unthrottled connection to the server. More...
 
 nSessionAttributes (const std::string &url, long initialConnectionRetry=0)
 Constructs an nSessionAttributes object with the string URL specified and retry count for initial connection attempts. More...
 
 nSessionAttributes (std::string *pUrls, int nUrl, long initialConnectionRetry=0)
 Constructs an nSessionAttributes object with the collection of string URLs specified. More...
 
void setInitialKeepAliveInterval (long timeMS)
 Sets the initial keep alive interval of the session. More...
 
UM_DEPRECATED void setRequestPriorityConnection (bool requestPriorityConnection)
 Sets the property which requests a priority connection to the server. More...
 
void setRequestUnthrottledConnection (bool requestUnthrottledConnection)
 Sets the property which requests an unthrottled connection to the server. More...
 

Detailed Description

This class is a container for the attributes necessary to create a Nirvana session.

Constructor & Destructor Documentation

com::pcbsys::nirvana::client::nSessionAttributes::nSessionAttributes ( const std::string &  url,
long  initialConnectionRetry = 0 
)

Constructs an nSessionAttributes object with the string URL specified and retry count for initial connection attempts.

Parameters
urlA string in the form protocol://host:port e.g. nsp://127.0.0.1:9000 Protocol can be one of nsp, nhp, nsps, nhps
initialConnectionRetryA long specifying amount of times to retry for initial connection
Exceptions
nIllegalArgumentExceptionif the URL is invalid
com::pcbsys::nirvana::client::nSessionAttributes::nSessionAttributes ( std::string *  pUrls,
int  nUrl,
long  initialConnectionRetry = 0 
)

Constructs an nSessionAttributes object with the collection of string URLs specified.

Parameters
*pUrlsA string array, containing strings in the form protocol://host:port e.g. nsp://127.0.0.1:9000 Protocol can be one of nsp, nhp, nsps, nhps
nUrlThe number of URLs
initialConnectionRetryA long specifying amount of times to retry for initial connection
Exceptions
nIllegalArgumentExceptionif the URL is invalid

Member Function Documentation

const std::string com::pcbsys::nirvana::client::nSessionAttributes::getConnectionDetail ( int  idx)

Returns the rname indexed by idx.

These where passed in when the initial nSession was created

Parameters
idxthe index of the connection details to return
Returns
String RNAME value
Exceptions
ExceptionIf the index is out of bounds
long com::pcbsys::nirvana::client::nSessionAttributes::getInitialConnectionRetryCount ( )

Gets the initial connection retry count.

Returns
a long specifying the number of retry attempts for establishing initial connection
int com::pcbsys::nirvana::client::nSessionAttributes::getNumberOfConnections ( )

Returns the number of protocols used by this nSession.

Returns
Number of rnames used by this nSession
UM_DEPRECATED bool com::pcbsys::nirvana::client::nSessionAttributes::isRequestPriorityConnection ( )

Queries the property which requests a priority connection to the server.

Returns
true if the request attribute is true, false otherwise.
bool com::pcbsys::nirvana::client::nSessionAttributes::isRequestUnthrottledConnection ( )

Queries the property which requests an unthrottled connection to the server.

Parameters
trueif the unthrottled connection attribute is true, false otherwise
void com::pcbsys::nirvana::client::nSessionAttributes::setInitialKeepAliveInterval ( long  timeMS)

Sets the initial keep alive interval of the session.

Parameters
timeMSlong specifies the initial keep alive interval (in milliseconds) of the first keep alive event sent to the server.
UM_DEPRECATED void com::pcbsys::nirvana::client::nSessionAttributes::setRequestPriorityConnection ( bool  requestPriorityConnection)

Sets the property which requests a priority connection to the server.

If this is true, sessions started with these session attributes will request their connection be a priority connection.

Parameters
requestPriorityConnectionboolean set to true to request a priority connection, false for a normal connection.

DEPRECATED. The priority connection will be removed in future versions.

void com::pcbsys::nirvana::client::nSessionAttributes::setRequestUnthrottledConnection ( bool  requestUnthrottledConnection)

Sets the property which requests an unthrottled connection to the server.

If this is true, sessions started with these session attributes will request that the server not throttle this connection when the available memory on the server is low. This is only necessary if the server has the EnableFlowControl config item set to true and the session publishes to the server. Otherwise the connection will not be throttled regardless.

Parameters
requestUnthrottledConnectionboolean set to true to request an unthrottled connection, false for a normal connection.