Interface SubjectQuerySession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession
All Known Subinterfaces:
SubjectSearchSession

public interface SubjectQuerySession extends OsidSession

This session provides methods for searching Subject objects. The search query is constructed using the SubjectQuery. The subject record Type also specifies the record for the subject query.

This session defines views that offer differing behaviors for searching.

  • federated ontology view: searches include subjects in ontologies of which this ontology is an ancestor in the ontology hierarchy
  • isolated ontology view: searches are restricted to subjects in this ontology

Subjects may have a query record indicated by their respective record types. The query record is accessed via the SubjectQuery.

  • Method Details

    • getOntologyId

      Id getOntologyId()
      Gets the Ontology Id associated with this session.
      Returns:
      the Ontology Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getOntology

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

      boolean canSearchSubjects()
      Tests if this user can perform Subjects searches. 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 search operations to unauthorized users.
      Returns:
      false if search methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useFederatedOntologyView

      void useFederatedOntologyView()
      Federates the view for methods in this session. A federated view will include subjects in ontologies which are children of this ontology in the ontology hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedOntologyView

      void useIsolatedOntologyView()
      Isolates the view for methods in this session. An isolated view restricts searches to this ontology only.
      Compliance:
      mandatory - This method is must be implemented.
    • getSubjectQuery

      SubjectQuery getSubjectQuery()
      Gets a subject query.
      Returns:
      the subject query
      Compliance:
      mandatory - This method must be implemented.
    • getSubjectsByQuery

      Gets a list of Subjects matching the given subject query.
      Parameters:
      subjectQuery - the subject query
      Returns:
      the returned SubjectList
      Throws:
      NullArgumentException - subjectQuery is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      UnsupportedException - subjectQuery is not of this service
      Compliance:
      mandatory - This method must be implemented.