com.novell.application.console.snapin
Interface NamespaceSnapin

All Superinterfaces:
Snapin
All Known Subinterfaces:
FSNamespace, NWFSNamespace
All Known Implementing Classes:
NetWareNamespace, LocalVolumesNamespace

public interface NamespaceSnapin
extends Snapin

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

getChildren

public ObjectEntryEnumeration getChildren(ObjectEntry parent,
                                          ResultModifier modifier)
                                   throws SnapinException
Returns an enumeration for subordinate objects (children).

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;
     }
 
Parameters:
parent - The parent object in the current namespace from which a list of children may be obtained.
modifier - The filter for the children desired.
Returns:
An enumeration of the subordinate objects (children). Null can be returned when there are no children.
Throws:
SnapinException - Thrown when ObjectEntry is not a container or a service provider error occured.
See Also:
ObjectEntryEnumeration

getChildContainers

public ObjectEntryEnumeration getChildContainers(ObjectEntry parent,
                                                 ResultModifier modifier)
                                          throws SnapinException
Returns an enumeration for subordinate container objects (children).
Parameters:
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.
Returns:
An enumeration of the subordinate container objects (children). Null can be returned when there are no children.
Throws:
SnapinException - Thrown when ObjectEntry is not a container or a service provider error occured.
See Also:
ObjectEntryEnumeration

getObjectTypes

public ObjectType[] getObjectTypes(ObjectEntry referentContext)
                            throws SnapinException
Returns an array of object types contained by the name space.
Parameters:
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.
Returns:
An array of object types contained within a name space. Null will be handled but pick lists will display an empty set.
Throws:
SnapinException - Thrown when a service provider error occured.
See Also:
ObjectType

getUniqueID

public java.lang.String getUniqueID()
Returns the unique identifier (name) of the namespace.

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";
     }
 
Returns:
The namespace unique identifier (name) as a string.

getFullName

public java.lang.String getFullName(ObjectEntry entry)
Returns the full name of the ObjectEntry.

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();
     }
 
Parameters:
entry - The ObjectEntry for which the full name is desired.
Returns:
The full name of the ObjectEntry as a string.

getObjectEntry

public ObjectEntry getObjectEntry(java.lang.String name)
                           throws SnapinException
Returns an ObjectEntry represented by a name.

Following is an example of the getObjectEntry() implementation:


     public ObjectEntry getObjectEntry(String name) throws ObjectNotFoundException
     {
         return makeObjectEntry(name, null);
     }
 
Parameters:
name - The name of the object (e.g //myTree/US/myOrg/me).
Returns:
The ObjectEntry specified by the name parameter.
Throws:
SnapinException - Thrown when a service provider error occured.

getInitialObjectEntries

public ObjectEntry[] getInitialObjectEntries()
                                      throws SnapinException
Returns the root ObjectEntry array.

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;
         }
     }
 
Returns:
The root ObjectEntry array, or null when there is no root ObjectEntry.
Throws:
SnapinException - Thrown when a service provider error occured.


API Documentation Copyright © 1998-2003 Novell, Inc. All rights reserved.
ConsoleOne is a registered trademark of Novell Inc.
Generated December 9 2003 1727.