Interface RWClient

All Superinterfaces:
Client, Serializable
All Known Implementing Classes:
RWClientImpl

public interface RWClient extends Client
User: mike Date: 3/8/21 Time: 15:52
  • Method Details

    • getWebUser

      boolean getWebUser()
      Returns:
      true if we are the web user client.
    • unindex

      void unindex(String href)
      Parameters:
      href - to be unindexed
    • addCollection

      org.bedework.calfacade.BwCalendar addCollection(org.bedework.calfacade.BwCalendar val, String parentPath)
      Add a calendar collection

      The 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 object
      parentPath - 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 collection
      emptyIt - 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 object
      newParent - 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

      org.bedework.calfacade.BwCategory getPersistentCategory(String uid)
      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

      RWClient.DeleteReffedEntityResult deleteCategory(org.bedework.calfacade.BwCategory val)
      Delete a category
      Parameters:
      val - BwEventProperty object to be deleted
      Returns:
      result indicating what happened - null for not there
    • getPersistentContact

      org.bedework.calfacade.BwContact getPersistentContact(String uid)
      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

      RWClient.DeleteReffedEntityResult deleteContact(org.bedework.calfacade.BwContact val)
      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

      org.bedework.calfacade.BwLocation getPersistentLocation(String uid)
      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

      RWClient.DeleteReffedEntityResult deleteLocation(org.bedework.calfacade.BwLocation val)
      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 added
      noInvites - 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 attendee

      Any changeset should be embedded in the event info object.

      Parameters:
      ei - EventInfo object to be added
      noInvites - True for don't send invitations.
      fromAttUri - attendee responding
      alwaysWrite - 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 moved
      newPath - 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 deleted
      sendSchedulingMessage - 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

      org.bedework.caldav.util.notifications.NotificationType findNotification(String name)
      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

      void removeNotification(String name)
      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

      void removeAllNotifications(String principalHref)
      Remove all notifications for given principal
      Parameters:
      principalHref - principal to clean
    • subscribe

      void subscribe(String principalHref, List<String> emails)
    • unsubscribe

      void unsubscribe(String principalHref, List<String> emails)
    • 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

      org.bedework.calfacade.BwResource getResource(String path)
      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

      List<org.bedework.calfacade.BwResource> getAllResources(String path)
      Get resources to which this user has access - content is not fetched.
      Parameters:
      path - String path to containing collection
      Returns:
      List of BwResource
    • getResources

      List<org.bedework.calfacade.BwResource> getResources(String path, int count)
      Get resources to which this user has access - content is not fetched.
      Parameters:
      path - String path to containing collection
      count - this many
      Returns:
      List of BwResource
    • updateResource

      void updateResource(org.bedework.calfacade.BwResource val, boolean updateContent)
      Update a resource.
      Parameters:
      val - resource
      updateContent - if true we also update the content
    • setResourceValue

      void setResourceValue(org.bedework.calfacade.BwResource val, String content)
      Parameters:
      val - the resource object
      content - to embed
    • setResourceValue

      void setResourceValue(org.bedework.calfacade.BwResource val, byte[] content)
      Parameters:
      val - the resource object
      content - to embed
    • setResourceValue

      void setResourceValue(org.bedework.calfacade.BwResource val, InputStream content, long length)
      Parameters:
      val - the resource object
      content - 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. caldav
      who - If cal is null getResource the info for this user, otherwise this is used as the free/busy result owner
      start - of freebusy period
      end - of freebusy period
      org - - needed to make the result compliant
      uid - - uid of requesting component or null for no request
      exceptUid - 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 - ScheduleResult
      start - of period
      end - of period
      granularity - 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 PUBLISH
      recipient - - non null to send to this recipient only (for REFRESH)
      fromAttUri - - identifies the attendee
      iSchedule - 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
    • share

      org.bedework.caldav.util.sharing.ShareResultType share(String principalHref, org.bedework.calfacade.BwCalendar col, org.bedework.caldav.util.sharing.ShareType share)
      Parameters:
      principalHref - share as this user.
      col - MUST be a sharable collection
      share - the request
      Returns:
      list of ok and !ok sharees
    • 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

      org.bedework.calfacade.svc.SubscribeResult subscribe(String colPath, String subscribedName)
      Subscribe to the collection - must be a published collection.
      Parameters:
      colPath - collection path
      subscribedName - 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 url
      subscribedName - name for new alias
      refresh - - refresh rate in minutes <= 0 for default
      remoteId - - may be null
      remotePw - - 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 add
      makeDefault - boolean true for make this the default.
      Returns:
      boolean false view not added, true - added.
    • addViewCollection

      boolean addViewCollection(String name, String path)
      Add a collection path to the named view.
      Parameters:
      name - String view name - null means default
      path - collection path to add
      Returns:
      boolean false view not found, true - collection path added.
    • removeViewCollection

      boolean removeViewCollection(String name, String path)
      Remove a collection path from the named view.
      Parameters:
      name - String view name - null means default
      path - 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 from
      newCal - where to
    • postMessage

      void postMessage(org.bedework.calfacade.mail.Message val)
      Parameters:
      val - mail message
    • changeAccess

      void changeAccess(org.bedework.calfacade.base.ShareableEntity ent, Collection<org.bedework.access.Ace> aces, boolean replaceAll)
      Change the access to the given calendar entity.
      Parameters:
      ent - BwShareableDbentity
      aces - Collection of ace
      replaceAll - true to replace the entire access list.
    • validateFilter

      void validateFilter(String val)
      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

      void deleteFilter(String name)
      Delete a filter given the name
      Parameters:
      name - String name of filter