Interface CommentLookupSession

All Superinterfaces:
AutoCloseable, Closeable, OsidSession, OsidSession

public interface CommentLookupSession extends OsidSession

This session defines methods for retrieving comments.

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 book view: All comment methods in this session operate, retrieve and pertain to comments defined explicitly in the current book. Using an isolated view is useful for managing comments with the CommentAdminSession .
  • federated book view: All comment lookup methods in this session operate, retrieve and pertain to all comments defined in this book and any other books implicitly available in this book through book inheritence.
  • effective comment view: All comment lookup methods return comments where the current dates falls in between the effective dates inclusive.
  • any effective comment view: Comments of any effective date are returned.

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

  • Method Details

    • getBookId

      Id getBookId()
      Gets the Book Id associated with this session.
      Returns:
      the Book Id associated with this session
      Compliance:
      mandatory - This method must be implemented.
    • getBook

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

      boolean canLookupComments()
      Tests if this user can examine this book. 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 these operations.
      Returns:
      false if book reading methods are not authorized, true otherwise
      Compliance:
      mandatory - This method must be implemented.
    • useComparativeCommentView

      void useComparativeCommentView()
      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.
    • usePlenaryCommentView

      void usePlenaryCommentView()
      A complete view of the Comment 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.
    • useFederatedBookView

      void useFederatedBookView()
      Federates the view for methods in this session. A federated view will include comments in books which are children of this book in the book hierarchy.
      Compliance:
      mandatory - This method is must be implemented.
    • useIsolatedBookView

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

      void useEffectiveCommentView()
      Only comments whose effective dates are current are returned by methods in this session.
      Compliance:
      mandatory - This method is must be implemented.
    • useAnyEffectiveCommentView

      void useAnyEffectiveCommentView()
      All comments of any effective dates are returned by all methods in this session.
      Compliance:
      mandatory - This method is must be implemented.
    • getComment

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

      Gets a CommentList corresponding to the given IdList . In plenary mode, the returned list contains all of the comments 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 comments may be omitted from the list and may present the elements in any order including returning a unique set. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      commentIds - the list of Ids to retrieve
      Returns:
      the returned Comment list
      Throws:
      NotFoundException - an Id was not found
      NullArgumentException - commentIds is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusType

      CommentList getCommentsByGenusType(Type commentGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a CommentList corresponding to the given comment genus Type which does not include comments of genus types derived from the specified Type . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      commentGenusType - a comment genus type
      Returns:
      the returned Comment list
      Throws:
      NullArgumentException - commentGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByParentGenusType

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

      CommentList getCommentsByRecordType(Type commentRecordType) throws OperationFailedException, PermissionDeniedException
      Gets a CommentList containing the given comment record Type . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      commentRecordType - a comment record type
      Returns:
      the returned Comment list
      Throws:
      NullArgumentException - commentRecordType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsOnDate

      Gets a CommentList effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      from - starting date
      to - ending date
      Returns:
      the returned Comment list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - from or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeOnDate

      CommentList getCommentsByGenusTypeOnDate(Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a CommentList of a given genus type and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      commentGenusType - a comment genus type
      from - starting date
      to - ending date
      Returns:
      the returned Comment list
      Throws:
      InvalidArgumentException - from is greater than to
      NullArgumentException - commentGenusType, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsForCommentor

      CommentList getCommentsForCommentor(Id resourceId) throws OperationFailedException, PermissionDeniedException
      Gets a list of comments corresponding to a resource Id . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      Returns:
      the returned CommentList
      Throws:
      NullArgumentException - resourceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsForCommentorOnDate

      CommentList getCommentsForCommentorOnDate(Id resourceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all comments corresponding to a resource Id and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      from - from date
      to - to date
      Returns:
      the returned CommentList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeForCommentor

      CommentList getCommentsByGenusTypeForCommentor(Id resourceId, Type commentGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a list of comments of the given genus type corresponding to a resource Id . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      commentGenusType - the comment genus type
      Returns:
      the returned CommentList
      Throws:
      NullArgumentException - resourceId or commentGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeForCommentorOnDate

      CommentList getCommentsByGenusTypeForCommentorOnDate(Id resourceId, Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all comments of the given genus type corresponding to a resource Id and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      commentGenusType - the comment genus type
      from - from date
      to - to date
      Returns:
      the returned CommentList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, commentGenusType, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsForReference

      CommentList getCommentsForReference(Id referenceId) throws OperationFailedException, PermissionDeniedException
      Gets a list of comments corresponding to a reference Id . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      referenceId - the Id of the reference
      Returns:
      the returned CommentList
      Throws:
      NullArgumentException - referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsForReferenceOnDate

      CommentList getCommentsForReferenceOnDate(Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all comments corresponding to a reference Id and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      referenceId - a reference Id
      from - from date
      to - to date
      Returns:
      the returned CommentList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - referenceId, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeForReference

      CommentList getCommentsByGenusTypeForReference(Id referenceId, Type commentGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a list of comments of the given genus type corresponding to a reference Id . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      referenceId - the Id of the reference
      commentGenusType - the comment genus type
      Returns:
      the returned CommentList
      Throws:
      NullArgumentException - referenceId or commentGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeForReferenceOnDate

      CommentList getCommentsByGenusTypeForReferenceOnDate(Id referenceId, Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all comments of the given genus type corresponding to a reference Id and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      referenceId - a reference Id
      commentGenusType - the comment genus type
      from - from date
      to - to date
      Returns:
      the returned CommentList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - referenceId, commentGenusType, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsForCommentorAndReference

      CommentList getCommentsForCommentorAndReference(Id resourceId, Id referenceId) throws OperationFailedException, PermissionDeniedException
      Gets a list of comments corresponding to a resource and reference Id . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      referenceId - the Id of the reference
      Returns:
      the returned CommentList
      Throws:
      NullArgumentException - resourceId or referenceId is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsForCommentorAndReferenceOnDate

      CommentList getCommentsForCommentorAndReferenceOnDate(Id resourceId, Id referenceId, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all comments corresponding to a resource and reference Id and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      referenceId - a reference Id
      from - from date
      to - to date
      Returns:
      the returned CommentList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, referenceId, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeForCommentorAndReference

      CommentList getCommentsByGenusTypeForCommentorAndReference(Id resourceId, Id referenceId, Type commentGenusType) throws OperationFailedException, PermissionDeniedException
      Gets a list of comments of the given genus type corresponding to a resource and reference Id . In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      referenceId - the Id of the reference
      commentGenusType - the comment genus type
      Returns:
      the returned CommentList
      Throws:
      NullArgumentException - resourceId, referenceId or commentGenusType is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getCommentsByGenusTypeForCommentorAndReferenceOnDate

      CommentList getCommentsByGenusTypeForCommentorAndReferenceOnDate(Id resourceId, Id referenceId, Type commentGenusType, DateTime from, DateTime to) throws OperationFailedException, PermissionDeniedException
      Gets a list of all comments corresponding to a resource and reference Id and effective during the entire given date range inclusive but not confined to the date range. In plenary mode, the returned list contains all known comments or an error results. Otherwise, the returned list may contain only those comments that are accessible through this session. In effective mode, comments are returned that are currently effective. In any effective mode, effective comments and those currently expired are returned.
      Parameters:
      resourceId - the Id of the resource
      referenceId - a reference Id
      commentGenusType - the comment genus type
      from - from date
      to - to date
      Returns:
      the returned CommentList
      Throws:
      InvalidArgumentException - to is less than from
      NullArgumentException - resourceId, referenceId, commentGenusType, from , or to is null
      OperationFailedException - unable to complete request
      PermissionDeniedException - authorization failure
      Compliance:
      mandatory - This method must be implemented.
    • getComments

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