Interface MapBatchAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, MapAdminSession, OsidSession, OsidSession
This session creates, updates, and deletes Maps 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
Map , a MapForm is requested using getMapFormsForCreate()
specifying the desired record Types or none if no record
Types are needed. Each of the returned MapForms 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 MapForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
MapForm corresponds to an attempted transaction.
The MapForms returned from getMapFormsForCreate() may
be linked to the originating request through the peer Ids of the
MapForm . In the case where there may be duplicates, any
MapForm of the same peer Ids may be used for a create operation.
Once a batch of MapForms are submitted for create, a
CreateResponse is returned for each MapForm , although the
ordering is not defined. Only errors that pertain to the entire create
operation are returned from createMaps() , errors specific to an
individual MapForm are indicated in the corresponding
CreateResponse . CreateResponses may be linked to the originating
MapForm through the MapForm Id .
For updates, MapForms are requested to the Map
Id that is to be updated using getMapFormsForUpdate() where the
reference Id in the MapForm may be used to link the
request. Similarly, the MapForm has metadata about the data that
can be updated and it can perform validation before submitting the update.
The MapForm can only be used once for a successful update and
cannot be reused.
Once a batch of MapForms are submitted for update, an
UpdateResponse is returned for each MapForm , although the
ordering is not defined. Only errors that pertain to the entire update
operation are returned from updateMaps() , errors specific to an
individual MapForm are indicated in the corresponding
UpdateResponse . UpdateResponses may be linked to the originating
MapForm through the MapForm Id .
The delete operations delete Maps in bulk. Bulk delete
operations return the results in DeleteResponses .
-
Method Summary
Modifier and TypeMethodDescriptionaliasMaps(AliasRequestList aliasRequests) Adds anIdto aMapfor the purpose of creating compatibility.createMaps(MapBatchFormList mapForms) Creates a new set ofMaps.Deletes allMaps.deleteMaps(IdList mapIds) Deletes maps for the givenIds.getMapFormsForCreate(long number, Type[] mapRecordTypes) Gets the map forms for creating a bunch of new maps.getMapFormsForUpdate(IdList mapIds) Gets the map forms for updating an existing set of maps.updateMaps(MapBatchFormList mapForms) Updates existing maps.Methods inherited from interface MapAdminSession
aliasMap, canCreateMaps, canCreateMapWithRecordTypes, canDeleteMaps, canManageMapAliases, canUpdateMaps, createMap, deleteMap, getMapFormForCreate, getMapFormForUpdate, updateMapModifier and TypeMethodDescriptionvoidAdds anIdto aMapfor the purpose of creating compatibility.booleanTests if this user can createMaps.booleancanCreateMapWithRecordTypes(Type[] mapRecordTypes) Tests if this user can create a singleMapusing the desired record types.booleanTests if this user can deleteMaps.booleanTests if this user can manageIdaliases forMaps.booleanTests if this user can updateMaps.Creates a newMap.voidDeletes aMap.getMapFormForCreate(Type[] mapRecordTypes) Gets the map form for creating new maps.getMapFormForUpdate(Id mapId) Gets the map form for updating an existing map.voidUpdates an existing mapMethods 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
-
getMapFormsForCreate
MapBatchFormList getMapFormsForCreate(long number, Type[] mapRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the map forms for creating a bunch of new maps.- Parameters:
number- the number of forms to retrievemapRecordTypes- array of map record types to be included in each create operation or an empty list if none- Returns:
- the map forms
- Throws:
NullArgumentException-mapRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to request forms with given record types- Compliance:
mandatory- This method must be implemented.
-
createMaps
CreateResponseList createMaps(MapBatchFormList mapForms) throws OperationFailedException, PermissionDeniedException Creates a new set ofMaps. This method returns an error if the entire operation fails. Otherwise, the status of an individual create operation is indicated in theBatchCreateResponse.- Parameters:
mapForms- the map forms- Returns:
- the create responses
- Throws:
NullArgumentException-mapFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMapFormsForUpdate
MapBatchFormList getMapFormsForUpdate(IdList mapIds) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the map forms for updating an existing set of maps. A new map form should be requested for each update transaction.- Parameters:
mapIds- theIdsof theMap- Returns:
- the map form
- Throws:
NotFoundException- amapIdis not foundNullArgumentException-mapIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateMaps
UpdateResponseList updateMaps(MapBatchFormList mapForms) throws OperationFailedException, PermissionDeniedException Updates existing maps. This method returns an error if the entire operation fails. Otherwise, the status of an individual update operation is indicated in theBatchCreateResponse.- Parameters:
mapForms- the form containing the elements to be updated- Returns:
- the update responses
- Throws:
NullArgumentException-mapFormsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteAllMaps
Deletes allMaps.- Returns:
- the delete responses
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
deleteMaps
DeleteResponseList deleteMaps(IdList mapIds) throws OperationFailedException, PermissionDeniedException Deletes maps for the givenIds.- Parameters:
mapIds- theIdsof the maps to delete- Returns:
- the delete responses
- Throws:
NullArgumentException-mapIdsisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
aliasMaps
AliasResponseList aliasMaps(AliasRequestList aliasRequests) throws OperationFailedException, PermissionDeniedException Adds anIdto aMapfor the purpose of creating compatibility. The primaryIdof theMapis determined by the provider. The newIdis an alias to the primaryId. If the alias is a pointer to another map, it is reassigned to the given mapId.- 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.
-