Package org.bedework.carddav.server
Interface SysIntf
-
- All Superinterfaces:
org.bedework.webdav.servlet.shared.WdSysIntf
- All Known Implementing Classes:
BwSysIntfImpl
public interface SysIntf extends org.bedework.webdav.servlet.shared.WdSysIntfAll interactions with the underlying calendar system are made via this interface.We're using the bedework object classes here. To simplify matters (a little) we don't have distinct event, todo and journal classes. They are all currently the BwEvent class with an entityType defining what the object represents.
- Author:
- Mike Douglass douglm at rpi.edu
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSysIntf.PrincipalInfo
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddCard(String path, Card card)Add a card.org.bedework.access.CurrentAccesscheckAccess(CarddavCollection ent, int desiredAccess, boolean returnResult)Check the access for the given entity.voidclose()End any transactions.booleancopyMove(Card from, org.bedework.webdav.servlet.shared.WdCollection to, String name, boolean copy, boolean overwrite)Copy or move the given entity to the destination collection with the given name.voidcopyMove(org.bedework.webdav.servlet.shared.WdCollection from, org.bedework.webdav.servlet.shared.WdCollection to, boolean copy, boolean overwrite)Copy or move the collection to another location.booleancopyMoveFile(CarddavResource from, org.bedework.webdav.servlet.shared.WdCollection to, String name, boolean copy, boolean overwrite)Copy or move the given file to the destination collection with the given name.voiddeleteCard(CarddavCardNode card)voiddeleteCollection(org.bedework.webdav.servlet.shared.WdCollection cal)voiddeleteFile(CarddavResource val)Delete a file.CardgetCard(String path, String name)Get card given the collection and String name.GetResultgetCards(CarddavCollection col, Filter filter, GetLimits limits)Return the cards for the current user in the given collection using the supplied filter.CarddavCollectiongetCollection(String path)Get a collection given the pathGetResultgetCollections(CarddavCollection col, GetLimits limits)Returns children of the given collection to which the current user has some access.booleangetDirectoryBrowsingDisallowed()Do we allow browsing of directories?CarddavResourcegetFile(org.bedework.webdav.servlet.shared.WdCollection coll, String name)GET a file.voidgetFileContent(CarddavResource val)Get resource content given the resource.Collection<CarddavResource>getFiles(org.bedework.webdav.servlet.shared.WdCollection coll)Get the files in a collection.Collection<String>getGroups(String rootUrl, String principalUrl)The urls should be principal urls.intgetMaxUserEntitySize()Max size for an entityorg.bedework.access.AccessPrincipalgetPrincipal()Return the current principalorg.bedework.access.AccessPrincipalgetPrincipal(String href)Return principal information for the given href.Collection<String>getPrincipalCollectionSet(String resourceUri)Given a uri returns a Collection of uris that allow search operations on principals for that resource.SysIntf.PrincipalInfogetPrincipalInfo(org.bedework.access.AccessPrincipal pcpl, boolean getDirInfo)Given a valid principal return the associated information needed for carddav interactions.Collection<SysIntf.PrincipalInfo>getPrincipals(String resourceUri, org.bedework.webdav.servlet.shared.PrincipalPropertySearch pps)Given a PrincipalPropertySearch returns a Collection of matching principals.PropertyHandlergetPropertyHandler(PropertyHandler.PropertyType ptype)Get a property handlervoidinit(javax.servlet.http.HttpServletRequest req, String account, CardDAVConfig conf, CardDAVContextConfig ctxConf)Called before any other method is called to allow initialisation to take place at the first or subsequent requestsbooleanisPrincipal(String val)Does the value appear to represent a valid principal?intmakeCollection(CarddavCollection col, String parentPath)StringmakeHref(org.bedework.access.AccessPrincipal p)voidputFile(org.bedework.webdav.servlet.shared.WdCollection coll, CarddavResource val)PUT a file.voidupdateAccess(CarddavCardNode card, org.bedework.access.Acl acl)voidupdateAccess(CarddavColNode col, org.bedework.access.Acl acl)voidupdateCard(String path, Card card)Update a card.voidupdateCollection(org.bedework.webdav.servlet.shared.WdCollection val)Update a collection.voidupdateFile(CarddavResource val, boolean updateContent)Update a file.
-
-
-
Method Detail
-
init
void init(javax.servlet.http.HttpServletRequest req, String account, CardDAVConfig conf, CardDAVContextConfig ctxConf) throws org.bedework.webdav.servlet.shared.WebdavExceptionCalled before any other method is called to allow initialisation to take place at the first or subsequent requests- Parameters:
req-account-conf- global service configurationctxConf- per application type configuration- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipal
org.bedework.access.AccessPrincipal getPrincipal() throws org.bedework.webdav.servlet.shared.WebdavExceptionReturn the current principal- Returns:
- String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPropertyHandler
PropertyHandler getPropertyHandler(PropertyHandler.PropertyType ptype) throws org.bedework.webdav.servlet.shared.WebdavException
Get a property handler- Parameters:
ptype-- Returns:
- PropertyHandler
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
isPrincipal
boolean isPrincipal(String val) throws org.bedework.webdav.servlet.shared.WebdavException
Does the value appear to represent a valid principal?- Parameters:
val-- Returns:
- true if it's a (possible) principal
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipal
org.bedework.access.AccessPrincipal getPrincipal(String href) throws org.bedework.webdav.servlet.shared.WebdavException
Return principal information for the given href. Also tests for a valid principal.- Parameters:
href-- Returns:
- AccessPrincipal
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
makeHref
String makeHref(org.bedework.access.AccessPrincipal p) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
p-- Returns:
- String href
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getGroups
Collection<String> getGroups(String rootUrl, String principalUrl) throws org.bedework.webdav.servlet.shared.WebdavException
The urls should be principal urls. principalUrl can null for the current user. The result is a collection of principal urls of which the given url is a member, based upon rootUrl. For example, if rootUrl points to the base of the user principal hierarchy, then the rsult should be at least the current user's principal url, remembering that user principals are themselves groups and the user is considered a member of their own group.- Parameters:
rootUrl- - url to base search on.principalUrl- - url of principal or null for current user- Returns:
- Collection of urls - always non-null
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getDirectoryBrowsingDisallowed
boolean getDirectoryBrowsingDisallowed() throws org.bedework.webdav.servlet.shared.WebdavExceptionDo we allow browsing of directories?- Returns:
- boolean true if browsing disallowed
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
getPrincipalInfo
SysIntf.PrincipalInfo getPrincipalInfo(org.bedework.access.AccessPrincipal pcpl, boolean getDirInfo) throws org.bedework.webdav.servlet.shared.WebdavException
Given a valid principal return the associated information needed for carddav interactions.- Parameters:
pcpl- the principalgetDirInfo- get directory info if true and available.- Returns:
- PrincipalInfo or null
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
getPrincipalCollectionSet
Collection<String> getPrincipalCollectionSet(String resourceUri) throws org.bedework.webdav.servlet.shared.WebdavException
Given a uri returns a Collection of uris that allow search operations on principals for that resource.- Parameters:
resourceUri-- Returns:
- Collection of String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipals
Collection<SysIntf.PrincipalInfo> getPrincipals(String resourceUri, org.bedework.webdav.servlet.shared.PrincipalPropertySearch pps) throws org.bedework.webdav.servlet.shared.WebdavException
Given a PrincipalPropertySearch returns a Collection of matching principals.- Parameters:
resourceUri-pps- Collection of PrincipalPropertySearch- Returns:
- Collection of CalUserInfo
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
addCard
void addCard(String path, Card card) throws org.bedework.webdav.servlet.shared.WebdavException
Add a card.- Parameters:
path- to collectioncard- Object to be added- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateCard
void updateCard(String path, Card card) throws org.bedework.webdav.servlet.shared.WebdavException
Update a card.- Parameters:
path- to collectioncard- Object to be updated- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCards
GetResult getCards(CarddavCollection col, Filter filter, GetLimits limits) throws org.bedework.webdav.servlet.shared.WebdavException
Return the cards for the current user in the given collection using the supplied filter.- Parameters:
col- collectionfilter- - if non-null defines a search filterlimits- - applied to this query- Returns:
- Collection populated card objects
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCard
Card getCard(String path, String name) throws org.bedework.webdav.servlet.shared.WebdavException
Get card given the collection and String name.- Parameters:
path- to collectionname- String possible name- Returns:
- Vcard or null
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteCard
void deleteCard(CarddavCardNode card) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
card-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateAccess
void updateAccess(CarddavCardNode card, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
card-acl-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
checkAccess
org.bedework.access.CurrentAccess checkAccess(CarddavCollection ent, int desiredAccess, boolean returnResult) throws org.bedework.webdav.servlet.shared.WebdavException
Check the access for the given entity. Returns the current access or null or optionally throws a no access exception.- Parameters:
ent-desiredAccess-returnResult-- Returns:
- CurrentAccess
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- if returnResult false and no access
-
updateAccess
void updateAccess(CarddavColNode col, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col-acl-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
makeCollection
int makeCollection(CarddavCollection col, String parentPath) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col- Initialised collection objectparentPath-- Returns:
- int status
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteCollection
void deleteCollection(org.bedework.webdav.servlet.shared.WdCollection cal) throws org.bedework.webdav.servlet.shared.WebdavException- Parameters:
cal-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMove
void copyMove(org.bedework.webdav.servlet.shared.WdCollection from, org.bedework.webdav.servlet.shared.WdCollection to, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavExceptionCopy or move the collection to another location. Status is set on return- Parameters:
from- Source collectionto- Destination collectioncopy- true for copyingoverwrite- destination exists- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMove
boolean copyMove(Card from, org.bedework.webdav.servlet.shared.WdCollection to, String name, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException
Copy or move the given entity to the destination collection with the given name. Status is set on return- Parameters:
from- Source entityto- Destination collectionname- String name of new entitycopy- true for copyingoverwrite- destination exists- Returns:
- true if destination created (i.e. not updated)
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCollection
CarddavCollection getCollection(String path) throws org.bedework.webdav.servlet.shared.WebdavException
Get a collection given the path- Parameters:
path- String path of collection- Returns:
- WdCollection null for unknown collection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateCollection
void updateCollection(org.bedework.webdav.servlet.shared.WdCollection val) throws org.bedework.webdav.servlet.shared.WebdavExceptionUpdate a collection.- Parameters:
val- updated WdCollection object- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCollections
GetResult getCollections(CarddavCollection col, GetLimits limits) throws org.bedework.webdav.servlet.shared.WebdavException
Returns children of the given collection to which the current user has some access.- Parameters:
col- parent collectionlimits-- Returns:
- GetResult with collection of WdCollection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
putFile
void putFile(org.bedework.webdav.servlet.shared.WdCollection coll, CarddavResource val) throws org.bedework.webdav.servlet.shared.WebdavExceptionPUT a file.- Parameters:
coll- WdCollection defining recipient collectionval- BwResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFile
CarddavResource getFile(org.bedework.webdav.servlet.shared.WdCollection coll, String name) throws org.bedework.webdav.servlet.shared.WebdavException
GET a file.- Parameters:
coll- WdCollection containing filename-- Returns:
- BwResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFileContent
void getFileContent(CarddavResource val) throws org.bedework.webdav.servlet.shared.WebdavException
Get resource content given the resource. It will be set in the resource object- Parameters:
val- BwResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFiles
Collection<CarddavResource> getFiles(org.bedework.webdav.servlet.shared.WdCollection coll) throws org.bedework.webdav.servlet.shared.WebdavException
Get the files in a collection.- Parameters:
coll- WdCollection containing file- Returns:
- Collection of BwResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateFile
void updateFile(CarddavResource val, boolean updateContent) throws org.bedework.webdav.servlet.shared.WebdavException
Update a file.- Parameters:
val- BwResourceupdateContent- if true we also update the content- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteFile
void deleteFile(CarddavResource val) throws org.bedework.webdav.servlet.shared.WebdavException
Delete a file.- Parameters:
val- BwResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMoveFile
boolean copyMoveFile(CarddavResource from, org.bedework.webdav.servlet.shared.WdCollection to, String name, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException
Copy or move the given file to the destination collection with the given name. Status is set on return- Parameters:
from- Source resourceto- Destination collectionname- String name of new entitycopy- true for copyingoverwrite- destination exists- Returns:
- true if destination created (i.e. not updated)
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getMaxUserEntitySize
int getMaxUserEntitySize() throws org.bedework.webdav.servlet.shared.WebdavExceptionMax size for an entity- Returns:
- int
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
close
void close() throws org.bedework.webdav.servlet.shared.WebdavExceptionEnd any transactions.- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
-