OSID Logo
OSID Specifications
resource batch package
Version 3.0.0
Release Candidate Preview
Interfaceosid.resource.batch.BinBatchAdminSession
Implementsosid.resource.BinAdminSession
Description

This session creates, updates, and deletes Bins 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 Bin, an BinForm is requested using getBinFormsForCreate() specifying the desired record Types or none if no record Types are needed. Each of the returned BinForms 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 BinForm is submiited to a create operation, it cannot be reused with another create operation unless the first operation was unsuccessful. Each BinForm corresponds to an attempted transaction.

The BinForms returned from getBinFormsForCreate() may be linked to the originating request through the peer Ids of the BinForm. In the case where there may be duplicates, any BinForm of the same peer Ids may be used for a create operation.

Once a batch of BinForms are submitted for create, a CreateResponse is returned for each BinForm, although the ordering is not defined. Only errors that pertain to the entire create operation are returned from createBins(), errors specific to an individual BinForm are indicated in the corresponding CreateResponse. CreateResponses may be linked to the originating BinForm through the BinForm Id .

For updates, BinForms are requested to the Bin Id that is to be updated using getBinFormsForUpdate() where the reference Id in the BinForm may be used to link the request. Similarly, the BinForm has metadata about the data that can be updated and it can perform validation before submitting the update. The BinForm can only be used once for a successful update and cannot be reused.

Once a batch of BinForms are submitted for update, an UpdateResponse is returned for each BinForm, although the ordering is not defined. Only errors that pertain to the entire update operation are returned from updateBins(), errors specific to an individual BinForm are indicated in the corresponding UpdateResponse. UpdateResponses may be linked to the originating BinForm through the BinForm Id.

The delete operations delete Bins in bulk. Bulk delete operations return the results in DeleteResponses.

MethodgetBinFormsForCreate
Description

Gets the bin forms for creating a bunch of new bins.

Parameterscardinalnumberthe number of forms to retrieve
osid.type.Type[]binRecordTypesarray of bin record types to be included in each create operation or an empty list if none
Returnosid.resource.batch.BinBatchFormListthe bin forms
ErrorsNULL_ARGUMENT binRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to request forms with given record types
CompliancemandatoryThis method must be implemented.
MethodcreateBins
Description

Creates a new set of Bins. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in the BatchCreateResponse .

Parametersosid.resource.batch.BinBatchFormListbinFormsthe bin forms
Returnosid.transaction.batch.CreateResponseListthe create responses
ErrorsNULL_ARGUMENT binForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetBinFormsForUpdate
Description

Gets the bin forms for updating an existing set of bins. A new bin form should be requested for each update transaction.

Parametersosid.id.IdListbinIdsthe Ids of the Bin
Returnosid.resource.batch.BinBatchFormListthe bin form
ErrorsNOT_FOUNDan binId is not found
NULL_ARGUMENT binIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateBins
Description

Updates existing bins. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in the BatchCreateResponse .

Parametersosid.resource.batch.BinBatchFormListbinFormsthe form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseListthe update responses
ErrorsNULL_ARGUMENT binForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteAllBins
Description

Deletes all Bins.

Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteBins
Description

Deletes bins for the given Ids.

Parametersosid.id.IdListbinIdsthe Ids of the bins to delete
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT binIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaliasBins
Description

Adds an Id to an Bin for the purpose of creating compatibility. The primary Id of the Bin is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another bin, it is reassigned to the given entry Id.

Parametersosid.transaction.batch.AliasRequestListaliasRequeststhe alias requests
Returnosid.transaction.batch.AliasResponseListthe alias responses
ErrorsNULL_ARGUMENT aliasRequests is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.