WebLogic Integration


com.bea.wlai.client
Interface NamespaceManager


public interface NamespaceManager
extends javax.ejb.EJBObject

Remote interface for the NamespaceManager EJB, used to interact with the WLAI namespace repository.

Author:
Copyright © 2000, 2001 BEA Systems, Inc. All Rights Reserved.

Method Summary
 INamespace addNamespace(INamespace parent, java.lang.String childName)
          Adds a namespace of the given name to the given parent namespace.
 boolean exists(QualifiedName aQualifiedName)
          Determine whether the namespace represented by a qualified name exists in the repository.
 INamespace getNamespace(QualifiedName name)
          Gets the namespace with the given qualified name.
 INamespaceObject getObject(NamespaceObjectHandle handle)
          Get a namespace object from a namespace object handle.
 NamespaceObjectHandle getObjectHandle(QualifiedName aQualifiedName)
          Get a namespace object handle using a qualified name.
 QualifiedName getQualifiedNameFromString(java.lang.String qnameStr)
          Get a QualifiedName object from the external string form of a qualified name.
 QualifiedName getQualifiedNameFromString(java.lang.String qnameStr, boolean allowNonExistent)
          Get a QualifiedName object from the external string form of a qualified name, optionally allowing the lowest level qualifier to not exist.
 INamespace getRootNamespace()
          Get the root namespace, which is the parent of all namespaces in the WLAI system.
 boolean hasChildren(INamespace aNamespace)
          Determine whether a given namespace contains any child namespaces.
 java.util.Iterator listObjects(INamespace namespace)
          Returns an iterator over the objects (NamespaceObjectHandle) contained in the given namespace.
 INamespace removeNamespace(QualifiedName name)
          Removes the namespace with the given qualified name from its parent namespace.
 void updateNamespace(INamespace namespace)
          Updates the given namespace with any changes that have been made to it since it was retrieved.
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

addNamespace

public INamespace addNamespace(INamespace parent,
                               java.lang.String childName)
                        throws NamespaceException,
                               java.rmi.RemoteException
Adds a namespace of the given name to the given parent namespace.

Parameters:
parent - an INamespace object specifying the parent namepace.
childName - the name of the new child namespace.
Returns:
The namespace created by this method. It will have the name given by the childName parameter.
Throws:
NamespaceException - If the parent namespace does not exist in the repository, or if any other namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

removeNamespace

public INamespace removeNamespace(QualifiedName name)
                           throws NamespaceException,
                                  java.rmi.RemoteException
Removes the namespace with the given qualified name from its parent namespace.

Parameters:
name - the QualifiedName denoting the namespace to remove.
Returns:
an INamespace object containing the namespace which was removed.
Throws:
NamespaceException - If the namespace does not exist in the repository, or any other namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

updateNamespace

public void updateNamespace(INamespace namespace)
                     throws NamespaceException,
                            java.rmi.RemoteException
Updates the given namespace with any changes that have been made to it since it was retrieved. If this namespace does not yet exist, this call will result in a NamespaceException.

Parameters:
namespace - The namespace to update in the repository.
Throws:
NamespaceException - If the given namespace does not exist in the repository, or some other namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

getNamespace

public INamespace getNamespace(QualifiedName name)
                        throws NamespaceException,
                               java.rmi.RemoteException
Gets the namespace with the given qualified name.

Parameters:
name - QualifiedName of the namespace to retrieve.
Returns:
an INamespace containing the retrieve namespace.
Throws:
NamespaceException - If the namespace does not exist, or any other namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

listObjects

public java.util.Iterator listObjects(INamespace namespace)
                               throws NamespaceException,
                                      java.rmi.RemoteException
Returns an iterator over the objects (NamespaceObjectHandle) contained in the given namespace. The objects returned by the iterator are of type NamespaceObjectHandle. To get the actual object represented by a handle returned from the Iterator, call a 'get' method on an associated manager object. For example, if the handle returned from Iterator.next() represents an IApplicationViewDescriptor...
 INamespace root = namespaceMgr.getRootNamespace();
 Iterator iterator = namespaceMgr.listObjects(root);
 while (iterator.hasNext())
 {
   NamespaceObjectHandle handle = (NamespaceObjectHandle)iterator.next();
   if (handle.isAssignableTo(IApplicationViewDescriptor.class))
   {
     // Use our ApplicationViewManager instance to resolve this handle
     IApplicationViewDescriptor avd = 
       appViewMgr.getApplicationView(handle.getQualifiedName());
   }
   else if (handle.isAssignableTo(INamespace.class))
   {
     // Use our NamespaceManager instance to resolve this handle
     INamespace namespace =
       namespaceMgr.getNamespace(handle.getQualifiedName());
   }
 }
 

