Interface RWClient
- All Superinterfaces:
Client,Serializable
- All Known Implementing Classes:
RWClientImpl
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface org.bedework.appcommon.client.Client
gridViewMode, listViewMode -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddCategory(org.bedework.calfacade.BwCategory val) Add the given category.org.bedework.calfacade.BwCalendaraddCollection(org.bedework.calfacade.BwCalendar val, String parentPath) Add a calendar collectionvoidaddContact(org.bedework.calfacade.BwContact val) Add the contactorg.bedework.calfacade.svc.EventInfo.UpdateResultaddEvent(org.bedework.calfacade.svc.EventInfo ei, boolean noInvites, boolean rollbackOnError) Add an event and ensure its location and contact exist.voidaddFilter(org.bedework.calfacade.BwFilterDef val) Validate and persist a new filter definitionbooleanaddLocation(org.bedework.calfacade.BwLocation val) Add the locationbooleanaddView(org.bedework.calfacade.svc.BwView val, boolean makeDefault) Add a view.booleanaddViewCollection(String name, String path) Add a collection path to the named view.org.bedework.calsvci.SchedulingI.FbResponsesaggregateFreeBusy(org.bedework.calfacade.ScheduleResult sr, org.bedework.calfacade.BwDateTime start, org.bedework.calfacade.BwDateTime end, org.bedework.calfacade.BwDuration granularity) Get aggregated free busy for a ScheduleResult.voidchangeAccess(org.bedework.calfacade.base.ShareableEntity ent, Collection<org.bedework.access.Ace> aces, boolean replaceAll) Change the access to the given calendar entity.voidclaimEvent(org.bedework.calfacade.BwEvent ev) Claim ownership of this eventdeleteCategory(org.bedework.calfacade.BwCategory val) Delete a categorybooleandeleteCollection(org.bedework.calfacade.BwCalendar val, boolean emptyIt) Delete a collection.deleteContact(org.bedework.calfacade.BwContact val) Delete a contactorg.bedework.base.response.ResponsedeleteEvent(org.bedework.calfacade.svc.EventInfo ei, boolean sendSchedulingMessage) Delete an event.voiddeleteFilter(String name) Delete a filter given the namedeleteLocation(org.bedework.calfacade.BwLocation val) Delete a locationorg.bedework.calfacade.svc.EnsureEntityExistsResult<org.bedework.calfacade.BwContact>ensureContactExists(org.bedework.calfacade.BwContact val, String ownerHref) Ensure a contact exists.org.bedework.calfacade.svc.EnsureEntityExistsResult<org.bedework.calfacade.BwLocation>ensureLocationExists(org.bedework.calfacade.BwLocation val, String ownerHref) Ensure a location exists.org.bedework.caldav.util.notifications.NotificationTypefindNotification(String name) Find a notification in the notification collection for the current principal with the given name.org.bedework.calfacade.ParticipantfindUserAttendee(org.bedework.calfacade.svc.EventInfo ei) Find the attendee in this event which corresponds to the current userCollection<org.bedework.calfacade.BwCalendar>Return a list of calendars in which calendar objects can be placed by the current user.List<org.bedework.calfacade.BwResource>getAllResources(String path) Get resources to which this user has access - content is not fetched.org.bedework.calfacade.BwEventgetFreeBusy(Collection<org.bedework.calfacade.BwCalendar> fbset, org.bedework.calfacade.BwPrincipal<?> who, org.bedework.calfacade.BwDateTime start, org.bedework.calfacade.BwDateTime end, org.bedework.calfacade.BwOrganizer org, String uid, String exceptUid) Get the free busy for the given principal as a list of busy periods.org.bedework.calfacade.BwCategoryorg.bedework.calfacade.BwContactGet the contact with the given uid.org.bedework.calfacade.BwLocationGet the location with the given uid.org.bedework.calfacade.BwResourcegetResource(String path) Get a resource given the path - does not getResource contentbooleangetResourceContent(org.bedework.calfacade.BwResource val) Retrieve resource content given the resource.List<org.bedework.calfacade.BwResource>getResources(String path, int count) Get resources to which this user has access - content is not fetched.org.bedework.calfacade.svc.EventInfogetStoredMeeting(org.bedework.calfacade.BwEvent ev) Return the users copy of the active meeting with the same uid as that given.org.bedework.calfacade.synch.BwSynchInfoReturns the synch service information.booleanvoidmarkDeleted(org.bedework.calfacade.BwEvent event) For an event to which we have write access we simply mark it deleted.voidmoveCollection(org.bedework.calfacade.BwCalendar val, org.bedework.calfacade.BwCalendar newParent) Move a calendar object from one parent to anothervoidmoveContents(org.bedework.calfacade.BwCalendar cal, org.bedework.calfacade.BwCalendar newCal) Move the contents of one collection to anotherorg.bedework.base.response.ResponseMove the event to the collection specified in newPath.voidpostMessage(org.bedework.calfacade.mail.Message val) voidpublish(org.bedework.calfacade.BwCalendar col) Publish the collection - that is make it available for subscriptions.org.bedework.calfacade.svc.RealiasResultreAlias(org.bedework.calfacade.BwEvent ev) Realias the event - set categories according to the set of aliasesorg.bedework.base.response.ResponserefreshSubscription(org.bedework.calfacade.BwCalendar val) Refresh a subscription represented by this calendar objectvoidremoveAllNotifications(String principalHref) Remove all notifications for given principalvoidremoveNotification(String name) Remove the given notification from the notification collection for the current calendar user.voidremoveNotification(org.bedework.caldav.util.notifications.NotificationType val) Remove the given notification from the notification collection for the current calendar user.booleanremoveView(org.bedework.calfacade.svc.BwView val) Remove the view for the owner of the object.booleanremoveViewCollection(String name, String path) Remove a collection path from the named view.org.bedework.calfacade.ScheduleResultrequestRefresh(org.bedework.calfacade.svc.EventInfo ei, String comment) Attendee wants a refreshvoidsaveResource(org.bedework.calfacade.BwResource val) Save a resource at the given collection path.org.bedework.calfacade.ScheduleResultschedule(org.bedework.calfacade.svc.EventInfo ei, String recipient, String fromAttUri, boolean iSchedule) Schedule a meeting or publish an event.voidsetResourceValue(org.bedework.calfacade.BwResource val, byte[] content) voidsetResourceValue(org.bedework.calfacade.BwResource val, InputStream content, long length) voidsetResourceValue(org.bedework.calfacade.BwResource val, String content) org.bedework.caldav.util.sharing.ShareResultTypeshare(String principalHref, org.bedework.calfacade.BwCalendar col, org.bedework.caldav.util.sharing.ShareType share) org.bedework.calfacade.svc.SharingReplyResultsharingReply(org.bedework.caldav.util.sharing.InviteReplyType reply) org.bedework.calfacade.svc.SubscribeResultSubscribe to the collection - must be a published collection.voidorg.bedework.calfacade.svc.SubscribeResultsubscribeExternal(String extUrl, String subscribedName, int refresh, String remoteId, String remotePw) Subscribe to an external url.voidvoidunpublish(org.bedework.calfacade.BwCalendar col) Unpublish the collection - that is make it unavailable for subscriptions and remove any existing subscriptions.voidunsubscribe(String principalHref, List<String> emails) voidupdateCategory(org.bedework.calfacade.BwCategory val) Update a category.voidupdateCollection(org.bedework.calfacade.BwCalendar col) Update the given collectionvoidupdateContact(org.bedework.calfacade.BwContact val) Update the contactorg.bedework.calfacade.svc.EventInfo.UpdateResultupdateEvent(org.bedework.calfacade.svc.EventInfo ei, boolean noInvites, String fromAttUri, boolean alwaysWrite) Update an event in response to an attendee.voidupdateLocation(org.bedework.calfacade.BwLocation val) Update the locationvoidupdateResource(org.bedework.calfacade.BwResource val, boolean updateContent) Update a resource.voidvalidateFilter(String val) Validate a filter definition.Methods inherited from interface org.bedework.appcommon.client.Client
calAddrToPrincipal, clearSearch, clearSearchEntries, close, collectionExists, copy, decomposeVirtualPath, fetchLocationByCombined, fetchLocationByKey, findContact, findLocation, flushAll, flushCached, flushState, getAdminGroups, getAllFilters, getAllViews, getAppType, getAuthPrincipal, getAuthProperties, getCalendarAddress, getCalSuite, getCalSuite, getCalsuitePreferences, getCategories, getCategory, getCategoryByName, getCategoryByUid, getChildren, getCollection, getConf, getContactByUid, getContacts, getContacts, getContextCalSuites, getCurrentCalendarAddress, getCurrentChangeToken, getCurrentPrincipal, getCurrentPrincipalHref, getDefaultPublicCategoryUids, getDirectoryInfo, getEditableCategories, getEditableContacts, getEditableLocations, getEvent, getEvent, getEventByUid, getEvents, getFilter, getHome, getHome, getLocationByUid, getLocations, getLocations, getOwner, getPreferences, getPreferences, getPreferredCollectionPath, getPrimaryPublicPath, getPrincipal, getPublicAdmin, getPublicAuth, getPublicCalendars, getPublicCalendarsRootPath, getPublicCategories, getPublicContacts, getPublicLocations, getSearchParams, getSearchResult, getSearchResult, getSpecial, getSynchStatus, getSystemProperties, getUser, getUserLocale, getUserMaxEntitySize, getView, getViewMode, getWebSubmit, isDefaultIndexPublic, isGuest, isOpen, isPrincipal, isSuperUser, makePrincipalUri, outputJson, parseFilter, parseSort, postNotification, requestIn, requestOut, resolveAlias, rollback, search, setViewMode, updatePreferences, uriToCaladdr, validPrincipal, writeJson
-
Method Details
-
getWebUser
boolean getWebUser()- Returns:
- true if we are the web user client.
-
unindex
- Parameters:
href- to be unindexed
-
addCollection
org.bedework.calfacade.BwCalendar addCollection(org.bedework.calfacade.BwCalendar val, String parentPath) Add a calendar collectionThe new collection object will be added to the db. If the indicated parent is null it will be added as a root level collection.
Certain restrictions apply, mostly because of interoperability issues. A collection cannot be added to another collection which already contains entities, e.g. events etc.
Names cannot contain certain characters - (complete this)
Name must be unique at this level, i.e. all paths must be unique
- Parameters:
val- BwCalendar new objectparentPath- String path to parent.- Returns:
- BwCalendar object as added. Parameter val MUST be discarded
-
updateCollection
void updateCollection(org.bedework.calfacade.BwCalendar col) Update the given collection- Parameters:
col- the collection
-
deleteCollection
boolean deleteCollection(org.bedework.calfacade.BwCalendar val, boolean emptyIt) Delete a collection. Also remove it from the current user preferences (if any).- Parameters:
val- BwCalendar collectionemptyIt- true to delete contents- Returns:
- boolean true if it was deleted. false if it didn't exist
-
moveCollection
void moveCollection(org.bedework.calfacade.BwCalendar val, org.bedework.calfacade.BwCalendar newParent) Move a calendar object from one parent to another- Parameters:
val- BwCalendar objectnewParent- BwCalendar potential parent
-
refreshSubscription
org.bedework.base.response.Response refreshSubscription(org.bedework.calfacade.BwCalendar val) Refresh a subscription represented by this calendar object- Parameters:
val- BwCalendar object
-
getAddContentCollections
Collection<org.bedework.calfacade.BwCalendar> getAddContentCollections()Return a list of calendars in which calendar objects can be placed by the current user.Caldav does not allow collections inside collections so that calendar collections are the leaf nodes only.
- Returns:
- Set of BwCalendar
-
getPersistentCategory
- Parameters:
uid- of the category- Returns:
- category entity or null.
-
addCategory
boolean addCategory(org.bedework.calfacade.BwCategory val) Add the given category.- Parameters:
val- category- Returns:
- false if not added because already exists
-
updateCategory
void updateCategory(org.bedework.calfacade.BwCategory val) Update a category.- Parameters:
val- category object to be updated
-
deleteCategory
Delete a category- Parameters:
val- BwEventProperty object to be deleted- Returns:
- result indicating what happened - null for not there
-
getPersistentContact
Get the contact with the given uid.- Parameters:
uid- of contact- Returns:
- contact object
-
addContact
void addContact(org.bedework.calfacade.BwContact val) Add the contact- Parameters:
val- contact
-
updateContact
void updateContact(org.bedework.calfacade.BwContact val) Update the contact- Parameters:
val- contact
-
deleteContact
Delete a contact- Parameters:
val- contact to be deleted- Returns:
- result indicating what happened - null for not there
-
ensureContactExists
org.bedework.calfacade.svc.EnsureEntityExistsResult<org.bedework.calfacade.BwContact> ensureContactExists(org.bedework.calfacade.BwContact val, String ownerHref) Ensure a contact exists. If it already does returns the object. If not creates the entity.- Parameters:
val- contact object.ownerHref- String principal href, null for current user- Returns:
- response object.
-
getPersistentLocation
Get the location with the given uid.- Parameters:
uid- of location- Returns:
- Location object
-
addLocation
boolean addLocation(org.bedework.calfacade.BwLocation val) Add the location- Parameters:
val- a location- Returns:
- true if added
-
updateLocation
void updateLocation(org.bedework.calfacade.BwLocation val) Update the location- Parameters:
val- a location
-
deleteLocation
Delete a location- Parameters:
val- location to be deleted- Returns:
- result indicating what happened - null for not there
-
ensureLocationExists
org.bedework.calfacade.svc.EnsureEntityExistsResult<org.bedework.calfacade.BwLocation> ensureLocationExists(org.bedework.calfacade.BwLocation val, String ownerHref) Ensure a location exists. If it already does returns the object. If not creates the entity.- Parameters:
val- location object.ownerHref- String principal href, null for current user- Returns:
- response object.
-
claimEvent
void claimEvent(org.bedework.calfacade.BwEvent ev) Claim ownership of this event- Parameters:
ev- event
-
reAlias
org.bedework.calfacade.svc.RealiasResult reAlias(org.bedework.calfacade.BwEvent ev) Realias the event - set categories according to the set of aliases- Parameters:
ev- event- Returns:
- set of categories referenced by the aliases
-
addEvent
org.bedework.calfacade.svc.EventInfo.UpdateResult addEvent(org.bedework.calfacade.svc.EventInfo ei, boolean noInvites, boolean rollbackOnError) Add an event and ensure its location and contact exist. The calendar path must be set in the event.For public events some calendar implementors choose to allow the dynamic creation of locations and contacts. For each of those, if we have an id, then the object represents a preexisting database item.
Otherwise the client has provided information which will be used to locate an already existing location or contact. Failing that we use the information to create a new entry.
For user clients, we generally assume no contact and the location is optional. However, both conditions are enforced at the application level.
On return the event object will have been updated. In addition the location and contact may have been updated.
If this is a scheduling event and noInvites is set to false then invitations wil be sent out to the attendees.
The event to be added may be a reference to another event. In this case a number of fields should have been copied from that event. Other fields will come from the target.
- Parameters:
ei- EventInfo object to be addednoInvites- True for don't send invitations.rollbackOnError- rollback transaction if true- Returns:
- UpdateResult Counts of changes.
-
updateEvent
org.bedework.calfacade.svc.EventInfo.UpdateResult updateEvent(org.bedework.calfacade.svc.EventInfo ei, boolean noInvites, String fromAttUri, boolean alwaysWrite) Update an event in response to an attendee. Exactly as normal update if fromAtt is null. Otherwise no status update is sent to the given attendeeAny changeset should be embedded in the event info object.
- Parameters:
ei- EventInfo object to be addednoInvites- True for don't send invitations.fromAttUri- attendee respondingalwaysWrite- write and reindex whatever changetable says- Returns:
- UpdateResult Counts of changes.
-
moveEvent
org.bedework.base.response.Response moveEvent(org.bedework.calfacade.svc.EventInfo ei, String newPath) Move the event to the collection specified in newPath. There must be no event with the same uid in the destination.- Parameters:
ei- EventInfo object to be movednewPath- Destination collection.- Returns:
- UpdateResult status.
-
deleteEvent
org.bedework.base.response.Response deleteEvent(org.bedework.calfacade.svc.EventInfo ei, boolean sendSchedulingMessage) Delete an event.- Parameters:
ei- BwEvent object to be deletedsendSchedulingMessage- Send a declined or cancel scheduling message- Returns:
- Response with status ok if event deleted
-
markDeleted
void markDeleted(org.bedework.calfacade.BwEvent event) For an event to which we have write access we simply mark it deleted.Otherwise we add an annotation maarking the event as deleted.
- Parameters:
event- to delete
-
findNotification
Find a notification in the notification collection for the current principal with the given name.- Parameters:
name- - of the notification- Returns:
- null for no notification or the notification with that name
-
removeNotification
Remove the given notification from the notification collection for the current calendar user.- Parameters:
name- of notification to remove
-
removeNotification
void removeNotification(org.bedework.caldav.util.notifications.NotificationType val) Remove the given notification from the notification collection for the current calendar user.- Parameters:
val- notification to remove
-
removeAllNotifications
Remove all notifications for given principal- Parameters:
principalHref- principal to clean
-
subscribe
-
unsubscribe
-
saveResource
void saveResource(org.bedework.calfacade.BwResource val) Save a resource at the given collection path. The collection MUST exist.- Parameters:
val- resource with attached content
-
getResource
Get a resource given the path - does not getResource content- Parameters:
path- String path to resource- Returns:
- BwResource null for unknown resource
-
getResourceContent
boolean getResourceContent(org.bedework.calfacade.BwResource val) Retrieve resource content given the resource. It will be set in the resource object- Parameters:
val- BwResource- Returns:
- false if content missing
-
getAllResources
Get resources to which this user has access - content is not fetched.- Parameters:
path- String path to containing collection- Returns:
- List of BwResource
-
getResources
Get resources to which this user has access - content is not fetched.- Parameters:
path- String path to containing collectioncount- this many- Returns:
- List of BwResource
-
updateResource
void updateResource(org.bedework.calfacade.BwResource val, boolean updateContent) Update a resource.- Parameters:
val- resourceupdateContent- if true we also update the content
-
setResourceValue
- Parameters:
val- the resource objectcontent- to embed
-
setResourceValue
void setResourceValue(org.bedework.calfacade.BwResource val, byte[] content) - Parameters:
val- the resource objectcontent- to embed
-
setResourceValue
- Parameters:
val- the resource objectcontent- input stream with content
-
findUserAttendee
org.bedework.calfacade.Participant findUserAttendee(org.bedework.calfacade.svc.EventInfo ei) Find the attendee in this event which corresponds to the current user- Parameters:
ei- to search- Returns:
- attendee or null.
-
getFreeBusy
org.bedework.calfacade.BwEvent getFreeBusy(Collection<org.bedework.calfacade.BwCalendar> fbset, org.bedework.calfacade.BwPrincipal<?> who, org.bedework.calfacade.BwDateTime start, org.bedework.calfacade.BwDateTime end, org.bedework.calfacade.BwOrganizer org, String uid, String exceptUid) Get the free busy for the given principal as a list of busy periods.- Parameters:
fbset- Collections for which to provide free-busy. Null for the for default collection (as specified by user). Used for local access to a given calendar via e.g. caldavwho- If cal is null getResource the info for this user, otherwise this is used as the free/busy result ownerstart- of freebusy periodend- of freebusy periodorg- - needed to make the result compliantuid- - uid of requesting component or null for no requestexceptUid- if non-null omit this uid from the freebusy calculation- Returns:
- BwEvent
-
aggregateFreeBusy
org.bedework.calsvci.SchedulingI.FbResponses aggregateFreeBusy(org.bedework.calfacade.ScheduleResult sr, org.bedework.calfacade.BwDateTime start, org.bedework.calfacade.BwDateTime end, org.bedework.calfacade.BwDuration granularity) Get aggregated free busy for a ScheduleResult.- Parameters:
sr- ScheduleResultstart- of periodend- of periodgranularity- of result - eg 1 hour- Returns:
- FbResponses
-
schedule
org.bedework.calfacade.ScheduleResult schedule(org.bedework.calfacade.svc.EventInfo ei, String recipient, String fromAttUri, boolean iSchedule) Schedule a meeting or publish an event. The event object must have the organizer and attendees and possibly recipients set according to itip + caldav.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 ischedule or mail.
- Parameters:
ei- EventInfo object containing with method=REQUEST, CANCEL, ADD, DECLINECOUNTER or PUBLISHrecipient- - non null to send to this recipient only (for REFRESH)fromAttUri- - identifies the attendeeiSchedule- true if it's an iSchedule request.- Returns:
- ScheduleResult
-
getStoredMeeting
org.bedework.calfacade.svc.EventInfo getStoredMeeting(org.bedework.calfacade.BwEvent ev) Return the users copy of the active meeting with the same uid as that given.- Parameters:
ev- the event to search for- Returns:
- possibly null meeting
-
requestRefresh
org.bedework.calfacade.ScheduleResult requestRefresh(org.bedework.calfacade.svc.EventInfo ei, String comment) Attendee wants a refresh- Parameters:
ei- event which is probably in a calendar.comment- - optional comment- Returns:
- ScheduleResult
-
publish
void publish(org.bedework.calfacade.BwCalendar col) Publish the collection - that is make it available for subscriptions.- Parameters:
col- collection object
-
unpublish
void unpublish(org.bedework.calfacade.BwCalendar col) Unpublish the collection - that is make it unavailable for subscriptions and remove any existing subscriptions.- Parameters:
col- collection object
-
sharingReply
org.bedework.calfacade.svc.SharingReplyResult sharingReply(org.bedework.caldav.util.sharing.InviteReplyType reply) - Parameters:
reply- the request- Returns:
- a ReplyResult object.
-
subscribe
Subscribe to the collection - must be a published collection.- Parameters:
colPath- collection pathsubscribedName- name for new alias- Returns:
- path of new alias and flag
-
subscribeExternal
org.bedework.calfacade.svc.SubscribeResult subscribeExternal(String extUrl, String subscribedName, int refresh, String remoteId, String remotePw) Subscribe to an external url.- Parameters:
extUrl- the urlsubscribedName- name for new aliasrefresh- - refresh rate in minutes <= 0 for defaultremoteId- - may be nullremotePw- - may be null- Returns:
- path of new alias and flag
-
getSynchInfo
org.bedework.calfacade.synch.BwSynchInfo getSynchInfo()Returns the synch service information.- Returns:
- full synch info
-
addView
boolean addView(org.bedework.calfacade.svc.BwView val, boolean makeDefault) Add a view.- Parameters:
val- BwView to addmakeDefault- boolean true for make this the default.- Returns:
- boolean false view not added, true - added.
-
addViewCollection
Add a collection path to the named view.- Parameters:
name- String view name - null means defaultpath- collection path to add- Returns:
- boolean false view not found, true - collection path added.
-
removeViewCollection
Remove a collection path from the named view.- Parameters:
name- String view name - null means defaultpath- collection path to remove- Returns:
- boolean false view not found, true - collection path removed.
-
removeView
boolean removeView(org.bedework.calfacade.svc.BwView val) Remove the view for the owner of the object.- Parameters:
val- BwView- Returns:
- boolean false - view not found.
-
moveContents
void moveContents(org.bedework.calfacade.BwCalendar cal, org.bedework.calfacade.BwCalendar newCal) Move the contents of one collection to another- Parameters:
cal- where fromnewCal- where to
-
postMessage
void postMessage(org.bedework.calfacade.mail.Message val) - Parameters:
val- mail message
-
validateFilter
Validate a filter definition.- Parameters:
val- String xml filter definition
-
addFilter
void addFilter(org.bedework.calfacade.BwFilterDef val) Validate and persist a new filter definition- Parameters:
val- filter definition
-
deleteFilter
Delete a filter given the name- Parameters:
name- String name of filter
-