public interface ObstacleAdminSession extends OsidSession
This session creates, updates, and deletes Obstacles.
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 an
Obstacle, an ObstacleForm is requested using
getObstacleFormForCreate() specifying the desired record
Types or none if no record Types are needed.
The returned ObstacleForm 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 ObstacleForm is
submiited to a create operation, it cannot be reused with another create
operation unless the first operation was unsuccessful. Each
ObstacleForm corresponds to an attempted transaction.
For updates, ObstacleForms are requested to the
Obstacle Id that is to be updated using
getObstacleFormForUpdate(). Similarly, the ObstacleForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The ObstacleForm
can only be used once for a successful update and cannot be reused.
The delete operations delete Obstacles. To unmap an
Obstacle from the current Map, the
ObstacleMapAssignmentSession should be used. These delete
operations attempt to remove the Obstacle itself thus
removing it from all known Map catalogs.
This session includes an Id aliasing mechanism to
assign an external Id to an internally assigned Id.
| Modifier and Type | Method and Description |
|---|---|
void |
aliasObstacle(Id obstacleId,
Id aliasId)
Adds an
Id to an Obstacle for the
purpose of creating compatibility. |
boolean |
canCreateObstacles()
Tests if this user can create
Obstacles. |
boolean |
canCreateObstacleWithRecordTypes(Type[] obstacleRecordTypes)
Tests if this user can create a single
Obstacle using
the desired record types. |
boolean |
canDeleteObstacles()
Tests if this user can delete
Obstacles. |
boolean |
canManageObstacleAliases()
Tests if this user can manage
Id aliases for
Obstacles. |
boolean |
canUpdateObstacles()
Tests if this user can update
Obstacles. |
Obstacle |
createObstacle(ObstacleForm obstacleForm)
Creates a new
Obstacle. |
void |
deleteObstacle(Id obstacleId)
Deletes an
Obstacle. |
Map |
getMap()
Gets the
Map associated with this session. |
Id |
getMapId()
Gets the
Map Id associated with this
session. |
ObstacleForm |
getObstacleFormForCreate(Id pathId,
Type[] obstacleRecordTypes)
Gets the obstable form for creating new obstables.
|
ObstacleForm |
getObstacleFormForUpdate(Id obstacleId)
Gets the obstable form for updating an existing obstable.
|
void |
updateObstacle(ObstacleForm obstacleForm)
Updates an existing obstable.
|
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactionscloseId getMapId()
Map Id associated with this
session. Map Id associated with this sessionmandatory - This method must be implemented. Map getMap() throws OperationFailedException, PermissionDeniedException
Map associated with this session.OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canCreateObstacles()
Obstacles. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known creating an Obstacle 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. false if Obstacle creation is
not authorized, true otherwisemandatory - This method must be implemented. boolean canCreateObstacleWithRecordTypes(Type[] obstacleRecordTypes)
Obstacle using
the desired record types. While
MappingPathManager.getObstacleRecordTypes() can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Obstacle.
Providing an empty array tests if an Obstacle can be
created with no records.obstacleRecordTypes - array of obstacle record types true if Obstacle creation using
the specified record Types is supported,
false otherwiseNullArgumentException - obstacleRecordTypes
is null mandatory - This method must be implemented. ObstacleForm getObstacleFormForCreate(Id pathId, Type[] obstacleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
pathId - the Id of the pathobstacleRecordTypes - array of obstacle record typesNotFoundException - pathId is not foundNullArgumentException - pathId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - unable to get form with given
record typesmandatory - This method must be implemented. Obstacle createObstacle(ObstacleForm obstacleForm) throws OperationFailedException, PermissionDeniedException
Obstacle. obstacleForm - the form for this Obstacle Obstacle IllegalStateException - obstacleForm
already used in a create transactionInvalidArgumentException - one or more of the form
elements is invalidNullArgumentException - pathId or
obstacleForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - obstacleForm did
not originate from getObstacleFormForCreate() mandatory - This method must be implemented. boolean canUpdateObstacles()
Obstacles. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known updating an Obstacle 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. false if Obstacle modification
is not authorized, true otherwisemandatory - This method must be implemented. ObstacleForm getObstacleFormForUpdate(Id obstacleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
obstacleId - the Id of the Obstacle
NotFoundException - obstacleId is not
foundNullArgumentException - obstacleId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. void updateObstacle(ObstacleForm obstacleForm) throws OperationFailedException, PermissionDeniedException
obstacleForm - the form containing the elements to be updatedIllegalStateException - obstacleForm
already used in an update transactionInvalidArgumentException - the form contains an invalid
valueNullArgumentException - obstacleId or
obstableForm is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failureUnsupportedException - obstacleForm did
not originate from getObstacleFormForUpdate() mandatory - This method must be implemented. boolean canDeleteObstacles()
Obstacles. A return of
true does not guarantee successful authorization. A return of false
indicates that it is known deleting an Obstacle 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. false if Obstacle deletion is
not authorized, true otherwisemandatory - This method must be implemented. void deleteObstacle(Id obstacleId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Obstacle. obstacleId - the Id of the Obstacle
to removeNotFoundException - obstacleId not foundNullArgumentException - obstacleId is
null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented. boolean canManageObstacleAliases()
Id aliases for
Obstacles. 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 Obstacle aliasing is
not authorized, true otherwisemandatory - This method must be implemented. void aliasObstacle(Id obstacleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id to an Obstacle for the
purpose of creating compatibility. The primary Id of
the Obstacle is determined by the provider. The new
Id performs as an alias to the primary Id
. If the alias is a pointer to another obstabce, it is
reassigned to the given obstacle Id. obstacleId - the Id of an Obstacle aliasId - the alias Id AlreadyExistsException - aliasId is
already assignedNotFoundException - obstacleId not foundNullArgumentException - obstacleId or
aliasId is null OperationFailedException - unable to complete requestPermissionDeniedException - authorization failuremandatory - This method must be implemented.