Interface LocationAdjacencySession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface LocationAdjacencySession extends OsidSession

This session defines methods to traverse through a map.

  • Method Details

    • getMapId

      Id getMapId()
      Gets the Map Id associated with this session.
      Returns:
      the Map Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getMap

      Gets the Map associated with this session.
      Returns:
      the map
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • canLookupLocationAdjacencies

      boolean canLookupLocationAdjacencies()
      Tests if this user can query adjacenies of locations 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 a PERMISSION_DENIED . This is intended as a hint to an application that may not offer lookup operations to unauthorized users.
      Returns:
      false if location adjacency methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeLocationView

      void useComparativeLocationView()
      The returns from the traversal methods may omit or translate elements based on this session, such as authorization, and not result in an error. This view is used when greater interoperability is desired at the expense of precision.
      Compliance:
      mandatory - This method is must be implemented.
    • usePlenaryLocationView

      void usePlenaryLocationView()
      A complete view of the method returns is desired. Methods will return what is requested or result in an error. This view is used when greater precision is desired at the expense of interoperability.
      Compliance:
      mandatory - This method is must be implemented.
    • useFederatedMapView

      void useFederatedMapView()
      Federates the view for methods in this session. A federated view will include paths in maps which are children of this map in the map hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedMapView

      void useIsolatedMapView()
      Isolates the view for methods in this session. An isolated view restricts retrievals to this map only.
      Compliance:
      mandatory - This method is must be implemented.
    • getAdjacentLocations

      LocationList getAdjacentLocations(Id locationId, long hops) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Gets a list of adjacent locations for the given location. The adjacent locations reflect the locations at the same level of the location hierarchy.
      Parameters:
      locationId - the given location Id
      hops - the number of hops to include. 0 returns an empty list. 1 returns the immediate adjacent locations.
      Returns:
      a list of locations
      Throws:
      NotFoundException - locationId is not found
      NullArgumentException - locationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • isAdjacent

      boolean isAdjacent(Id locationId, Id anotherLocationId) throws NotFoundException, OperationFailedException, PermissionDeniedException
      Tests if two locations of the same type are adjacent. A location is not adjacent if contained within another location.
      Parameters:
      locationId - the given location Id
      anotherLocationId - the given location Id
      Returns:
      true of the locations are adjacent, false otherwise
      Throws:
      NotFoundException - locationId or anotherLocationId is not found
      NullArgumentException - locationId or anotherLocationId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.