public interface NamespaceSnapin extends Snapin
The NamespaceSnapin is responsible for knowing enough about the data store it is providing to generate ObjectEntry objects for every object the data store contains. It should also provide default display information to the shell for every ObjectEntry the namespace generates.
| Modifier and Type | Method and Description |
|---|---|
ObjectEntryEnumeration |
getChildContainers(ObjectEntry parent,
ResultModifier modifier)
Returns an enumeration for subordinate container objects (children).
|
ObjectEntryEnumeration |
getChildren(ObjectEntry parent,
ResultModifier modifier)
Returns an enumeration for subordinate objects (children).
|
java.lang.String |
getFullName(ObjectEntry entry)
Returns the full name of the ObjectEntry.
|
ObjectEntry[] |
getInitialObjectEntries()
Returns the root ObjectEntry array.
|
ObjectEntry |
getObjectEntry(java.lang.String name)
Returns an ObjectEntry represented by a name.
|
ObjectType[] |
getObjectTypes(ObjectEntry referenceContext)
Returns an array of object types contained by the name space.
|
java.lang.String |
getUniqueID()
Returns the unique identifier (name) of the namespace.
|
java.lang.String |
getUnrootedName(ObjectEntry obj)
Get the fully distinguished name not including the tree for an object.
|
getSnapinDescription, getSnapinName, initSnapin, shutdownSnapinObjectEntryEnumeration getChildren(ObjectEntry parent, ResultModifier modifier) throws SnapinException
You must return an enumeration for subordinate objects (list of children from the current namespace) that the shell will use for the namespace being described, or null when there are no children.
Following is an example of the getChildren() implementation:
public ObjectEntryEnumeration getChildren(ObjectEntry parent,
ResultModifier modifier)
throws SnapinException
{
File file = new File(parent.getName());
if(!file.isDirectory())
{
throw new SnapinException();
}
String [] children = file.list();
if (children != null)
{
return new FileEnumeration(children, parent, this);
}
return null;
}
parent - The parent object in the current namespace from
which a list of children may be obtained.modifier - The filter for the children desired.SnapinException - Thrown when ObjectEntry is not
a container or a service provider error occured.ObjectEntryEnumerationObjectEntryEnumeration getChildContainers(ObjectEntry parent, ResultModifier modifier) throws SnapinException
parent - The parent object in the current namespace from
which a list of children containers may be obtained.modifier - The filter for the children desired.SnapinException - Thrown when ObjectEntry is not
a container or a service provider error occured.ObjectEntryEnumerationObjectType[] getObjectTypes(ObjectEntry referenceContext) throws SnapinException
referenceContext - An ObjectEntry providing the context from which
the ObjectTypes will be extracted. The context could change the returned
ObjectTypes if non-global schema is encountered.SnapinException - Thrown when a service provider error occured.ObjectTypejava.lang.String getUniqueID()
You must return a name that the shell will use for the namespace being described. The unique namespace identifier is the key used to register snap-ins that will operate against this namespace.
Following is an example of the getUniqueID() implementation:
public String getUniqueID()
{
return "com.novell.sample.snapins.filesystem";
}
java.lang.String getFullName(ObjectEntry entry)
The full name should represent a unique name in the namespace.
Following is an example of the getFullName() implementation:
public String getFullName(ObjectEntry entry)
{
return entry.getName();
}
entry - The ObjectEntry for which the full name is desired.java.lang.String getUnrootedName(ObjectEntry obj)
obj - The object to get the unrooted name for.ObjectEntry getObjectEntry(java.lang.String name) throws SnapinException
Following is an example of the getObjectEntry() implementation:
public ObjectEntry getObjectEntry(String name) throws ObjectNotFoundException
{
return makeObjectEntry(name, null);
}
name - The name of the object (e.g //myTree/US/myOrg/me).SnapinException - Thrown when a service provider error occured.ObjectEntry[] getInitialObjectEntries() throws SnapinException
The ObjectEntry array will be placed in the root of the tree. Null can be returned when there is no root ObjectEntry in the namespace.
Following is an example of the getObjectEntry() implementation:
public ObjectEntry[] getInitialObjectEntrries()
{
ObjectEntry[] roots = new ObjectEntry[1];
try
{
roots[0] = makeObjectEntry(File.separator, null);
return roots;
}
catch(ObjectNotFoundException e)
{
return null;
}
}
SnapinException - Thrown when a service provider error occured.
API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated ${TODAY} ${TSTAMP}.