Interface AwardBatchAdminSession
- All Superinterfaces:
AutoCloseable, AwardAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Awards 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 an
Award , an AwardForm is requested using
getAwardFormsForCreate() specifying the desired record Types or
none if no record Types are needed. Each of the returned
AwardForms 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 an AwardForm is submiited to a create operation, it cannot be
reused with another create operation unless the first operation was
unsuccessful. Each AwardForm corresponds to an attempted
transaction.
The AwardForms returned from getAwardFormsForCreate()
may be linked to the originating request through the peer Ids of
the AwardForm . In the case where there may be duplicates, any
AwardForm of the same peer Ids may be used for a create
operation.
Once a batch of AwardForms are submitted for create, a
CreateResponse is returned for each AwardForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createAwards() , errors specific to an
individual AwardForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
AwardForm through the AwardForm Id .
For updates, AwardForms are requested to the Award
Id that is to be updated using getAwardFormsForUpdate()
where the reference Id in the AwardForm may be used to
link the request. Similarly, the AwardForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The AwardForm can only be used once for a successful
update and cannot be reused.
Once a batch of AwardForms are submitted for update, an
UpdateResponse is returned for each AwardForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateAwards() , errors specific to an
individual AwardForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
AwardForm through the AwardForm Id .
The delete operations delete Awards in bulk. To unmap an
Award from the current Academy , the
AwardAcademyAssignmentSession should be used. These delete operations
attempt to remove the Award itself thus removing it from all known
Academy catalogs. Bulk delete operations return the results in
DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasAwards(AliasRequestList aliasRequests) Adds anIdto anAwardfor the purpose of creating compatibility.createAwards(AwardBatchFormList awardForms) Creates a new set ofAwards.Deletes allAwardsin thisAcademy.deleteAwards(IdList awardIds) Deletes awards for the givenIds.getAwardFormsForCreate(long number, Type[] awardRecordTypes) Gets the award forms for creating a bunch of new awards.getAwardFormsForUpdate(IdList awardIds) Gets the award forms for updating an existing set of awards.updateAwards(AwardBatchFormList awardForms) Updates existing awards.Methods inherited from interface AwardAdminSession
aliasAward, canCreateAwards, canCreateAwardWithRecordTypes, canDeleteAwards, canManageAwardAliases, canUpdateAwards, createAward, deleteAward, getAcademy, getAcademyId, getAwardFormForCreate, getAwardFormForUpdate, updateAwardModifier and TypeMethodDescriptionvoidaliasAward(Id awardId, Id aliasId) Adds anIdto anAwardfor the purpose of creating compatibility.booleanTests if this user can createAwards.booleancanCreateAwardWithRecordTypes(Type[] awardRecordTypes) Tests if this user can create a singleAwardusing the desired record types.booleanTests if this user can deleteAwardsA return of true does not guarantee successful authorization.booleanTests if this user can manageIdaliases forAwards.booleanTests if this user can updateAwards.createAward(AwardForm awardForm) Creates a newAward.voiddeleteAward(Id awardId) Deletes anAward.Gets theAcademyassociated with this session.Gets theAcademyIdassociated with this session.getAwardFormForCreate(Type[] awardRecordTypes) Gets the award form for creating new awards.getAwardFormForUpdate(Id awardId) Gets the award form for updating an existing award.voidupdateAward(AwardForm awardForm) Updates an existing award.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
-
getAwardFormsForCreate
AwardBatchFormList getAwardFormsForCreate(long number, Type[] awardRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the award forms for creating a bunch of new awards.- Parameters:
number- the number of forms to retrieveawardRecordTypes- array of award record types to be included in each create operation or an empty list if none- Returns:
- the award forms
- Throws:
NullArgumentException-awardRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createAwards
CreateResponseList createAwards(AwardBatchFormList awardForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofAwards. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
awardForms- the award forms- Returns:
- the create responses
- Throws:
NullArgumentException-awardFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getAwardFormsForUpdate
AwardBatchFormList getAwardFormsForUpdate(IdList awardIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the award forms for updating an existing set of awards. A new award form should be requested for each update transaction.- Parameters:
awardIds- theIdsof theAward- Returns:
- the award form
- Throws:
NotFoundException- anawardIdis not foundNullArgumentException-awardIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateAwards
UpdateResponseList updateAwards(AwardBatchFormList awardForms) throws OperationFailedException, PermissionDeniedException Updates existing awards. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
awardForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-awardFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllAwards
Deletes allAwardsin thisAcademy.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAwards
DeleteResponseList deleteAwards(IdList awardIds) throws OperationFailedException, PermissionDeniedException Deletes awards for the givenIds.- Parameters:
awardIds- theIdsof the awards to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-awardIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasAwards
AliasResponseList aliasAwards(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anAwardfor the purpose of creating compatibility. The primaryIdof theAwardis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another award, it is reassigned to the given awardId.- 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.
-