Interface PathAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
PathBatchAdminSession
This session creates, updates, and deletes Paths . 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
Path , a PathForm is requested using
getPathFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned PathForm
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
PathForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each PathForm corresponds to an attempted transaction.
For updates, PathForms are requested to the Path
Id that is to be updated using getPathFormForUpdate() .
Similarly, the PathForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
PathForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Paths . To unmap a Path
from the current Map , the PathMapAssignmentSession should
be used. These delete operations attempt to remove the Path 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 TypeMethodDescriptionvoidAdds anIdto aPathfor the purpose of creating compatibility.booleanTests if this user can createPaths.booleancanCreatePathWithRecordTypes(Type[] pathRecordTypes) Tests if this user can create a singlePathusing the desired record types.booleanTests if this user can deletePaths.booleanTests if this user can manageIdaliases forPaths.booleanTests if this user can updatePaths.createPath(PathForm pathForm) Creates a newPath.voiddeletePath(Id pathId) Deletes aPath.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.getPathFormForCreate(Type[] pathRecordTypes) Gets the path form for creating new paths.getPathFormForUpdate(Id pathId) Gets the path form for updating an existing path.voidupdatePath(PathForm pathForm) Updates an existing path.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.
-
canCreatePaths
boolean canCreatePaths()Tests if this user can createPaths. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aPathwill 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:
falseifPathcreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreatePathWithRecordTypes
Tests if this user can create a singlePathusing the desired record types. WhileMappingPathManager.getPathRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificPath. Providing an empty array tests if aPathcan be created with no records.- Parameters:
pathRecordTypes- array of path record types- Returns:
trueifPathcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-pathRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getPathFormForCreate
PathForm getPathFormForCreate(Type[] pathRecordTypes) throws OperationFailedException, PermissionDeniedException Gets the path form for creating new paths. A new form should be requested for each create transaction.- Parameters:
pathRecordTypes- array of path record types- Returns:
- the path form
- Throws:
NullArgumentException-pathRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get a form with given record types- Compliance:
mandatory- This method must be implemented.
-
createPath
Creates a newPath.- Parameters:
pathForm- the form for thisPath- Returns:
- the new
Path - Throws:
IllegalStateException-pathFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-pathFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-pathFormdid not originate fromgetPathFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdatePaths
boolean canUpdatePaths()Tests if this user can updatePaths. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aPathwill 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:
falseifPathmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getPathFormForUpdate
PathForm getPathFormForUpdate(Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the path form for updating an existing path. A new path form should be requested for each update transaction.- Parameters:
pathId- theIdof thePath- Returns:
- the path form
- Throws:
NotFoundException-pathIdis not foundNullArgumentException-pathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updatePath
Updates an existing path.- Parameters:
pathForm- the form containing the elements to be updated- Throws:
IllegalStateException-pathFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-pathFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-pathFormdid not originate fromgetPathFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeletePaths
boolean canDeletePaths()Tests if this user can deletePaths. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aPathwill 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:
falseifPathdeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deletePath
void deletePath(Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aPath.- Parameters:
pathId- theIdof thePathto remove- Throws:
NotFoundException-pathIdnot foundNullArgumentException-pathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManagePathAliases
boolean canManagePathAliases()Tests if this user can manageIdaliases forPaths. 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:
falseifPathaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasPath
void aliasPath(Id pathId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aPathfor the purpose of creating compatibility. The primaryIdof thePathis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another path, it is reassigned to the given pathId.- Parameters:
pathId- theIdof aPathaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-pathIdnot foundNullArgumentException-pathIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-