com.pcbsys.nirvana.client.nSessionAttributes Class Reference

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

Public Member Functions

String getConnectionDetail (int idx) throws Exception
 Returns the rname indexed by idx. More...
 
String[] getEnabledCiphers ()
 
long getInitialConnectionRetryCount ()
 Gets the inital connection retry count. More...
 
String getKeyStoreCert ()
 
String getKeyStorePass ()
 
String getKeyStorePath ()
 
int getNumberOfConnections ()
 Returns the number of protocols used by this nSession. More...
 
String getSSLProtocol ()
 
String getTrustStorePass ()
 
String getTrustStorePath ()
 
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...
 
 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 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 setRequestPriorityConnection (boolean requestPriorityConnection)
 Sets the property which requests a priority connection to the server. More...
 
void setSSLProtocol (String sslProtocol)
 
void setTruststore (String truststore, String password)
 

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 ( nRealm  realm) throws nIllegalArgumentException

Constructs an nSessionAttributes object from the nRealm object supplied.

Parameters
realmA nRealm object of the realm you want to connect to.
Exceptions
nIllegalArgumentExceptionif 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.

Parameters
realmA nRealm object of the realm you want to connect to.
initialConnectionRetryA long specfiying amount of times to retry for inital connection
Exceptions
nIllegalArgumentExceptionif the url is invalid
com.pcbsys.nirvana.client.nSessionAttributes.nSessionAttributes ( String  url) throws nIllegalArgumentException

Constructs an nSessionAttributes object with the string URL specified.

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
Exceptions
nIllegalArgumentExceptionif 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.

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 specfiying amount of times to retry for inital connection
Exceptions
nIllegalArgumentExceptionif 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.

Parameters
urlsA 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
Exceptions
nIllegalArgumentExceptionif 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.

Parameters
urlsA 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
initialConnectionRetryA long specfiying amount of times to retry for inital connection
Exceptions
nIllegalArgumentExceptionif the url is invalid

Member Function Documentation

String com.pcbsys.nirvana.client.nSessionAttributes.getConnectionDetail ( int  idx) throws Exception

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
String [] com.pcbsys.nirvana.client.nSessionAttributes.getEnabledCiphers ( )
Since
9.9 Returns the list of enabled ciphers set by the setEnabledCiphers() method
Returns
String[] enabledCiphers value otherwise returns null
long com.pcbsys.nirvana.client.nSessionAttributes.getInitialConnectionRetryCount ( )

Gets the inital connection retry count.

Returns
a long specifying the number of retry attempts for establishing initial connection
String com.pcbsys.nirvana.client.nSessionAttributes.getKeyStoreCert ( )
Since
9.9 Returns the Key Store Certificate Alias set by the setKeystore() method
Returns
String certificateAlias value otherwise returns null
String com.pcbsys.nirvana.client.nSessionAttributes.getKeyStorePass ( )
Since
9.9 Returns the Key Store Password set by the setKeystore() method
Returns
String keyStorePassword value otherwise returns null
String com.pcbsys.nirvana.client.nSessionAttributes.getKeyStorePath ( )
Since
9.9 Returns the Key Store Path set by the setKeystore() method
Returns
String keyStore value otherwise returns null
int com.pcbsys.nirvana.client.nSessionAttributes.getNumberOfConnections ( )

Returns the number of protocols used by this nSession.

Returns
Number of rnames used by this nSession
String com.pcbsys.nirvana.client.nSessionAttributes.getSSLProtocol ( )
Since
9.9 Returns the SSL Protocol set by the setSSLProtocol() method
Returns
String sslProtocol value Otherwise returns the value of the system property 'SSLClientProtocol' if set Otherwise returns null
String com.pcbsys.nirvana.client.nSessionAttributes.getTrustStorePass ( )
Since
9.9 Returns the Trust Store Password set by the setTruststore() method
Returns
String trustStorePassword value otherwise returns null
String com.pcbsys.nirvana.client.nSessionAttributes.getTrustStorePath ( )
Since
9.9 Returns the Trust Store Path set by the setTruststore() method
Returns
String trustStore value otherwise returns null
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.

Returns
The current state
boolean com.pcbsys.nirvana.client.nSessionAttributes.isFollowTheMaster ( )

If the Session Attributes has been configured to follow the cluster master.

Returns
the current state
boolean 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.
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.

Parameters
disconnectOnClusterFailureThe required state for this session
void com.pcbsys.nirvana.client.nSessionAttributes.setEnabledCiphers ( String[]  enabledCiphers)
Since
9.9 Sets the SSL enabled ciphers for this client. This will be used when connecting via NHPS or NSPS.
Parameters
enabledCiphersan 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

Parameters
followTheMasterThe required state for this session
void com.pcbsys.nirvana.client.nSessionAttributes.setKeystore ( String  keystore,
String  password 
)
Since
9.9 Sets custom SSL key store information. This will be used when connecting via NHPS or NSPS.
Parameters
keystorepath value for the key store file
passwordvalue for the key store
void com.pcbsys.nirvana.client.nSessionAttributes.setKeystore ( String  keystore,
String  password,
String  alias 
)
Since
9.9 Sets custom SSL key store information. This will be used when connecting via NHPS or NSPS.
Parameters
keystorepath value for the key store file
passwordvalue for the key store
aliasvalue for certificate to use from key store when doing client validation
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.

Parameters
requestPriorityConnectionboolean set to true to request a priority connection, false for a normal connection.
void com.pcbsys.nirvana.client.nSessionAttributes.setSSLProtocol ( String  sslProtocol)
Since
9.9 Sets the SSL protocol for this client. This will be used when connecting via NHPS or NSPS.
Parameters
sslProtocolis the protocol this client can use in its SSL communication
void com.pcbsys.nirvana.client.nSessionAttributes.setTruststore ( String  truststore,
String  password 
)
Since
9.9 Sets custom SSL trust store information. This will be used when connecting via NHPS or NSPS.
Parameters
truststorepath value for the trust store file
passwordvalue for the trust store