Interface ObstacleAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
ObstacleBatchAdminSession
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.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaliasObstacle(Id obstacleId, Id aliasId) Adds anIdto anObstaclefor the purpose of creating compatibility.booleanTests if this user can createObstacles.booleancanCreateObstacleWithRecordTypes(Type[] obstacleRecordTypes) Tests if this user can create a singleObstacleusing the desired record types.booleanTests if this user can deleteObstacles.booleanTests if this user can manageIdaliases forObstacles.booleanTests if this user can updateObstacles.createObstacle(ObstacleForm obstacleForm) Creates a newObstacle.voiddeleteObstacle(Id obstacleId) Deletes anObstacle.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.getObstacleFormForCreate(Id pathId, Type[] obstacleRecordTypes) Gets the obstable form for creating new obstables.getObstacleFormForUpdate(Id obstacleId) Gets the obstable form for updating an existing obstable.voidupdateObstacle(ObstacleForm obstacleForm) Updates an existing obstable.Methods 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
-
getMapId
Id getMapId()Gets theMapIdassociated with this session.- Returns:
- the
Map Idassociated with this session - Compliance:
mandatory- This method must be implemented.
-
getMap
Gets theMapassociated with this session.- Returns:
- the map
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateObstacles
boolean canCreateObstacles()Tests if this user can createObstacles. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anObstaclewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to an unauthorized user.- Returns:
falseifObstaclecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateObstacleWithRecordTypes
Tests if this user can create a singleObstacleusing the desired record types. WhileMappingPathManager.getObstacleRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificObstacle. Providing an empty array tests if anObstaclecan be created with no records.- Parameters:
obstacleRecordTypes- array of obstacle record types- Returns:
trueifObstaclecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-obstacleRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getObstacleFormForCreate
ObstacleForm getObstacleFormForCreate(Id pathId, Type[] obstacleRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the obstable form for creating new obstables. A new form should be requested for each create transaction.- Parameters:
pathId- theIdof the pathobstacleRecordTypes- array of obstacle record types- Returns:
- the obstable form
- Throws:
NotFoundException-pathIdis not foundNullArgumentException-pathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with given record types- Compliance:
mandatory- This method must be implemented.
-
createObstacle
Obstacle createObstacle(ObstacleForm obstacleForm) throws OperationFailedException, PermissionDeniedException Creates a newObstacle.- Parameters:
obstacleForm- the form for thisObstacle- Returns:
- the new
Obstacle - Throws:
IllegalStateException-obstacleFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-pathIdorobstacleFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-obstacleFormdid not originate fromgetObstacleFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateObstacles
boolean canUpdateObstacles()Tests if this user can updateObstacles. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anObstaclewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer update operations to an unauthorized user.- Returns:
falseifObstaclemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getObstacleFormForUpdate
ObstacleForm getObstacleFormForUpdate(Id obstacleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the obstable form for updating an existing obstable. A new obstable form should be requested for each update transaction.- Parameters:
obstacleId- theIdof theObstacle- Returns:
- the obstable form
- Throws:
NotFoundException-obstacleIdis not foundNullArgumentException-obstacleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateObstacle
void updateObstacle(ObstacleForm obstacleForm) throws OperationFailedException, PermissionDeniedException Updates an existing obstable.- Parameters:
obstacleForm- the form containing the elements to be updated- Throws:
IllegalStateException-obstacleFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-obstacleIdorobstableFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-obstacleFormdid not originate fromgetObstacleFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteObstacles
boolean canDeleteObstacles()Tests if this user can deleteObstacles. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anObstaclewill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to an unauthorized user.- Returns:
falseifObstacledeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteObstacle
void deleteObstacle(Id obstacleId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anObstacle.- Parameters:
obstacleId- theIdof theObstacleto remove- Throws:
NotFoundException-obstacleIdnot foundNullArgumentException-obstacleIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageObstacleAliases
boolean canManageObstacleAliases()Tests if this user can manageIdaliases forObstacles. 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:
falseifObstaclealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasObstacle
void aliasObstacle(Id obstacleId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anObstaclefor the purpose of creating compatibility. The primaryIdof theObstacleis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another obstabce, it is reassigned to the given obstacleId.- Parameters:
obstacleId- theIdof anObstaclealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-obstacleIdnot foundNullArgumentException-obstacleIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-