Interface CompositionBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, CompositionAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Compositions 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
Composition , a CompositionForm is requested using
getCompositionFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the returned
CompositionForms 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 CompositionForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CompositionForm corresponds
to an attempted transaction.
The CompositionForms returned from
getCompositionFormsForCreate() may be linked to the originating request
through the peer Ids of the CompositionForm . In the case
where there may be duplicates, any CompositionForm of the same
peer Ids may be used for a create operation.
Once a batch of CompositionForms are submitted for create, a
CreateResponse is returned for each CompositionForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCompositions() ,
errors specific to an individual CompositionForm are indicated in
the corresponding CreateResponse . CreateResponses may be
linked to the originating CompositionForm through the
CompositionForm Id .
For updates, CompositionForms are requested to the
Composition Id that is to be updated using
getCompositionFormsForUpdate() where the reference Id in the
CompositionForm may be used to link the request. Similarly, the
CompositionForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
CompositionForm can only be used once for a successful update and cannot
be reused.
Once a batch of CompositionForms are submitted for update, an
UpdateResponse is returned for each CompositionForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCompositions() ,
errors specific to an individual CompositionForm are indicated in
the corresponding UpdateResponse . UpdateResponses may be
linked to the originating CompositionForm through the
CompositionForm Id .
The delete operations delete Compositions in bulk. To unmap a
Composition from the current Repository , the
CompositionRepositoryAssignmentSession should be used. These delete
operations attempt to remove the Composition itself thus removing
it from all known Repository catalogs. Bulk delete operations
return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCompositions(AliasRequestList aliasRequests) Adds anIdto aCompositionfor the purpose of creating compatibility.createCompositions(CompositionBatchFormList compositionForms) Creates a new set ofCompositions.Deletes allCompositionsin thisRepository.deleteCompositions(IdList compositionIds) Deletes compositions for the givenIds.Deletes compositions expired before the given date.getCompositionFormsForCreate(long number, Type[] compositionRecordTypes) Gets the composition forms for creating a bunch of new compositions.getCompositionFormsForUpdate(IdList compositionIds) Gets the composition forms for updating an existing set of compositions.updateCompositions(CompositionBatchFormList compositionForms) Updates existing compositions.Methods inherited from interface CompositionAdminSession
addCompositionChild, aliasComposition, canCreateCompositions, canCreateCompositionWithRecordTypes, canDeleteCompositions, canManageCompositionAliases, canUpdateCompositions, createComposition, deleteComposition, deleteCompositionNode, getCompositionFormForCreate, getCompositionFormForUpdate, getRepository, getRepositoryId, removeCompositionChild, updateCompositionModifier and TypeMethodDescriptionvoidaddCompositionChild(Id compositionId, Id childCompositionId) Adds a composition to a parent composition.voidaliasComposition(Id compositionId, Id aliasId) Adds anIdto aCompositionfor the purpose of creating compatibility.booleanTests if this user can createCompositions.booleancanCreateCompositionWithRecordTypes(Type[] compositionRecordTypes) Tests if this user can create a singleCompositionusing the desired record types.booleanTests if this user can deleteCompositions.booleanTests if this user can manageIdaliases forCompositions.booleanTests if this user can updateCompositions.createComposition(CompositionForm compositionForm) Creates a newComposition.voiddeleteComposition(Id compositionId) Deletes aComposition.voiddeleteCompositionNode(Id compositionId) Deletes aCompositionand all contained children.getCompositionFormForCreate(Type[] compositionRecordTypes) Gets the composition form for creating new compositions.getCompositionFormForUpdate(Id compositionId) Gets the composition form for updating an existing composition.Gets theRepositoryassociated with this session.Gets theRepositoryIdassociated with this session.voidremoveCompositionChild(Id compositionId, Id childCompositionId) Removes a composition from a parent composition.voidupdateComposition(CompositionForm compositionForm) Updates an existing composition.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
-
getCompositionFormsForCreate
CompositionBatchFormList getCompositionFormsForCreate(long number, Type[] compositionRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the composition forms for creating a bunch of new compositions.- Parameters:
number- the number of forms to retrievecompositionRecordTypes- array of composition record types to be included in each create operation or an empty list if none- Returns:
- the composition forms
- Throws:
NullArgumentException-compositionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCompositions
CreateResponseList createCompositions(CompositionBatchFormList compositionForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCompositions. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
compositionForms- the composition forms- Returns:
- the create responses
- Throws:
NullArgumentException-compositionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCompositionFormsForUpdate
CompositionBatchFormList getCompositionFormsForUpdate(IdList compositionIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the composition forms for updating an existing set of compositions. A new composition form should be requested for each update transaction.- Parameters:
compositionIds- theIdsof theComposition- Returns:
- the composition form
- Throws:
NotFoundException- acompositionIdis not foundNullArgumentException-compositionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCompositions
UpdateResponseList updateCompositions(CompositionBatchFormList compositionForms) throws OperationFailedException, PermissionDeniedException Updates existing compositions. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
compositionForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-compositionFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCompositions
DeleteResponseList deleteAllCompositions() throws OperationFailedException, PermissionDeniedExceptionDeletes allCompositionsin thisRepository.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCompositions
DeleteResponseList deleteCompositions(IdList compositionIds) throws OperationFailedException, PermissionDeniedException Deletes compositions for the givenIds.- Parameters:
compositionIds- theIdsof the compositions to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-compositionIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteIneffectiveCompositionsByDate
DeleteResponseList deleteIneffectiveCompositionsByDate(DateTime date) throws OperationFailedException, PermissionDeniedException Deletes compositions expired before the given date.- Parameters:
date- a date- Returns:
- the delete responses
- Throws:
NullArgumentException-dateisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCompositions
AliasResponseList aliasCompositions(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCompositionfor the purpose of creating compatibility. The primaryIdof theCompositionis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another composition, it is reassigned to the given compositionId.- 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.
-