|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jasig.portlet.calendar.adapter.ConfigurableHttpCalendarAdapter
public final class ConfigurableHttpCalendarAdapter
Implementation of ICalendarAdapter that uses Commons HttpClient
for retrieving CalendarEvents.
This bean requires an EhCache Cache be provided.
This bean also depends on instances of 3 different interfaces
(default implementation listed in parenthesis):
IUrlCreator (default configuration: DefaultUrlCreatorImpl)ICredentialsExtractor (default: DefaultCredentialsExtractorImpl)IContentProcessor (default: ICalendarContentProcessorImpl)CalendarEvents from a variety of different
end points, for example an RSS feed behind basic auth, a CalendarKey implementation behind
a shared secret, or behind CAS.
| Field Summary | |
|---|---|
protected org.apache.commons.logging.Log |
log
|
| Constructor Summary | |
|---|---|
ConfigurableHttpCalendarAdapter()
|
|
| Method Summary | |
|---|---|
CalendarEvent |
getEvent(CalendarConfiguration calendar,
net.fortuna.ical4j.model.Period period,
String uid,
String recurrenceId,
javax.servlet.http.HttpServletRequest request)
|
CalendarEvent |
getEvent(CalendarConfiguration calendar,
net.fortuna.ical4j.model.Period period,
String uid,
String recurrenceId,
javax.portlet.PortletRequest request)
|
Set<CalendarEvent> |
getEvents(CalendarConfiguration calendarConfiguration,
net.fortuna.ical4j.model.Period period,
javax.servlet.http.HttpServletRequest request)
Workflow for this implementation: consult the configured IUrlCreator for the url to request
consult the cache to see if the fetch via HTTP is necessary (if not return the cached events)
if the fetch is necessary, consult the ICredentialsExtractor for necessary Credentials
Invoke retrieveCalendarHttp
Pass the returned InputStream into the configured IContentProcessor
Return the CalendarEvents
(non-Javadoc) |
Set<CalendarEvent> |
getEvents(CalendarConfiguration calendarConfiguration,
net.fortuna.ical4j.model.Period period,
javax.portlet.PortletRequest request)
Workflow for this implementation: consult the configured IUrlCreator for the url to request
consult the cache to see if the fetch via HTTP is necessary (if not return the cached events)
if the fetch is necessary, consult the ICredentialsExtractor for necessary Credentials
Invoke retrieveCalendarHttp
Pass the returned InputStream into the configured IContentProcessor
Return the CalendarEvents
(non-Javadoc) |
String |
getLink(CalendarConfiguration calendar,
net.fortuna.ical4j.model.Period period,
javax.portlet.PortletRequest request)
Get hyper link for the defined calendar. |
protected InputStream |
retrieveCalendarHttp(String url,
org.apache.commons.httpclient.Credentials credentials)
Uses Commons HttpClient to retrieve the specified url (optionally with the provided Credentials. |
void |
setCache(net.sf.ehcache.Cache cache)
|
void |
setCacheKeyGenerator(ICacheKeyGenerator cacheKeyGenerator)
|
void |
setCacheKeyPrefix(String cacheKeyPrefix)
|
void |
setContentProcessor(IContentProcessor contentProcessor)
|
void |
setCredentialsExtractor(ICredentialsExtractor credentialsExtractor)
|
void |
setUrlCreator(IUrlCreator urlCreator)
|
| 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 ConfigurableHttpCalendarAdapter()
| Method Detail |
|---|
public void setCache(net.sf.ehcache.Cache cache)
cache - the cache to setpublic void setUrlCreator(IUrlCreator urlCreator)
urlCreator - the urlCreator to setpublic void setCredentialsExtractor(ICredentialsExtractor credentialsExtractor)
credentialsExtractor - the credentialsExtractor to setpublic void setContentProcessor(IContentProcessor contentProcessor)
contentProcessor - the contentProcessor to setpublic void setCacheKeyPrefix(String cacheKeyPrefix)
cacheKeyPrefix - the cacheKeyPrefix to setpublic void setCacheKeyGenerator(ICacheKeyGenerator cacheKeyGenerator)
public Set<CalendarEvent> getEvents(CalendarConfiguration calendarConfiguration,
net.fortuna.ical4j.model.Period period,
javax.portlet.PortletRequest request)
throws CalendarException
IUrlCreator for the url to requestICredentialsExtractor for necessary CredentialsInputStream into the configured IContentProcessorCalendarEvents
getEvents in interface ICalendarAdaptercalendarConfiguration - calendar configuration for which to retrieve eventsperiod - time period for which to retrieve eventsrequest - user's portlet request
CalendarExceptionICalendarAdapter.getEvents(org.jasig.portlet.calendar.CalendarConfiguration, net.fortuna.ical4j.model.Period, javax.portlet.PortletRequest)
public Set<CalendarEvent> getEvents(CalendarConfiguration calendarConfiguration,
net.fortuna.ical4j.model.Period period,
javax.servlet.http.HttpServletRequest request)
throws CalendarException
IUrlCreator for the url to requestICredentialsExtractor for necessary CredentialsInputStream into the configured IContentProcessorCalendarEvents
getEvents in interface ICalendarAdaptercalendarConfiguration - calendar configuration for which to retrieve eventsperiod - time period for which to retrieve eventsrequest - user's servlet request
CalendarExceptionICalendarAdapter.getEvents(org.jasig.portlet.calendar.CalendarConfiguration, net.fortuna.ical4j.model.Period, javax.servlet.http.HttpServletRequest)
public CalendarEvent getEvent(CalendarConfiguration calendar,
net.fortuna.ical4j.model.Period period,
String uid,
String recurrenceId,
javax.servlet.http.HttpServletRequest request)
throws CalendarException
getEvent in interface ISingleEventSupportCalendarException
public CalendarEvent getEvent(CalendarConfiguration calendar,
net.fortuna.ical4j.model.Period period,
String uid,
String recurrenceId,
javax.portlet.PortletRequest request)
throws CalendarException
getEvent in interface ISingleEventSupportCalendarException
public String getLink(CalendarConfiguration calendar,
net.fortuna.ical4j.model.Period period,
javax.portlet.PortletRequest request)
ICalendarAdapter
getLink in interface ICalendarAdaptercalendar - calendar configuration for which to retrieve eventsperiod - time period for which to retrieve eventsrequest - user's servlet request
protected InputStream retrieveCalendarHttp(String url,
org.apache.commons.httpclient.Credentials credentials)
throws CalendarException
Credentials.
The response body is returned as an InputStream.
url - URL of the calendar to be retrievedcredentials - Credentials to use with the request, if necessary (null is ok if credentials not required)
CalendarException - wraps all potential Exception types
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||