Interface RouteAdminSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session creates, updates, and deletes Routes . 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
Route , a RouteForm is requested using
getRouteFormForCreate() specifying the desired record Types or
none if no record Types are needed. The returned RouteForm
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
RouteForm is submiited to a create operation, it cannot be reused
with another create operation unless the first operation was unsuccessful.
Each RouteForm corresponds to an attempted transaction.
For updates, RouteForms are requested to the Route
Id that is to be updated using getRouteFormForUpdate() .
Similarly, the RouteForm has metadata about the data that can be
updated and it can perform validation before submitting the update. The
RouteForm can only be used once for a successful update and cannot
be reused.
The delete operations delete Routes . To unmap a Route
from the current Map , the RouteMapAssignmentSession
should be used. These delete operations attempt to remove the
Route 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 TypeMethodDescriptionvoidaliasRoute(Id routeId, Id aliasId) Adds anIdto aRoutefor the purpose of creating compatibility.voidaliasRouteSegment(Id routeSegmentId, Id aliasId) Adds anIdto aRouteSegmentfor the purpose of creating compatibility.booleanTests if this user can createRoutes.booleancanCreateRouteSegmentWithRecordTypes(Type[] routeSegmentRecordTypes) Tests if this user can create a singleRouteSegmentusing the desired record types.booleancanCreateRouteWithRecordTypes(Type[] routeRecordTypes) Tests if this user can create a singleRouteusing the desired record types.booleanTests if this user can deleteRoutes.booleanTests if this user can manageIdaliases forRoutes.booleanTests if this user can manageIdaliases forRouteSegments.booleanTests if this user can updateRoutes.createRoute(RouteForm routeForm) Creates a newRoute.createRouteSegment(RouteSegmentForm routeSegmentForm) Creates a newRouteSegment.voiddeleteRoute(Id routeId) Deletes aRoute.voiddeleteRouteSegment(Id routeSegmentId) Deletes aRouteSegment.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.getRouteFormForCreate(Id startingLocationId, Id endingLocationId, Type[] routeRecordTypes) Gets the route form for creating new routes.getRouteFormForUpdate(Id routeId) Gets the route form for updating an existing route.getRouteSegmentFormForCreate(Id routeId, Type[] routeSegmentRecordTypes) Gets the route segment form for adding route segments.getRouteSegmentFormForUpdate(Id routeSegmentId) Gets the route segment form for adding route segments.voidupdateRoute(RouteForm routeForm) Updates an existing route.voidupdateRouteSegment(RouteSegmentForm routeSegmentForm) Updates aRouteSegment.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.
-
canCreateRoutes
boolean canCreateRoutes()Tests if this user can createRoutes. A return of true does not guarantee successful authorization. A return of false indicates that it is known creating aRoutewill 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:
falseifRoutecreation is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
canCreateRouteWithRecordTypes
Tests if this user can create a singleRouteusing the desired record types. WhileMappingRouteManager.getRouteRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRoute. Providing an empty array tests if aRoutecan be created with no records.- Parameters:
routeRecordTypes- array of route record types- Returns:
trueifRoutecreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-routeRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRouteFormForCreate
RouteForm getRouteFormForCreate(Id startingLocationId, Id endingLocationId, Type[] routeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the route form for creating new routes. A new form should be requested for each create transaction.- Parameters:
startingLocationId- theIdof the starting location.endingLocationId- theIdof the ending location.routeRecordTypes- array of route record types- Returns:
- the route form
- Throws:
NotFoundException-startingLocationIdorendingLocationIdis not foundNullArgumentException-startingLocationId, endingLocationIdorrouteRecordTypesisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable top get form with given record types- Compliance:
mandatory- This method must be implemented.
-
createRoute
Creates a newRoute.- Parameters:
routeForm- the form for thisRoute- Returns:
- the new
Route - Throws:
IllegalStateException-routeFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-routeFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-routeFormdid not originate fromgetRouteFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
canUpdateRoutes
boolean canUpdateRoutes()Tests if this user can updateRoutes. A return of true does not guarantee successful authorization. A return of false indicates that it is known updating aRoutewill 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:
falseifRoutemodification is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
getRouteFormForUpdate
RouteForm getRouteFormForUpdate(Id routeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the route form for updating an existing route. A new route form should be requested for each update transaction.- Parameters:
routeId- theIdof theRoute- Returns:
- the route form
- Throws:
NotFoundException-routeIdis not foundNullArgumentException-routeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRoute
Updates an existing route.- Parameters:
routeForm- the form containing the elements to be updated- Throws:
IllegalStateException-routeFormalready used in an update transactionInvalidArgumentException- the form contains an invalid valueNullArgumentException-routeFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-routeFormdid not originate fromgetRouteFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
canDeleteRoutes
boolean canDeleteRoutes()Tests if this user can deleteRoutes. A return of true does not guarantee successful authorization. A return of false indicates that it is known deleting aRoutewill 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:
falseifRoutedeletion is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
deleteRoute
void deleteRoute(Id routeId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRoute.- Parameters:
routeId- theIdof theRouteto remove- Throws:
NotFoundException-routeIdnot foundNullArgumentException-routeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRouteAliases
boolean canManageRouteAliases()Tests if this user can manageIdaliases forRoutes. 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:
falseifRoutealiasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRoute
void aliasRoute(Id routeId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRoutefor the purpose of creating compatibility. The primaryIdof theRouteis determined by the provider. The newIdperforms as an alias to the primaryId.The newIdperforms as an alias to the primaryId. If the alias is a pointer to another route, it is reassigned to the given routeId.- Parameters:
routeId- theIdof aRoutealiasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-routeIdnot foundNullArgumentException-routeIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canCreateRouteSegmentWithRecordTypes
Tests if this user can create a singleRouteSegmentusing the desired record types. WhileMappingRouteManager.getRouteSegmentRecordTypes()can be used to examine which records are supported, this method tests which record(s) are required for creating a specificRoute. Providing an empty array tests if aRoutecan be created with no records.- Parameters:
routeSegmentRecordTypes- array of route segment record types- Returns:
trueifRouteSegmentcreation using the specified recordTypesis supported,falseotherwise- Throws:
NullArgumentException-routeSegmentRecordTypesisnull- Compliance:
mandatory- This method must be implemented.
-
getRouteSegmentFormForCreate
RouteSegmentForm getRouteSegmentFormForCreate(Id routeId, Type[] routeSegmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the route segment form for adding route segments. A new form should be requested for each create transaction.- Parameters:
routeId- theIdof aRouterouteSegmentRecordTypes- array of route segment record types- Returns:
- the route segment form
- Throws:
NotFoundException-routeIdis not foundNullArgumentException-routeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException- unable to get form with given record types- Compliance:
mandatory- This method must be implemented.
-
createRouteSegment
RouteSegment createRouteSegment(RouteSegmentForm routeSegmentForm) throws OperationFailedException, PermissionDeniedException Creates a newRouteSegment.- Parameters:
routeSegmentForm- the form for thisRouteSegment- Returns:
- the new
RouteSegment - Throws:
IllegalStateException-routeSegmentFormalready used in a create transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-routeFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-routeFormdid not originate fromgetRouteSegmentFormForCreate()- Compliance:
mandatory- This method must be implemented.
-
getRouteSegmentFormForUpdate
RouteSegmentForm getRouteSegmentFormForUpdate(Id routeSegmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Gets the route segment form for adding route segments. A new form should be requested for each create transaction.- Parameters:
routeSegmentId- theIdof theRouteSegment- Returns:
- the route segment form
- Throws:
NotFoundException-routeSegmentIdis not foundNullArgumentException-routeSegmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
updateRouteSegment
void updateRouteSegment(RouteSegmentForm routeSegmentForm) throws OperationFailedException, PermissionDeniedException Updates aRouteSegment.- Parameters:
routeSegmentForm- the form for thisRouteSegment- Throws:
IllegalStateException-routeSegmentFormalready used in an update transactionInvalidArgumentException- one or more of the form elements is invalidNullArgumentException-routeFormisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failureUnsupportedException-routeFormdid not originate fromgetRouteSegmentFormForUpdate()- Compliance:
mandatory- This method must be implemented.
-
deleteRouteSegment
void deleteRouteSegment(Id routeSegmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException Deletes aRouteSegment.- Parameters:
routeSegmentId- theIdof the route segment to delete- Throws:
NotFoundException-routeSegmentIdis not foundNullArgumentException-routeSegmentIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
canManageRouteSegmentAliases
boolean canManageRouteSegmentAliases()Tests if this user can manageIdaliases forRouteSegments. 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:
falseifRouteSegmentaliasing is not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
aliasRouteSegment
void aliasRouteSegment(Id routeSegmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Adds anIdto aRouteSegmentfor the purpose of creating compatibility. The primaryIdof theRouteSegmentis determined by the provider. The newIdperforms as an alias to the primaryId. If the alias is a pointer to another route segment, it is reassigned to the given route segmentId.- Parameters:
routeSegmentId- theIdof aRouteSegmentaliasId- the aliasId- Throws:
AlreadyExistsException-aliasIdis already assignedNotFoundException-routeSegmentIdnot foundNullArgumentException-routeSegmentIdoraliasIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-