Interface StateLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface StateLookupSession extends OsidSession

This session defines methods for retrieving states. A State is an arbitrary entity that may represent a person, place or thing used to identify an object used in various services.

This lookup session defines several views:

  • comparative view: elements may be silently omitted or re-ordered
  • plenary view: provides a complete result set or is an error condition
  • isolated process view: All state methods in this session operate, retrieve and pertain to states defined explicitly in the current process. Using an isolated view is useful for managing States with the StateAdminSession .
  • federated process view: All state methods in this session operate, retrieve and pertain to all states defined in this process and any other states implicitly available in this process through process inheritence.

The methods useFederatedProcessView() and useIsolatedProcessView() behave as a radio group and one should be selected before invoking any lookup methods.

States may have an additional records indicated by their respective record types. The record may not be accessed through a cast of the State .

  • Method Details

    • getProcessId

      Id getProcessId()
      Gets the Process Id associated with this session.
      Returns:
      the Process Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getProcess

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

      boolean canLookupStates()
      Tests if this user can perform State lookups. 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 opt not to offer lookup operations.
      Returns:
      false if lookup methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeStateView

      void useComparativeStateView()
      The returns from the lookup 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.
    • usePlenaryStateView

      void usePlenaryStateView()
      A complete view of the State 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.
    • useFederatedProcessView

      void useFederatedProcessView()
      Federates the view for methods in this session. A federated view will include states in processes which are children of this process in the process hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedProcessView

      void useIsolatedProcessView()
      Isolates the view for methods in this session. An isolated view restricts lookups to this process only.
      Compliance:
      mandatory - This method is must be implemented.
    • getState

      Gets the State specified by its Id . In plenary mode, the exact Id is found or a NOT_FOUND results. Otherwise, the returned State may have a different Id than requested, such as the case where a duplicate Id was assigned to a State and retained for compatibility.
      Parameters:
      stateId - the Id of the State to retrieve
      Returns:
      the returned State
      Throws:
      NotFoundException - no State found with the given Id
      NullArgumentException - stateId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getStatesByIds

      Gets a StateList corresponding to the given IdList . In plenary mode, the returned list contains all of the states specified in the Id list, in the order of the list, including duplicates, or an error results if an Id in the supplied list is not found or inaccessible. Otherwise, inaccessible States may be omitted from the list and may present the elements in any order including returning a unique set.
      Parameters:
      stateIds - the list of Ids to retrieve
      Returns:
      the returned State list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - stateIdLs is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getStatesByGenusType

      StateList getStatesByGenusType(Type stateGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a StateList corresponding to the given state genus Type which does not include states of types derived from the specified Type . In plenary mode, the returned list contains all known states or an error results. Otherwise, the returned list may contain only those states that are accessible through this session.
      Parameters:
      stateGenusType - a state genus type
      Returns:
      the returned State list
      Throws:
      NullArgumentException - stateGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getStatesByParentGenusType

      StateList getStatesByParentGenusType(Type stateGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a StateList corresponding to the given state genus Type and include any additional states with genus types derived from the specified Type . In plenary mode, the returned list contains all known states or an error results. Otherwise, the returned list may contain only those states that are accessible through this session.
      Parameters:
      stateGenusType - a state genus type
      Returns:
      the returned State list
      Throws:
      NullArgumentException - stateGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getStatesByRecordType

      StateList getStatesByRecordType(Type stateRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a StateList containing the given state record Type . In plenary mode, the returned list contains all known states or an error results. Otherwise, the returned list may contain only those states that are accessible through this session.
      Parameters:
      stateRecordType - a state record type
      Returns:
      the returned State list
      Throws:
      NullArgumentException - stateRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getStates

      Gets all States . In plenary mode, the returned list contains all known states or an error results. Otherwise, the returned list may contain only those states that are accessible through this session.
      Returns:
      a list of States
      Throws:
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getValidNextStates

      Gets the next valid states for the given state.
      Parameters:
      stateId - a state Id
      Returns:
      the valid next States
      Throws:
      NotFoundException - stateId is not found
      NullArgumentException - stateId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.