Voyager ORB

com.objectspace.voyager.directory
Interface IDirectory

All Known Implementing Classes:
Directory, LightDirectory

public abstract interface IDirectory

IDirectory is the interface that is implemented by Directory.

Version:
3.0

Field Summary
static int ALREADY_BOUND
          The name was already bound to another object.
static int COMPONENT_MISSING
          An intermediate component in a path was missing.
static int COMPONENT_NOT_DIRECTORY
          An intermediate component in a path was not a directory.
static int INTERNAL_ERROR
          An error occurred in the underlying directory implementation.
static int INVALID_KEY
          The key was empty.
static java.lang.String SEPARATOR
           
static java.lang.String SEPARATOR_STRING
           
 
Method Summary
 void add(java.lang.String key, java.lang.Object value)
          Associate a key with a value.
 void clear()
          Remove every entry from the local directory.
 IDirectory createSubdirectory(java.lang.String key)
           
 java.lang.Object get(java.lang.String key)
          Return the value associated with a particular key.
 Entry[] getAllEntries(java.lang.String key)
           
 Entry[] getDirectoryEntries(java.lang.String key)
           
 java.lang.Object[] getKeys()
          Return an array of the keys in the local directory.
 Entry[] getObjectEntries(java.lang.String key)
           
 java.lang.Object[] getValues()
          Return an array of the values in the local directory.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Associate a key with a value.
 java.lang.Object remove(java.lang.String key)
          Remove the directory entry with the specified key.
 int size()
          Return the number of keys in the local directory.
 

Field Detail

SEPARATOR

public static final java.lang.String SEPARATOR

SEPARATOR_STRING

public static final java.lang.String SEPARATOR_STRING

INVALID_KEY

public static final int INVALID_KEY
The key was empty.

ALREADY_BOUND

public static final int ALREADY_BOUND
The name was already bound to another object.

COMPONENT_NOT_DIRECTORY

public static final int COMPONENT_NOT_DIRECTORY
An intermediate component in a path was not a directory.

COMPONENT_MISSING

public static final int COMPONENT_MISSING
An intermediate component in a path was missing.

INTERNAL_ERROR

public static final int INTERNAL_ERROR
An error occurred in the underlying directory implementation.
Method Detail

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
                     throws DirectoryException
Associate a key with a value. If key is a simple string, associate it with the specified value in the local directory. If key is a path, look up the IDirectory associated with the head of the path name and then forward the put() message with the remaining tail of the path name. Return the value that was previously associated with the key, or null if there was none.
Parameters:
key - The key.
value - The value to be associated with the key.
Throws:
DirectoryException - The key was a path whose head was not an IDirectory.

get

public java.lang.Object get(java.lang.String key)
                     throws DirectoryException
Return the value associated with a particular key. If key is a simple string, return its associated value in the local directory or null if there is none. If key is a path, look up the IDirectory associated with the head of the path name and then forward the get() message with the remaining tail of the path name.
Parameters:
key - The key.
Throws:
DirectoryException - The key was a path whose head was not an IDirectory.

remove

public java.lang.Object remove(java.lang.String key)
                        throws DirectoryException
Remove the directory entry with the specified key. If key is a simple string, remove its entry from the local directory. If key is a path, look up the IDirectory associated with the head of the path name and then forward the remove() message with the remaining tail of the path name. Return the value that was associated with the key, or null if there was none.
Parameters:
key - The key.
Throws:
DirectoryException - The key was a path whose head was not an IDirectory.

clear

public void clear()
Remove every entry from the local directory. This has no effect on the directories that the local directory used to reference.

size

public int size()
Return the number of keys in the local directory.

getValues

public java.lang.Object[] getValues()
Return an array of the values in the local directory.

getKeys

public java.lang.Object[] getKeys()
Return an array of the keys in the local directory.

add

public void add(java.lang.String key,
                java.lang.Object value)
         throws DirectoryException
Associate a key with a value. If key is a simple string, associate it with the specified value in the local directory. If key is a path, look up the IDirectory associated with the head of the path name and then forward the put() message with the remaining tail of the path name. Throws DirectoryException if key already has a value in this directory.
Parameters:
key - The key to add.
value - The value to add.
Throws:
DirectoryException - The key was a path whose head was not an IDirectory or the key already had a value.

getAllEntries

public Entry[] getAllEntries(java.lang.String key)
                      throws DirectoryException

getObjectEntries

public Entry[] getObjectEntries(java.lang.String key)
                         throws DirectoryException

getDirectoryEntries

public Entry[] getDirectoryEntries(java.lang.String key)
                            throws DirectoryException

createSubdirectory

public IDirectory createSubdirectory(java.lang.String key)
                              throws DirectoryException

ObjectSpace Inc.

(c) Copyright 1997-1999 ObjectSpace, Inc.
14850 Quorum Drive, Suite 500
Dallas, Texas 75240