public interface RaceBatchAdminSession extends RaceAdminSession
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.
| Modifier and Type | Method and Description |
|---|---|
AliasResponseList |
aliasRaces(AliasRequestList aliasRequests)
Adds an
Id to a Race for the purpose of
creating compatibility. |
CreateResponseList |
createRaces(RaceBatchFormList raceForms)
Creates a new set of
Races. |
DeleteResponseList |
deleteAllRaces()
Deletes all
Races in this Polls . |
DeleteResponseList |
deleteRaces(IdList raceIds)
Deletes races for the given
Ids. |
DeleteResponseList |
deleteRacesForBallot(Id ballotId)
Deletes all races for the given ballot.
|
RaceBatchFormList |
getRaceFormsForCreate(IdList ballotIds,
Type[] raceRecordTypes)
Gets the race forms for creating a bunch of new races.
|
RaceBatchFormList |
getRaceFormsForUpdate(IdList raceIds)
Gets the race forms for updating an existing set of races.
|
UpdateResponseList |
updateRaces(RaceBatchFormList raceForms)
Updates existing races.
|
aliasRace, canCreateRaces, canCreateRaceWithRecordTypes, canDeleteRaces, canManageRaceAliases, canUpdateRaces, createRace, deleteRace, getPolls, getPollsId, getRaceFormForCreate, getRaceFormForUpdate, updateRacegetAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseRaceBatchFormList getRaceFormsForCreate(IdList ballotIds, Type[] raceRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
Id. ballotIds - an Id of a ballotraceRecordTypes - array of race record types to be included in
each create operation or an empty list if noneNotFoundException - a ballotId is not
foundNullArgumentException - ballotId or
raceRecordTypes is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to request forms with
given record typesmandatory - This method must be implemented. CreateResponseList createRaces(RaceBatchFormList raceForms) throws OperationFailedException, PermissionDeniedException
Races. This method returns an
error if the entire operation fails. Otherwise, the status of an
individual create operation is indicated in the
BatchCreateResponse .raceForms - the race formsNullArgumentException - raceForms is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. RaceBatchFormList getRaceFormsForUpdate(IdList raceIds) throws NotFoundException, OperationFailedException, PermissionDeniedException
raceIds - the Ids of the Race NotFoundException - a raceId is not
foundNullArgumentException - raceIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. UpdateResponseList updateRaces(RaceBatchFormList raceForms) throws OperationFailedException, PermissionDeniedException
BatchCreateResponse .raceForms - the form containing the elements to be updatedNullArgumentException - raceForms is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteAllRaces() throws OperationFailedException, PermissionDeniedException
Races in this Polls .OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteRaces(IdList raceIds) throws OperationFailedException, PermissionDeniedException
Ids. raceIds - the Ids of the races to deleteNullArgumentException - raceIds is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. DeleteResponseList deleteRacesForBallot(Id ballotId) throws OperationFailedException, PermissionDeniedException
ballotId - an Id of a ballotNullArgumentException - ballotId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. AliasResponseList aliasRaces(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException
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.
aliasRequests - the alias requestsNullArgumentException - aliasRequests is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.