org.apache.wvcm.store
Interface ResourceAccessor

All Superinterfaces:
Accessor
All Known Subinterfaces:
ActivityAccessor, BaselineAccessor, ConfigurationAccessor, ControllableFolderAccessor, ControllableResourceAccessor, FolderAccessor, FolderVersionAccessor, PrincipalAccessor, PrivilegeAccessor, VersionAccessor, VersionHistoryAccessor, WorkspaceAccessor
All Known Implementing Classes:
ActivityWebdavAccessor, BaselineWebdavAccessor, ConfigurationWebdavAccessor, ControllableFolderWebdavAccessor, ControllableResourceWebdavAccessor, FolderVersionWebdavAccessor, FolderWebdavAccessor, PrincipalWebdavAccessor, PrivilegeWebdavAccessor, ResourceWebdavAccessor, VersionHistoryWebdavAccessor, VersionWebdavAccessor, WorkspaceWebdavAccessor

public interface ResourceAccessor
extends Accessor

Persistent resource state accessor. There can be various implementations of this interface for server-side as well as for client-side persistent state.

Version:
$Revision: 1.1.1.1.2.4 $

Method Summary
 boolean doCheckExists()
          Checks whether the resource exists at the storage where this accessor is in charge of.
 void doCopy(java.lang.String destination, boolean overwrite)
          Create a copy of the resource identified by the associated proxy at the location identified by the destination.
 void doDelete()
          Deletes the resource at the location of the associated resource.
 LockToken doLock(LockToken.Timeout timeout, boolean deep, boolean exclusive, java.lang.String owner)
          NOT YET STANDARD Locks this resource.
 void doMove(java.lang.String destination, boolean overwrite)
          Moves the resource identified by associated proxy to the location identified by the destination.
 java.util.List doReadAccessControlList(boolean includeInherited)
          Return the list of AccessControlElement instances (ACL) defined on the associated resource.
 Resource doReadContent(PropertyNameList wantedPropertyList, java.io.OutputStream content)
          Return a new resource proxy at the location of the associated resource containing the wanted properties.
 Resource doReadProperties(PropertyNameList wantedPropertyList)
          Return a new resource proxy at the location of the associated resource containing the wanted properties.
 java.util.List doSearch(PropertyNameList wantedPropertyList, SearchToken searchToken)
          Return a list of Resource objects containing the wanted properties according to the conditions of the specified search token from the scope defined by the associated resource.
 void doUnlock(LockToken lockToken)
          NOT YET STANDARD Releases the specified lock of this resource.
 void doWriteAccessControlList(java.util.List acl)
          Modifies the access control list (ACL) of the associated resource.
 void doWriteContent(java.io.InputStream content, java.lang.String contentIdentifier)
          Persists content changes to a resource.
 void doWriteProperties()
          Persists property changes to associated resource.
 Resource resource()
          Get the resource proxy this accessor is assigned to.
 
Methods inherited from interface org.apache.wvcm.store.Accessor
serverWorkspaceFolderList
 

Method Detail

resource

Resource resource()
Get the resource proxy this accessor is assigned to.

Returns:
the resource proxy this accessor is assigned to.

doReadContent

Resource doReadContent(PropertyNameList wantedPropertyList,
                       java.io.OutputStream content)
                       throws WvcmException
Return a new resource proxy at the location of the associated resource containing the wanted properties. The exact resource type of the resulting resource proxy is determined by this method. The resource content is written to content and content is closed.

Parameters:
wantedPropertyList - the wanted properties
content - an OutputStream
Returns:
a new resource proxy containing the wanted properties
Throws:
WvcmException

doWriteContent

void doWriteContent(java.io.InputStream content,
                    java.lang.String contentIdentifier)
                    throws WvcmException
Persists content changes to a resource. If contentIdentifier matches the current state identifier of the persistent resource, the content of the resource is replaced with the bytes read from content, and content is then closed. If reading from the stream throws a java.io.IOException, then no further data will be read from the stream, and after attempting to close the stream, a WvcmException wrapping the IOException will be thrown, possibly leading to incomplete data being stored on the resource.

