public interface RouteAdminSession extends 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.
Modifier and Type | Method and Description |
---|---|
void |
aliasRoute(Id routeId,
Id aliasId)
Adds an
Id to a Route for the purpose of
creating compatibility. |
void |
aliasRouteSegment(Id routeSegmentId,
Id aliasId)
Adds an
Id to a RouteSegment for the
purpose of creating compatibility. |
boolean |
canCreateRoutes()
Tests if this user can create
Routes. |
boolean |
canCreateRouteSegmentWithRecordTypes(Type[] routeSegmentRecordTypes)
Tests if this user can create a single
RouteSegment
using the desired record types. |
boolean |
canCreateRouteWithRecordTypes(Type[] routeRecordTypes)
Tests if this user can create a single
Route using the
desired record types. |
boolean |
canDeleteRoutes()
Tests if this user can delete
Routes. |
boolean |
canManageRouteAliases()
Tests if this user can manage
Id aliases for
Routes. |
boolean |
canManageRouteSegmentAliases()
Tests if this user can manage
Id aliases for
RouteSegments. |
boolean |
canUpdateRoutes()
Tests if this user can update
Routes. |
Route |
createRoute(RouteForm routeForm)
Creates a new
Route. |
RouteSegment |
createRouteSegment(RouteSegmentForm routeSegmentForm)
Creates a new
RouteSegment. |
void |
deleteRoute(Id routeId)
Deletes a
Route. |
void |
deleteRouteSegment(Id routeSegmentId)
Deletes a
RouteSegment. |
Map |
getMap()
Gets the
Map associated with this session. |
Id |
getMapId()
Gets the
Map Id associated with this
session. |
RouteForm |
getRouteFormForCreate(Id startingLocationId,
Id endingLocationId,
Type[] routeRecordTypes)
Gets the route form for creating new routes.
|
RouteForm |
getRouteFormForUpdate(Id routeId)
Gets the route form for updating an existing route.
|
RouteSegmentForm |
getRouteSegmentFormForCreate(Id routeId,
Type[] routeSegmentRecordTypes)
Gets the route segment form for adding route segments.
|
RouteSegmentForm |
getRouteSegmentFormForUpdate(Id routeSegmentId)
Gets the route segment form for adding route segments.
|
void |
updateRoute(RouteForm routeForm)
Updates an existing route.
|
void |
updateRouteSegment(RouteSegmentForm routeSegmentForm)
Updates a
RouteSegment. |
getAuthenticatedAgent, getAuthenticatedAgentId, getClockRate, getDate, getEffectiveAgent, getEffectiveAgentId, getFormatType, getLocale, isAuthenticated, startTransaction, supportsTransactions
close
Id 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 canCreateRoutes()
Routes.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known creating a Route
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 Route
creation is not
authorized, true
otherwisemandatory
- This method must be implemented. boolean canCreateRouteWithRecordTypes(Type[] routeRecordTypes)
Route
using the
desired record types. While
MappingRouteManager.getRouteRecordTypes()
can be used to
examine which records are supported, this method tests which record(s)
are required for creating a specific Route.
Providing
an empty array tests if a Route
can be created with no
records.routeRecordTypes
- array of route record types true
if Route
creation using the
specified record Types
is supported,
false
otherwiseNullArgumentException
- routeRecordTypes
is null
mandatory
- This method must be implemented. RouteForm getRouteFormForCreate(Id startingLocationId, Id endingLocationId, Type[] routeRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
startingLocationId
- the Id
of the starting
location.endingLocationId
- the Id
of the ending location.routeRecordTypes
- array of route record typesNotFoundException
- startingLocationId
or endingLocationId
is not foundNullArgumentException
- startingLocationId,
endingLocationId
or routeRecordTypes
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable top get form with given
record typesmandatory
- This method must be implemented. Route createRoute(RouteForm routeForm) throws OperationFailedException, PermissionDeniedException
Route.
routeForm
- the form for this Route
Route
IllegalStateException
- routeForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- routeForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- routeForm
did not
originate from getRouteFormForCreate()
mandatory
- This method must be implemented. boolean canUpdateRoutes()
Routes.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known updating a Route
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 Route
modification is
not authorized, true
otherwisemandatory
- This method must be implemented. RouteForm getRouteFormForUpdate(Id routeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
routeId
- the Id
of the Route
NotFoundException
- routeId
is not foundNullArgumentException
- routeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateRoute(RouteForm routeForm) throws OperationFailedException, PermissionDeniedException
routeForm
- the form containing the elements to be updatedIllegalStateException
- routeForm
already used in an update transactionInvalidArgumentException
- the form contains an invalid
valueNullArgumentException
- routeForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- routeForm
did not
originate from getRouteFormForUpdate()
mandatory
- This method must be implemented. boolean canDeleteRoutes()
Routes.
A return of true
does not guarantee successful authorization. A return of false
indicates that it is known deleting a Route
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 Route
deletion is not
authorized, true
otherwisemandatory
- This method must be implemented. void deleteRoute(Id routeId) throws NotFoundException, OperationFailedException, PermissionDeniedException
Route.
routeId
- the Id
of the Route
to
removeNotFoundException
- routeId
not foundNullArgumentException
- routeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageRouteAliases()
Id
aliases for
Routes.
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 Route
aliasing is not
authorized, true
otherwisemandatory
- This method must be implemented. void aliasRoute(Id routeId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a Route
for the purpose of
creating compatibility. The primary Id
of the
Route
is determined by the provider. The new Id
performs as an alias to the primary Id.
The new
Id
performs as an alias to the primary Id.
If
the alias is a pointer to another route, it is reassigned to the given
route Id.
routeId
- the Id
of a Route
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- routeId
not foundNullArgumentException
- routeId
or
aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canCreateRouteSegmentWithRecordTypes(Type[] routeSegmentRecordTypes)
RouteSegment
using the desired record types. While
MappingRouteManager.getRouteSegmentRecordTypes()
can be used
to examine which records are supported, this method tests which
record(s) are required for creating a specific Route.
Providing an empty array tests if a Route
can be
created with no records.routeSegmentRecordTypes
- array of route segment record types true
if RouteSegment
creation
using the specified record Types
is supported,
false
otherwiseNullArgumentException
- routeSegmentRecordTypes
is null
mandatory
- This method must be implemented. RouteSegmentForm getRouteSegmentFormForCreate(Id routeId, Type[] routeSegmentRecordTypes) throws NotFoundException, OperationFailedException, PermissionDeniedException
routeId
- the Id
of a Route
routeSegmentRecordTypes
- array of route segment record typesNotFoundException
- routeId
is not foundNullArgumentException
- routeId
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- unable to get form with given
record typesmandatory
- This method must be implemented. RouteSegment createRouteSegment(RouteSegmentForm routeSegmentForm) throws OperationFailedException, PermissionDeniedException
RouteSegment.
routeSegmentForm
- the form for this RouteSegment
RouteSegment
IllegalStateException
- routeSegmentForm
already used in a create transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- routeForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- routeForm
did not
originate from getRouteSegmentFormForCreate()
mandatory
- This method must be implemented. RouteSegmentForm getRouteSegmentFormForUpdate(Id routeSegmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
routeSegmentId
- the Id
of the
RouteSegment
NotFoundException
- routeSegmentId
is
not foundNullArgumentException
- routeSegmentId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. void updateRouteSegment(RouteSegmentForm routeSegmentForm) throws OperationFailedException, PermissionDeniedException
RouteSegment.
routeSegmentForm
- the form for this RouteSegment
IllegalStateException
- routeSegmentForm
already used in an update transactionInvalidArgumentException
- one or more of the form
elements is invalidNullArgumentException
- routeForm
is
null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failureUnsupportedException
- routeForm
did not
originate from getRouteSegmentFormForUpdate()
mandatory
- This method must be implemented. void deleteRouteSegment(Id routeSegmentId) throws NotFoundException, OperationFailedException, PermissionDeniedException
RouteSegment.
routeSegmentId
- the Id
of the route segment to
deleteNotFoundException
- routeSegmentId
is
not foundNullArgumentException
- routeSegmentId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented. boolean canManageRouteSegmentAliases()
Id
aliases for
RouteSegments.
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 RouteSegment
aliasing
is not authorized, true
otherwisemandatory
- This method must be implemented. void aliasRouteSegment(Id routeSegmentId, Id aliasId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException
Id
to a RouteSegment
for the
purpose of creating compatibility. The primary Id
of
the RouteSegment
is determined by the provider. The new
Id
performs as an alias to the primary Id.
If the alias is a pointer to another route segment, it is
reassigned to the given route segment Id.
routeSegmentId
- the Id
of a RouteSegment
aliasId
- the alias Id
AlreadyExistsException
- aliasId
is
already assignedNotFoundException
- routeSegmentId
not
foundNullArgumentException
- routeSegmentId
or aliasId
is null
OperationFailedException
- unable to complete requestPermissionDeniedException
- authorization failuremandatory
- This method must be implemented.