Interface CyclicEventBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CyclicEventAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes CyclicEvents in
bulk. 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
CyclicEvent , a CyclicEventForm is requested using
getCyclicEventFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the returned
CyclicEventForms 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 a CyclicEventForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CyclicEventForm corresponds
to an attempted transaction.
The CyclicEventForms returned from
getCyclicEventFormsForCreate() may be linked to the originating request
through the peer Ids of the CyclicEventForm . In the case
where there may be duplicates, any CyclicEventForm of the same
peer Ids may be used for a create operation.
Once a batch of CyclicEventForms are submitted for create, a
CreateResponse is returned for each CyclicEventForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCyclicEvents() ,
errors specific to an individual CyclicEventForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating CyclicEventForm through the
CyclicEventForm Id .
For updates, CyclicEventForms are requested to the
CyclicEvent Id that is to be updated using
getCyclicEventFormsForUpdate() where the reference Id in the
CyclicEventForm may be used to link the request. Similarly, the
CyclicEventForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
CyclicEventForm can only be used once for a successful update and cannot
be reused.
Once a batch of CyclicEventForms are submitted for update, an
UpdateResponse is returned for each CyclicEventForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCyclicEvents() ,
errors specific to an individual CyclicEventForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating CyclicEventForm through the
CyclicEventForm Id .
The delete operations delete CyclicEvents in bulk. To unmap a
CyclicEvent from the current Calendar , the
CyclicEventCalendarAssignmentSession should be used. These delete
operations attempt to remove the CyclicEvent itself thus removing
it from all known Calendar catalogs. Bulk delete operations return
the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCyclicEvents(AliasRequestList aliasRequests) Adds anIdto aCyclicEventfor the purpose of creating compatibility.createCyclicEvents(CyclicEventBatchFormList cyclicEventForms) Creates a new set ofCyclicEvents.Deletes allCyclicEventsin thisCalendar.deleteCyclicEvents(IdList cyclicEventIds) Deletes cyclic events for the givenIds.getCyclicEventFormsForCreate(long number, Type[] cyclicEventRecordTypes) Gets the cyclic event forms for creating a bunch of new cyclic events.getCyclicEventFormsForUpdate(IdList cyclicEventIds) Gets the cyclic event forms for updating an existing set of cyclic events.updateCyclicEvents(CyclicEventBatchFormList cyclicEventForms) Updates existing cyclic events.Methods inherited from interface CyclicEventAdminSession
aliasCyclicEvent, canCreateCyclicEvents, canCreateCyclicEventWithRecordTypes, canDeleteCyclicEvents, canManageCyclicEventAliases, canUpdateCyclicEvents, createCyclicEvent, deleteCyclicEvent, getCalendar, getCalendarId, getCyclicEventFormForCreate, getCyclicEventFormForUpdate, updateCyclicEventModifier and TypeMethodDescriptionvoidaliasCyclicEvent(Id cyclicEventId, Id aliasId) Adds anIdto aCyclicEventfor the purpose of creating compatibility.booleanTests if this user can createCyclicEvents.booleancanCreateCyclicEventWithRecordTypes(Type[] cyclicEventRecordTypes) Tests if this user can create a singleCyclicEventusing the desired record types.booleanTests if this user can deleteCyclicEvents.booleanTests if this user can manageIdaliases forCyclicEvents.booleanTests if this user can updateCyclicEvents.createCyclicEvent(CyclicEventForm cyclicEventForm) Creates a newCyclicEvent.voiddeleteCyclicEvent(Id cyclicEventId) Deletes theCyclicEventidentified by the givenId.Gets theCalendarassociated with this session.Gets theCalendarIdassociated with this session.getCyclicEventFormForCreate(Type[] cyclicEventRecordTypes) Gets the cyclic event form for creating new cyclic events.getCyclicEventFormForUpdate(Id cyclicEventId) Gets the cyclic event form for updating an existing cyclic event.voidupdateCyclicEvent(CyclicEventForm cyclicEventForm) Updates an existing cyclic 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
-
getCyclicEventFormsForCreate
CyclicEventBatchFormList getCyclicEventFormsForCreate(long number, Type[] cyclicEventRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the cyclic event forms for creating a bunch of new cyclic events.- Parameters:
number- the number of forms to retrievecyclicEventRecordTypes- array of cyclic event record types to be included in each create operation or an empty list if none- Returns:
- the cyclic event forms
- Throws:
NullArgumentException-cyclicEventRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCyclicEvents
CreateResponseList createCyclicEvents(CyclicEventBatchFormList cyclicEventForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCyclicEvents. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
cyclicEventForms- the cyclic event forms- Returns:
- the create responses
- Throws:
NullArgumentException-cyclicEventFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCyclicEventFormsForUpdate
CyclicEventBatchFormList getCyclicEventFormsForUpdate(IdList cyclicEventIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the cyclic event forms for updating an existing set of cyclic events. A new cyclic event form should be requested for each update transaction.- Parameters:
cyclicEventIds- theIdsof theCyclicEvent- Returns:
- the cyclic event form
- Throws:
NotFoundException- acyclicEventIdis not foundNullArgumentException-cyclicEventIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCyclicEvents
UpdateResponseList updateCyclicEvents(CyclicEventBatchFormList cyclicEventForms) throws OperationFailedException, PermissionDeniedException Updates existing cyclic events. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
cyclicEventForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-cyclicEventFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCyclicEvents
DeleteResponseList deleteAllCyclicEvents() throws OperationFailedException, PermissionDeniedExceptionDeletes allCyclicEventsin thisCalendar.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCyclicEvents
DeleteResponseList deleteCyclicEvents(IdList cyclicEventIds) throws OperationFailedException, PermissionDeniedException Deletes cyclic events for the givenIds.- Parameters:
cyclicEventIds- theIdsof the cyclic events to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-cyclicEventIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCyclicEvents
AliasResponseList aliasCyclicEvents(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCyclicEventfor the purpose of creating compatibility. The primaryIdof theCyclicEventis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another cyclic event, it is reassigned to the given cyclic eventId.- Parameters:
aliasRequests- the alias requests- Returns:
- the alias responses
- Throws:
NullArgumentException-aliasRequestsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-