Package org.bedework.carddav.bwserver
Class BwSysIntfImpl
- java.lang.Object
-
- org.bedework.carddav.bwserver.BwSysIntfImpl
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.bedework.carddav.server.SysIntf
SysIntf.PrincipalInfo
-
-
Constructor Summary
Constructors Constructor Description BwSysIntfImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCard(String path, Card card)Add a card.booleanallowsSyncReport(org.bedework.webdav.servlet.shared.WdCollection col)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 col)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 val, GetLimits limits)Returns children of the given collection to which the current user has some access.StringgetDefaultContentType()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.org.bedework.util.logging.BwLoggergetLogger()intgetMaxUserEntitySize()Max size for an entityStringgetNotificationURL()org.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 handlerorg.bedework.webdav.servlet.shared.UrlHandlergetUrlHandler()voidinit(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.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, setLogLevel, trace, trace, warn
-
-
-
-
Method Detail
-
init
public void init(javax.servlet.http.HttpServletRequest req, String account, CardDAVConfig conf, CardDAVContextConfig ctxConf) throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfCalled before any other method is called to allow initialisation to take place at the first or subsequent requests
-
getDefaultContentType
public String getDefaultContentType()
- Specified by:
getDefaultContentTypein interfaceorg.bedework.webdav.servlet.shared.WdSysIntf
-
getNotificationURL
public String getNotificationURL() throws org.bedework.webdav.servlet.shared.WebdavException
- Specified by:
getNotificationURLin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipal
public org.bedework.access.AccessPrincipal getPrincipal() throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfReturn the current principal- Specified by:
getPrincipalin interfaceSysIntf- Returns:
- String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPropertyHandler
public PropertyHandler getPropertyHandler(PropertyHandler.PropertyType ptype) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGet a property handler- Specified by:
getPropertyHandlerin interfaceSysIntf- Returns:
- PropertyHandler
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getUrlHandler
public org.bedework.webdav.servlet.shared.UrlHandler getUrlHandler()
- Specified by:
getUrlHandlerin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf
-
allowsSyncReport
public boolean allowsSyncReport(org.bedework.webdav.servlet.shared.WdCollection col) throws org.bedework.webdav.servlet.shared.WebdavException- Specified by:
allowsSyncReportin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
isPrincipal
public boolean isPrincipal(String val) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfDoes the value appear to represent a valid principal?- Specified by:
isPrincipalin interfaceSysIntf- Returns:
- true if it's a (possible) principal
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipal
public org.bedework.access.AccessPrincipal getPrincipal(String href) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfReturn principal information for the given href. Also tests for a valid principal.- Specified by:
getPrincipalin interfaceSysIntf- Returns:
- AccessPrincipal
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
makeHref
public String makeHref(org.bedework.access.AccessPrincipal p) throws org.bedework.webdav.servlet.shared.WebdavException
-
getGroups
public Collection<String> getGroups(String rootUrl, String principalUrl) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfThe 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.
-
getDirectoryBrowsingDisallowed
public boolean getDirectoryBrowsingDisallowed() throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfDo we allow browsing of directories?- Specified by:
getDirectoryBrowsingDisallowedin interfaceSysIntf- Returns:
- boolean true if browsing disallowed
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
getPrincipalInfo
public SysIntf.PrincipalInfo getPrincipalInfo(org.bedework.access.AccessPrincipal pcpl, boolean getDirInfo) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGiven a valid principal return the associated information needed for carddav interactions.- Specified by:
getPrincipalInfoin interfaceSysIntf- 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
public Collection<String> getPrincipalCollectionSet(String resourceUri) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGiven a uri returns a Collection of uris that allow search operations on principals for that resource.- Specified by:
getPrincipalCollectionSetin interfaceSysIntf- Returns:
- Collection of String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPrincipals
public Collection<SysIntf.PrincipalInfo> getPrincipals(String resourceUri, org.bedework.webdav.servlet.shared.PrincipalPropertySearch pps) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGiven a PrincipalPropertySearch returns a Collection of matching principals.- Specified by:
getPrincipalsin interfaceSysIntfpps- Collection of PrincipalPropertySearch- Returns:
- Collection of CalUserInfo
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
addCard
public void addCard(String path, Card card) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfAdd a card.
-
updateCard
public void updateCard(String path, Card card) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfUpdate a card.- Specified by:
updateCardin interfaceSysIntf- Parameters:
path- to collectioncard- Object to be updated- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCards
public GetResult getCards(CarddavCollection col, Filter filter, GetLimits limits) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfReturn the cards for the current user in the given collection using the supplied filter.
-
getCard
public Card getCard(String path, String name) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGet card given the collection and String name.
-
deleteCard
public void deleteCard(CarddavCardNode card) throws org.bedework.webdav.servlet.shared.WebdavException
- Specified by:
deleteCardin interfaceSysIntf- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateAccess
public void updateAccess(CarddavCardNode card, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException
- Specified by:
updateAccessin interfaceSysIntf- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
checkAccess
public org.bedework.access.CurrentAccess checkAccess(CarddavCollection ent, int desiredAccess, boolean returnResult) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfCheck the access for the given entity. Returns the current access or null or optionally throws a no access exception.- Specified by:
checkAccessin interfaceSysIntf- Returns:
- CurrentAccess
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- if returnResult false and no access
-
updateAccess
public void updateAccess(CarddavColNode col, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException
- Specified by:
updateAccessin interfaceSysIntf- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
makeCollection
public int makeCollection(CarddavCollection col, String parentPath) throws org.bedework.webdav.servlet.shared.WebdavException
- Specified by:
makeCollectionin interfaceSysIntf- Parameters:
col- Initialised collection object- Returns:
- int status
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteCollection
public void deleteCollection(org.bedework.webdav.servlet.shared.WdCollection col) throws org.bedework.webdav.servlet.shared.WebdavException- Specified by:
deleteCollectionin interfaceSysIntf- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMove
public 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.WebdavExceptionDescription copied from interface:SysIntfCopy or move the collection to another location. Status is set on return
-
copyMove
public boolean copyMove(Card from, org.bedework.webdav.servlet.shared.WdCollection to, String name, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfCopy or move the given entity to the destination collection with the given name. Status is set on return- Specified by:
copyMovein interfaceSysIntf- 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
public CarddavCollection getCollection(String path) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGet a collection given the path- Specified by:
getCollectionin interfaceSysIntf- Parameters:
path- String path of collection- Returns:
- WdCollection null for unknown collection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateCollection
public void updateCollection(org.bedework.webdav.servlet.shared.WdCollection val) throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfUpdate a collection.- Specified by:
updateCollectionin interfaceSysIntf- Parameters:
val- updated WdCollection object- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCollections
public GetResult getCollections(CarddavCollection val, GetLimits limits) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfReturns children of the given collection to which the current user has some access.- Specified by:
getCollectionsin interfaceSysIntf- Parameters:
val- parent collection- Returns:
- GetResult with collection of WdCollection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
putFile
public void putFile(org.bedework.webdav.servlet.shared.WdCollection coll, CarddavResource val) throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfPUT a file.
-
getFile
public CarddavResource getFile(org.bedework.webdav.servlet.shared.WdCollection coll, String name) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGET a file.
-
getFileContent
public void getFileContent(CarddavResource val) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGet resource content given the resource. It will be set in the resource object- Specified by:
getFileContentin interfaceSysIntf- Parameters:
val- BwResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFiles
public Collection<CarddavResource> getFiles(org.bedework.webdav.servlet.shared.WdCollection coll) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfGet the files in a collection.
-
updateFile
public void updateFile(CarddavResource val, boolean updateContent) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfUpdate a file.- Specified by:
updateFilein interfaceSysIntf- Parameters:
val- BwResourceupdateContent- if true we also update the content- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteFile
public void deleteFile(CarddavResource val) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfDelete a file.- Specified by:
deleteFilein interfaceSysIntf- Parameters:
val- BwResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMoveFile
public boolean copyMoveFile(CarddavResource from, org.bedework.webdav.servlet.shared.WdCollection to, String name, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException
Description copied from interface:SysIntfCopy or move the given file to the destination collection with the given name. Status is set on return- Specified by:
copyMoveFilein interfaceSysIntf- 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
public int getMaxUserEntitySize() throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfMax size for an entity- Specified by:
getMaxUserEntitySizein interfaceSysIntf- Returns:
- int
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
close
public void close() throws org.bedework.webdav.servlet.shared.WebdavExceptionDescription copied from interface:SysIntfEnd any transactions.
-
getLogger
public org.bedework.util.logging.BwLogger getLogger()
- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-
-