public interface CalendarAdminSession extends OsidSession
This session creates, updates, and deletes Calendars.
The data for create and update is provided by the consumer via the form
object. OsidForms are requested for each create or update
and may not be reused.
Create and update operations differ in their usage. To create a
Calendar, a CalendarForm is requested using
getCalendarFormForCreate() specifying the desired record
Types or none if no record Types are needed. The
returned CalendarForm will indicate that it is to be used
with a create operation and can be used to examine metdata or validate
data prior to creation. Once the CalendarForm is submiited
to a create operation, it cannot be reused with another create operation
unless the first operation was unsuccessful. Each CalendarForm
corresponds to an attempted transaction.
For updates, CalendarForms are requested to the
Calendar Id that is to be updated using
getCalendarFormForUpdate(). Similarly, the CalendarForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The Calendar can
only be used once for a successful update and cannot be reused.
The delete operations delete Calendars. This session
also includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasCalendar(Id calendarId,
Id aliasId)
Adds an
Id to a Calendar for the purpose
of creating compatibility. |
boolean |
canCreateCalendars()
Tests if this user can create
Calendars. |
boolean |
canCreateCalendarWithRecordTypes(Type[] calendarRecordTypes)
Tests if this user can create a single
Calendar using
the desired record types. |
boolean |
canDeleteCalendars()
Tests if this user can delete calendars.
|
boolean |
canManageCalendarAliases()
Tests if this user can manage
Id aliases for
Calendars. |
boolean |
canUpdateCalendars()
Tests if this user can update
Calendars. |
CalendarForm |
createCalendar(CalendarForm calendarForm)
Creates a new
Calendar. |
void |
deleteCalendar(Id calendarId)
Deletes a
Calendar. |
CalendarForm |
getCalendarFormForCreate(Type[] calendarRecordTypes)
Gets the calendar form for creating new calendars.
|
CalendarForm |
getCalendarFormForUpdate(Id calendarId)
Gets the calendar form for updating an existing calendar.
|
void |
updateCalendar(CalendarForm calendarForm)
Updates an existing calendar.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseboolean canCreateCalendars()
Calendars. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating a Calendar will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer create operations to
unauthorized users. false if Calendar creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateCalendarWithRecordTypes(Type[] calendarRecordTypes)
Calendar using
the desired record types. While
CalendaringManager.getCalendarRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Calendar.
Providing an empty array tests if a Calendar can be
created with no records.calendarRecordTypes - array of calendar record types true if Calendar creation using
the specified Types is supported, false
otherwiseNullArgumentException - calendarRecordTypes
is null mandatory - This method must be implemented. CalendarForm getCalendarFormForCreate(Type[] calendarRecordTypes) throws OperationFailedException, PermissionDeniedException
calendarRecordTypes - array of calendar record typesNullArgumentException - calendarRecordTypes
is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form for requested
record typesmandatory - This method must be implemented. CalendarForm createCalendar(CalendarForm calendarForm) throws OperationFailedException, PermissionDeniedException
Calendar. calendarForm - the form for this Calendar Calendar IllegalStateException - calendarForm
already used for a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - calendarForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - calendarForm did
not originate from getCalendarFormForCreate() mandatory - This method must be implemented. boolean canUpdateCalendars()
Calendars. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating a Calendar will
result in a PERMISSION_DENIED. This is intended as a
hint to an application that may not wish to offer update operations to
unauthorized users. false if Calendar modification
is not authorized, true otherwisemandatory - This method must be implemented. CalendarForm getCalendarFormForUpdate(Id calendarId) throws NotFoundException, OperationFailedException, PermissionDeniedException
calendarId - the Id of the Calendar
NotFoundException - calendarId is not
foundNullArgumentException - calendarId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateCalendar(CalendarForm calendarForm) throws OperationFailedException, PermissionDeniedException
calendarForm - the form containing the elements to be updatedIllegalStateException - calendarForm
already used for an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - calendarForm is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - calendarForm did
not originate from getCalendarFormForUpdate() mandatory - This method must be implemented. boolean canDeleteCalendars()
Calendar will result in a
PERMISSION_DENIED. This is intended as a hint to an
application that may not wish to offer delete operations to
unauthorized users. false if Calendar deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteCalendar(Id calendarId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Calendar. calendarId - the Id of the Calendar
to removeNotFoundException - calendarId not foundNullArgumentException - calendarId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageCalendarAliases()
Id aliases for
Calendars. A return of true does not guarantee successful
authorization. A return of false indicates that it is known changing
an alias will result in a PERMISSION_DENIED. This is
intended as a hint to an application that may opt not to offer alias
operations to an unauthorized user. false if Calendar aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasCalendar(Id calendarId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to a Calendar for the purpose
of creating compatibility. The primary Id of the
Calendar is determined by the provider. The new Id
performs as an alias to the primary Id. If the
alias is a pointer to another calendar, it is reassigned to the given
calendar Id. calendarId - the Id of a Calendar aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - calendarId not foundNullArgumentException - calendarId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.