Interface MyLocationSession
- All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
This session defines methods to route between locations.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanTests if this agent is at a designated location.booleanTests if this user can query own location.getMap()Gets theMapassociated with this session.getMapId()Gets theMapIdassociated with this session.Gets the current coordinate of this agent.Gets the current location of this agent.Gets the current nearest locations to this agent ordered by distance.getNearestLocationToMeByGenusType(Type locationGenusType) Gets the current nearest location of this agent of the specified location genus type ordered by distance.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.
-
atDesignatedLocation
boolean atDesignatedLocation()Tests if this agent is at a designated location.- Returns:
trueif the agent is at a designated location,falseotherrwise- Compliance:
mandatory- This method must be implemented.
-
getMyLocation
Gets the current location of this agent.- Returns:
- the current location
- Throws:
IllegalStateException-atDesignatedLocation()isfalseOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getMyCoordinate
Gets the current coordinate of this agent.- Returns:
- the current coordinate
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getNearestLocationsToMe
Gets the current nearest locations to this agent ordered by distance.- Returns:
- the nearest locations
- Throws:
OperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-
getNearestLocationToMeByGenusType
LocationList getNearestLocationToMeByGenusType(Type locationGenusType) throws OperationFailedException, PermissionDeniedException Gets the current nearest location of this agent of the specified location genus type ordered by distance.- Parameters:
locationGenusType- a location genus type- Returns:
- the nearest locations
- Throws:
NullArgumentException-locationGenusTypeisnullOperationFailedException- unable to complete requestPermissionDeniedException- authorization failure- Compliance:
mandatory- This method must be implemented.
-