Interface IntersectionAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
- All Known Subinterfaces:
IntersectionBatchAdminSession
This session creates, updates, and deletes Intersections . 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
Intersection , an IntersectionForm is requested using
getIntersectionFormForCreate() specifying the desired paths and
record Types or none if no record Types are needed. The
returned IntersectionForm 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 IntersectionForm is submiited to a
create operation, it cannot be reused with another create operation unless
the first operation was unsuccessful. Each IntersectionForm
corresponds to an attempted transaction.
For updates, IntersectionForms are requested to the
Intersection Id that is to be updated using
getIntersectionFormForUpdate() . Similarly, the IntersectionForm
has metadata about the data that can be updated and it can perform
validation before submitting the update. The IntersectionForm can
only be used once for a successful update and cannot be reused.
The delete operations delete Intersections . To unmap an
Intersection from the current Map , the
IntersectionMapAssignmentSession should be used. These delete operations
attempt to remove the Intersection 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 TypeMethodDescriptionvoidaddPathToIntersection(Id intersectionId, Id pathId) Adds a path to an existing intersection.voidaliasIntersection(Id intersectionId, Id aliasId) Adds anIdto anIntersectionfor the purpose of creating compatibility.booleanTests if this user can createIntersections.booleancanCreateIntersectionWithRecordTypes(Type[] intersectionRecordTypes) Tests if this user can create a singleIntersectionusing the desired record types.booleanTests if this user can deleteIntersections.booleanTests if this user can manageIdaliases forIntersections.booleancanUpdateIntersection(Id intersectionId) Tests if this user can update a specifiedIntersection.booleanTests if this user can updateIntersections.createIntersection(IntersectionForm intersectionForm) Creates a newIntersection.voiddeleteIntersection(Id intersectionId) Deletes anIntersection.getIntersectionFormForCreate(Id[] pathIds, Type[] intersectionRecordTypes) Gets the intersection form for creating new intersections.getIntersectionFormForUpdate(Id intersectionId) Gets the intersection form for updating an existing intersection.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.voidremovePathFromIntersection(Id intersectionId, Id pathId) Removes a path from an existing intersection.voidupdateIntersection(IntersectionForm intersectionForm) Updates an existing intersection.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.
-
canCreateIntersections
boolean canCreateIntersections()Tests if this user can createIntersections. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating anIntersectionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer create operations to unauthorized users.- Returns:
falseifIntersectioncreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateIntersectionWithRecordTypes
Tests if this user can create a singleIntersectionusing the desired record types. WhileMappingPathManager.getIntersectionRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificIntersection. Providing an empty array tests if anIntersectioncan be created with no records.- Parameters:
intersectionRecordTypes- array of intersection record types- Returns:
trueifIntersectioncreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-intersectionRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getIntersectionFormForCreate
IntersectionForm getIntersectionFormForCreate(Id[] pathIds, Type[] intersectionRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the intersection form for creating new intersections. A new form should be requested for each create transaction.- Parameters:
pathIds- theIdof the pathsintersectionRecordTypes- array of intersection record types- Returns:
- the intersection form
- Throws:
NotFoundException-a pathIdis not foundNullArgumentException-pathIdsorintersectionRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get a form with given record types- Compliance:
mandatory- This method must be implemented.
-
createIntersection
Intersection createIntersection(IntersectionForm intersectionForm) throws OperationFailedException, PermissionDeniedException Creates a newIntersection.- Parameters:
intersectionForm- an intersection form- Returns:
- the new
Intersection - Throws:
IllegalStateException-intersectionFormalready used in a create transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-pathIdsorintersectionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-intersectionFormdid not originate fromgetIntersectionFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateIntersections
boolean canUpdateIntersections()Tests if this user can updateIntersections. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating anIntersectionwill 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:
falseifIntersectionmodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canUpdateIntersection
Tests if this user can update a specifiedIntersection. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating theIntersectionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer an update operation to an unauthorized user for this intersection.- Parameters:
intersectionId- theIdof theIntersection- Returns:
falseif intersection modification is not authorized,trueotherwise- Throws:
NullArgumentException-intersectionIdisnull- Compliance:
mandatory- This method must be implemented.- Notes:
If- the {@code intersectionId} is not found, then it is acceptable to return false to indicate the lack of an update available.
-
getIntersectionFormForUpdate
IntersectionForm getIntersectionFormForUpdate(Id intersectionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the intersection form for updating an existing intersection. A new intersection form should be requested for each update transaction.- Parameters:
intersectionId- theIdof theIntersection- Returns:
- the intersection form
- Throws:
NotFoundException-intersectionIdis not foundNullArgumentException-intersectionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateIntersection
void updateIntersection(IntersectionForm intersectionForm) throws OperationFailedException, PermissionDeniedException Updates an existing intersection.- Parameters:
intersectionForm- the form containing the elements to be updated- Throws:
IllegalStateException-intersectionFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-intersectionFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-intersectionFormdid not originate fromgetIntersectionFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
addPathToIntersection
void addPathToIntersection(Id intersectionId, Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException Adds a path to an existing intersection.- Parameters:
intersectionId- theIdof theIntersectionpathId- theIdof the aPath- Throws:
NotFoundException-intersectionIdorpathIdis not foundNullArgumentException-intersectionIdorpathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canDeleteIntersections
boolean canDeleteIntersections()Tests if this user can deleteIntersections. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting anIntersectionwill result in aPERMISSION_DENIED. This is intended as a hint to an application that may opt not to offer delete operations to unauthorized users.- Returns:
falseifIntersectiondeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteIntersection
void deleteIntersection(Id intersectionId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes anIntersection.- Parameters:
intersectionId- theIdof theIntersectionto remove- Throws:
NotFoundException-intersectionIdnot foundNullArgumentException-intersectionIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
removePathFromIntersection
void removePathFromIntersection(Id intersectionId, Id pathId) throws NotFoundException, OperationFailedException, PermissionDeniedException Removes a path from an existing intersection.- Parameters:
intersectionId- theIdof theIntersectionpathId- theIdof thePathto remove- Throws:
NotFoundException-intersectionIdorpathIdnot foundNullArgumentException-intersectionIdorpathIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageIntersectionAliases
boolean canManageIntersectionAliases()Tests if this user can manageIdaliases forIntersections. 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:
falseifIntersectionaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasIntersection
void aliasIntersection(Id intersectionId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto anIntersectionfor the purpose of creating compatibility. The primaryIdof theIntersectionis determined by the provider. The newIdperforms as an alias to the primaryId.- Parameters:
intersectionId- theIdof anIntersectionaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-intersectionIdnot foundNullArgumentException-intersectionIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-