|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Describes a namespace, including the ObjectEntry for every object contained in the data store.
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.
| Method Summary | |
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 referentContext)
Returns an array of object types contained by the name space. |
java.lang.String |
getUniqueID()
Returns the unique identifier (name) of the namespace. |
| Methods inherited from interface com.novell.application.console.snapin.Snapin |
getSnapinDescription,
getSnapinName,
initSnapin,
shutdownSnapin |
| Method Detail |
public ObjectEntryEnumeration 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.ObjectEntryEnumeration
public ObjectEntryEnumeration 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.ObjectEntryEnumeration
public ObjectType[] getObjectTypes(ObjectEntry referentContext)
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.ObjectTypepublic java.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";
}
public 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.
public 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).
public 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;
}
}
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||