Interface ResultBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession, ResultAdminSession
This session creates, updates, and deletes Results 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
Result , a ResultForm is requested using
getResultFormsForCreate() specifying the desired participant, and record
Types or none if no record Types are needed. Each of the
returned ResultForms 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 ResultForm is submiited to a create operation,
it cannot be reused with another create operation unless the first
operation was unsuccessful. Each ResultForm corresponds to an
attempted transaction.
The ResultForms returned from
getResultFormsForCreate() may be linked to the originating request
through the peer Ids of the ResultForm . In the case where
there may be duplicates, any ResultForm of the same peer
Ids may be used for a create operation.
Once a batch of ResultForms are submitted for create, a
CreateResponse is returned for each ResultForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createResults() , errors specific to
an individual ResultForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
ResultForm through the ResultForm Id .
For updates, ResultForms are requested to the Result
Id that is to be updated using getResultFormsForUpdate()
where the reference Id in the ResultForm may be used to
link the request. Similarly, the ResultForm has metadata about the
data that can be updated and it can perform validation before submitting
the update. The ResultForm can only be used once for a successful
update and cannot be reused.
Once a batch of ResultForms are submitted for update, an
UpdateResponse is returned for each ResultForm , although
the ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateResults() , errors specific to
an individual ResultForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
ResultForm through the ResultForm Id .
The delete operations delete Results in bulk. To unmap a
Result from the current Catalogue , the
ResultCatalogueAssignmentSession should be used. These delete operations
attempt to remove the Result itself thus removing it from all
known Catalogue catalogs. Bulk delete operations return the
results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasResults(AliasRequestList aliasRequests) Adds anIdto aResultfor the purpose of creating compatibility.createResults(ResultBatchFormList resultForms) Creates a new set ofResults.Deletes allResultsin thisCatalogue.deleteResults(IdList resultIds) Deletes results for the givenIds.deleteResultsForParticipant(Id participantId) Deletes results for the given participant.getResultFormsForCreate(IdList participantIds, Type[] resultRecordTypes) Gets the result forms for creating a bunch of new results.getResultFormsForUpdate(IdList resultIds) Gets the result forms for updating an existing set of results.updateResults(ResultBatchFormList resultForms) Updates existing results.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.Methods inherited from interface ResultAdminSession
aliasResult, canCreateResults, canCreateResultWithRecordTypes, canDeleteResults, canManageResultAliases, canUpdateResults, createResult, deleteResult, getCatalogue, getCatalogueId, getResultFormForCreate, getResultFormForUpdate, updateResultModifier and TypeMethodDescriptionvoidaliasResult(Id resultId, Id aliasId) Adds anIdto aResultfor the purpose of creating compatibility.booleanTests if this user can create results.booleancanCreateResultWithRecordTypes(Type[] resultRecordTypes) Tests if this user can create a singleResultusing the desired record types.booleanTests if this user can delete results.booleanTests if this user can manageIdaliases forResults.booleanTests if this user can update results.createResult(ResultForm resultForm) Creates a newResult.voiddeleteResult(Id resultId) Deletes aResult.Gets theCatalogueassociated with this session.Gets theCatalogueIdassociated with this session.getResultFormForCreate(Id canonicalUnitId, Id particpantId, Type[] resultRecordTypes) Gets the result form for creating new results.getResultFormForUpdate(Id resultId) Gets the result form for updating an existing result.voidupdateResult(ResultForm resultForm) Updates an existing result.
-
Method Details
-
getResultFormsForCreate
ResultBatchFormList getResultFormsForCreate(IdList participantIds, Type[] resultRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the result forms for creating a bunch of new results. A form is returned for each participant.- Parameters:
participantIds- a list of participantsresultRecordTypes- array of result record types to be included in each create operation or an empty list if none- Returns:
- the result forms
- Throws:
NotFoundException- aparticipantIdis not foundNullArgumentException-participantIdsorresultRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createResults
CreateResponseList createResults(ResultBatchFormList resultForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofResults. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
resultForms- the result forms- Returns:
- the create responses
- Throws:
NullArgumentException-resultFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getResultFormsForUpdate
ResultBatchFormList getResultFormsForUpdate(IdList resultIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the result forms for updating an existing set of results. A new result form should be requested for each update transaction.- Parameters:
resultIds- theIdsof theResult- Returns:
- the result form
- Throws:
NotFoundException- aresultIdis not foundNullArgumentException-resultIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateResults
UpdateResponseList updateResults(ResultBatchFormList resultForms) throws OperationFailedException, PermissionDeniedException Updates existing results. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
resultForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-resultFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllResults
Deletes allResultsin thisCatalogue.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteResults
DeleteResponseList deleteResults(IdList resultIds) throws OperationFailedException, PermissionDeniedException Deletes results for the givenIds.- Parameters:
resultIds- theIdsof the results to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-resultIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteResultsForParticipant
DeleteResponseList deleteResultsForParticipant(Id participantId) throws OperationFailedException, PermissionDeniedException Deletes results for the given participant.- Parameters:
participantId- anIdof a participant- Returns:
- the delete responses
- Throws:
NullArgumentException-participantIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasResults
AliasResponseList aliasResults(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aResultfor the purpose of creating compatibility. The primaryIdof theResultis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another result, it is reassigned to the given resultId.- 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.
-