public interface MapAdminSession extends OsidSession
This session creates, updates, and deletes Maps.
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
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.
Modifier and Type | Method and Description |
---|---|
void |
aliasMap(Id mapId,
Id aliasId)
Adds an
Id to a Map for the purpose of
creating compatibility. |
boolean |
canCreateMaps()
Tests if this user can create
Maps. |
boolean |
canCreateMapWithRecordTypes(Type[] mapRecordTypes)
Tests if this user can create a single
Map using the
desired record types. |
boolean |
canDeleteMaps()
Tests if this user can delete
Maps. |
boolean |
canManageMapAliases()
Tests if this user can manage
Id aliases for
Maps. |
boolean |
canUpdateMaps()
Tests if this user can update
Maps. |
Map |
createMap(MapForm mapForm)
Creates a new
Map. |
void |
deleteMap(Id mapId)
Deletes a
Map. |
MapForm |
getMapFormForCreate(Type[] mapRecordTypes)
Gets the map form for creating new maps.
|
MapForm |
getMapFormForUpdate(Id mapId)
Gets the map form for updating an existing map.
|
void |
updateMap(MapForm mapForm)
Updates an existing map
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
boolean canCreateMaps()
Maps.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Map.
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer create operations to
unauthorized users. false
if Map
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateMapWithRecordTypes(Type[] mapRecordTypes)
Map
using the
desired record types. While MappingManager.getMapRecordTypes()
can be used to examine which records are supported, this
method tests which record(s) are required for creating a specific
Map.
Providing an empty array tests if a Map
can be created with no records.mapRecordTypes
- array of map record types true
if Map
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- mapRecordTypes
is null
mandatory
- This method must be implemented. MapForm getMapFormForCreate(Type[] mapRecordTypes) throws OperationFailedException, PermissionDeniedException
mapRecordTypes
- array of map record typesNullArgumentException
- mapRecordTypes
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get a form with given
record typesmandatory
- This method must be implemented. Map createMap(MapForm mapForm) throws OperationFailedException, PermissionDeniedException
Map.
mapForm
- the form for this Map
Map
IllegalStateException
- mapForm
already
used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- mapForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- mapForm
did not
originate from getMapFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateMaps()
Maps.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Map
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer update operations to
unauthorized users. false
if Map
modification is not
authorized, true
otherwisemandatory
- This method must be implemented. MapForm getMapFormForUpdate(Id mapId) throws NotFoundException, OperationFailedException, PermissionDeniedException
mapId
- the Id
of the Map
NotFoundException
- mapId
is not foundNullArgumentException
- mapId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateMap(MapForm mapForm) throws OperationFailedException, PermissionDeniedException
mapForm
- the form containing the elements to be updatedIllegalStateException
- mapForm
already
used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- mapId
or
mapForm
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- mapForm
did not
originate from getMapFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteMaps()
Maps.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Map
will result
in a PERMISSION_DENIED.
This is intended as a hint to
an application that may not wish to offer delete operations to
unauthorized users. false
if Map
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteMap(Id mapId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Map.
mapId
- the Id
of the Map
to
removeNotFoundException
- mapId
not foundNullArgumentException
- mapId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageMapAliases()
Id
aliases for
Maps.
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. false
if Map
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasMap(Id mapId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Map
for the purpose of
creating compatibility. The primary Id
of the
Map
is determined by the provider. The new Id
performs as an alias to the primary Id.
If the alias is
a pointer to another map, it is reassigned to the given map Id.
mapId
- the Id
of a Map
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- mapId
not foundNullArgumentException
- mapId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.