Interface RecurringEventAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
RecurringEventBatchAdminSession
This session creates, updates, and deletes RecurringEvents .
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
RecurringEvent , a RecurringEventForm is requested using
getRecurringEventFormForCreate() specifying the desired relationship
peers and record Types or none if no record Types are
needed. The returned RecurringEventForm 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 RecurringEventForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
RecurringEventForm corresponds to an attempted transaction.
For updates, RecurringEventForms are requested to the
RecurringEvent Id that is to be updated using
getRecurringEventFormForUpdate() . Similarly, the
RecurringEventForm has metadata about the data that can be updated and it
can perform validation before submitting the update. The
RecurringEventForm can only be used once for a successful update and
cannot be reused.
The delete operations delete Recurring Events . To unmap a
RecurringEvent from the current Calendar , the
RecurringEventCalendarAssignmentSession should be used. These delete
operations attempt to remove the Event itself thus removing it
from all known Calendar catalogs.
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlackout(Id recurringEventId, DateTime from, DateTime to) Adds a blackout to the given recurring event that blocks events in the series.voidAdds another event as part of this recurring event.addSchedule(Id recurringEventId, Id scheduleId) Adds a schedule to the given recurring event.voidaddSpecificDate(Id recurringEventId, DateTime date, DisplayText locationDescription) Adds a specific date to the given recurring event.voidaddSpecificDateWithLocation(Id recurringEventId, DateTime date, Id locationId) Adds a specific date to the given recurring event.voidaliasRecurringEvent(Id recurringEventId, Id aliasId) Adds anIdto aRecurringEventfor the purpose of creating compatibility.booleanTests if this user can createRecurringEvents.booleancanCreateRecurringEventWithRecordTypes(Type[] recurringEventRecordTypes) Tests if this user can create a singleRecurringEventusing the desired record types.booleanTests if this user can deleteRecurringEvents.booleanTests if this user can manageIdaliases forRecurringEvents.booleanTests if this user can schedule recurring events.booleanTests if this user can updateRecurringEvents.voidclearBlackout(Id recurringEventId, DateTime from, DateTime to) Clears any blackouts between the given dates inclusive.voidclearSpecificDates(Id recurringEventId, DateTime from, DateTime to) Clears any specific dates between the given dates inclusive.createRecurringEvent(RecurringEventForm recurringEventForm) Creates a newRecurringEvent.voiddeleteRecurringEvent(Id recurringEventId) Deletes theRecurringEventidentified by the givenId.Gets theCalendarassociated with this session.Gets theCalendarIdassociated with this session.getRecurringEventFormForCreate(Type[] recurringEventRecordTypes) Gets the recurring event form for creating new recurring events.getRecurringEventFormForUpdate(Id recurringEventId) Gets the recurring event form for updating an existing recurring event.voidremoveEvent(Id recurringEventId, Id eventId) Removes an event as part of this recurring event.voidremoveSchedule(Id recurringEventId, Id scheduleId) Removes a schedule from a given recurring event.voidupdateRecurringEvent(RecurringEventForm recurringEventForm) Updates an existing recurring event.Methods inherited from interface OsidSession
closeMethods inherited from interface OsidSession
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionsModifier and TypeMethodDescriptionGets the agent authenticated to this session.Gets theIdof the agent authenticated to this session.Gets the rate of the service clock.getDate()Gets the service date which may be the current date or the effective date in which this session exists.Gets the effective agent in use by this session.Gets theIdof the effective agent in use by this session.Gets theDisplayTextformatTypepreference in effect for this session.Gets the locale indicating the localization preferences in effect for this session.booleanTests if an agent is authenticated to this session.Starts a new transaction for this sesson.booleanTests for the availability of transactions.
-
Method Details
-
getCalendarId
Id getCalendarId()Gets theCalendarIdassociated with this session.- Returns:
- the
Calendar Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getCalendar
Gets theCalendarassociated with this session.- Returns:
- the
Calendarassociated with this session - Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRecurringEvents
boolean canCreateRecurringEvents()Tests if this user can createRecurringEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRecurringEventwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifRecurringEventcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRecurringEventWithRecordTypes
Tests if this user can create a singleRecurringEventusing the desired record types. WhileCalendaringManager.getRecurringEventRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRecurringEvent. Providing an empty array tests if aRecurringEventcan be created with no records.- Parameters:
recurringEventRecordTypes- array of recurring event types- Returns:
trueifRecurringEventcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-recurringEventRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRecurringEventFormForCreate
RecurringEventForm getRecurringEventFormForCreate(Type[] recurringEventRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the recurring event form for creating new recurring events. A new form should be requested for each create transaction.- Parameters:
recurringEventRecordTypes- array of recurring event types- Returns:
- the recurring event form
- Throws:
NullArgumentException-recurringEventRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form for requested record types- Compliance:
mandatory- This method must be implemented.
-
createRecurringEvent
RecurringEvent createRecurringEvent(RecurringEventForm recurringEventForm) throws OperationFailedException, PermissionDeniedException Creates a newRecurringEvent.- Parameters:
recurringEventForm- the form for thisRecurringEvent- Returns:
- the new
RecurringEvent - Throws:
IllegalStateException-recurringEventFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-recurringEventFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-recurringEventFormdid not originate in a create transaction- Compliance:
mandatory- This method must be implemented.
-
canUpdateRecurringEvents
boolean canUpdateRecurringEvents()Tests if this user can updateRecurringEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRecurringEventwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseif recurring event modification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRecurringEventFormForUpdate
RecurringEventForm getRecurringEventFormForUpdate(Id recurringEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the recurring event form for updating an existing recurring event. A new recurring event form should be requested for each update transaction.- Parameters:
recurringEventId- theIdof theRecurringEvent- Returns:
- the recurring event form
- Throws:
NotFoundException-recurringEventIdis not foundNullArgumentException-recurringEventIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRecurringEvent
void updateRecurringEvent(RecurringEventForm recurringEventForm) throws OperationFailedException, PermissionDeniedException Updates an existing recurring event.- Parameters:
recurringEventForm- the form containing the elements to be updated- Throws:
IllegalStateException-recurringEventFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-recurringEventFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-recurringEventFormdid not originate in an update transaction- Compliance:
mandatory- This method must be implemented.
-
canDeleteRecurringEvents
boolean canDeleteRecurringEvents()Tests if this user can deleteRecurringEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRecurringEventwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifRecurringEventdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRecurringEvent
void deleteRecurringEvent(Id recurringEventId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes theRecurringEventidentified by the givenId.- Parameters:
recurringEventId- theIdof theRecurringEventto delete- Throws:
NotFoundException- aRecurringEventwas not found identified by the givenIdNullArgumentException-recurringEventIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRecurringEventAliases
boolean canManageRecurringEventAliases()Tests if this user can manageIdaliases forRecurringEvents. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifRecurringEventaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRecurringEvent
void aliasRecurringEvent(Id recurringEventId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRecurringEventfor the purpose of creating compatibility. The primaryIdof theRecurringEventis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another recurring event, it is reassigned to the given recurring eventId.- Parameters:
recurringEventId- theIdof aRecurringEventaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-recurringEventIdnot foundNullArgumentException-recurringEventIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canScheduleRecurringEvents
boolean canScheduleRecurringEvents()Tests if this user can schedule recurring events. A return of true does not guarantee successful authorization. A return of false indicates that it is known recurring event methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseif recurring event scheduling is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
addSchedule
Id addSchedule(Id recurringEventId, Id scheduleId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds a schedule to the given recurring event.- Parameters:
recurringEventId- a recurring eventIdscheduleId- a scheduleId- Returns:
- the
Idof the schedule - Throws:
AlreadyExistsException- schedule is already part of recurring eventNotFoundException-recurringEventIdorscheduleIdis not foundNullArgumentException-recurringEventIdorscheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeSchedule
void removeSchedule(Id recurringEventId, Id scheduleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a schedule from a given recurring event.- Parameters:
recurringEventId- a recurring eventIdscheduleId- the scheduleId- Throws:
NotFoundException- schedule not part of recurring eventNullArgumentException-recurringEventIdorscheduleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addSpecificDate
void addSpecificDate(Id recurringEventId, DateTime date, DisplayText locationDescription) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a specific date to the given recurring event.- Parameters:
recurringEventId- a recurring eventIddate- a datelocationDescription- location description- Throws:
NotFoundException-recurringEventIdis not foundNullArgumentException-recurringEventId, date, orlocationDescriptionisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addSpecificDateWithLocation
void addSpecificDateWithLocation(Id recurringEventId, DateTime date, Id locationId) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a specific date to the given recurring event.- Parameters:
recurringEventId- a recurring eventIddate- a datelocationId- a location- Throws:
NotFoundException-recurringEventIdorlocationIdis not foundNullArgumentException-recurringEventId, date, orlocationIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
clearSpecificDates
void clearSpecificDates(Id recurringEventId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Clears any specific dates between the given dates inclusive.- Parameters:
recurringEventId- a recurring eventIdfrom- start date inclusiveto- end date inclusive- Throws:
InvalidArgumentException-fromis greater thantoNotFoundException-recurringEventIdis not foundNullArgumentException-recurringEventId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addEvent
void addEvent(Id recurringEventId, Id eventId) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds another event as part of this recurring event.- Parameters:
recurringEventId- a recurring eventIdeventId- an eventId- Throws:
NotFoundException-recurringEventIdoreventIdis not foundNullArgumentException-recurringEventIdoreventIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removeEvent
void removeEvent(Id recurringEventId, Id eventId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes an event as part of this recurring event.- Parameters:
recurringEventId- a recurring eventIdeventId- an eventId- Throws:
NotFoundException-recurringEventIdoreventIdis not found oreventIdnot part ofrecurringEventIdNullArgumentException-recurringEventIdoreventIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
addBlackout
void addBlackout(Id recurringEventId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a blackout to the given recurring event that blocks events in the series.- Parameters:
recurringEventId- a recurring eventIdfrom- start date inclusiveto- end date inclusive- Throws:
InvalidArgumentException-fromis greater thantoNotFoundException-recurringEventIdis not foundNullArgumentException-recurringEventId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
clearBlackout
void clearBlackout(Id recurringEventId, DateTime from, DateTime to) throws NotFoundException, OperationFailedException, PermissionDeniedException Clears any blackouts between the given dates inclusive.- Parameters:
recurringEventId- a recurring eventIdfrom- start date inclusiveto- end date inclusive- Throws:
InvalidArgumentException-fromis greater thantoNotFoundException-recurringEventIdis not foundNullArgumentException-recurringEventId, fromortoisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-