org.apache.slide.structure
Class StructureImpl

java.lang.Object
  |
  +--org.apache.slide.structure.StructureImpl
All Implemented Interfaces:
Structure

public final class StructureImpl
extends java.lang.Object
implements Structure

Data helper class.

Version:
$Revision: 1.19 $
Author:
Remy Maucherat

Constructor Summary
StructureImpl(Namespace namespace, NamespaceConfig namespaceConfig, Security securityHelper, Lock lockHelper)
          Constructor.
 
Method Summary
 void create(SlideToken token, ObjectNode object, java.lang.String strUri)
          Create an object.
 void createLink(SlideToken token, LinkNode link, java.lang.String linkUri, ObjectNode linkedObject)
          Create a link.
 java.util.Enumeration getChildren(SlideToken token, ObjectNode object)
          Get object's children.
 ObjectNode getParent(SlideToken token, ObjectNode object)
          Get object's parent.
 void remove(SlideToken token, ObjectNode object)
          Remove an object.
 ObjectNode retrieve(SlideToken token, java.lang.String strUri)
          Get an object, following any link.
 ObjectNode retrieve(SlideToken token, java.lang.String strUri, boolean translateLastUriElement)
          Get an object, following any link.
 void store(SlideToken token, ObjectNode object)
          Store (ie, update) an object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StructureImpl

public StructureImpl(Namespace namespace,
                     NamespaceConfig namespaceConfig,
                     Security securityHelper,
                     Lock lockHelper)
Constructor.
Parameters:
namespace - Namespace associated with the helper object
namespaceConfig - Configuration of the namespace
securityHelper - Associated security helper
Method Detail

getChildren

public java.util.Enumeration getChildren(SlideToken token,
                                         ObjectNode object)
                                  throws ServiceAccessException,
                                         ObjectNotFoundException,
                                         LinkedObjectNotFoundException
Get object's children.
Specified by:
getChildren in interface Structure
Parameters:
token - Credentials token
object - Slide object
Returns:
Enumeration Enumeration of children objects
Throws:
ServiceAccessException - Low level service access exception
ObjectNotFoundException - One of the children specified by the object were not found
LinkedObjectNotFoundException - Cannot happen

getParent

public ObjectNode getParent(SlideToken token,
                            ObjectNode object)
                     throws ServiceAccessException,
                            ObjectNotFoundException,
                            LinkedObjectNotFoundException,
                            AccessDeniedException
Get object's parent.
Specified by:
getParent in interface Structure
Parameters:
token - Credentials token
object - Slide object
Returns:
ObjectNode Object's parent; null if the object specified if 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

retrieve

public ObjectNode retrieve(SlideToken token,
                           java.lang.String strUri)
                    throws ServiceAccessException,
                           ObjectNotFoundException,
                           LinkedObjectNotFoundException,
                           AccessDeniedException
Get an object, following any link.
Specified by:
retrieve in interface Structure
Parameters:
token - Credentials token
strUri - Object uri
Returns:
ObjectNode Object specified by the Uri
Throws:
ServiceAccessException - Low level service access exception
ObjectNotFoundException - The given Uri doesn't have any matching ObjectNode
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
Get an object, following any link.
Specified by:
retrieve in interface Structure
Parameters:
token - Credentials token
strUri - Object uri
translateLastUriElement - If set to true and if the uri is associated with a link, the function will return the linked object. Otherwise, the link object is returned
Throws:
ServiceAccessException - Low level service access exception
ObjectNotFoundException - The given Uri doesn't have any matching ObjectNode
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
Create an object.
Specified by:
create in interface Structure
Parameters:
token - Credentials token
object - Object we want to create
uri - Location in the namespace where we want to create the object
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
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
Create a link.
Specified by:
createLink in interface Structure
Parameters:
token - Credentials token
link - Link object we want to create
linkUri - Location in the namespace where we want to create the object
linkedObject - Link target
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
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
Store (ie, update) an object.
Specified by:
store in interface Structure
Parameters:
token - Credentials token
object - Object to update
updatePermissions - True to update permissions
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
Remove an object.
Specified by:
remove in interface Structure
Parameters:
token - Credentials token
object - Slide object to remove
Throws:
ServiceAccessException - Low level service access exception
ObjectNotFoundException - The update failed because one 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