Product: OpenFusion Naming Service
Version: 2.1 and above
Description:
Is there a command line tool to view the contents of the Name Service?
Solution:
The nsMgrTool, available in the bin directory of the installation, allows you to manage and view the Name Service via the command line.
In order to use the tool the Naming Service must be running.
Additionally the environmental variable NS_IOR_LOCATION must be set with the location of the Name Service ior file e.g.
file:////usr/users/me/distribdir/domains/OpenFusion/localhost/NameService/NameSingleton/NameSingleton.ior
OR
http://myhost:8080/MyNameService/LWNaming.ior
There are a number of options available:
-l | -l [ path ]
This lists the contents specified by the path. If the path resolves to a context, its contents are displayed. If the path resolves to an object, the object is displayed. If no path is specified the contents of the root naming context are displayed. The path argument should be in the form of a string. e.g.
nsMgrTool -l Videos/Films
-create | -create [ path ]
This creates a new naming context. If an element of the path does not exist then it is created automatically, e.g. if the path entered was Videos/Sport/Football and only the Videos context existed, a context would be created for Sport (under Videos) and for Football (under Videos/Sport). If a path is not supplied an unbound NamingContext is created and the object reference string is displayed to the user. e.g
nsMgrTool -create Videos/Sport
-bind | -bind < -c | -o > < -p path > < IOR > | -bind < -c | -o > < -p path > < -f filename > /
This option binds a given IOR as a context or object to the specified path. The IOR can either be provided directly or can be read from a file. If the IOR does not resolve to a context then it is bound as an object. e.g.
nsMgrTool -bind -c -p Videos/Films/ET -f /filedir/filename.ior
-resolve | -resolve [ path ]
Returns the object reference string for the specified path. If a path is not specified then the object reference string for the root context is returned. The object reference string is in the format IOR:000000000000002B49444C3A6F6D672E6F7267....... e.g
nsMgrTool -resolve Videos/Films
-destroy | -destroy [ -r ] < path > /
This unbinds and destroys the context or object specified by the path. If the path refers to a context the context is only destroyed if it is empty. If it is not empty and the -r argument has not been set it is not destroyed and a message is displayed. If the -r argument has been set then the context and its contents are unbound and destroyed recursively e.g.
nsMgrTool -destroy -r Videos/Films
-unbind | -unbind < path >
This option unbinds the context or object for the path specified. The unbind will fail if the path relates to a context and the context is not empty. e.g.
nsMgrTool -unbind Videos/Films/ET
#KnowledgeDocs
#OpenFusion