Interface ObjectiveBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, ObjectiveAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Objectives 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
Objective , an ObjectiveForm is requested using
getObjectiveFormsForCreate() specifying the desired record Types
or none if no record Types are needed. Each of the returned
ObjectiveForms 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 ObjectiveForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each ObjectiveForm corresponds
to an attempted transaction.
The ObjectiveForms returned from
getObjectiveFormsForCreate() may be linked to the originating request
through the peer Ids of the ObjectiveForm . In the case
where there may be duplicates, any ObjectiveForm of the same peer
Ids may be used for a create operation.
Once a batch of ObjectiveForms are submitted for create, a
CreateResponse is returned for each ObjectiveForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createObjectives() ,
errors specific to an individual ObjectiveForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating ObjectiveForm through the
ObjectiveForm Id .
For updates, ObjectiveForms are requested to the
Objective Id that is to be updated using
getObjectiveFormsForUpdate() where the reference Id in the
ObjectiveForm may be used to link the request. Similarly, the
ObjectiveForm has metadata about the data that can be updated and it can
perform validation before submitting the update. The ObjectiveForm
can only be used once for a successful update and cannot be reused.
Once a batch of ObjectiveForms are submitted for update, an
UpdateResponse is returned for each ObjectiveForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateObjectives() ,
errors specific to an individual ObjectiveForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating ObjectiveForm through the
ObjectiveForm Id .
The delete operations delete Objectives in bulk. To unmap an
Objective from the current ObjectiveBank , the
ObjectiveObjectiveBankAssignmentSession should be used. These delete
operations attempt to remove the Objective itself thus removing it
from all known ObjectiveBank catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasObjectives(AliasRequestList aliasRequests) Adds anIdto anObjectivefor the purpose of creating compatibility.createObjectives(ObjectiveBatchFormList objectiveForms) Creates a new set ofObjectives.Deletes allObjectivesin thisObjectiveBank.deleteObjectives(IdList objectiveIds) Deletes objectives for the givenIds.getObjectiveFormsForCreate(long number, Type[] objectiveRecordTypes) Gets the objective forms for creating a bunch of new objectives.getObjectiveFormsForUpdate(IdList objectiveIds) Gets the objective forms for updating an existing set of objectives.updateObjectives(ObjectiveBatchFormList objectiveForms) Updates existing objectives.Methods inherited from interface ObjectiveAdminSession
aliasObjective, canCreateObjectives, canCreateObjectiveWithRecordTypes, canDeleteObjectives, canManageObjectiveAliases, canUpdateObjectives, createObjective, deleteObjective, getObjectiveBank, getObjectiveBankId, getObjectiveFormForCreate, getObjectiveFormForUpdate, updateObjectiveModifier and TypeMethodDescriptionvoidaliasObjective(Id objectiveId, Id aliasId) Adds anIdto anObjectivefor the purpose of creating compatibility.booleanTests if this user can createObjectives.booleancanCreateObjectiveWithRecordTypes(Type[] objectiveRecordTypes) Tests if this user can create a singleObjectiveusing the desired record types.booleanTests if this user can deleteObjectives.booleanTests if this user can manageIdaliases forObjectives.booleanTests if this user can updateObjectives.createObjective(ObjectiveForm objectiveForm) Creates a newObjective.voiddeleteObjective(Id objectiveId) Deletes theObjectiveidentified by the givenId.Gets theObjectiveBankassociated with this session.Gets theObjectiveBankIdassociated with this session.getObjectiveFormForCreate(Type[] objectiveRecordTypes) Gets the objective form for creating new objectives.getObjectiveFormForUpdate(Id objectiveId) Gets the objective form for updating an existing objective.voidupdateObjective(ObjectiveForm objectiveForm) Updates an existing objective.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
-
getObjectiveFormsForCreate
ObjectiveBatchFormList getObjectiveFormsForCreate(long number, Type[] objectiveRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the objective forms for creating a bunch of new objectives.- Parameters:
number- the number of forms to retrieveobjectiveRecordTypes- array of objective record types to be included in each create operation or an empty list if none- Returns:
- the objective forms
- Throws:
NullArgumentException-objectiveRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createObjectives
CreateResponseList createObjectives(ObjectiveBatchFormList objectiveForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofObjectives. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
objectiveForms- the objective forms- Returns:
- the create responses
- Throws:
NullArgumentException-objectiveFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getObjectiveFormsForUpdate
ObjectiveBatchFormList getObjectiveFormsForUpdate(IdList objectiveIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the objective forms for updating an existing set of objectives. A new objective form should be requested for each update transaction.- Parameters:
objectiveIds- theIdsof theObjective- Returns:
- the objective form
- Throws:
NotFoundException- anobjectiveIdis not foundNullArgumentException-objectiveIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateObjectives
UpdateResponseList updateObjectives(ObjectiveBatchFormList objectiveForms) throws OperationFailedException, PermissionDeniedException Updates existing objectives. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
objectiveForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-objectiveFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllObjectives
Deletes allObjectivesin thisObjectiveBank.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteObjectives
DeleteResponseList deleteObjectives(IdList objectiveIds) throws OperationFailedException, PermissionDeniedException Deletes objectives for the givenIds.- Parameters:
objectiveIds- theIdsof the objectives to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-objectiveIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasObjectives
AliasResponseList aliasObjectives(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto anObjectivefor the purpose of creating compatibility. The primaryIdof theObjectiveis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another objective, it is reassigned to the given objectiveId.- 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.
-