|
The 2 external interfaces may be specified as using
nhp, and
nhps on
ports 80 and 443 respectively, since for firewall purposes,
these ports are the most commonly accessible ports to
external clients connecting to the realm. The remaining
internal interfaces, visible to internal client connections
do not have the same restrictions, and so could be defined
as using nsp
and nsps
protocols on other ports, say 9000 and 9002 respectively.
What this guarantees is separation of internal and
external connections based on network interface and
protocol.
nInterfaceManager
When you have connected to a realm, and have a reference
to an nRealmNode
object, you can access an object called nInterfaceManager,
which provides the ability to add, modify, delete, stop
and start interfaces on the Nirvana realm. To get access
to this object, you can call the following method from
a realm node:
nInterfaceManager iMgr = realm.getInterfaceManager();
Using the nInterfaceManager object you can then obtain
a list of known interfaces for that realm:
Vector ifaces = iMgr.getInterfaces();
All interfaces extend a base class called nInterface.
There are 4 types of interface object that correspond
to the different types of protocols
that an interface can use. These are:
nSocketInterface - standard socket
interface, Nirvana
protocol is nsp
nHTTPInterface - http interface,
Nirvana protocol is nhp
nSSLInterface - ssl socket interface,
Nirvana protocol is nsps
nHTTPSInterface - https interface,
Nirvana protocl is nhps
Each of these interface objects contain standard configuration
information and allows the same operations to be performed
on them. For example, if there is an interface called
'nsp1', and you wanted to change the 'autostart' property
to true (i.e. make the interface start automatically
when the realm is started) this can be achieved with
the following code:
nInterface iface = iMgr.findInterface("nsp0");
iface.setAutostart(true);
iMgr.modInterface(iface);
Which will modify the interface configuration at the
server, stop and restart the interface. When performing
a modInterface operation, if you are modifying the interface
that your nRealmNode is connected to, you will be disconnected
and reconncted when the interface restarts. This is
important to remember when using the stop method of
an interface too, since if you stop the interface you
are connected to, you cannot start it again, since your
connection needs to be active, and the stop operation
will close your connection. If you wish to restart an
interface you should therefore do it from a connection
which has been made via another interface.
For more information on the Nirvana Administration,
please see the API
documentation, and the administrator
guide.
|