- com
- pcbsys
- nirvana
- client
- nSessionAttributes
This class is a container for the attributes necessary to create a Nirvana session. More...
Public Member Functions | |
String | getConnectionDetail (int idx) |
Returns the rname indexed by idx. More... | |
String[] | getEnabledCiphers () |
long | getInitialConnectionRetryCount () |
Gets the inital connection retry count. More... | |
String | getKeyStoreCert () |
String | getKeyStorePass () |
String | getKeyStorePath () |
String | getName () |
int | getNumberOfConnections () |
Returns the number of protocols used by this nSession. More... | |
String | getSSLProtocol () |
String | getTrustStorePass () |
String | getTrustStorePath () |
boolean | isDisableReconnect () |
Returns the value of the disableReconnect flag, which stops the session from automatically attempting a reconnection before calling the tryAgain function of any supplied nReconnectHandler. More... | |
boolean | isDisconnectOnClusterFailure () |
If the Session Attribute has been configured such that loss of cluster quorum or the currently connected node disconnects from the cluster then the connection is dropped. More... | |
boolean | isFollowTheMaster () |
If the Session Attributes has been configured to follow the cluster master. More... | |
boolean | isRequestPriorityConnection () |
Queries the property which requests a priority connection to the server. More... | |
boolean | isRequestUnthrottledConnection () |
Queries the property which requests an unthrottled connection to the server. More... | |
boolean | isSessionThreadsDaemon () |
Returns whether or not the session associated with this nSessionAttributes will use Daemon threads or not. More... | |
nSessionAttributes (nRealm realm) throws nIllegalArgumentException | |
Constructs an nSessionAttributes object from the nRealm object supplied. More... | |
nSessionAttributes (nRealm realm, long initialConnectionRetry) throws nIllegalArgumentException | |
Constructs an nSessionAttributes object from the nRealm object supplied. More... | |
nSessionAttributes (String url) throws nIllegalArgumentException | |
Constructs an nSessionAttributes object with the string URL specified. More... | |
nSessionAttributes (String url, long initialConnectionRetry) throws nIllegalArgumentException | |
Constructs an nSessionAttributes object with the string URL specified and retry count for initial connection attempts. More... | |
nSessionAttributes (String[] urls) throws nIllegalArgumentException | |
Constructs an nSessionAttributes object with the collection of string URLs specified. More... | |
nSessionAttributes (String[] urls, long initialConnectionRetry) throws nIllegalArgumentException | |
Constructs an nSessionAttributes object with the collection of string URLs specified. More... | |
void | setDisableReconnect (boolean disableReconnect) |
Sets whether to stop the session from automatically attempting a reconnection before calling the tryAgain function of any supplied nReconnectHandler. More... | |
void | setDisconnectOnClusterFailure (boolean disconnectOnClusterFailure) |
Set this flag to true if the session is to be disconnected on cluster failure, or node disconnection to the cluster. More... | |
void | setEnabledCiphers (String[] enabledCiphers) |
void | setFollowTheMaster (boolean followTheMaster) |
Set this flag to true if the session is to connect only to a master in a cluster, has no effect on none clustered servers. More... | |
void | setKeystore (String keystore, String password) |
void | setKeystore (String keystore, String password, String alias) |
void | setName (String sessionName) |
void | setRequestPriorityConnection (boolean requestPriorityConnection) |
Sets the property which requests a priority connection to the server. More... | |
void | setRequestUnthrottledConnection (boolean requestUnthrottledConnection) |
Sets the property which requests an unthrottled connection to the server. More... | |
void | setSessionThreadsAsDaemon (boolean useDaemonThreads) |
Each Nirvana nSession has a dedicated thread used to synchronously read from the underlying transport. More... | |
void | setSSLProtocol (String sslProtocol) |
void | setTruststore (String truststore, String password) |
Static Public Member Functions | |
static String | getPKCS11NSSConfigFile () |
static String | getPKCS11NSSName () |
static void | setPKCS11NSSConfigFile (String config) |
static void | setPKCS11NSSName (String name) |
This class is a container for the attributes necessary to create a Nirvana session.
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes | ( | nRealm | realm | ) | throws nIllegalArgumentException |
Constructs an nSessionAttributes object from the nRealm object supplied.
realm | A nRealm object of the realm you want to connect to. |
nIllegalArgumentException | if the url is invalid |
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes | ( | nRealm | realm, |
long | initialConnectionRetry | ||
) | throws nIllegalArgumentException |
Constructs an nSessionAttributes object from the nRealm object supplied.
realm | A nRealm object of the realm you want to connect to. |
initialConnectionRetry | A long specfiying amount of times to retry for inital connection |
nIllegalArgumentException | if the url is invalid |
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes | ( | String | url | ) | throws nIllegalArgumentException |
Constructs an nSessionAttributes object with the string URL specified.
url | A string in the form protocol://host:port e.g. nsp://127.0.0.1:9000 Protocol can be one of nsp, nhp, nsps, nhps |
nIllegalArgumentException | if the url is invalid |
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes | ( | String | url, |
long | initialConnectionRetry | ||
) | throws nIllegalArgumentException |
Constructs an nSessionAttributes object with the string URL specified and retry count for initial connection attempts.
url | A string in the form protocol://host:port e.g. nsp://127.0.0.1:9000 Protocol can be one of nsp, nhp, nsps, nhps |
initialConnectionRetry | A long specfiying amount of times to retry for inital connection |
nIllegalArgumentException | if the url is invalid |
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes | ( | String[] | urls | ) | throws nIllegalArgumentException |
Constructs an nSessionAttributes object with the collection of string URLs specified.
urls | A string[], 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 |
nIllegalArgumentException | if the url is invalid |
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes | ( | String[] | urls, |
long | initialConnectionRetry | ||
) | throws nIllegalArgumentException |
Constructs an nSessionAttributes object with the collection of string URLs specified.
urls | A string[], 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 |
initialConnectionRetry | A long specfiying amount of times to retry for inital connection |
nIllegalArgumentException | if the url is invalid |
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
idx | the index of the connection details to return |
NoSuchElementException | If the index is out of bounds |
String [] com.pcbsys.nirvana.client.nSessionAttributes.getEnabledCiphers | ( | ) |
long com.pcbsys.nirvana.client.nSessionAttributes.getInitialConnectionRetryCount | ( | ) |
Gets the inital connection retry count.
String com.pcbsys.nirvana.client.nSessionAttributes.getKeyStoreCert | ( | ) |
String com.pcbsys.nirvana.client.nSessionAttributes.getKeyStorePass | ( | ) |
String com.pcbsys.nirvana.client.nSessionAttributes.getKeyStorePath | ( | ) |
String com.pcbsys.nirvana.client.nSessionAttributes.getName | ( | ) |
int com.pcbsys.nirvana.client.nSessionAttributes.getNumberOfConnections | ( | ) |
|
static |
|
static |
String com.pcbsys.nirvana.client.nSessionAttributes.getSSLProtocol | ( | ) |
String com.pcbsys.nirvana.client.nSessionAttributes.getTrustStorePass | ( | ) |
String com.pcbsys.nirvana.client.nSessionAttributes.getTrustStorePath | ( | ) |
boolean com.pcbsys.nirvana.client.nSessionAttributes.isDisableReconnect | ( | ) |
Returns the value of the disableReconnect flag, which stops the session from automatically attempting a reconnection before calling the tryAgain function of any supplied nReconnectHandler.
boolean com.pcbsys.nirvana.client.nSessionAttributes.isDisconnectOnClusterFailure | ( | ) |
If the Session Attribute has been configured such that loss of cluster quorum or the currently connected node disconnects from the cluster then the connection is dropped.
boolean com.pcbsys.nirvana.client.nSessionAttributes.isFollowTheMaster | ( | ) |
If the Session Attributes has been configured to follow the cluster master.
boolean com.pcbsys.nirvana.client.nSessionAttributes.isRequestPriorityConnection | ( | ) |
Queries the property which requests a priority connection to the server.
boolean com.pcbsys.nirvana.client.nSessionAttributes.isRequestUnthrottledConnection | ( | ) |
Queries the property which requests an unthrottled connection to the server.
boolean com.pcbsys.nirvana.client.nSessionAttributes.isSessionThreadsDaemon | ( | ) |
Returns whether or not the session associated with this nSessionAttributes will use Daemon threads or not.
void com.pcbsys.nirvana.client.nSessionAttributes.setDisableReconnect | ( | boolean | disableReconnect | ) |
Sets whether to stop the session from automatically attempting a reconnection before calling the tryAgain function of any supplied nReconnectHandler.
disableReconnect | if set to true we will stop reconnection attempts |
void com.pcbsys.nirvana.client.nSessionAttributes.setDisconnectOnClusterFailure | ( | boolean | disconnectOnClusterFailure | ) |
Set this flag to true if the session is to be disconnected on cluster failure, or node disconnection to the cluster.
If followTheMaster is enabled then this value will be ignored and automatically set to true when connecting
disconnectOnClusterFailure | The required state for this session |
void com.pcbsys.nirvana.client.nSessionAttributes.setEnabledCiphers | ( | String[] | enabledCiphers | ) |
enabledCiphers | an array of enabled ciphers that the client can use |
void com.pcbsys.nirvana.client.nSessionAttributes.setFollowTheMaster | ( | boolean | followTheMaster | ) |
Set this flag to true if the session is to connect only to a master in a cluster, has no effect on none clustered servers.
If true, then on connection to any node within the cluster, if its not the master then the connection will be closed and a connection to the master established
Setting this flag to be true will also automatically set the flag disconnectOnClusterFailure to true when connecting
followTheMaster | The required state for this session |
void com.pcbsys.nirvana.client.nSessionAttributes.setKeystore | ( | String | keystore, |
String | password | ||
) |
keystore | path value for the key store file |
password | value for the key store |
void com.pcbsys.nirvana.client.nSessionAttributes.setKeystore | ( | String | keystore, |
String | password, | ||
String | alias | ||
) |
keystore | path value for the key store file |
password | value for the key store |
alias | value for certificate to use from key store when doing client validation |
void com.pcbsys.nirvana.client.nSessionAttributes.setName | ( | String | sessionName | ) |
|
static |
config | is the location of the NSS configuration file on the file system |
|
static |
name | is the unique identifier in the NSS configuration file for identification purposes |
void com.pcbsys.nirvana.client.nSessionAttributes.setRequestPriorityConnection | ( | boolean | 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.
requestPriorityConnection | boolean set to true to request a priority connection, false for a normal connection. |
void com.pcbsys.nirvana.client.nSessionAttributes.setRequestUnthrottledConnection | ( | boolean | 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.
requestUnthrottledConnection | boolean set to true to request an unthrottled connection, false for a normal connection |
void com.pcbsys.nirvana.client.nSessionAttributes.setSessionThreadsAsDaemon | ( | boolean | useDaemonThreads | ) |
Each Nirvana nSession has a dedicated thread used to synchronously read from the underlying transport.
This thread is set as non-daemon thread by default. This is to ensure that on program exit, or Main thread exit, call stacks are correctly unwound. Setting the read thread to be a daemon thread may cause your program to prematurely exit when all other non-daemon threads exit. This method should be used with extreme care.
useDaemonThreads | specifies whether to set the read thread as a daemon |
void com.pcbsys.nirvana.client.nSessionAttributes.setSSLProtocol | ( | String | sslProtocol | ) |
sslProtocol | is the protocol this client can use in its SSL communication |
void com.pcbsys.nirvana.client.nSessionAttributes.setTruststore | ( | String | truststore, |
String | password | ||
) |
truststore | path value for the trust store file |
password | value for the trust store |