Interface CanonicalUnitBatchAdminSession
- All Superinterfaces:
AutoCloseable, CanonicalUnitAdminSession, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes CanonicalUnits 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
CanonicalUnit , a CanonicalUnitForm is requested using
getCanonicalUnitFormsForCreate() specifying the desired record
Types or none if no record Types are needed. Each of the returned
CanonicalUnitForms 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 CanonicalUnitForm is submiited to a create
operation, it cannot be reused with another create operation unless the
first operation was unsuccessful. Each CanonicalUnitForm
corresponds to an attempted transaction.
The CanonicalUnitForms returned from
getCanonicalUnitFormsForCreate() may be linked to the originating request
through the peer Ids of the CanonicalUnitForm . In the
case where there may be duplicates, any CanonicalUnitForm of the
same peer Ids may be used for a create operation.
Once a batch of CanonicalUnitForms are submitted for create, a
CreateResponse is returned for each CanonicalUnitForm ,
although the ordering is not defined. Only errors that pertain to the
entire create operation are returned from createCanonicalUnits() ,
errors specific to an individual CanonicalUnitForm are indicated
in the corresponding CreateResponse . CreateResponses may
be linked to the originating CanonicalUnitForm through the
CanonicalUnitForm Id .
For updates, CanonicalUnitForms are requested to the
CanonicalUnit Id that is to be updated using
getCanonicalUnitFormsForUpdate() where the reference Id in the
CanonicalUnitForm may be used to link the request. Similarly, the
CanonicalUnitForm has metadata about the data that can be updated
and it can perform validation before submitting the update. The
CanonicalUnitForm can only be used once for a successful update and
cannot be reused.
Once a batch of CanonicalUnitForms are submitted for update,
an UpdateResponse is returned for each CanonicalUnitForm ,
although the ordering is not defined. Only errors that pertain to the
entire update operation are returned from updateCanonicalUnits() ,
errors specific to an individual CanonicalUnitForm are indicated
in the corresponding UpdateResponse . UpdateResponses may
be linked to the originating CanonicalUnitForm through the
CanonicalUnitForm Id .
The delete operations delete CanonicalUnits in bulk. To unmap
a CanonicalUnit from the current Catalogue , the
CanonicalUnitCatalogueAssignmentSession should be used. These delete
operations attempt to remove the CanonicalUnit itself thus
removing it from all known Catalogue catalogs. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasCanonicalUnits(AliasRequestList aliasRequests) Adds anIdto aCanonicalUnitfor the purpose of creating compatibility.createCanonicalUnits(CanonicalUnitBatchFormList canonicalUnitForms) Creates a new set ofCanonicalUnits.Deletes allCanonicalUnitsin thisCatalogue.deleteCanonicalUnits(IdList canonicalUnitIds) Deletes canonicalUnits for the givenIds.getCanonicalUnitFormsForCreate(long number, Type[] canonicalUnitRecordTypes) Gets the canonical unit forms for creating a bunch of new canonical units.getCanonicalUnitFormsForUpdate(IdList canonicalUnitIds) Gets the canonical unit forms for updating an existing set of canonicalUnits.updateCanonicalUnits(CanonicalUnitBatchFormList canonicalUnitForms) Updates existing canonical units.Methods inherited from interface CanonicalUnitAdminSession
aliasCanonicalUnit, canCreateCanonicalUnits, canCreateCanonicalUnitWithRecordTypes, canDeleteCanonicalUnits, canManageCanonicalUnitAliases, canUpdateCanonicalUnits, createCanonicalUnit, deleteCanonicalUnit, getCanonicalUnitFormForCreate, getCanonicalUnitFormForUpdate, getCatalogue, getCatalogueId, updateCanonicalUnitModifier and TypeMethodDescriptionvoidaliasCanonicalUnit(Id canonicalUnitId, Id aliasId) Adds anIdto aCanonicalUnitfor the purpose of creating compatibility.booleanTests if this user can create canonical units.booleancanCreateCanonicalUnitWithRecordTypes(Type[] canonicalUnitRecordTypes) Tests if this user can create a singleCanonicalUnitusing the desired record types.booleanTests if this user can delete canonical units.booleanTests if this user can manageIdaliases forCanonicalUnits.booleanTests if this user can update canonical units.createCanonicalUnit(CanonicalUnitForm canonicalUnitForm) Creates a newCanonicalUnit.voiddeleteCanonicalUnit(Id canonicalUnitId) Deletes aCanonicalUnit.getCanonicalUnitFormForCreate(Type[] canonicalUnitRecordTypes) Gets the canonical unit form for creating new canonical units.getCanonicalUnitFormForUpdate(Id canonicalUnitId) Gets the canonical unit form for updating an existing canonical unit.Gets theCatalogueassociated with this session.Gets theCatalogueIdassociated with this session.voidupdateCanonicalUnit(CanonicalUnitForm canonicalUnitForm) Updates an existing canonical unit.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
-
getCanonicalUnitFormsForCreate
CanonicalUnitBatchFormList getCanonicalUnitFormsForCreate(long number, Type[] canonicalUnitRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the canonical unit forms for creating a bunch of new canonical units.- Parameters:
number- the number of forms to retrievecanonicalUnitRecordTypes- array of canonical unit record types to be included in each create operation or an empty list if none- Returns:
- the canonical unit forms
- Throws:
NullArgumentException-canonicalUnitRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createCanonicalUnits
CreateResponseList createCanonicalUnits(CanonicalUnitBatchFormList canonicalUnitForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofCanonicalUnits. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
canonicalUnitForms- the canonical unit forms- Returns:
- the create responses
- Throws:
NullArgumentException-canonicalUnitFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getCanonicalUnitFormsForUpdate
CanonicalUnitBatchFormList getCanonicalUnitFormsForUpdate(IdList canonicalUnitIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the canonical unit forms for updating an existing set of canonicalUnits. A new canonical unit form should be requested for each update transaction.- Parameters:
canonicalUnitIds- theIdsof theCanonicalUnit- Returns:
- the canonical unit form
- Throws:
NotFoundException- acanonicalUnitIdis not foundNullArgumentException-canonicalUnitIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateCanonicalUnits
UpdateResponseList updateCanonicalUnits(CanonicalUnitBatchFormList canonicalUnitForms) throws OperationFailedException, PermissionDeniedException Updates existing canonical units. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
canonicalUnitForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-canonicalUnitFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllCanonicalUnits
DeleteResponseList deleteAllCanonicalUnits() throws OperationFailedException, PermissionDeniedExceptionDeletes allCanonicalUnitsin thisCatalogue.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteCanonicalUnits
DeleteResponseList deleteCanonicalUnits(IdList canonicalUnitIds) throws OperationFailedException, PermissionDeniedException Deletes canonicalUnits for the givenIds.- Parameters:
canonicalUnitIds- theIdsof the canonical units to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-canonicalUnitIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasCanonicalUnits
AliasResponseList aliasCanonicalUnits(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aCanonicalUnitfor the purpose of creating compatibility. The primaryIdof theCanonicalUnitis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another canonical unit, it is reassigned to the given canonical unitId.- 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.
-