Interface MyRouteSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to route between locations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this user can query own location.voidCancels the current route for this agent.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.Gets the current route progress.Gets the current route of this agent.Gets the current route segment of this agent.booleanTests if this agent is on a route.selectMyRoute(Id routeId) Sets the route for this agent.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.
-
canAccessMyLocation
boolean canAccessMyLocation()Tests if this user can query own location. A return of true does not guarantee successful authorization. A return of false indicates that it is known all methods in this session will result in aPERMISSION_DENIED. This is intended as a hint to an application that may not offer location operations to unauthorized users.- Returns:
falseif location methods are not authorized,trueotherwise- Compliance:
mandatory- This method must be implemented.
-
isOnRoute
boolean isOnRoute()Tests if this agent is on a route.- Returns:
trueif the agent is on a route,falseotherrwise- Compliance:
mandatory- This method must be implemented.
-
getMyRoute
Gets the current route of this agent.- Returns:
- the current route
- Throws:
IllegalStateException-isOnRoute()isfalseOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMyRouteSegment
Gets the current route segment of this agent.- Returns:
- the current route segment
- Throws:
IllegalStateException-isOnRoute()isfalseOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
selectMyRoute
RouteSegment selectMyRoute(Id routeId) throws AlreadyExistsException, NotFoundException, OperationFailedException, PermissionDeniedException Sets the route for this agent.- Parameters:
routeId- a routeId- Returns:
- the current route segment
- Throws:
AlreadyExistsException- the agent is already moving on a routeNotFoundException-routeIdis not foundNullArgumentException-routeIdisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
cancelMyRoute
Cancels the current route for this agent.- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMyProgress
Gets the current route progress.- Returns:
- the current route progress
- Throws:
IllegalStateException-isOnRoute()isfalseOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-