Parameters:
content - the content input stream
contentIdentifier - the content identifier to match the current identifier
Throws:
WvcmException - if the resource identified by this Resource does not exist.
WvcmException

doReadProperties

Resource doReadProperties(PropertyNameList wantedPropertyList)
                          throws WvcmException
Return a new resource proxy at the location of the associated resource containing the wanted properties. The exact resource type of the resulting resource proxy is determined by this method.

Parameters:
wantedPropertyList - the wanted properties
Returns:
a new resource proxy containing the wanted properties
Throws:
WvcmException

doWriteProperties

void doWriteProperties()
                       throws WvcmException
Persists property changes to associated resource.

Throws:
WvcmException

doDelete

void doDelete()
              throws WvcmException
Deletes the resource at the location of the associated resource. If a folder is deleted, its members are deleted as well.

Throws:
WvcmException

doCopy

void doCopy(java.lang.String destination,
            boolean overwrite)
            throws WvcmException
Create a copy of the resource identified by the associated proxy at the location identified by the destination.

Parameters:
destination - The location of the new resource created by doCopy.
overwrite - If false the existence of a resource at the destination will cause the copy to fail; otherwise, doCopy will replace the destination resource.
Throws:
WvcmException

doMove

void doMove(java.lang.String destination,
            boolean overwrite)
            throws WvcmException
Moves the resource identified by associated proxy to the location identified by the destination.

Parameters:
destination - The new location of the resource.
overwrite - If false the existence of a resource at the destination will cause doMove to fail; otherwise, doMove will replace the destination resource.
Throws:
WvcmException

doCheckExists

boolean doCheckExists()
                      throws WvcmException
Checks whether the resource exists at the storage where this accessor is in charge of.

Returns:
true, if the resource exists
Throws:
WvcmException

doSearch

java.util.List doSearch(PropertyNameList wantedPropertyList,
                        SearchToken searchToken)
                        throws WvcmException
Return a list of Resource objects containing the wanted properties according to the conditions of the specified search token from the scope defined by the associated resource. A requested property named XXX can be retrieved from the resource with the getXxx method.

Parameters:
wantedPropertyList - the wanted properties
searchToken - a SearchToken
Returns:
the result list
Throws:
WvcmException

doReadAccessControlList

java.util.List doReadAccessControlList(boolean includeInherited)
                                       throws WvcmException
Return the list of AccessControlElement instances (ACL) defined on the associated resource. The ACL specifies the list of access control elements (ACEs), which define what principals are to get what privileges for this resource. Each ACE specifies the set of privileges to be either granted or denied to a single principal. If the ACL is empty, no principal is granted any privilege.

Parameters:
includeInherited - if false, only ACEs defined for the resource are returned; otherwise, the ACL includes all inherited ACEs
Returns:
a List
Throws:
WvcmException

doWriteAccessControlList

void doWriteAccessControlList(java.util.List acl)
                              throws WvcmException
Modifies the access control list (ACL) of the associated resource. Specifically, this method only permits modification to ACEs that are not inherited, and are not protected.

Parameters:
acl - a list of AccessControlElement instances
Throws:
WvcmException

doLock

LockToken doLock(LockToken.Timeout timeout,
                 boolean deep,
                 boolean exclusive,
                 java.lang.String owner)
                 throws WvcmException
NOT YET STANDARD Locks this resource.

Parameters:
timeout - a Timeout
deep - a boolean
exclusive - a boolean
owner - a String
Returns:
a LockToken
Throws:
WvcmException

doUnlock

void doUnlock(LockToken lockToken)
              throws WvcmException
NOT YET STANDARD Releases the specified lock of this resource.

Parameters:
lockToken - a LockToken
Throws:
WvcmException


Copyright (c) 2003 - Apache Software Foundation