public class CardDavStore extends Object implements WebDavStore
WebDavStore.MoveResourceStatus, WebDavStore.PutResourceStatus| Modifier and Type | Field and Description |
|---|---|
protected javax.jdo.PersistenceManagerFactory |
pmf |
protected Map<String,String> |
uidMapping |
| Constructor and Description |
|---|
CardDavStore(javax.jdo.PersistenceManagerFactory pmf)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RequestContext |
begin(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Indicates that a new request or transaction with this store involved has
been started.
|
void |
commit(RequestContext requestContext)
Indicates that all changes done inside this request shall be made
permanent and any transactions, connections and other temporary resources
shall be terminated.
|
void |
createCollection(RequestContext requestContext,
String path)
Creates a folder at the position specified by
folderUri. |
Collection<Resource> |
getChildren(RequestContext requestContext,
Resource res)
Gets the names of the children of the folder specified by
folderUri. |
List<Lock> |
getLocksByPath(RequestContext requestContext,
String path)
Gets the LockedObject on specified path.
|
String |
getMimeType(Resource res)
Gets mime type of stored object.
|
protected String |
getParentPath(String path)
Get parent of given path.
|
static javax.jdo.PersistenceManager |
getPersistenceManager(javax.servlet.http.HttpServletRequest req,
javax.jdo.PersistenceManagerFactory pmf)
Get persistence manager for this store.
|
Resource |
getResourceByPath(RequestContext requestContext,
String path)
Path is of the form:
- Format 1: {provider.id} "/" {segment.id} "/" ["user" "/"] {user.id} "/" ["profile" "/"] {profile.id} "/" {feed.id} "/" {account.id}
|
org.w3c.cci2.BinaryLargeObject |
getResourceContent(RequestContext requestContext,
Resource res)
Gets the content of the resource specified by
resourceUri. |
Lock |
lock(RequestContext requestContext,
String path,
String owner,
String scope,
String type,
int depth,
int timeout)
Tries to lock the resource at "path".
|
WebDavStore.MoveResourceStatus |
moveResource(RequestContext requestContext,
Resource res,
String sourcePath,
String destinationPath)
Moves the resource from sourcePath to destinationPath
|
WebDavStore.PutResourceStatus |
putResource(RequestContext requestContext,
String path,
InputStream content,
String contentType) |
void |
removeResource(RequestContext requestContext,
Resource res)
Removes the object specified by
uri. |
void |
rollback(RequestContext requestContext)
Indicates that all changes done inside this request shall be undone and
any transactions, connections and other temporary resources shall be
terminated.
|
void |
setLockTimeout(RequestContext requestContext,
String id,
int timeout)
Set timeout for specified lock.
|
boolean |
unlock(RequestContext requestContext,
String id)
Unlocks all resources at "path" (and all subfolders if existing) that
have the same owner.
|
public CardDavStore(javax.jdo.PersistenceManagerFactory pmf)
pmf - public static javax.jdo.PersistenceManager getPersistenceManager(javax.servlet.http.HttpServletRequest req,
javax.jdo.PersistenceManagerFactory pmf)
req - pmf - public RequestContext begin(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
WebDavStoreWebDavStore.commit(RequestContext transaction) or
WebDavStore.rollback(RequestContext transaction). If only non-read methods
have been called, the request will be terminated by a
WebDavStore.commit(RequestContext transaction). This method will be
called by (@link WebdavStoreAdapter} at the beginning of each request.begin in interface WebDavStorepublic void commit(RequestContext requestContext)
WebDavStorecommit in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpublic void createCollection(RequestContext requestContext, String path)
WebDavStorefolderUri.createCollection in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpath - URI of the folderpublic Collection<Resource> getChildren(RequestContext requestContext, Resource res)
WebDavStorefolderUri.getChildren in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpublic org.w3c.cci2.BinaryLargeObject getResourceContent(RequestContext requestContext, Resource res)
WebDavStoreresourceUri.getResourceContent in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpublic Resource getResourceByPath(RequestContext requestContext, String path)
getResourceByPath in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpath - URIpublic void removeResource(RequestContext requestContext, Resource res)
WebDavStoreuri.removeResource in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpublic WebDavStore.MoveResourceStatus moveResource(RequestContext requestContext, Resource res, String sourcePath, String destinationPath)
WebDavStoremoveResource in interface WebDavStorepublic void rollback(RequestContext requestContext)
WebDavStorerollback in interface WebDavStorerequestContext - indicates that the method is within the scope of a WebDAV
transactionpublic String getMimeType(Resource res)
WebDavStoregetMimeType in interface WebDavStoreprotected String getParentPath(String path)
path - public WebDavStore.PutResourceStatus putResource(RequestContext requestContext, String path, InputStream content, String contentType)
putResource in interface WebDavStorepublic List<Lock> getLocksByPath(RequestContext requestContext, String path)
WebDavStoregetLocksByPath in interface WebDavStorepath - Path to requested resourcepublic Lock lock(RequestContext requestContext, String path, String owner, String scope, String type, int depth, int timeout) throws LockFailedException
WebDavStorelock in interface WebDavStorepath - what resource to lockowner - the owner of the lockdepth - depthtimeout - Lock Duration in seconds.LockFailedExceptionpublic void setLockTimeout(RequestContext requestContext, String id, int timeout)
WebDavStoresetLockTimeout in interface WebDavStorepublic boolean unlock(RequestContext requestContext, String id)
WebDavStoreunlock in interface WebDavStoreid - id to the resource to unlockThis software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.