Interface MapAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
MapBatchAdminSession
This session creates, updates, and deletes Maps . The data for
create and update is provided by the consumer via the form.
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 getMapFormForCreate()
specifying the desired record Types or none if no record
Types are needed. The returned MapForm 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 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.
For updates, MapForms are requested to the Map
Id that is to be updated using getMapFormForUpdate() . 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.
The delete operations delete Maps .
This session includes an Id aliasing mechanism to assign an
external Id to an internally assigned Id.
-
Method Summary
Modifier 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
-
canCreateMaps
boolean canCreateMaps()Tests if this user can createMaps. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aMap. will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer create operations to unauthorized users.- Returns:
falseifMapcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateMapWithRecordTypes
Tests if this user can create a singleMapusing the desired record types. WhileMappingManager.getMapRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificMap. Providing an empty array tests if aMapcan be created with no records.- Parameters:
mapRecordTypes- array of map record types- Returns:
trueifMapcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-mapRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getMapFormForCreate
MapForm getMapFormForCreate(Type[] mapRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the map form for creating new maps. A new form should be requested for each create transaction.- Parameters:
mapRecordTypes- array of map record types- Returns:
- the map form
- Throws:
NullArgumentException-mapRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get a form with given record types- Compliance:
mandatory- This method must be implemented.
-
createMap
Creates a newMap.- Parameters:
mapForm- the form for thisMap- Returns:
- the new
Map - Throws:
IllegalStateException-mapFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-mapFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-mapFormdid not originate fromgetMapFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateMaps
boolean canUpdateMaps()Tests if this user can updateMaps. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aMapwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer update operations to unauthorized users.- Returns:
falseifMapmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getMapFormForUpdate
MapForm getMapFormForUpdate(Id mapId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the map form for updating an existing map. A new map form should be requested for each update transaction.- Parameters:
mapId- theIdof theMap- Returns:
- the map form
- Throws:
NotFoundException-mapIdis not foundNullArgumentException-mapIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateMap
Updates an existing map- Parameters:
mapForm- the form containing the elements to be updated- Throws:
IllegalStateException-mapFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-mapIdormapFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-mapFormdid not originate fromgetMapFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteMaps
boolean canDeleteMaps()Tests if this user can deleteMaps. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aMapwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may not wish to offer delete operations to unauthorized users.- Returns:
falseifMapdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteMap
void deleteMap(Id mapId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aMap.- Parameters:
mapId- theIdof theMapto remove- Throws:
NotFoundException-mapIdnot foundNullArgumentException-mapIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageMapAliases
boolean canManageMapAliases()Tests if this user can manageIdaliases forMaps. A return of true does not guarantee successful authorization. A return of false indicates that it is known changing an alias will result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer alias operations to an unauthorized user.- Returns:
falseifMapaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasMap
void aliasMap(Id mapId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aMapfor the purpose of creating compatibility. The primaryIdof theMapis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another map, it is reassigned to the given mapId.- Parameters:
mapId- theIdof aMapaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-mapIdnot foundNullArgumentException-mapIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-