Interface ResourceService
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
ResourceServiceImpl
public interface ResourceService extends Serializable
All CRUD as well as versioning functionalities against logicalDOC will be handled through this service pattern. Therefore it is called the most common-class where changes must be done during the time. Security mechanism are also implemented through every method. Therefore the caller (WebDAV-Implementation) has just pass the required path or- Author:
- Sebastian Wenzky
- See Also:
Object to the appropriated method.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBookmark(Resource resource, WebdavSession session)
void
checkout(Resource resource, WebdavSession session)
Versioning-part.void
copyResource(Resource destinResource, Resource resource, WebdavSession session)
Copying of a resource within logicalDOC.Resource
createResource(Resource parentResource, String name, boolean isCollection, ImportContext context, WebdavSession session)
Handle of resource creation by passed parent resource as well as the most import parameters needed for a resource creation.void
deleteBookmark(Resource resource, WebdavSession session)
void
deleteResource(Resource resource, WebdavSession session)
Deletion of a resource within logicalDOC.Resource
getChildByName(Resource parentResource, String name)
Based on the parent resource it will be tried to get a child by a specific nameList<Resource>
getChildResources(Resource parentResource)
On passing a validList<Resource>
getHistory(Resource resource)
Versioning-part.Resource
getParentResource(Resource resource)
Based on the current resource location it will be turned back the upper resourceResource
getParentResource(String location, long userId, WebdavSession session)
Based on a location pathResource
getResource(String location, WebdavSession session)
On passing a location as well as the current session you gettin back the appropriated resource.Resource
move(Resource target, Resource destination, WebdavSession session)
Moves a resource named target to the folder dictionary destinationboolean
resourceExists(Resource resource)
Check for existing resource(logically)void
streamIn(Resource resource, InputStream is)
Sets the stream for a resourceInputStream
streamOut(Resource resource)
Gets the stream for a resourcevoid
uncheckout(Resource resource, WebdavSession session)
Cancels a checkoutResource
updateResource(Resource resource)
Updating a resource on passing all new properties though a valid resource object.void
updateResource(Resource resource, ImportContext context, WebdavSession session)
Updating a resource on passing all new properties though a valid resource object.
-
-
-
Method Detail
-
getResource
Resource getResource(String location, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
On passing a location as well as the current session you gettin back the appropriated resource.- Parameters:
location
- The location retrieved through (@see DavResourceLocator#getResourcePath())session
- The current session- Returns:
- the DAV resource
- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
getChildResources
List<Resource> getChildResources(Resource parentResource) throws org.apache.jackrabbit.webdav.DavException
On passing a valid- Parameters:
parentResource
- The resource(mostly a folder) from which are all direct childs has to be fetched and turned back s- Returns:
- direct childs of the parent resource
- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication- See Also:
all resources (Folders as well as documents) will be returned - unsorted.
-
createResource
Resource createResource(Resource parentResource, String name, boolean isCollection, ImportContext context, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
Handle of resource creation by passed parent resource as well as the most import parameters needed for a resource creation.- Parameters:
parentResource
- The parent resource(mostly a folder)name
- the filename and titlename of the childisCollection
- is the resource folder?context
- for inputstreamsession
- the current session- Returns:
- the newly created
Resource
- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
updateResource
Resource updateResource(Resource resource)
Updating a resource on passing all new properties though a valid resource object. This resource object must correspond on the ID attribute with a valid resource in logicalDOC.- Parameters:
resource
- The updateable resource- Returns:
- the updated resource
-
updateResource
void updateResource(Resource resource, ImportContext context, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
Updating a resource on passing all new properties though a valid resource object. This resource object must correspond on the ID attribute with a valid resource in logicalDOC.- Parameters:
resource
- The updateable resourcecontext
- the ImportContextsession
- the current session- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
resourceExists
boolean resourceExists(Resource resource)
Check for existing resource(logically)- Parameters:
resource
- The Resource- Returns:
- True if found else false
-
getChildByName
Resource getChildByName(Resource parentResource, String name)
Based on the parent resource it will be tried to get a child by a specific name- Parameters:
parentResource
- The parent resourcename
- name of the child must be- Returns:
- The resource that matches, else it will be returned null
-
getParentResource
Resource getParentResource(Resource resource)
Based on the current resource location it will be turned back the upper resource- Parameters:
resource
- the current resource- Returns:
- the parent resource
-
getParentResource
Resource getParentResource(String location, long userId, WebdavSession session)
Based on a location path- Parameters:
location
- the resource pathuserId
- the user idsession
- the current session- Returns:
- the parent resource
- See Also:
the system tries to get the parent resource
-
move
Resource move(Resource target, Resource destination, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
Moves a resource named target to the folder dictionary destination- Parameters:
target
- the resource that is involveddestination
- the destination of the move operationsession
- the current session- Returns:
- the moved resource
- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
streamIn
void streamIn(Resource resource, InputStream is)
Sets the stream for a resource- Parameters:
resource
- the DAV resourceis
- the stream gor the resource
-
streamOut
InputStream streamOut(Resource resource)
Gets the stream for a resource- Parameters:
resource
- the DAV resource- Returns:
- the stream of the resource
-
deleteResource
void deleteResource(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
Deletion of a resource within logicalDOC.- Parameters:
resource
- a valid resourcesession
- the current session- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
copyResource
void copyResource(Resource destinResource, Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
Copying of a resource within logicalDOC. Not supported those days.- Parameters:
destinResource
- target resourceresource
- the DAV resourcesession
- the current session- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
checkout
void checkout(Resource resource, WebdavSession session) throws org.apache.jackrabbit.webdav.DavException
Versioning-part. Checkout causes the system to make a version "overwriteable" to put a new version on it.- Parameters:
resource
- The appropriated resource that has to be checked outsession
- the current session- Throws:
org.apache.jackrabbit.webdav.DavException
- error in the DAV communication
-
getHistory
List<Resource> getHistory(Resource resource)
Versioning-part. Based upon the current resource, the versionhistory is returned matches to this resource.- Parameters:
resource
- The appropriated resource- Returns:
- All Versions
-
uncheckout
void uncheckout(Resource resource, WebdavSession session)
Cancels a checkout- Parameters:
resource
- the DAV resourcesession
- the current session
-
addBookmark
void addBookmark(Resource resource, WebdavSession session)
-
deleteBookmark
void deleteBookmark(Resource resource, WebdavSession session)
-
-