org.apache.slide.structure
Interface Structure

All Known Implementing Classes:
StructureImpl

public interface Structure

Structure helper. Provides methods to manage and navigate the hierarchy of nodes in a namespace.

Version:
$Revision: 1.8 $
Author:
Remy Maucherat

Method Summary
 void create(SlideToken token, ObjectNode object, java.lang.String strUri)
          Creates a new node in the namespace.
 void createLink(SlideToken token, LinkNode link, java.lang.String linkUri, ObjectNode linkedObject)
          Creates a link to another node in the namespace.
 java.util.Enumeration getChildren(SlideToken token, ObjectNode object)
          Returns the children of a node.
 ObjectNode getParent(SlideToken token, ObjectNode object)
          Returns the parent of a node.
 void remove(SlideToken token, ObjectNode object)
          Removes a node from the namespace.
 ObjectNode retrieve(SlideToken token, java.lang.String strUri)
          Retrieves a node by URI, following any links.
 ObjectNode retrieve(SlideToken token, java.lang.String strUri, boolean translateLastUriElement)
          Retrieves a node by URI.
 void store(SlideToken token, ObjectNode object)
          Stores/updates an object.
 

Method Detail

getChildren

public java.util.Enumeration getChildren(SlideToken token,
                                         ObjectNode object)
                                  throws ServiceAccessException,
                                         ObjectNotFoundException,
                                         LinkedObjectNotFoundException
Returns the children of a node.
Parameters:
token - the slide token
object - the node
Returns:
Enumeration of ObjectNode objects
Throws:
ServiceAccessException - low level service access exception
ObjectNotFoundException - one of the children specified by the object was not found
LinkedObjectNotFoundException - cannot happen
See Also:
ObjectNode.enumerateChildren()

getParent

public ObjectNode getParent(SlideToken token,
                            ObjectNode object)
                     throws ServiceAccessException,
                            ObjectNotFoundException,
                            LinkedObjectNotFoundException,
                            AccessDeniedException
Returns the parent of a node.
Parameters:
token - the slide token
object - the node
Returns:
the node's parent, or null if the object specified is the root node of the namespace
Throws:
ServiceAccessException - low level service access exception
ObjectNotFoundException - the parent object specified by the object was not found
LinkedObjectNotFoundException - cannot happen (a link cannot have children)
AccessDeniedException - credentials token does not have permission to perform the action
See Also:
ObjectNode.enumerateChildren()

retrieve

public ObjectNode retrieve(SlideToken token,
                           java.lang.String strUri)
                    throws ServiceAccessException,
                           ObjectNotFoundException,
                           LinkedObjectNotFoundException,
                           AccessDeniedException
Retrieves a node by URI, following any links.
Parameters:
token - the slide token
strUri - the URI of the object to retrieve
Returns:
the node specified by the URI or the node linked to by the node at the URI.
Throws:
ServiceAccessException - low level service access exception
ObjectNotFoundException - if no node exists at the URI
LinkedObjectNotFoundException - A link object encountered during URI resolution doesn't have a valid target
AccessDeniedException - credentials token does not have permission to perform the action

retrieve

public ObjectNode retrieve(SlideToken token,
                           java.lang.String strUri,
                           boolean translateLastUriElement)
                    throws ServiceAccessException,
                           ObjectNotFoundException,
                           LinkedObjectNotFoundException,
                           AccessDeniedException
Retrieves a node by URI.
Parameters:
token - the slide token
strUri - the URI of the object to retrieve
translateLastUriElement - if set to true and the URI is associated with a link, this method will return the target of the link, otherwise the link itself is returned
Returns:
the node specified by the URI, or the node linked to by the node at the URI, if translateLastUriElement is true
Throws:
ServiceAccessException - low level service access exception
ObjectNotFoundException - if no node exists at the URI
LinkedObjectNotFoundException - A link object encountered during URI resolution doesn't have a valid target
AccessDeniedException - credentials token does not have permission to perform the action

create

public void create(SlideToken token,
                   ObjectNode object,
                   java.lang.String strUri)
            throws ServiceAccessException,
                   ObjectAlreadyExistsException,
                   ObjectNotFoundException,
                   LinkedObjectNotFoundException,
                   AccessDeniedException
Creates a new node in the namespace.
Parameters:
token - the slide token
object - the object that should be created
strUri - location in the namespace where we the object should be created
Throws:
ServiceAccessException - low level service access exception
ObjectAlreadyExistException - an object already exists at the specified URI
ObjectNotFoundException - Update of the parent object failed because the parent object does no longer exist. Should not happen, and indicates a critical error if it does
LinkedObjectNotFoundException - retrieval of a link target failed during URI resolution
AccessDeniedException - credentials token does not have permission to perform the action

createLink

public void createLink(SlideToken token,
                       LinkNode link,
                       java.lang.String linkUri,
                       ObjectNode linkedObject)
                throws ServiceAccessException,
                       ObjectAlreadyExistsException,
                       ObjectNotFoundException,
                       LinkedObjectNotFoundException,
                       AccessDeniedException
Creates a link to another node in the namespace.
Parameters:
token - the slide token
link - the link object that should be created
linkUri - location in the namespace where the link object should be created
linkedObject - target object of the link
Throws:
ServiceAccessException - Low level service access exception
ObjectAlreadyExistException - An object already exist at the specified URI
ObjectNotFoundException - Update of the parent object failed because the parent object does no longer exist. Should not happen, and indicate a critical error if it does
LinkedObjectNotFoundException - Retrieval of a link target failed during Uri resolution
AccessDeniedException - credentials token does not have permission to perform the action

store

public void store(SlideToken token,
                  ObjectNode object)
           throws ServiceAccessException,
                  ObjectNotFoundException,
                  AccessDeniedException,
                  LinkedObjectNotFoundException
Stores/updates an object.
Parameters:
token - the slide token
object - the object to update
Throws:
ServiceAccessException - low level service access exception
ObjectNotFoundException - the update failed because one object was not found during URI resolution
LinkedObjectNotFoundException - retrieval of a link target failed during URI resolution
AccessDeniedException - credentials token does not have permission to perform the action

remove

public void remove(SlideToken token,
                   ObjectNode object)
            throws ServiceAccessException,
                   ObjectNotFoundException,
                   ObjectHasChildrenException,
                   AccessDeniedException,
                   LinkedObjectNotFoundException,
                   ObjectLockedException
Removes a node from the namespace.
Parameters:
token - the slide token
object - the node to remove
Throws:
ServiceAccessException - low level service access exception
ObjectNotFoundException - the update failed because an object was not found during URI resolution
ObjectHasChildrenException - removal failed because object has children
LinkedObjectNotFoundException - retrieval of a link target failed during URI resolution
AccessDeniedException - credentials token does not have permission to perform the action