Package org.bedework.carddav.bwserver
Class BwSysIntfImpl
java.lang.Object
org.bedework.carddav.bwserver.BwSysIntfImpl
- All Implemented Interfaces:
SysIntf,org.bedework.util.logging.Logged,org.bedework.webdav.servlet.shared.WdSysIntf
Bedework implementation of carddav SysIntf.
- Author:
- Mike Douglass douglm at rpi.edu
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.bedework.carddav.server.SysIntf
SysIntf.PrincipalInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd 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) voidDelete a file.Get card given the collection and String name.getCards(CarddavCollection col, Filter filter, GetLimits limits) Return the cards for the current user in the given collection using the supplied filter.getCollection(String path) Get a collection given the pathgetCollections(CarddavCollection val, GetLimits limits) Returns children of the given collection to which the current user has some access.booleanDo we allow browsing of directories?GET a file.voidGet resource content given the resource.getFiles(org.bedework.webdav.servlet.shared.WdCollection<?> coll) Get the files in a collection.The urls should be principal urls.org.bedework.util.logging.BwLoggerintMax size for an entityorg.bedework.access.AccessPrincipalReturn the current principalorg.bedework.access.AccessPrincipalgetPrincipal(String href) Return principal information for the given href.getPrincipalCollectionSet(String resourceUri) Given a uri returns a Collection of uris that allow search operations on principals for that resource.getPrincipalInfo(org.bedework.access.AccessPrincipal pcpl, boolean getDirInfo) Given a valid principal return the associated information needed for carddav interactions.getPrincipals(String resourceUri, org.bedework.webdav.servlet.shared.PrincipalPropertySearch pps) Given a PrincipalPropertySearch returns a Collection of matching principals.Get a property handlerorg.bedework.webdav.servlet.shared.UrlHandlervoidinit(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) makeHref(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, waitMethods inherited from interface org.bedework.util.logging.Logged
audit, debug, debug, debug, enableAuditLogger, enableErrorLogger, enableMetricsLogger, error, error, error, getLogLevel, info, isAuditLoggerEnabled, isErrorLoggerEnabled, isMetricsDebugEnabled, isMetricsLoggerEnabled, metrics, setLoggerClass, setLoggerClass, trace, trace, trace, warn
-
Constructor Details
-
BwSysIntfImpl
public BwSysIntfImpl()
-
-
Method Details
-
init
public void init(javax.servlet.http.HttpServletRequest req, String account, CardDAVConfig conf, CardDAVContextConfig ctxConf) Description copied from interface:SysIntfCalled before any other method is called to allow initialisation to take place at the first or subsequent requests -
getDefaultContentType
- Specified by:
getDefaultContentTypein interfaceorg.bedework.webdav.servlet.shared.WdSysIntf
-
getNotificationURL
- Specified by:
getNotificationURLin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf
-
getPrincipal
public org.bedework.access.AccessPrincipal getPrincipal()Description copied from interface:SysIntfReturn the current principal- Specified by:
getPrincipalin interfaceSysIntf- Returns:
- String
-
getPropertyHandler
Description copied from interface:SysIntfGet a property handler- Specified by:
getPropertyHandlerin interfaceSysIntf- Returns:
- PropertyHandler
-
getUrlHandler
public org.bedework.webdav.servlet.shared.UrlHandler getUrlHandler()- Specified by:
getUrlHandlerin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf
-
isPrincipal
Description copied from interface:SysIntfDoes the value appear to represent a valid principal?- Specified by:
isPrincipalin interfaceSysIntf- Parameters:
val- possible id or principal- Returns:
- true if it's a (possible) principal
-
getPrincipal
Description copied from interface:SysIntfReturn principal information for the given href. Also tests for a valid principal.- Specified by:
getPrincipalin interfaceSysIntf- Parameters:
href- for principal- Returns:
- AccessPrincipal
-
makeHref
-
getGroups
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()Description copied from interface:SysIntfDo we allow browsing of directories?- Specified by:
getDirectoryBrowsingDisallowedin interfaceSysIntf- Returns:
- boolean true if browsing disallowed
-
getPrincipalInfo
public SysIntf.PrincipalInfo getPrincipalInfo(org.bedework.access.AccessPrincipal pcpl, boolean getDirInfo) 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
-
getPrincipalCollectionSet
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
-
addCard
Description copied from interface:SysIntfAdd a card. -
updateCard
Description copied from interface:SysIntfUpdate a card.- Specified by:
updateCardin interfaceSysIntf- Parameters:
path- to collectioncard- Object to be updated
-
getCards
Description copied from interface:SysIntfReturn the cards for the current user in the given collection using the supplied filter. -
getCard
Description copied from interface:SysIntfGet card given the collection and String name. -
deleteCard
- Specified by:
deleteCardin interfaceSysIntf
-
updateAccess
- Specified by:
updateAccessin interfaceSysIntf
-
checkAccess
public org.bedework.access.CurrentAccess checkAccess(CarddavCollection ent, int desiredAccess, boolean returnResult) 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
-
updateAccess
- Specified by:
updateAccessin interfaceSysIntf
-
makeCollection
- Specified by:
makeCollectionin interfaceSysIntf- Parameters:
col- Initialised collection object- Returns:
- int status
-
getCollection
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
-
getCollections
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
-
getFileContent
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
-
updateFile
Description copied from interface:SysIntfUpdate a file.- Specified by:
updateFilein interfaceSysIntf- Parameters:
val- BwResourceupdateContent- if true we also update the content
-
deleteFile
Description copied from interface:SysIntfDelete a file.- Specified by:
deleteFilein interfaceSysIntf- Parameters:
val- BwResource
-
getMaxUserEntitySize
public int getMaxUserEntitySize()Description copied from interface:SysIntfMax size for an entity- Specified by:
getMaxUserEntitySizein interfaceSysIntf- Returns:
- int
-
close
public void close()Description copied from interface:SysIntfEnd any transactions. -
getLogger
public org.bedework.util.logging.BwLogger getLogger()- Specified by:
getLoggerin interfaceorg.bedework.util.logging.Logged
-