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

This session creates, updates, and deletes Races. 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 getRaceFormForCreate() specifying the Ballot and desired record Types or none if no record Types are needed. The returned RaceForm 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 the 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.

For updates, RaceForms are requested to the Race Id that is to be updated using getRaceFormForUpdate(). 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.

The delete operations delete Races. 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.

This session includes an Id aliasing mechanism to assign an external Id to an internally assigned Id.

MethodgetPollsId
Description

Gets the Polls Id associated with this session.

Returnosid.id.Idthe Polls Id associated with this session
CompliancemandatoryThis method must be implemented.
MethodgetPolls
Description

Gets the Polls associated with this session.

Returnosid.voting.Pollsthe Polls associated with this session
ErrorsOPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanCreateRaces
Description

Tests if this user can create Races A return of true does not guarantee successful authorization. A return of false indicates that it is known creating a Race will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.

Returnboolean false if Race creation is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodcanCreateRaceWithRecordTypes
Description

Tests if this user can create a single Race using the desired record types. While VotingManager.getRaceRecordTypes() can be used to examine which records are supported, this method tests which record(s) are required for creating a specific Race. Providing an empty array tests if a Race can be created with no records.

Parametersosid.type.Type[]raceRecordTypesarray of race record types
Returnboolean true if Race creation using the specified record Types is supported, false otherwise
ErrorsNULL_ARGUMENT raceRecordTypes is null
CompliancemandatoryThis method must be implemented.
MethodgetRaceFormForCreate
Description

Gets the race form for creating new races. A new form should be requested for each create transaction.

Parametersosid.id.IdballotIda ballot Id
osid.type.Type[]raceRecordTypesarray of race record types
Returnosid.voting.RaceFormthe race form
ErrorsNOT_FOUND raceId is not found
NULL_ARGUMENT raceId or raceRecordTypes is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTEDunable to get form with requested record types
CompliancemandatoryThis method must be implemented.
MethodcreateRace
Description

Creates a new Race.

Parametersosid.voting.RaceFormraceFormthe form for this Race
Returnosid.voting.Racethe new Race
ErrorsILLEGAL_STATE raceForm already used in a create transaction
INVALID_ARGUMENTone or more of the form elements is invalid
NULL_ARGUMENT raceForm is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED raceForm did not originate from getRaceFormForCreate()
CompliancemandatoryThis method must be implemented.
MethodcanUpdateRaces
Description

Tests if this user can update Races. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating a Race will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.

Returnboolean false if Race modification is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodgetRaceFormForUpdate
Description

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

Parametersosid.id.IdraceIdthe Id of the Race
Returnosid.voting.RaceFormthe race form
ErrorsNOT_FOUND raceId is not found
NULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodupdateRace
Description

Updates an existing race.

Parametersosid.voting.RaceFormraceFormthe form containing the elements to be updated
ErrorsILLEGAL_STATE raceForm already used in an update transaction
INVALID_ARGUMENTthe form contains an invalid value
NULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
UNSUPPORTED raceForm did not originate from getRaceFormForUpdate()
CompliancemandatoryThis method must be implemented.
MethodcanDeleteRaces
Description

Tests if this user can delete Races. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting a Race will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.

Returnboolean false if Race deletion is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethoddeleteRace
Description

Deletes a Race.

Parametersosid.id.IdraceIdthe Id of the Race to remove
ErrorsNOT_FOUND raceId is not found
NULL_ARGUMENT raceId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.
MethodcanManageRaceAliases
Description

Tests if this user can manage Id aliases for Races. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in a PERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.

Returnboolean false if Race aliasing is not authorized, true otherwise
CompliancemandatoryThis method must be implemented.
MethodaliasRace
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 performs as an alias to the primary Id. If the alias is a pointer to another race, it is reassigned to the given race Id.

Parametersosid.id.IdraceIdthe Id of a Race
osid.id.IdaliasIdthe alias Id
ErrorsALREADY_EXISTS aliasId is already assigned
NOT_FOUND raceId not found
NULL_ARGUMENT raceId or aliasId is null
OPERATION_FAILEDunable to complete request
PERMISSION_DENIEDauthorization failure
CompliancemandatoryThis method must be implemented.