Nirvana fully supports HTTP and HTTPS. Rather than
tunnel an existing protocol through HTTP Nirvana has
a plugable set of communications drivers supporting
TCP/IP Sockets, SSL enabled TCP/IP sockets, HTTP and
HTTPS. Both the client and server make use of these
pluggable drivers. From the server perspective different
driver types can be assigned to specific Nirvana interfaces.
From a client perspective a Nirvana session can be built
on any one of the available drivers dynamically.
To create a connect to a Nirvana Realm over HTTPS you
would use an RNAME that specific
the Nirvana HTTPS protocol (nhps) as follows:
1. Create a nSessionAttrib object with the RNAME value
of your choice
//use an RNAME indicating the communication
protocol you are using (HTTPS in this case)
//you can pass an array of up to four values for
RNAME for added robustness
String[] RNAME=( { “nhps://remoteHost:443”
} );
nSessionAttrib nsa = new nSessionAttrib( RNAME );
2. Call the create method on nSessionFactory to create
your session
nSession mySession = nSessionFactory.create(
nsa );
Alternatively, if you require the use of a session
reconnect handler to intercept the automatic reconnection
attempts, pass an instance of that class too in the
create method:
Public class myReconnectHandler implements
nReconnectHandler {
…
}
myReconnectHandler rhandler = new myReconnectHandler(
);
nSession mySession = nSessionFactory.create( nsa,
rhandler );
3. Initialise the session object to open the connection
to the Nirvana Realm
mySession.init();
After initialising your Nirvana session, you will be
connected to the Nirvana Realm using HTTPS. From that
point, all functionality is subject to a Realm ACL check.
If you call a method that requires a permission your
credential does not have, you will receive an nSecurityException.
Click here for more information on Nirvana
ACLs.
|