Interface AcademyBatchAdminSession
- All Superinterfaces:
AcademyAdminSession, AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Academies 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
Academy , a AcademyForm is requested using
getAcademyFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
AcademyForms 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 AcademyForm is submiited to a create operation, it cannot
be reused with another create operation unless the first operation was
unsuccessful. Each AcademyForm corresponds to an attempted
transaction.
The AcademyForms returned from
getAcademyFormsForCreate() may be linked to the originating request
through the peer Ids of the AcademyForm . In the case
where there may be duplicates, any AcademyForm of the same peer
Ids may be used for a create operation.
Once a batch of AcademyForms are submitted for create, a
CreateResponse is returned for each AcademyForm , although
the ordering is not defined. Only errors that pertain to the entire create
operation are returned from createAcademy() , errors specific to
an individual AcademyForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the
originating AcademyForm through the AcademyForm Id
.
For updates, AcademyForms are requested to the Academy
Id that is to be updated using getAcademyFormsForUpdate()
where the reference Id in the AcademyForm may be used to
link the request. Similarly, the AcademyForm has metadata about
the data that can be updated and it can perform validation before
submitting the update. The AcademyForm can only be used once for a
successful update and cannot be reused.
Once a batch of AcademyForms are submitted for update, an
UpdateResponse is returned for each AcademyForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateAcademy() , errors specific to
an individual AcademyForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the
originating AcademyForm through the AcademyForm Id
.
The delete operations delete Academies in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAcademies(AliasRequestList aliasRequests) Adds anIdto aAcademyfor the purpose of creating compatibility.createAcademies(AcademyBatchFormList academyForms) Creates a new set ofAcademies.deleteAcademies(IdList academyIds) Deletes academies for the givenIds.Deletes allAcademies.getAcademyFormsForCreate(long number, Type[] academyRecordTypes) Gets the academy forms for creating a bunch of new academy.getAcademyFormsForUpdate(IdList academyIds) Gets the academy forms for updating an existing set of academies.updateAcademies(AcademyBatchFormList academyForms) Updates existing academies.Methods inherited from interface AcademyAdminSession
aliasAcademy, canCreateAcademies, canCreateAcademyWithRecordTypes, canDeleteAcademies, canManageAcademyAliases, canUpdateAcademies, createAcademy, deleteAcademy, getAcademyFormForCreate, getAcademyFormForUpdate, updateAcademyModifier and TypeMethodDescriptionvoidaliasAcademy(Id academyId, Id aliasId) Adds anIdto anAcademyfor the purpose of creating compatibility.booleanTests if this user can createAcademies.booleancanCreateAcademyWithRecordTypes(Type[] academyRecordTypes) Tests if this user can create a singleAcademyusing the desired record types.booleanTests if this user can deleteAcademiesA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forAcademies.booleanTests if this user can updateAcademies.createAcademy(AcademyForm academyForm) Creates a newAcademy.voiddeleteAcademy(Id academyId) Deletes anAcademy.getAcademyFormForCreate(Type[] academyRecordTypes) Gets the academy form for creating new academies.getAcademyFormForUpdate(Id academyId) Gets the academy form for updating an existing academy.voidupdateAcademy(AcademyForm academyForm) Updates an existing academy.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
-
getAcademyFormsForCreate
AcademyBatchFormList getAcademyFormsForCreate(long number, Type[] academyRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the academy forms for creating a bunch of new academy.- Parameters:
number- the number of forms to retrieveacademyRecordTypes- array of academy record types to be included in each create operation or an empty list if none- Returns:
- the academy forms
- Throws:
NullArgumentException-academyRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAcademies
CreateResponseList createAcademies(AcademyBatchFormList academyForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAcademies. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
academyForms- the academy forms- Returns:
- the create responses
- Throws:
NullArgumentException-academyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAcademyFormsForUpdate
AcademyBatchFormList getAcademyFormsForUpdate(IdList academyIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the academy forms for updating an existing set of academies. A new academy form should be requested for each update transaction.- Parameters:
academyIds- theIdsof theAcademies- Returns:
- the academy form
- Throws:
NotFoundException- aacademyIdis not foundNullArgumentException-academyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAcademies
UpdateResponseList updateAcademies(AcademyBatchFormList academyForms) throws OperationFailedException, PermissionDeniedException Updates existing academies. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
academyForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-academyFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAcademies
Deletes allAcademies.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAcademies
DeleteResponseList deleteAcademies(IdList academyIds) throws OperationFailedException, PermissionDeniedException Deletes academies for the givenIds.- Parameters:
academyIds- theIdsof the academies to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-academyIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAcademies
AliasResponseList aliasAcademies(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aAcademyfor the purpose of creating compatibility. The primaryIdof theAcademyis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another academy, it is reassigned to the given academyId.- 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.
-