# Class CalendarSource

java.lang.Object
com.codename1.calendar.CalendarSource

Direct Known Subclasses:
  `CalDavCalendarSource, LocalCalendarSource, OAuthCalendarSource`

public abstract class CalendarSource extends Object
Base contract shared by local stores and online providers.

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `CalendarSource(String id, String displayName)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final void`
  `addChangeListener(CalendarChangeListener listener)`
  `protected static <T> AsyncResource<T>`
  `completed(T value)`
  `AsyncResource<Boolean>`
  `deleteCalendar(CalendarInfo calendar)`
  Deletes a calendar or task list.
  `AsyncResource<Boolean>`
  `deleteCalendar(String calendarId)`
  `AsyncResource<Boolean>`
  `deleteEvent(String calendarId, String eventId, CalendarMutationScope scope, String version)`
  `AsyncResource<Boolean>`
  `deleteTask(String calendarId, String taskId, CalendarMutationScope scope, String version)`
  `protected final void`
  `fireChange(CalendarChange change)`
  `CalendarAuthorizationStatus`
  `getAuthorizationStatus(CalendarAccess access)`
  `CalendarCapabilities`
  `getCapabilities()`
  `final String`
  `getDisplayName()`
  `AsyncResource<CalendarEvent>`
  `getEvent(String calendarId, String eventId)`
  `final String`
  `getId()`
  `AsyncResource<CalendarTask>`
  `getTask(String calendarId, String taskId)`
  `boolean`
  `isAvailable()`
  `AsyncResource<CalendarPage<CalendarInfo>>`
  `listCalendars(CalendarInfo.ContentType type, String pageToken)`
  `AsyncResource<CalendarPage<CalendarEvent>>`
  `queryEvents(CalendarQuery query)`
  `AsyncResource<List<FreeBusyInterval>>`
  `queryFreeBusy(List<String> calendarIds, Instant startTime, Instant endTime)`
  `AsyncResource<CalendarPage<CalendarTask>>`
  `queryTasks(CalendarQuery query)`
  `final void`
  `removeChangeListener(CalendarChangeListener listener)`
  `AsyncResource<CalendarAuthorizationStatus>`
  `requestAuthorization(CalendarAccess access)`
  `AsyncResource<CalendarEvent>`
  `respondToEvent(String calendarId, String eventId, CalendarAttendee.Response response, String comment)`
  `AsyncResource<CalendarInfo>`
  `saveCalendar(CalendarInfo calendar)`
  `AsyncResource<CalendarEvent>`
  `saveEvent(CalendarEvent event, CalendarMutationScope scope)`
  `AsyncResource<CalendarTask>`
  `saveTask(CalendarTask task, CalendarMutationScope scope)`
  `protected static <T> AsyncResource<T>`
  `unavailable(String message)`
  `protected static <T> AsyncResource<T>`
  `unsupported(String operation)`

  ### Methods inherited from class Object

  `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### CalendarSource

    protected CalendarSource(String id, String displayName)

- ## Method Details

  - ### getId

    public final String getId()

  - ### getDisplayName

    public final String getDisplayName()

  - ### isAvailable

    public boolean isAvailable()

  - ### getCapabilities

    public CalendarCapabilities getCapabilities()

  - ### getAuthorizationStatus

    public CalendarAuthorizationStatus getAuthorizationStatus(CalendarAccess access)

  - ### requestAuthorization

    public AsyncResource<CalendarAuthorizationStatus> requestAuthorization(CalendarAccess access)

  - ### listCalendars

    public AsyncResource<CalendarPage<CalendarInfo>> listCalendars(CalendarInfo.ContentType type, String pageToken)

  - ### saveCalendar

    public AsyncResource<CalendarInfo> saveCalendar(CalendarInfo calendar)

  - ### deleteCalendar

    public AsyncResource<Boolean> deleteCalendar(String calendarId)

  - ### deleteCalendar

    public AsyncResource<Boolean> deleteCalendar(CalendarInfo calendar)
    Deletes a calendar or task list. Sources that expose both use the content type to select the correct provider endpoint.

  - ### queryEvents

    public AsyncResource<CalendarPage<CalendarEvent>> queryEvents(CalendarQuery query)

  - ### getEvent

    public AsyncResource<CalendarEvent> getEvent(String calendarId, String eventId)

  - ### saveEvent

    public AsyncResource<CalendarEvent> saveEvent(CalendarEvent event, CalendarMutationScope scope)

  - ### deleteEvent

    public AsyncResource<Boolean> deleteEvent(String calendarId, String eventId, CalendarMutationScope scope, String version)

  - ### respondToEvent

    public AsyncResource<CalendarEvent> respondToEvent(String calendarId, String eventId, CalendarAttendee.Response response, String comment)

  - ### queryFreeBusy

    public AsyncResource<List<FreeBusyInterval>> queryFreeBusy(List<String> calendarIds, Instant startTime, Instant endTime)

  - ### queryTasks

    public AsyncResource<CalendarPage<CalendarTask>> queryTasks(CalendarQuery query)

  - ### getTask

    public AsyncResource<CalendarTask> getTask(String calendarId, String taskId)

  - ### saveTask

    public AsyncResource<CalendarTask> saveTask(CalendarTask task, CalendarMutationScope scope)

  - ### deleteTask

    public AsyncResource<Boolean> deleteTask(String calendarId, String taskId, CalendarMutationScope scope, String version)

  - ### addChangeListener

    public final void addChangeListener(CalendarChangeListener listener)

  - ### removeChangeListener

    public final void removeChangeListener(CalendarChangeListener listener)

  - ### fireChange

    protected final void fireChange(CalendarChange change)

  - ### unsupported

    protected static <T> AsyncResource<T> unsupported(String operation)

  - ### unavailable

    protected static <T> AsyncResource<T> unavailable(String message)

  - ### completed

    protected static <T> AsyncResource<T> completed(T value)