The Information Directory Service (IDS) provides components with a consistent interface to information about component installations. A component would use this information to create components through the Creation Service. The IDS functions as a front-end. Any number of service providers store the actual information.
Information in the IDS is logically stored in a hierarchy. This hierarchy is similar to a file system hierarchy, and its form is dictated by the structure of the URL identifying a component installation. Users can store and retrieve installation information in the IDS and can navigate the hierarchy to identify the installation in which they are interested.
Context objects are used to traverse the hierarchy. Logically, a context object is a reference to a directory in the heirarchy. Various operations are defined on the context for such things as descending the tree, or obtaining a list of its children.
The actual information is returned as a InformationInfo object. Info objects represent information stored as a tree of nodes with a name-value pairs associated with each node.

In this case, the nodes are A, B, and C. With node A is associated the name-value pairs Name/Splib and Version/2.2.
typedef sequenceInformationDirectoryNodeSeq;
valuetype InformationDirectoryNode {
string getName();
bool isInformation();
bool isContext();
};
valuetype InformationDirectoryContext : InformationDirectoryNode {
InformationInfo lookup(in string name)
raises (NotFoundException, InvalidContextException);
InformationDirectoryContext getSubContext(in string subcontext)
raises (BadContextNameException, InvalidContextException, NotFoundException);
InformationDirectoryNodeSeq getChildren() raises (InvalidContextException);
InformationInfoSeq getAllComponents() raises (InvalidContextException);
void bind(in Info info, in string name);
void unbind(in string name) raises (NotFoundException);
};
valuetype InformationInfo : InformationDirectoryNode, Info {
};
class InformationDirectoryService : public CCAPort {
virtual InformationDirectoryContext getContext(const char *context)
throw (NotFoundException, ServerNotFoundException) = 0;
};
class InformationDirectoryNode {
virtual char *getName() = 0;
virtual bool isInformation() = 0;
virtual bool isContext() = 0;
};
class InformationDirectoryContext : public InformationDirectoryNode {
virtual InformationInfo lookup(const char *instance_name)
throw (NotFoundException, InvalidContextException) = 0;
virtual InformationDirectoryContext getSubContext(const char *sub)
throw (BadContextNameException, InvalidContextException,
NotFoundException) = 0;
virtual HPCxx_Array getChildren()
throw (InvalidContextException) = 0;
virtual HPCxx_Array getAllComponents()
throw (InvalidContextException) = 0;
virtual void bind(Info info, const char *name)
throw (InvalidContextException, DuplicateNameException);
virtual void unbind(const char *name)
throw (InvalidContextException, NotFoundException);
};
class InformationInfo : public InformationDirectoryNode, public Info {
};
interface InformationDirectoryService extends CCAPort {
public InformationDirectoryContext getContext(String context)
throws NotFoundException, ServerNotFoundException;
};
interface InformationDirectoryNode {
public String getName();
public bool isInformation();
public bool isContext();
}
interface InformationDirectoryContext extends InformationDirectoryNode {
public InformationInfo lookup(String instance_name)
throws NotFoundException, InvalidContextException;
public InformationDirectoryContext getSubContext(String subcontext)
throws BadContextNameException, InvalidContextException,
NotFoundException;
public InformationDirectoryNode [] getChildren()
throws InvalidContextException;
public InformationInfo [] getAllComponents()
throws InvalidContextException;
public void bind(Info info, String name);
public void unbind(String name) throws NotFoundException;
};
interface InformationInfo extends InformationDirectoryNode, Info {
}
getContext(in string context) [1]
This returns a context value object that can be used to look up static component information. context is any prefix of the full URL name. Examples are:
http://rainier:3434/cca/
ldap://moose:1234/
file://l/extreme/dir_containing_instance_info/
This method raises a NotFoundException if the specified context does not correspond to an actual registry. A ServerNotFound exception is generated if the specified server could not be located.
string getName()
This returns the name of the current node.
bool isContext()
Returns true if this node is a leaf node. If so, it can be cast to an InformationInfo object.
bool isContext()
Returns true if this node is a directory node. If so, it can be cast to an InformationDirectoryContext object.
InformationInfo [] lookup(in string name)
Returns the InformationInfo object associated with the given name. This object can be queried for further information. 'name' is the full URL for the component minus the context prefix. Examples are:
cat/lsa/NewSystem
/components/cca/dog/cfd/SolveIt
A NotFoundException is thrown if name does not appear in the current context. An InvalidContextException is thrown if the context is no longer valid because the corresponding directory has been deleted from the server.
InformationDirectoryContext getSubContext(in string sub_dir)
This returns an InformationDirectoryContext for the provided subcontext path. The subcontext path starts from the current context. This allows the user to then navigate through the component hierarchy starting from the new context if they so wished.
This method raises a BadContextNameException if the specified subcontext corresponds to a non-leaf node in the instance hierarchy. It raises a NotFoundException if the specified subcontext did not correspond to a node in the instance hierarchy. It raises an InvalidContextException if the current context being used became invalid for some reason.
InformationDirectoryNodeSeq getChildren ()
Returns all children of this directory as a list of InformationDirectoryNode objects.
An InvalidContextException will be raised if for some reason the context being used becomes invalid.
InformationInfoSeq getAllInstances()
Returns all leaves of the tree rooted at this context. The leafs are returned as a list of InformationInfo objects.
An InvalidContextException will be raised if the context becomes invalid.
void bind(in Info info, in string name)
Bind the name to the given Info object. If the name includes directories, they are created as needed on the server. Publishes a ComponentChanged event if the leaf already exists, otherwise, it will publish a ComponentAdded event.
void unbind(in string name)
Unbinds the name. Empty directories are automatically deleted. Publishes a ComponentRemoved event. This methods raises a NotFoundException if the provided name does not correspond to any component stored in the registry.
This example shows how a component would create another component using information obtained from the IDS.
// This code is an excerpt from within a component.
// Obtain initial context.
context = idsPort.getContext(url); // URL obtained by other means.
// Lookup information for a component.
info = context.lookup("Component");
// Get list of installations.
installations = getInfo("installations", length);
// Loop through installations, looking for one on machine "my_machine".
for (i = 0; i < length; i++) {
host = installations[i]->getValue("host");
if (strcmp(host, "my_machine") {
// Get path and creation method.
exe_path = installations[i]->getValue("path");
method = installations[i]->getValue("method");
createService.create(exe_path, method);
}
}
Last modified: Tue Sep 28 20:43:27 EST 1999