OSID Logo
OSID Specifications
voting batch package
Version 3.0.0
Release Candidate Preview
Interfaceosid.voting.batch.RaceBatchAdminSession
Implementsosid.voting.RaceAdminSession
Description

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

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

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

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

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

The delete operations delete Races in bulk. To unmap a Race from the current Polls, the RacePollsAssignmentSession should be used. These delete operations attempt to remove the Race itself thus removing it from all known Polls catalogs. Bulk delete operations return the results in DeleteResponses.

MethodgetRaceFormsForCreate
Description

Gets the race forms for creating a bunch of new races. A RaceForm is returned for each ballot Id.

Parametersosid.id.IdListballotIdsan Id of a ballot
osid.type.Type[]raceRecordTypesarray of race record types to be included in each create operation or an empty list if none
Returnosid.voting.batch.RaceBatchFormListthe race forms
ErrorsNOT_FOUNDa ballotId is not found
NULL_ARGUMENT ballotId or raceRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to request forms with given record types
CompliancemandatoryThis method must be implemented.
MethodcreateRaces
Description

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

Parametersosid.voting.batch.RaceBatchFormListraceFormsthe race forms
Returnosid.transaction.batch.CreateResponseListthe create responses
ErrorsNULL_ARGUMENT raceForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodgetRaceFormsForUpdate
Description

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

Parametersosid.id.IdListraceIdsthe Ids of the Race
Returnosid.voting.batch.RaceBatchFormListthe race form
ErrorsNOT_FOUNDa raceId is not found
NULL_ARGUMENT raceIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateRaces
Description

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

Parametersosid.voting.batch.RaceBatchFormListraceFormsthe form containing the elements to be updated
Returnosid.transaction.batch.UpdateResponseListthe update responses
ErrorsNULL_ARGUMENT raceForms is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteAllRaces
Description

Deletes all Races in this Polls .

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

Deletes races for the given Ids.

Parametersosid.id.IdListraceIdsthe Ids of the races to delete
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT raceIds is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethoddeleteRacesForBallot
Description

Deletes all races for the given ballot.

Parametersosid.id.IdballotIdan Id of a ballot
Returnosid.transaction.batch.DeleteResponseListthe delete responses
ErrorsNULL_ARGUMENT ballotId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodaliasRaces
Description

Adds an Id to a Race for the purpose of creating compatibility. The primary Id of the Race is determined by the provider. The new Id is an alias to the primary Id. If the alias is a pointer to another race, it is reassigned to the given race 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.