Throws:
NamespaceException - If any namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

getRootNamespace

public INamespace getRootNamespace()
                            throws NamespaceException,
                                   java.rmi.RemoteException
Get the root namespace, which is the parent of all namespaces in the WLAI system.

Returns:
an INamespace object containing the root namespace.
Throws:
NamespaceException - If any namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

getObject

public INamespaceObject getObject(NamespaceObjectHandle handle)
                           throws NamespaceException,
                                  java.rmi.RemoteException
Get a namespace object from a namespace object handle.

Parameters:
handle - the namespace object handle of the object to retrieve.
Returns:
an INamespaceObject containing the retrieved repository object.
Throws:
NamespaceException - If the object does not exist in the repository or if any namespace access error occurs.
java.rmi.RemoteException - If an RMI communication error occurs.

getObjectHandle

public NamespaceObjectHandle getObjectHandle(QualifiedName aQualifiedName)
                                      throws NamespaceException,
                                             java.rmi.RemoteException
Get a namespace object handle using a qualified name.

Parameters:
aQualifiedName - for the object to be retrieved.
Returns:
a NamespaceObjectHandle representing the repository object specified by the qualified name parameter.
Throws:
NamespaceException - If the object does not exist in the repository or if any namespace access error occurs.
java.rmi.RemoteException - If any namespace RMI communication error occurs.

getQualifiedNameFromString

public QualifiedName getQualifiedNameFromString(java.lang.String qnameStr)
                                         throws NamespaceException,
                                                java.rmi.RemoteException
Get a QualifiedName object from the external string form of a qualified name. This method is equivalent to calling getQualifiedNameFromString(String, boolean) where the boolean argument is false. In other words, this method does not allow any portion of the qualified name to be non-existent.

Parameters:
qnameStr - A string in dot-separated notation that represents a qualified name (e.g. 'foo.bar').
Returns:
A QualifiedName object whose toString() method returns the same string as the qnameStr parameter.
Throws:
NamespaceException - If the qualified name refers to non-existent namespaces, or if one of the internal components of the qualified name is not a namespace, or if the lowest level qualifier (object name) does not exist.
java.rmi.RemoteException - If an RMI communication error occurs.
See Also:
getQualifiedNameFromString(String, boolean)

getQualifiedNameFromString

public QualifiedName getQualifiedNameFromString(java.lang.String qnameStr,
                                                boolean allowNonExistent)
                                         throws NamespaceException,
                                                java.rmi.RemoteException
Get a QualifiedName object from the external string form of a qualified name, optionally allowing the lowest level qualifier to not exist. This method resolves each component namespace name to an INamespace as required by QualifiedName. For example, if we have a qualified name in string form 'foo.bar', this method will return a QualifiedName which has the name 'bar', and an INamespace that represents the 'foo' namespace. This INamespace will have the name 'foo', and an INamespace that represents the root namespace.

Parameters:
qnameStr - A string in dot-separated notation that represents a qualified name (e.g. 'foo.bar').
allowNonExistent - Indicates whether to allow string values that refer to non-existent lowest level qualifiers. If true, the final (lowest level) qualifier in the stringified QualifiedName is allowed to be non-existent. Otherwise, all qualifiers must exist.
Returns:
A QualifiedName object whose toString() method returns the same string as the qnameStr parameter.
Throws:
NamespaceException - If the qualified name refers to non-existent namespaces, or if one of the internal components of the qname is not a namespace, or if the lowest level qualifier (object name) does not exist.
java.rmi.RemoteException - If an RMI communication error occurs.

hasChildren

public boolean hasChildren(INamespace aNamespace)
                    throws NamespaceException,
                           java.rmi.RemoteException
Determine whether a given namespace contains any child namespaces.

Parameters:
aNamespace - - the namespace to examine for child namespaces.
Returns:
a boolean object containing true if the namespace contains any child namespaces and false if it does not.
Throws:
NamespaceException - If the namespace cannot be found.
java.rmi.RemoteException - If an RMI communication error occurs.

exists

public boolean exists(QualifiedName aQualifiedName)
               throws NamespaceException,
                      java.rmi.RemoteException
Determine whether the namespace represented by a qualified name exists in the repository.

Parameters:
aQualifiedName - - the qualified name of the namespace to find in the repository.
Returns:
a boolean object containing true if the namespace exists in the repository and false if it does not.
Throws:
NamespaceException - If an error occurs while examining the repository.
java.rmi.RemoteException - If an RMI communication error occurs.

WebLogic Integration

WebLogic Integration (WLI)