|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.schedassist.impl.caldav.CaldavCalendarDataDaoImpl
@Service public class CaldavCalendarDataDaoImpl
Implementation of ICalendarDataDao for CalDAV-capable calendar servers.
Requires the following be provided (via setter injection):
HttpClient instance.Credentials and AuthScope for authentication; will need authorization to alter any account's calendar.CaldavDialect instance.cancelAppointment(IScheduleVisitor, IScheduleOwner, VEvent)
and leaveAppointment(IScheduleVisitor, IScheduleOwner, VEvent) remove the CANCELLED entries from the visitor's calendar.
This instance constructs a DefaultCaldavEventUtilsImpl instance with a NullAffiliationSourceImpl; if you need to override the IEventUtils
instance, a setter is provided (setEventUtils(IEventUtils)).
Lastly this instance constructs a NoopHttpMethodInterceptorImpl instance; if you need to
override the HttpMethodInterceptor a setter is provided (setMethodInterceptor(HttpMethodInterceptor)).
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
|---|---|
CaldavCalendarDataDaoImpl()
|
|
| Method Summary | |
|---|---|
void |
afterPropertiesSet()
Injects the Credentials and AuthScope into the
HttpClient's HttpState. |
void |
cancelAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
net.fortuna.ical4j.model.component.VEvent appointment)
|
void |
checkForConflicts(IScheduleOwner owner,
AvailableBlock block)
|
protected net.fortuna.ical4j.model.Calendar |
consolidate(List<CalendarWithURI> calendars)
Consolidate the Calendars within the argument, returning 1. |
net.fortuna.ical4j.model.component.VEvent |
createAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
AvailableBlock block,
String eventDescription)
|
protected int |
deleteCalendar(CalendarWithURI calendarWithURI,
ICalendarAccount calendarAccount)
|
protected String |
generateEventUri(ICalendarAccount owner,
net.fortuna.ical4j.model.component.VEvent event)
This method is intended to generate a unique URI to use with the PUT method in createAppointment(IScheduleVisitor, IScheduleOwner, AvailableBlock, String). |
net.fortuna.ical4j.model.Calendar |
getCalendar(ICalendarAccount calendarAccount,
Date startDate,
Date endDate)
|
protected List<CalendarWithURI> |
getCalendarsInternal(ICalendarAccount calendarAccount,
Date startDate,
Date endDate)
|
net.fortuna.ical4j.model.component.VEvent |
getExistingAppointment(IScheduleOwner owner,
AvailableBlock block)
|
protected CalendarWithURI |
getExistingAppointmentInternal(IScheduleOwner owner,
Date startTime,
Date endTime)
This method returns the CalendarWithURI containing a single VEvent that
was created with the Scheduling Assistant with the specified IScheduleOwner as the owner
and the specified start and end times. |
protected CalendarWithURI |
getExistingAppointmentInternalForVisitor(IScheduleVisitor visitor,
Date startTime,
Date endTime,
net.fortuna.ical4j.model.property.Uid eventUid)
Special method used when cancelUpdatesVisitorCalendar is set to true. |
net.fortuna.ical4j.model.component.VEvent |
joinAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
net.fortuna.ical4j.model.component.VEvent appointment)
|
net.fortuna.ical4j.model.component.VEvent |
leaveAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
net.fortuna.ical4j.model.component.VEvent appointment)
|
List<CalendarWithURI> |
peekAtAvailableScheduleReflections(IScheduleOwner owner,
Date startDate,
Date endDate)
|
void |
purgeAvailableScheduleReflections(IScheduleOwner owner,
Date startDate,
Date endDate)
|
protected CalendarWithURI |
purgeDeclinedAttendees(CalendarWithURI calendarWithURI,
ICalendarAccount owner)
This method will inspect IScheduleVisitor Attendees among the SchedulingAssistantAppointments
in the Calendar argument. |
protected int |
putExistingEvent(ICalendarAccount eventOwner,
net.fortuna.ical4j.model.component.VEvent event,
String etag)
Update an existing event using CalDAV PUT. |
protected int |
putNewEvent(ICalendarAccount eventOwner,
net.fortuna.ical4j.model.component.VEvent event)
Store a new event using CalDAV PUT. |
void |
reflectAvailableSchedule(IScheduleOwner owner,
AvailableSchedule schedule)
|
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
|
void |
setCaldavAdminAuthScope(org.apache.commons.httpclient.auth.AuthScope caldavAdminAuthScope)
|
void |
setCaldavAdminCredentials(org.apache.commons.httpclient.Credentials caldavAdminCredentials)
|
void |
setCaldavDialect(CaldavDialect caldavDialect)
|
void |
setCancelUpdatesVisitorCalendar(String cancelUpdatesVisitorCalendar)
|
void |
setEventUtils(IEventUtils eventUtils)
|
void |
setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
|
void |
setMethodInterceptor(HttpMethodInterceptor methodInterceptor)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log log
| Constructor Detail |
|---|
public CaldavCalendarDataDaoImpl()
| Method Detail |
|---|
public void setHttpClient(org.apache.commons.httpclient.HttpClient httpClient)
httpClient - the httpClient to setpublic void setCaldavAdminCredentials(org.apache.commons.httpclient.Credentials caldavAdminCredentials)
caldavAdminCredentials - the caldavAdminCredentials to setpublic void setCaldavAdminAuthScope(org.apache.commons.httpclient.auth.AuthScope caldavAdminAuthScope)
caldavAdminAuthScope - the caldavAdminAuthScope to setpublic void setEventUtils(IEventUtils eventUtils)
eventUtils - the eventUtils to setpublic void setCaldavDialect(CaldavDialect caldavDialect)
caldavDialect - the caldavDialect to setpublic void setMethodInterceptor(HttpMethodInterceptor methodInterceptor)
methodInterceptor - the methodInterceptor to setpublic void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
applicationEventPublisher - the applicationEventPublisher to setpublic void setCancelUpdatesVisitorCalendar(String cancelUpdatesVisitorCalendar)
cancelUpdatesVisitorCalendar - the cancelUpdatesVisitorCalendar to set
public void afterPropertiesSet()
throws Exception
Credentials and AuthScope into the
HttpClient's HttpState.
This task is performed in afterPropertiesSet because HttpState.setCredentials(AuthScope, Credentials)'s
method signature is not supported by Spring's DI.
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionHttpState.setCredentials(AuthScope, Credentials),
InitializingBean.afterPropertiesSet()
public net.fortuna.ical4j.model.Calendar getCalendar(ICalendarAccount calendarAccount,
Date startDate,
Date endDate)
getCalendar in interface ICalendarDataDao
public net.fortuna.ical4j.model.component.VEvent getExistingAppointment(IScheduleOwner owner,
AvailableBlock block)
getExistingAppointment in interface ICalendarDataDao
public net.fortuna.ical4j.model.component.VEvent createAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
AvailableBlock block,
String eventDescription)
createAppointment in interface ICalendarDataDao
public void cancelAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
net.fortuna.ical4j.model.component.VEvent appointment)
cancelAppointment in interface ICalendarDataDao
protected int deleteCalendar(CalendarWithURI calendarWithURI,
ICalendarAccount calendarAccount)
calendarWithURI - calendarAccount -
public net.fortuna.ical4j.model.component.VEvent joinAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
net.fortuna.ical4j.model.component.VEvent appointment)
throws SchedulingException
joinAppointment in interface ICalendarDataDaoSchedulingException
public net.fortuna.ical4j.model.component.VEvent leaveAppointment(IScheduleVisitor visitor,
IScheduleOwner owner,
net.fortuna.ical4j.model.component.VEvent appointment)
throws SchedulingException
leaveAppointment in interface ICalendarDataDaoSchedulingException
public void checkForConflicts(IScheduleOwner owner,
AvailableBlock block)
throws ConflictExistsException
checkForConflicts in interface ICalendarDataDaoConflictExistsException
public void reflectAvailableSchedule(IScheduleOwner owner,
AvailableSchedule schedule)
reflectAvailableSchedule in interface ICalendarDataDao
public void purgeAvailableScheduleReflections(IScheduleOwner owner,
Date startDate,
Date endDate)
purgeAvailableScheduleReflections in interface ICalendarDataDao
public List<CalendarWithURI> peekAtAvailableScheduleReflections(IScheduleOwner owner,
Date startDate,
Date endDate)
owner - startDate - endDate -
protected String generateEventUri(ICalendarAccount owner,
net.fortuna.ical4j.model.component.VEvent event)
createAppointment(IScheduleVisitor, IScheduleOwner, AvailableBlock, String).
It is implemented by the following:
caldavDialect.calculateCalendarAccountHome(owner.getCalendarAccount) + "/sched-assist-" + randomAlphanumeric + ".ics"
owner -
protected List<CalendarWithURI> getCalendarsInternal(ICalendarAccount calendarAccount,
Date startDate,
Date endDate)
calendarAccount - startDate - endDate -
protected net.fortuna.ical4j.model.Calendar consolidate(List<CalendarWithURI> calendars)
Calendars within the argument, returning 1.
calendars -
net.fortuna.ical4j.data.ParserExceptionCalendars.merge(Calendar, Calendar)
protected CalendarWithURI getExistingAppointmentInternal(IScheduleOwner owner,
Date startTime,
Date endTime)
CalendarWithURI containing a single VEvent that
was created with the Scheduling Assistant with the specified IScheduleOwner as the owner
and the specified start and end times.
owner - startTime - endTime -
VEvent, or null if none for this IScheduleOwner at the specified times
protected CalendarWithURI getExistingAppointmentInternalForVisitor(IScheduleVisitor visitor,
Date startTime,
Date endTime,
net.fortuna.ical4j.model.property.Uid eventUid)
CalendarWithURI in the visitor's account for the event
with the specified start, end and eventuid.
owner - startTime - endTime - eventUid -
protected int putNewEvent(ICalendarAccount eventOwner,
net.fortuna.ical4j.model.component.VEvent event)
throws org.apache.commons.httpclient.HttpException,
IOException
eventOwner - event -
org.apache.commons.httpclient.HttpException
IOException
protected int putExistingEvent(ICalendarAccount eventOwner,
net.fortuna.ical4j.model.component.VEvent event,
String etag)
throws org.apache.commons.httpclient.HttpException,
IOException
eventOwner - event - etag -
org.apache.commons.httpclient.HttpException
IOException
protected CalendarWithURI purgeDeclinedAttendees(CalendarWithURI calendarWithURI,
ICalendarAccount owner)
IScheduleVisitor Attendees among the SchedulingAssistantAppointments
in the Calendar argument.
If an Attendee on an SchedulingAssistantAppointment has Partstat#DECLINED, the appointment
will be cancelled (if one on one or lone visitor on group appt) or the attendee will be removed (group appointment
with multiple attending visitors).
calendarWithURI - session - owner -
SchedulingException
StatusException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||