Interface CommentQuery

All Superinterfaces:
Extensible, OsidBrowsableQuery, OsidExtensibleQuery, OsidIdentifiableQuery, OsidObjectQuery, OsidQuery, OsidRelationshipQuery, OsidTemporalQuery, Suppliable

public interface CommentQuery extends OsidRelationshipQuery

This is the query for searching comments. Each method specifies an AND term while multiple invocations of the same method produce a nested OR .

  • Method Details

    • matchReferenceId

      void matchReferenceId(Id sourceId, boolean match)
      Sets reference Id .
      Parameters:
      sourceId - a source Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - sourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearReferenceIdTerms

      void clearReferenceIdTerms()
      Clears the reference Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchCommentorId

      void matchCommentorId(Id resourceId, boolean match)
      Sets a resource Id to match a commentor.
      Parameters:
      resourceId - a resource Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - resourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearCommentorIdTerms

      void clearCommentorIdTerms()
      Clears the resource Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsCommentorQuery

      boolean supportsCommentorQuery()
      Tests if a ResourceQuery is available.
      Returns:
      true if a resource query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getCommentorQuery

      ResourceQuery getCommentorQuery()
      Gets the query for a resource query. Multiple retrievals produce a nested OR term.
      Returns:
      the resource query
      Throws:
      UnimplementedException - supportsCommentorQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsCommentorQuery()} is {@code true} .
    • clearCommentorTerms

      void clearCommentorTerms()
      Clears the resource terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchCommentingAgentId

      void matchCommentingAgentId(Id agentId, boolean match)
      Sets an agent Id .
      Parameters:
      agentId - an agent Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - agentId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearCommentingAgentIdTerms

      void clearCommentingAgentIdTerms()
      Clears the agent Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsCommentingAgentQuery

      boolean supportsCommentingAgentQuery()
      Tests if an AgentQuery is available.
      Returns:
      true if an agent query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getCommentingAgentQuery

      AgentQuery getCommentingAgentQuery()
      Gets the query for an agent query. Multiple retrievals produce a nested OR term.
      Returns:
      the agent query
      Throws:
      UnimplementedException - supportsCommentingAgentQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsCommentingAgentQuery()} is {@code true} .
    • clearCommentingAgentTerms

      void clearCommentingAgentTerms()
      Clears the agent terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchText

      void matchText(String text, Type stringMatchType, boolean match)
      Matches text.
      Parameters:
      text - the text
      stringMatchType - a string match type
      match - true for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - text is not of stringMatchType
      NullArgumentException - text is null
      UnsupportedException - supportsStringMatchType(stringMatchType) is false
      Compliance:
      mandatory - This method must be implemented.
    • matchAnyText

      void matchAnyText(boolean match)
      Matches a comment that has any text assigned.
      Parameters:
      match - true to match comments with any text, false to match comments with no text
      Compliance:
      mandatory - This method must be implemented.
    • clearTextTerms

      void clearTextTerms()
      Clears the text terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchRatingId

      void matchRatingId(Id gradeId, boolean match)
      Sets a grade Id .
      Parameters:
      gradeId - a grade Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - gradeId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearRatingIdTerms

      void clearRatingIdTerms()
      Clears the rating Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsRatingQuery

      boolean supportsRatingQuery()
      Tests if a GradeQuery is available.
      Returns:
      true if a rating query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getRatingQuery

      GradeQuery getRatingQuery()
      Gets the query for a rating query. Multiple retrievals produce a nested OR term.
      Returns:
      the rating query
      Throws:
      UnimplementedException - supportsRatingQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsRatingQuery()} is {@code true} .
    • matchAnyRating

      void matchAnyRating(boolean match)
      Matches books with any rating.
      Parameters:
      match - true to match comments with any rating, false to match comments with no ratings
      Compliance:
      mandatory - This method must be implemented.
    • clearRatingTerms

      void clearRatingTerms()
      Clears the rating terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchBookId

      void matchBookId(Id bookId, boolean match)
      Sets the book Id for this query to match comments assigned to books.
      Parameters:
      bookId - a book Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - bookId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearBookIdTerms

      void clearBookIdTerms()
      Clears the book Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsBookQuery

      boolean supportsBookQuery()
      Tests if a BookQuery is available.
      Returns:
      true if a book query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getBookQuery

      BookQuery getBookQuery()
      Gets the query for a book query. Multiple retrievals produce a nested OR term.
      Returns:
      the book query
      Throws:
      UnimplementedException - supportsBookQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsBookQuery()} is {@code true} .
    • clearBookTerms

      void clearBookTerms()
      Clears the book terms.
      Compliance:
      mandatory - This method must be implemented.
    • getCommentQueryRecord

      CommentQueryRecord getCommentQueryRecord(Type commentRecordType) throws OperationFailedException
      Gets the comment query record corresponding to the given Comment record Type .Multiple record retrievals produce a nested OR term.
      Parameters:
      commentRecordType - a comment record type
      Returns:
      the comment query record
      Throws:
      NullArgumentException - commentRecordType is null
      OperationFailedException - unable to complete request
      UnsupportedException - hasRecordType(commentRecordType) is false
      Compliance:
      mandatory - This method must be implemented.