Interface SysIntf
-
- All Superinterfaces:
org.bedework.webdav.servlet.shared.WdSysIntf
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, task 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.IcalResultTypeExpected result typestatic classSysIntf.MethodEmittedWhat method do we want emittedstatic classSysIntf.SchedRecipientResultResult for a single recipient.static classSysIntf.SynchReportDataData for Synch Reportstatic classSysIntf.UpdateResultShow the outcome of an update
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<CalDAVEvent<?>>addEvent(CalDAVEvent<?> ev, boolean noInvites, boolean rollbackOnError)Add an event/task/journal.booleanbedeworkExtensionsEnabled()true if bedework extensions are enabled for the request.org.bedework.access.AccessPrincipalcaladdrToPrincipal(String caladdr)Given a calendar address return the associated calendar account.org.bedework.access.CurrentAccesscheckAccess(org.bedework.webdav.servlet.shared.WdEntity<?> ent, int desiredAccess, boolean returnResult)Check the access for the given entity.voidclose()End any transactions.voidcopyMove(CalDAVCollection<?> from, CalDAVCollection<?> to, boolean copy, boolean overwrite)Copy or move the collection to another location.booleancopyMove(CalDAVEvent<?> from, CalDAVCollection<?> to, String name, boolean copy, boolean overwrite)Copy or move the given entity to the destination collection with the given name.booleancopyMoveFile(CalDAVResource<?> from, String toPath, String name, boolean copy, boolean overwrite)Copy or move the given file to the destination collection with the given name.voiddeleteCollection(CalDAVCollection<?> col, boolean sendSchedulingMessage)voiddeleteEvent(CalDAVEvent<?> ev, boolean scheduleReply)voiddeleteFile(CalDAVResource<?> val)Delete a file.SysiIcalendarfromIcal(CalDAVCollection<?> col, ietf.params.xml.ns.icalendar_2.IcalendarType ical, SysIntf.IcalResultType rtype)Convert the Icalendar object to a Collection of Calendar objectsSysiIcalendarfromIcal(CalDAVCollection<?> col, Reader rdr, String contentType, SysIntf.IcalResultType rtype, boolean mergeAttendees)Convert the Icalendar reader to a Collection of Calendar objectsCalDAVAuthPropertiesgetAuthProperties()Return CalDAV properties relevant to authentication state.CalPrincipalInfogetCalPrincipalInfo(org.bedework.access.AccessPrincipal principal)Given a valid AccessPrincipal return the associated calendar user information needed for caldav interactions.CalDAVCollection<?>getCollection(String path)Get a collection given the pathCollection<CalDAVCollection<?>>getCollections(CalDAVCollection<?> col)Returns children of the given collection to which the current user has some access.CalDAVEvent<?>getEvent(CalDAVCollection<?> col, String val)Get events given the collection and String name.Collection<CalDAVEvent<?>>getEvents(CalDAVCollection<?> col, FilterBase filter, List<String> retrieveList, RetrievalMode recurRetrieval)Return the events for the current user in the given collection using the supplied filter.CalDAVResource<?>getFile(CalDAVCollection<?> coll, String name)GET a file.voidgetFileContent(CalDAVResource<?> val)Get resource content given the resource.Collection<CalDAVResource<?>>getFiles(CalDAVCollection<?> coll)Get the files in a collection.CalDAVEvent<?>getFreeBusy(CalDAVCollection<?> col, int depth, TimeRange timeRange)Generate a free busy object for the given time period which reflects the state of the given collection.Collection<String>getFreebusySet()Return a set of hrefs for each resource affecting this users freebusyCollection<String>getGroups(String rootUrl, String principalUrl)The urls should be principal urls.InviteTypegetInviteStatus(CalDAVCollection<?> col)List<NotificationType>getNotifications()List<NotificationType>getNotifications(String href, QName type)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.org.bedework.access.AccessPrincipalgetPrincipalForUser(String account)Return principal information for the given account.Collection<CalPrincipalInfo>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 handlerbyte[]getPublicKey(String domain, String service)Returns a public key for the given domain and service - either or both of which may be null.voidgetSpecialFreeBusy(String cua, Set<String> recipients, String originator, TimeRange tr, Writer wtr)Handle the special freebusy resquests, i.e.SysIntf.SynchReportDatagetSyncReport(String path, String token, int limit, boolean recurse)StringgetSyncToken(CalDAVCollection<?> col)CalDAVSystemPropertiesgetSystemProperties()Return CalDAV relevant properties about the system.org.bedework.webdav.servlet.shared.UrlHandlergetUrlHandler()Stringinit(javax.servlet.http.HttpServletRequest req, String account, boolean service, boolean calWs, boolean synchWs, boolean notifyWs, boolean socketWs, String opaqueData)Called before any other method is called to allow initialization to take place at the first or subsequent requestsbooleanisPrincipal(String val)Does the value appear to represent a valid principal?intmakeCollection(CalDAVCollection<?> col)StringmakeHref(String id, int whoType)CalDAVCollection<?>newCollectionObject(boolean isCalendarCollection, String parentPath)Return a new object representing the parameters.CalDAVResource<?>newResourceObject(String parentPath)Return a new object representing the parameters.StringprincipalToCaladdr(org.bedework.access.AccessPrincipal principal)The inverse of caladdrToPrincipalvoidputFile(CalDAVCollection<?> coll, CalDAVResource<?> val)PUT a file.voidreindexEvent(CalDAVEvent<?> event)Reindex an event after an error that may be the result of an out of date index.voidremoveNotification(String href, NotificationType val)Remove the given notification from the notification collection for the indicated calendar user.Collection<SysIntf.SchedRecipientResult>requestFreeBusy(CalDAVEvent<?> val, boolean iSchedule)Get the free busy for one or more principals based on the given VFREEBUSY request.voidrollback()Called on the way out before close if there was an error.Collection<SysIntf.SchedRecipientResult>schedule(CalDAVEvent<?> ev)Request to schedule a meeting.booleansendNotification(String href, NotificationType val)Add the given notification to the notification collection for the indicated calendar user.ShareResultTypeshare(CalDAVCollection<?> col, ShareType share)StringsharingReply(CalDAVCollection<?> col, InviteReplyType reply)Handle a reply to a sharing notification.booleansubscribeNotification(String principalHref, String action, List<String> emails)Subscribe for email notifications to the notification engine for the indicated calendar user.booleantestMode()Allows some special handling of some requests - mostly to do with cleanup of accounts when testing.net.fortuna.ical4j.model.CalendartoCalendar(CalDAVEvent<?> ev, boolean incSchedMethod)Make an ical Calendar from an event.ietf.params.xml.ns.icalendar_2.IcalendarTypetoIcalendar(CalDAVEvent<?> ev, boolean incSchedMethod, ietf.params.xml.ns.icalendar_2.IcalendarType pattern)Make an XML IcalendarType from an event.StringtoIcalString(net.fortuna.ical4j.model.Calendar cal, String contentType)Convert a Calendar to it's string formStringtoJcal(CalDAVEvent<?> ev, boolean incSchedMethod)Make a JSON jcal object from an event.StringtoStringTzCalendar(String tzid)Create a Calendar object from the named timezone and convert to a String representationStringtzidFromTzdef(String val)Given a timezone spec return the tzidvoidupdateAccess(CalDAVCollection<?> col, org.bedework.access.Acl acl)voidupdateAccess(CalDAVEvent<?> ev, org.bedework.access.Acl acl)voidupdateCollection(CalDAVCollection<?> val)Update a collection.voidupdateEvent(CalDAVEvent<?> event)Update an event/todo/journal.SysIntf.UpdateResultupdateEvent(CalDAVEvent<?> event, List<org.oasis_open.docs.ws_calendar.ns.soap.ComponentSelectionType> updates)Update the supplied event using the web services update message.voidupdateFile(CalDAVResource<?> val, boolean updateContent)Update a file.booleanvalidateAlarm(String val)Validate an alarm componentbooleanvalidPrincipal(String href)Is href a valid principal?StringwriteCalendar(Collection<CalDAVEvent<?>> evs, SysIntf.MethodEmitted method, org.bedework.util.xml.XmlEmit xml, Writer wtr, String contentType)Write a collection of events as an ical calendar.
-
-
-
Method Detail
-
init
String init(javax.servlet.http.HttpServletRequest req, String account, boolean service, boolean calWs, boolean synchWs, boolean notifyWs, boolean socketWs, String opaqueData) throws org.bedework.webdav.servlet.shared.WebdavException
Called before any other method is called to allow initialization to take place at the first or subsequent requests- Parameters:
req- the http servlet requestaccount- - possible accountservice- - true if this is a service call - e.g. iSchedule - rather than a real user.calWs- true if this is a CalWs-SOAP servicesynchWs- true if this is a SynchWs-SOAP servicenotifyWs- true if this is a notification servicesocketWs- true if this is a service for the websockets proxyopaqueData- possibly from headers etc.- Returns:
- the account which may have changed
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
testMode
boolean testMode()
Allows some special handling of some requests - mostly to do with cleanup of accounts when testing.- Returns:
- true for test mode.
-
bedeworkExtensionsEnabled
boolean bedeworkExtensionsEnabled()
true if bedework extensions are enabled for the request. Client has sent a header "X-BEDEWORK-EXTENSIONS: TRUE".Current extensions
- Extra elements in notifications
- Returns:
- true for extensions enabled.
-
getAuthProperties
CalDAVAuthProperties getAuthProperties()
Return CalDAV properties relevant to authentication state.- Returns:
- CalDAVAuthProperties object - never null.
-
getSystemProperties
CalDAVSystemProperties getSystemProperties()
Return CalDAV relevant properties about the system.- Returns:
- CalDAVSystemProperties object - never null.
-
getPrincipal
org.bedework.access.AccessPrincipal getPrincipal()
Return the current principal- Returns:
- String
-
getPropertyHandler
PropertyHandler getPropertyHandler(PropertyHandler.PropertyType ptype)
Get a property handler- Parameters:
ptype-- Returns:
- PropertyHandler
-
getUrlHandler
org.bedework.webdav.servlet.shared.UrlHandler getUrlHandler()
- Specified by:
getUrlHandlerin interfaceorg.bedework.webdav.servlet.shared.WdSysIntf- Returns:
- UrlHandler object to manipulate urls.
-
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
-
getPrincipalForUser
org.bedework.access.AccessPrincipal getPrincipalForUser(String account) throws org.bedework.webdav.servlet.shared.WebdavException
Return principal information for the given account.- Parameters:
account-- Returns:
- PrincipalInfo
- 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:
- PrincipalInfo
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getPublicKey
byte[] getPublicKey(String domain, String service) throws org.bedework.webdav.servlet.shared.WebdavException
Returns a public key for the given domain and service - either or both of which may be null.This allows us to have different keys for communication with different domains and for different services. At its simplest, both are ignored and a single key (pair) is used to secure all communications.
This is used, for example, by iSchedule for DKIM verification.
In keeping with the DKIM approach,
- if there are no keys an empty object is returned.
- To refuse keys for a domain/service return null.
- Parameters:
domain-service-- Returns:
- key, empty key object or null.
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
makeHref
String makeHref(String id, int whoType)
- Parameters:
id-whoType- - from WhoDefs- Returns:
- String href
-
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
-
caladdrToPrincipal
org.bedework.access.AccessPrincipal caladdrToPrincipal(String caladdr)
Given a calendar address return the associated calendar account. For example, we might have a calendar address
auser@ahost.org
with the associated account of
auser.
Whereever we need a user account use the converted value. Call userToCaladdr for the inverse.
- Parameters:
caladdr- calendar address- Returns:
- AccessPrincipal or null if not caladdr for this system
-
principalToCaladdr
String principalToCaladdr(org.bedework.access.AccessPrincipal principal) throws org.bedework.webdav.servlet.shared.WebdavException
The inverse of caladdrToPrincipal- Parameters:
principal-- Returns:
- String calendar user address
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCalPrincipalInfo
CalPrincipalInfo getCalPrincipalInfo(org.bedework.access.AccessPrincipal principal)
Given a valid AccessPrincipal return the associated calendar user information needed for caldav interactions.- Parameters:
principal- valid AccessPrincipal- Returns:
- CalUserInfo or null if not caladdr for this system
- Throws:
RuntimeException- 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<CalPrincipalInfo> 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- on fatal error
-
validPrincipal
boolean validPrincipal(String href) throws org.bedework.webdav.servlet.shared.WebdavException
Is href a valid principal?- Parameters:
href-- Returns:
- boolean true for a valid user
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
subscribeNotification
boolean subscribeNotification(String principalHref, String action, List<String> emails) throws org.bedework.webdav.servlet.shared.WebdavException
Subscribe for email notifications to the notification engine for the indicated calendar user.- Parameters:
principalHref- the subscriberaction- "add"/"remove"emails- addresses to add or remove- Returns:
- false for not done
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
sendNotification
boolean sendNotification(String href, NotificationType val) throws org.bedework.webdav.servlet.shared.WebdavException
Add the given notification to the notification collection for the indicated calendar user.- Parameters:
href-val-- Returns:
- false for unknown CU
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
removeNotification
void removeNotification(String href, NotificationType val) throws org.bedework.webdav.servlet.shared.WebdavException
Remove the given notification from the notification collection for the indicated calendar user.- Parameters:
href-val-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getNotifications
List<NotificationType> getNotifications() throws org.bedework.webdav.servlet.shared.WebdavException
- Returns:
- notifications for this user
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getNotifications
List<NotificationType> getNotifications(String href, QName type) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
href- of principaltype- of notification (null for all)- Returns:
- notifications for the given principal of the given type
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
share
ShareResultType share(CalDAVCollection<?> col, ShareType share) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col- MUST be a sharable collectionshare- is the request- Returns:
- list of ok and !ok sharees
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
sharingReply
String sharingReply(CalDAVCollection<?> col, InviteReplyType reply) throws org.bedework.webdav.servlet.shared.WebdavException
Handle a reply to a sharing notification.- Parameters:
col- - unchecked sharees calendar homereply- - the reply to the invitation with the path reset to be the relative path.- Returns:
- null for unknown sharer or no invitation otherwise the path to the new alias in the sharees calendar home.
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getInviteStatus
InviteType getInviteStatus(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col-- Returns:
- current invitations
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFreebusySet
Collection<String> getFreebusySet() throws org.bedework.webdav.servlet.shared.WebdavException
Return a set of hrefs for each resource affecting this users freebusy- Returns:
- Collection of hrefs
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- for errors
-
schedule
Collection<SysIntf.SchedRecipientResult> schedule(CalDAVEvent<?> ev) throws org.bedework.webdav.servlet.shared.WebdavException
Request to schedule a meeting. The event object must have the organizer and attendees and possibly recipients set. If no recipients are set, they will be set from the attendees.The functioning of this method must conform to the requirements of iTip. The event object must have the required method (publish, request etc) set.
The event will be added to the users outbox which will trigger the send of requests to other users inboxes. For users within this system the request will be immediately addded to the recipients inbox. For external users they are sent via mail.
- Parameters:
ev- Event object- Returns:
- ScheduleResult
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
addEvent
Collection<CalDAVEvent<?>> addEvent(CalDAVEvent<?> ev, boolean noInvites, boolean rollbackOnError) throws org.bedework.webdav.servlet.shared.WebdavException
Add an event/task/journal. If this is a scheduling event we are adding, determined by examining the organizer and attendee properties, we will send out invitations to the attendees, unless the noInvites flag is set.- Parameters:
ev- CalDAVEvent objectnoInvites- Set from request - if true don't send invitesrollbackOnError- true if we rollback and throw an exception on error- Returns:
- Collection of overrides which did not match or null if all matched
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
reindexEvent
void reindexEvent(CalDAVEvent<?> event)
Reindex an event after an error that may be the result of an out of date index.- Parameters:
event- a CalDAVEvent object
-
updateEvent
void updateEvent(CalDAVEvent<?> event) throws org.bedework.webdav.servlet.shared.WebdavException
Update an event/todo/journal.- Parameters:
event- updated CalDAVEvent object- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateEvent
SysIntf.UpdateResult updateEvent(CalDAVEvent<?> event, List<org.oasis_open.docs.ws_calendar.ns.soap.ComponentSelectionType> updates) throws org.bedework.webdav.servlet.shared.WebdavException
Update the supplied event using the web services update message.- Parameters:
event- updated CalDAVEvent objectupdates- set of updates to be applied- Returns:
- UpdateResult
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getEvents
Collection<CalDAVEvent<?>> getEvents(CalDAVCollection<?> col, FilterBase filter, List<String> retrieveList, RetrievalMode recurRetrieval) throws org.bedework.webdav.servlet.shared.WebdavException
Return the events for the current user in the given collection using the supplied filter. Stored freebusy objects are returned as BwEvent objects with the appropriate entity type. If retrieveList is supplied only those fields (and a few required fields) will be returned.We flag the desired entity types.
- Parameters:
col-filter- - if non-null defines a search filterretrieveList- List of properties to retrieve or null for a full event.recurRetrieval- How recurring event is returned.- Returns:
- Collection populated event value objects
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getEvent
CalDAVEvent<?> getEvent(CalDAVCollection<?> col, String val) throws org.bedework.webdav.servlet.shared.WebdavException
Get events given the collection and String name. Return null for not found. There should be only one event or none. For recurring, the overrides and possibly the instances will be attached.- Parameters:
col- CalDAVCollection objectval- String possible name- Returns:
- CalDAVEvent or null
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteEvent
void deleteEvent(CalDAVEvent<?> ev, boolean scheduleReply) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
ev-scheduleReply- - true if we want a schduling reply posted- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
requestFreeBusy
Collection<SysIntf.SchedRecipientResult> requestFreeBusy(CalDAVEvent<?> val, boolean iSchedule) throws org.bedework.webdav.servlet.shared.WebdavException
Get the free busy for one or more principals based on the given VFREEBUSY request.- Parameters:
val- A representation of a scheduling freebusy request to be acted upon.iSchedule- true if this is from an ischedule request- Returns:
- ScheduleResult
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getSpecialFreeBusy
void getSpecialFreeBusy(String cua, Set<String> recipients, String originator, TimeRange tr, Writer wtr) throws org.bedework.webdav.servlet.shared.WebdavException
Handle the special freebusy resquests, i.e. non-CalDAV- Parameters:
cua-originator- value of the Originator headerrecipients- values of Recipient headerstr-wtr-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFreeBusy
CalDAVEvent<?> getFreeBusy(CalDAVCollection<?> col, int depth, TimeRange timeRange) throws org.bedework.webdav.servlet.shared.WebdavException
Generate a free busy object for the given time period which reflects the state of the given collection.- Parameters:
col-depth-timeRange-- Returns:
- CalDAVEvent - as a freebusy entity
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
checkAccess
org.bedework.access.CurrentAccess checkAccess(org.bedework.webdav.servlet.shared.WdEntity<?> ent, int desiredAccess, boolean returnResult) throws org.bedework.webdav.servlet.shared.WebdavExceptionCheck 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(CalDAVEvent<?> ev, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
ev-acl-- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMove
boolean copyMove(CalDAVEvent<?> from, CalDAVCollection<?> 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
-
newCollectionObject
CalDAVCollection<?> newCollectionObject(boolean isCalendarCollection, String parentPath)
Return a new object representing the parameters. No collection is created. makeCollection must be called subsequently with the object.- Parameters:
isCalendarCollection-parentPath-- Returns:
- CalDAVCollection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateAccess
void updateAccess(CalDAVCollection<?> col, org.bedework.access.Acl acl) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col-acl-- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
makeCollection
int makeCollection(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col- Initialised collection object- Returns:
- int status
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
copyMove
void copyMove(CalDAVCollection<?> from, CalDAVCollection<?> to, boolean copy, boolean overwrite) throws org.bedework.webdav.servlet.shared.WebdavException
Copy 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- on fatal error
-
getCollection
CalDAVCollection<?> getCollection(String path) throws org.bedework.webdav.servlet.shared.WebdavException
Get a collection given the path- Parameters:
path- String path of collection- Returns:
- CalDAVCollection null for unknown collection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException- on fatal error
-
updateCollection
void updateCollection(CalDAVCollection<?> val) throws org.bedework.webdav.servlet.shared.WebdavException
Update a collection.- Parameters:
val- updated CalDAVCollection object- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteCollection
void deleteCollection(CalDAVCollection<?> col, boolean sendSchedulingMessage) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col- to deletesendSchedulingMessage- true if we should send cancels- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getCollections
Collection<CalDAVCollection<?>> getCollections(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException
Returns children of the given collection to which the current user has some access.- Parameters:
col- parent collection- Returns:
- Collection of CalDAVCollection
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
newResourceObject
CalDAVResource<?> newResourceObject(String parentPath) throws org.bedework.webdav.servlet.shared.WebdavException
Return a new object representing the parameters. No resource is created. putFile must be called subsequently with the object.- Parameters:
parentPath-- Returns:
- CalDAVResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
putFile
void putFile(CalDAVCollection<?> coll, CalDAVResource<?> val) throws org.bedework.webdav.servlet.shared.WebdavException
PUT a file.- Parameters:
coll- CalDAVCollection defining recipient collectionval- CalDAVResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFile
CalDAVResource<?> getFile(CalDAVCollection<?> coll, String name) throws org.bedework.webdav.servlet.shared.WebdavException
GET a file.- Parameters:
coll- CalDAVCollection containing filename-- Returns:
- CalDAVResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getFileContent
void getFileContent(CalDAVResource<?> val)
Get resource content given the resource. It will be set in the resource object- Parameters:
val- CalDAVResource- Throws:
RuntimeException- on fatal error
-
getFiles
Collection<CalDAVResource<?>> getFiles(CalDAVCollection<?> coll) throws org.bedework.webdav.servlet.shared.WebdavException
Get the files in a collection.- Parameters:
coll- CalDAVCollection containing file- Returns:
- Collection of CalDAVResource
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
updateFile
void updateFile(CalDAVResource<?> val, boolean updateContent) throws org.bedework.webdav.servlet.shared.WebdavException
Update a file.- Parameters:
val- CalDAVResourceupdateContent- if true we also update the content- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
deleteFile
void deleteFile(CalDAVResource<?> val) throws org.bedework.webdav.servlet.shared.WebdavException
Delete a file.- Parameters:
val- CalDAVResource- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
copyMoveFile
boolean copyMoveFile(CalDAVResource<?> from, String toPath, 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 resourcetoPath- Destination collection pathname- 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
-
getSyncToken
String getSyncToken(CalDAVCollection<?> col) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
col-- Returns:
- A sync-token which must be a URI.
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
getSyncReport
SysIntf.SynchReportData getSyncReport(String path, String token, int limit, boolean recurse) throws org.bedework.webdav.servlet.shared.WebdavException
- Parameters:
path-token-limit- - negative for no limit on result set sizerecurse-- Returns:
- report
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toCalendar
net.fortuna.ical4j.model.Calendar toCalendar(CalDAVEvent<?> ev, boolean incSchedMethod) throws org.bedework.webdav.servlet.shared.WebdavException
Make an ical Calendar from an event.- Parameters:
ev-incSchedMethod- - true if we should emit the scheduling method- Returns:
- Calendar
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toIcalendar
ietf.params.xml.ns.icalendar_2.IcalendarType toIcalendar(CalDAVEvent<?> ev, boolean incSchedMethod, ietf.params.xml.ns.icalendar_2.IcalendarType pattern) throws org.bedework.webdav.servlet.shared.WebdavException
Make an XML IcalendarType from an event.- Parameters:
ev-incSchedMethod- - true if we should emit the scheduling methodpattern- - non-null to restrict returned properties- Returns:
- IcalendarType
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toJcal
String toJcal(CalDAVEvent<?> ev, boolean incSchedMethod) throws org.bedework.webdav.servlet.shared.WebdavException
Make a JSON jcal object from an event.- Parameters:
ev- event to convertincSchedMethod- - true if we should emit the scheduling method- Returns:
- String jcal representation
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toIcalString
String toIcalString(net.fortuna.ical4j.model.Calendar cal, String contentType) throws org.bedework.webdav.servlet.shared.WebdavException
Convert a Calendar to it's string form- Parameters:
cal- Calendar to convertcontentType-- Returns:
- String representation
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
writeCalendar
String writeCalendar(Collection<CalDAVEvent<?>> evs, SysIntf.MethodEmitted method, org.bedework.util.xml.XmlEmit xml, Writer wtr, String contentType) throws org.bedework.webdav.servlet.shared.WebdavException
Write a collection of events as an ical calendar.- Parameters:
evs-method- - what scheduling method?xml- - if this is embedded in an xml streamwtr- - if standalone output or no xml stream initialized.contentType- - requested type. null for default- Returns:
- actual contentType written
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
fromIcal
SysiIcalendar fromIcal(CalDAVCollection<?> col, Reader rdr, String contentType, SysIntf.IcalResultType rtype, boolean mergeAttendees) throws org.bedework.webdav.servlet.shared.WebdavException
Convert the Icalendar reader to a Collection of Calendar objects- Parameters:
col- collection in which to place entitiesrdr-contentType- null for ICalendar or valid calendar mime typertype-mergeAttendees- True if we should only update our own attendee.- Returns:
- SysiIcalendar
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
fromIcal
SysiIcalendar fromIcal(CalDAVCollection<?> col, ietf.params.xml.ns.icalendar_2.IcalendarType ical, SysIntf.IcalResultType rtype) throws org.bedework.webdav.servlet.shared.WebdavException
Convert the Icalendar object to a Collection of Calendar objects- Parameters:
col- collection in which to place entitiesical-rtype-- Returns:
- SysiIcalendar
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
toStringTzCalendar
String toStringTzCalendar(String tzid) throws org.bedework.webdav.servlet.shared.WebdavException
Create a Calendar object from the named timezone and convert to a String representation- Parameters:
tzid- String timezone id- Returns:
- String
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
tzidFromTzdef
String tzidFromTzdef(String val) throws org.bedework.webdav.servlet.shared.WebdavException
Given a timezone spec return the tzid- Parameters:
val-- Returns:
- String tzid or null for failure
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
validateAlarm
boolean validateAlarm(String val) throws org.bedework.webdav.servlet.shared.WebdavException
Validate an alarm component- Parameters:
val-- Returns:
- boolean false for failure
- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
rollback
void rollback()
Called on the way out before close if there was an error.
-
close
void close() throws org.bedework.webdav.servlet.shared.WebdavExceptionEnd any transactions.- Throws:
org.bedework.webdav.servlet.shared.WebdavException
-
-