com.pcbsys.nirvana.client.nConstants Class Reference
This class is a container for the various constants that affect the behaviour of various Nirvana Client API calls. More...
#include <nConstants.h>
Static Public Member Functions | |
| static bool | attemptReconnectAfterAccessChange () |
| Returns whether a nirvana nSession will attempt to reconnect to the realm after the realm ACL has been revoked. | |
| static bool | attemptReconnectImmediately () |
| Returns whether a nirvana nSession will attempt to immediately reconnect or whether reconnection attempts will back off over time to prevent a network storm where multiple re-connections can occur all at once. | |
| static int | compareNoCase (const std::string &string1, const std::string &string2) |
| Compare 2 strings for equality. | |
| static longlong | currentTimeMillis () |
| Return an Epoch Date in milliseconds representing the current system date / time. | |
| static void | decode (unsigned char *pBuffer, int size, std::string &str) |
| Decode the array into a string. | |
| static unsigned char * | encode (const std::string &str, int &size) |
| Encode the string into an array. | |
| static int | getAccessWaitLimit () |
| Returns the outbound publish queue access wait time. | |
| static int | getBlockLimit () |
| Returns the outbound publish queue block wait time. | |
| static std::string | GetCAPath () |
| Return the CA path. | |
| static std::string | GetCertificatePassword () |
| Return the certificate password for the SSL client certificate used for authentication. | |
| static std::string | GetCertificatePath () |
| Return the certificate path used for SSL client authentication. | |
| static int | getConnectionBlockWeighting () |
| Returns the outbound publish queue block weighting. | |
| static int | getConnectionQueueHighWater () |
| Returns the outbound publish queue high watermark. | |
| static int | getConnectionQueueLowWater () |
| Returns the outbound publish queue low watermark. | |
| static int | getDataGroupQueueSize () |
| static long | getEVENTWAIT () |
| This is the maximum time the client API will wait for a response to a specific request from the Nirvana realm. | |
| static int | getInitialConnectionTimeout () |
| This returns the current value for the Initial socket connect timeout. | |
| static long | getKeepAliveInterval () |
| Gets the value in ms to wait before sending a Keep Alive. | |
| static int | getPushWaitLimit () |
| Returns the outbound publish queue push wait time. | |
| static long | getReconnectInterval () |
| Returns the interval value to use between reconnect attempts when the session is set to reconnect immediately. | |
| static int | getSubHighWater () |
| Retrieves the subscriber queue high watermark. | |
| static int | getSubLowWater () |
| Retrieves the subscriber queue low watermark. | |
| static int | getWriteHandlerType () |
| Returns the current write handling mode that the client is using. | |
| static void | setAccessWaitLimit (int p_accessWait) |
| Sets the outbound publish queue access wait time. | |
| static void | setBlockLimit (int p_blockWait) |
| Sets the outbound publish queue block wait time. | |
| static void | SetCAPath (const std::string &CAPath) |
| Sets the path to the CA. | |
| static void | SetCertificatePassword (const std::string &certificatePassword) |
| Sets the password for the pem certificate used for SSL client authentication. | |
| static void | SetCertificatePath (const std::string &certificatePath) |
| Sets the path to the pem certificate used for SSL client authentication. | |
| static void | setClientLogLevel (int level) |
| Sets the log level for the client. | |
| static void | setConnectionBlockWeighting (int blockWeighting) |
| Sets the outbound publish queue block weighting. | |
| static void | setConnectionQueueHighWater (int high) |
| Sets the outbound publish queue high watermark. | |
| static void | setConnectionQueueLowWater (int low) |
| Sets the outbound publish queue low watermark. | |
| static void | setDataGroupQueueSize (int queueSize) |
| Sets the number of events that are still to ve delivered to the client. | |
| static void | setEVENTWAIT (long newval) |
| This is the maximum time the client API will wait for a response to a specific request from the Nirvana realm. | |
| static void | setInitialConnectionTimeout (int timeout) |
| This sets the current value for the Initial socket connect timeout. | |
| static void | setKeepAliveInterval (long newVal) |
| Sets the value in ms to wait before sending a Keep Alive. | |
| static void | SetProxy (const std::string &host, int &port) |
| Sets the proxy host & port used for http (nhp) communication. | |
| static void | setPushWaitLimit (int p_pushWait) |
| Sets the outbound publish queue push wait time. | |
| static void | setReconnectAfterAccessChange (bool recon) |
| Sets whether a nirvana nSession will attempt to reconnect to the realm after the realm ACL has been revoked. | |
| static void | setReconnectImmediately (bool recon) |
| Sets whether a nirvana nSession will attempt to immediately reconnect or whether reconnection attempts will back off over time to prevent a network storm where multiple re-connections can occur all at once. | |
| static void | setReconnectInterval (long interval) |
| Returns the interval value to use between reconnect attempts when the session is set to reconnect immediately. | |
| static void | setSubHighWater (int high) |
| Sets the subscriber queue high watermark. | |
| static void | setSubLowWater (int low) |
| Sets the subscriber queue low watermark. | |
| static void | setWriteHandlerType (int type) |
| Allows the client to specify the type of write handling that the client code will employ. | |
Static Public Attributes | |
| static const int | m_sDirectWriteHandler = fConnectionSettings::sDirectWriteHandler |
| This write handler only uses a direct write method to the network layer, this reduces latencies but may increase the cpu used. | |
| static const int | m_sStandardWriteHandler = fConnectionSettings::sPeakWriteHandler |
| This write handler uses a combination of direct writing and buffered writing to the network depending on client event load. | |
Detailed Description
This class is a container for the various constants that affect the behaviour of various Nirvana Client API calls.Member Function Documentation
| static bool com.pcbsys.nirvana.client.nConstants.attemptReconnectAfterAccessChange | ( | ) | [static] |
Returns whether a nirvana nSession will attempt to reconnect to the realm after the realm ACL has been revoked.
By default, the nSession will not reconnect after one of these incidents, and a manual restart would need to be initiated
- Returns:
- true if reconnect is enabled after realm ACL subject revocation
| static bool com.pcbsys.nirvana.client.nConstants.attemptReconnectImmediately | ( | ) | [static] |
Returns whether a nirvana nSession will attempt to immediately reconnect or whether reconnection attempts will back off over time to prevent a network storm where multiple re-connections can occur all at once.
- Returns:
- true if reconnect immediately is enabled
| static int com.pcbsys.nirvana.client.nConstants.compareNoCase | ( | const std::string & | string1, | |
| const std::string & | string2 | |||
| ) | [static] |
Compare 2 strings for equality.
- Parameters:
-
string1 the 1st string in comparison string2 the 2nd string in comparison
- Returns:
- result of string1.compare(string2)
| static longlong com.pcbsys.nirvana.client.nConstants.currentTimeMillis | ( | ) | [static] |
Return an Epoch Date in milliseconds representing the current system date / time.
- Returns:
- Epoch time as a long
| static void com.pcbsys.nirvana.client.nConstants.decode | ( | unsigned char * | pBuffer, | |
| int | size, | |||
| std::string & | str | |||
| ) | [static] |
Decode the array into a string.
- Parameters:
-
pBuffer the array to decode size the size of the array str the string to decode into
| static unsigned char* com.pcbsys.nirvana.client.nConstants.encode | ( | const std::string & | str, | |
| int & | size | |||
| ) | [static] |
Encode the string into an array.
- Parameters:
-
str the string to encode size the size of the array
- Returns:
- the encoded array
| static int com.pcbsys.nirvana.client.nConstants.getAccessWaitLimit | ( | ) | [static] |
Returns the outbound publish queue access wait time.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a period of time that the queue cannot be accessed. This period is called the block access time
- Returns:
- the connection queue access wait
| static int com.pcbsys.nirvana.client.nConstants.getBlockLimit | ( | ) | [static] |
Returns the outbound publish queue block wait time.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a configurable period. This period is called the block wait time
- Returns:
- the connection queue block wait
| static int com.pcbsys.nirvana.client.nConstants.getConnectionBlockWeighting | ( | ) | [static] |
Returns the outbound publish queue block weighting.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a configurable period. The connection block weighting is a value that is applied to the block wait value in order to control the frequency of these notifications.
- Returns:
- the connection queue block weighting
| static int com.pcbsys.nirvana.client.nConstants.getConnectionQueueHighWater | ( | ) | [static] |
Returns the outbound publish queue high watermark.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
- Returns:
- the outbound connection queue high water mark
| static int com.pcbsys.nirvana.client.nConstants.getConnectionQueueLowWater | ( | ) | [static] |
Returns the outbound publish queue low watermark.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
- Returns:
- the outbound connection queue low water mark
| static int com.pcbsys.nirvana.client.nConstants.getDataGroupQueueSize | ( | ) | [static] |
- Returns:
- The current data group event queue size
| static long com.pcbsys.nirvana.client.nConstants.getEVENTWAIT | ( | ) | [static] |
This is the maximum time the client API will wait for a response to a specific request from the Nirvana realm.
The default value is 60 secs and typically if you get a nRequestTimedOutException the cause would be:
1. There is a protocol mismatch between the client library in use and server you are connected to.
2. The realm is really so busy that it has not managed to respond to your request within the specified maximum interval.
- Returns:
- a long specifying the maximum wait time for a protocol request (in ms)
| static int com.pcbsys.nirvana.client.nConstants.getInitialConnectionTimeout | ( | ) | [static] |
This returns the current value for the Initial socket connect timeout.
This timeout is specified in the actual underlying Socket connect, and enables connections made to non existent or unreachable hosts to be returned within a configurable time frame
- Returns:
- the socket connect timeout value, default is 30000ms
| static long com.pcbsys.nirvana.client.nConstants.getKeepAliveInterval | ( | ) | [static] |
Gets the value in ms to wait before sending a Keep Alive.
This is relevant to the local JVM only.
| static int com.pcbsys.nirvana.client.nConstants.getPushWaitLimit | ( | ) | [static] |
Returns the outbound publish queue push wait time.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a period of time that events cannot be pushed to the queue. This period is called the push wait time
- Returns:
- the connection queue push wait
| static long com.pcbsys.nirvana.client.nConstants.getReconnectInterval | ( | ) | [static] |
Returns the interval value to use between reconnect attempts when the session is set to reconnect immediately.
- Returns:
- true if reconnect immediately is enabled
- Since:
- 4.0
| static int com.pcbsys.nirvana.client.nConstants.getSubHighWater | ( | ) | [static] |
Retrieves the subscriber queue high watermark.
Each Nirvana subscriber uses a queue to store events retrieved from the server prior to performing the callback to the registered event listeners. When the queue reaches the high watermark the subscription is suspended to allow the event listener to catch up and control the amount of memory used on the client. When the queue reaches the low watermark, the subscription is automatically resumed.
- Returns:
- an int specifying the number of events to be used as a queue high watermark
| static int com.pcbsys.nirvana.client.nConstants.getSubLowWater | ( | ) | [static] |
Retrieves the subscriber queue low watermark.
Each Nirvana subscriber uses a queue to store events retrieved from the server prior to performing the callback to the registered event listeners. When the queue reaches the high watermark the subscription is suspended to allow the event listener to catch up and control the amount of memory used on the client. When the queue reaches the low watermark, the subscription is automatically resumed.
- Returns:
- an int specifying the number of events to be used as a queue low watermark
| static int com.pcbsys.nirvana.client.nConstants.getWriteHandlerType | ( | ) | [static] |
Returns the current write handling mode that the client is using.
- Returns:
- an int of either sStandardWriteHandler or sDirectWriteHandler
| static void com.pcbsys.nirvana.client.nConstants.setAccessWaitLimit | ( | int | p_accessWait | ) | [static] |
Sets the outbound publish queue access wait time.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a period of time that the queue cannot be accessed. This period is called the block access time
- Parameters:
-
p_accessWait the connection queue access wait
| static void com.pcbsys.nirvana.client.nConstants.setBlockLimit | ( | int | p_blockWait | ) | [static] |
Sets the outbound publish queue block wait time.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a configurable period. This period is called the block wait time
- Parameters:
-
p_blockWait the connection queue block wait
| static void com.pcbsys.nirvana.client.nConstants.setClientLogLevel | ( | int | level | ) | [static] |
Sets the log level for the client.
All Nirvana client api code contains useful logging messages. The messages are set at specific levels from 0-7. This method allows you to choose what log level you wish to see. Setting to log level 0 will provide verbose output, whereas level 7 will be fairly quiet.
By default, these messages will be sent to the console output
- Parameters:
-
level the log level you wish to set the client application to for nirvana messages
| static void com.pcbsys.nirvana.client.nConstants.setConnectionBlockWeighting | ( | int | blockWeighting | ) | [static] |
Sets the outbound publish queue block weighting.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a configurable period. The connection block weighting is a value that is applied to the block wait value in order to control the frequency of these notifications.
- Parameters:
-
blockWeighting the connection queue block weighting
| static void com.pcbsys.nirvana.client.nConstants.setConnectionQueueHighWater | ( | int | high | ) | [static] |
Sets the outbound publish queue high watermark.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
- Parameters:
-
high the outbound connection queue high water mark
| static void com.pcbsys.nirvana.client.nConstants.setConnectionQueueLowWater | ( | int | low | ) | [static] |
Sets the outbound publish queue low watermark.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
- Parameters:
-
low the outbound connection queue low water mark
| static void com.pcbsys.nirvana.client.nConstants.setDataGroupQueueSize | ( | int | queueSize | ) | [static] |
Sets the number of events that are still to ve delivered to the client.
- Parameters:
-
queueSize number of events that the queue will hold before blocking
| static void com.pcbsys.nirvana.client.nConstants.setEVENTWAIT | ( | long | newval | ) | [static] |
This is the maximum time the client API will wait for a response to a specific request from the Nirvana realm.
The default value is 60 secs and typically if you get a nRequestTimedOutException the cause would be:
1. There is a protocol mismatch between the client library in use and server you are connected to.
2. The realm is really so busy that it has not managed to respond to your request within the specified maximum interval.
Calling this method will only have effect on the local client. Alternatively if you change this value through on the realm configuration using the Admin API, all subsequent Nirvana clients that connect will be affected.
| static void com.pcbsys.nirvana.client.nConstants.setInitialConnectionTimeout | ( | int | timeout | ) | [static] |
This sets the current value for the Initial socket connect timeout.
This timeout is specified in the actual underlying Socket connect, and enables connections made to non existent or unreachable hosts to be returned within a configurable time frame.
- Parameters:
-
timeout the socket connect timeout value to be set, default is 30000ms
| static void com.pcbsys.nirvana.client.nConstants.setKeepAliveInterval | ( | long | newVal | ) | [static] |
Sets the value in ms to wait before sending a Keep Alive.
This is applied to the local JVM only and is NOT sent to the realm.
| static void com.pcbsys.nirvana.client.nConstants.setPushWaitLimit | ( | int | p_pushWait | ) | [static] |
Sets the outbound publish queue push wait time.
Each Nirvana session that sends events to the server (e.g. publishers) place events into an outbound queue to be sent to the server. When the queue reaches the high watermark the queue is unavailable to the client session until the queue reaches it's low water mark, i.e. the events are delivered to the server. When the low water mark is reached the queue is automatically resumed.
When an outbound queue becomes blocked (unavailable) it is possible to become notified after a period of time that events cannot be pushed to the queue. This period is called the push wait time
- Parameters:
-
p_pushWait the connection queue push wait
| static void com.pcbsys.nirvana.client.nConstants.setReconnectAfterAccessChange | ( | bool | recon | ) | [static] |
Sets whether a nirvana nSession will attempt to reconnect to the realm after the realm ACL has been revoked.
By default, the nSession will not reconnect after one of these incidents, and a manual restart would need to be initiated
- Parameters:
-
recon true - will reconnect continually until successful, false, will disabled reconnect
| static void com.pcbsys.nirvana.client.nConstants.setReconnectImmediately | ( | bool | recon | ) | [static] |
Sets whether a nirvana nSession will attempt to immediately reconnect or whether reconnection attempts will back off over time to prevent a network storm where multiple re-connections can occur all at once.
- Parameters:
-
recon true - will reconnect immediately, and use the value set in
- Since:
- 4.0
| static void com.pcbsys.nirvana.client.nConstants.setReconnectInterval | ( | long | interval | ) | [static] |
Returns the interval value to use between reconnect attempts when the session is set to reconnect immediately.
- Parameters:
-
interval value in milliseconds specifying the interval between reconnect attempts
- Since:
- 4.0
| static void com.pcbsys.nirvana.client.nConstants.setSubHighWater | ( | int | high | ) | [static] |
Sets the subscriber queue high watermark.
Each Nirvana subscriber uses a queue to store events retrieved from the server prior to performing the callback to the registered event listeners. When the queue reaches the high watermark the subscription is suspended to allow the event listener to catch up and control the amount of memory used on the client. When the queue reaches the low watermark, the subscription is automatically resumed.
- Parameters:
-
high sets the subscriber high water mark
| static void com.pcbsys.nirvana.client.nConstants.setSubLowWater | ( | int | low | ) | [static] |
Sets the subscriber queue low watermark.
Each Nirvana subscriber uses a queue to store events retrieved from the server prior to performing the callback to the registered event listeners. When the queue reaches the high watermark the subscription is suspended to allow the event listener to catch up and control the amount of memory used on the client. When the queue reaches the low watermark, the subscription is automatically resumed.
- Parameters:
-
low the low water ,ark for the subscriber
| static void com.pcbsys.nirvana.client.nConstants.setWriteHandlerType | ( | int | type | ) | [static] |
