org.jasig.schedassist.impl.caldav
Interface CaldavDialect

All Known Implementing Classes:
DefaultCaldavDialectImpl, OracleCommsCaldavDialectImpl

public interface CaldavDialect

This interface specifies a number of methods focused on dialect with the CalDAV server.

Version:
$ Id: CaldavDialect.java $
Author:
Nicholas Blair

Method Summary
 org.apache.commons.httpclient.methods.RequestEntity generateGetCalendarRequestEntity(Date startDate, Date endDate)
          Generate an appropriate RequestEntity body for retrieving Calendar data between the specified dates.
 org.apache.commons.httpclient.methods.RequestEntity generatePutAppointmentRequestEntity(net.fortuna.ical4j.model.component.VEvent event)
          Generate an appropriate RequestEntity body for storing the specified VEvent.
 URI getCaldavHost()
          Return a URI that resolves to the root address of the CalDAV server, e.g.
 String getCalendarAccountHome(ICalendarAccount calendarAccount)
          Returns a String that represents the "Path" the ICalendarAccount's calendar home directory.
 URI resolveCalendarURI(CalendarWithURI calendar)
          Return a URI that represents the full URI to the URI field within the CalendarWithURI.
 

Method Detail

getCaldavHost

URI getCaldavHost()
Return a URI that resolves to the root address of the CalDAV server, e.g. 'http://localhost:8080'

Returns:
never null URI for the CalDAV server

resolveCalendarURI

URI resolveCalendarURI(CalendarWithURI calendar)
Return a URI that represents the full URI to the URI field within the CalendarWithURI. It's common for CalDAV servers to respond with just a path (e.g. /caldav/some/user/file.ics) in the href attribute for a calendar-query method response. The intent of this method is to return a string that is composed of:
         caldavhost + calendarWithUri.getUri()
         
Implementations may need to adjust from above, but the primary responsibility of this method is to return a string that looks like:
         http://hostname.somewhere.org:8080/caldav/some/user/file.ics
         

Parameters:
calendar -
Returns:
the resolved complete URI to the calendar on the CalDAV server

getCalendarAccountHome

String getCalendarAccountHome(ICalendarAccount calendarAccount)
Returns a String that represents the "Path" the ICalendarAccount's calendar home directory. The calendar home directory is used as the base path for retrieving/storing calendar data for that calendar account. The return value MUST be terminated with a "/".

Parameters:
calendarAccount -
Returns:
the calendar home directory path for the specified calendar account.

generatePutAppointmentRequestEntity

org.apache.commons.httpclient.methods.RequestEntity generatePutAppointmentRequestEntity(net.fortuna.ical4j.model.component.VEvent event)
Generate an appropriate RequestEntity body for storing the specified VEvent. Per the CalDAV RFC:
 
                PUT /home/lisa/calendars/events/qwue23489.ics HTTP/1.1
                If-None-Match: *
                Host: cal.example.com
                Content-Type: text/calendar
                Content-Length: xxxx

                BEGIN:VCALENDAR
                VERSION:2.0
                PRODID:-//Example Corp.//CalDAV Client//EN
                BEGIN:VEVENT
                UID:20010712T182145Z-123401@example.com
                DTSTAMP:20060712T182145Z
                DTSTART:20060714T170000Z
                DTEND:20060715T040000Z
                SUMMARY:Bastille Day Party
                END:VEVENT
                END:VCALENDAR
         
This method is focused on all of the content in the above example with the exception of the very first line ('PUT /home/lisa...').

Parameters:
event -
Returns:
a RequestEntity used with the PUT request to store the specified VEvent

generateGetCalendarRequestEntity

org.apache.commons.httpclient.methods.RequestEntity generateGetCalendarRequestEntity(Date startDate,
                                                                                     Date endDate)
Generate an appropriate RequestEntity body for retrieving Calendar data between the specified dates.

Parameters:
startDate -
endDate -
Returns:
a RequestEntity used with the REPORT request to retrieve an account's Calendar data between the 2 Dates


Copyright © 2011 Jasig. All Rights Reserved.