Interface MessageQuery

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

public interface MessageQuery extends OsidObjectQuery

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

  • Method Details

    • matchSubjectLine

      void matchSubjectLine(String subject, Type stringMatchType, boolean match)
      Adds a subject line to match. Multiple subject line matches can be added to perform a boolean OR among them.
      Parameters:
      subject - subject to match
      stringMatchType - the string match type
      match - true for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - subject is not of stringMatchType
      NullArgumentException - subject or stringMatchType is null
      UnsupportedException - supportsStringMatchType(stringMatchType) is false
      Compliance:
      mandatory - This method must be implemented.
    • matchAnySubjectLine

      void matchAnySubjectLine(boolean match)
      Matches messages with any subject line.
      Parameters:
      match - true to match messages with any subject line, false to match messages with no subject line
      Compliance:
      mandatory - This method must be implemented.
    • clearSubjectLineTerms

      void clearSubjectLineTerms()
      Clears the subject line terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchText

      void matchText(String text, Type stringMatchType, boolean match)
      Adds text to match. Multiple subject line matches can be added to perform a boolean OR among them.
      Parameters:
      text - dtext to match
      stringMatchType - the string match type
      match - true for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - text is not of stringMatchType
      NullArgumentException - text or stringMatchType is null
      UnsupportedException - supportsStringMatchType(stringMatchType) is false
      Compliance:
      mandatory - This method must be implemented.
    • matchAnyText

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

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

      void matchSent(boolean match)
      Matches messages that have been sent.
      Parameters:
      match - true to match sent messages, false to match unsent messages
      Compliance:
      mandatory - This method must be implemented.
    • clearSentTerms

      void clearSentTerms()
      Clears the sent terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchSentTime

      void matchSentTime(DateTime startTime, DateTime endTime, boolean match)
      Matches messages whose sent time is between the supplied range inclusive.
      Parameters:
      startTime - start time
      endTime - end time
      match - true if for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - startTime is greater than endTime
      NullArgumentException - startTime or endTime is null
      Compliance:
      mandatory - This method must be implemented.
    • clearSentTimeTerms

      void clearSentTimeTerms()
      Clears the sent time terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchSenderId

      void matchSenderId(Id resourceId, boolean match)
      Matches the sender of the message.
      Parameters:
      resourceId - Id to match
      match - true if for a positive match, false for a negative match
      Throws:
      NullArgumentException - resourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearSenderIdTerms

      void clearSenderIdTerms()
      Clears the sender Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsSenderQuery

      boolean supportsSenderQuery()
      Tests if a ResourceQuery is available for querying senders.
      Returns:
      true if a resource query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getSenderQuery

      ResourceQuery getSenderQuery()
      Gets the query for a resource.
      Returns:
      the resource query
      Throws:
      UnimplementedException - supportsSenderQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsSenderQuery()} is {@code true} .
    • clearSenderTerms

      void clearSenderTerms()
      Clears the sender terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchSendingAgentId

      void matchSendingAgentId(Id agentId, boolean match)
      Matches the sending agent of the message.
      Parameters:
      agentId - Id to match
      match - true if for a positive match, false for a negative match
      Throws:
      NullArgumentException - agentId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearSendingAgentIdTerms

      void clearSendingAgentIdTerms()
      Clears the sending agent Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsSendingAgentQuery

      boolean supportsSendingAgentQuery()
      Tests if an AgentQuery is available for querying senders.
      Returns:
      true if an agent query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getSendingAgentQuery

      AgentQuery getSendingAgentQuery()
      Gets the query for an agent.
      Returns:
      the agent query
      Throws:
      UnimplementedException - supportsSendingAgentQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsSendingAgentQuery()} is {@code true} .
    • clearSendingAgentTerms

      void clearSendingAgentTerms()
      Clears the sending agent terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchReceivedTime

      void matchReceivedTime(DateTime startTime, DateTime endTime, boolean match)
      Matches messages whose received time is between the supplied range inclusive.
      Parameters:
      startTime - start time
      endTime - end time
      match - true if for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - startTime is greater than endTime
      NullArgumentException - startTime or endTime is null
      Compliance:
      mandatory - This method must be implemented.
    • clearReceivedTimeTerms

      void clearReceivedTimeTerms()
      Clears the received time terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchDeliveryTime

      void matchDeliveryTime(Duration start, Duration end, boolean match)
      Matches messages whose delivery duration is between the supplied range inclusive.
      Parameters:
      start - start time
      end - end time
      match - true if for a positive match, false for a negative match
      Throws:
      InvalidArgumentException - start is greater than end
      NullArgumentException - start or end is null
      Compliance:
      mandatory - This method must be implemented.
    • clearDeliveryTimeTerms

      void clearDeliveryTimeTerms()
      Clears the delivery time terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchRecipientId

      void matchRecipientId(Id resourceId, boolean match)
      Matches any recipient of the message.
      Parameters:
      resourceId - Id to match
      match - true if for a positive match, false for a negative match
      Throws:
      NullArgumentException - resourceId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearRecipientIdTerms

      void clearRecipientIdTerms()
      Clears the recipient Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsRecipientQuery

      boolean supportsRecipientQuery()
      Tests if a ResourceQuery is available for querying recipients.
      Returns:
      true if a resource query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getRecipientQuery

      ResourceQuery getRecipientQuery()
      Gets the query for a recipient resource.
      Returns:
      the resource query
      Throws:
      UnimplementedException - supportsRecipientQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsRecipientQuery()} is {@code true} .
    • clearRecipientTerms

      void clearRecipientTerms()
      Clears the recipient terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchReceiptId

      void matchReceiptId(Id receiptId, boolean match)
      Matches the receipt of the message.
      Parameters:
      receiptId - Id to match
      match - true if for a positive match, false for a negative match
      Throws:
      NullArgumentException - receiptId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearReceiptIdTerms

      void clearReceiptIdTerms()
      Clears the receipt Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsReceiptQuery

      boolean supportsReceiptQuery()
      Tests if a ReceiptQuery is available for querying receipts.
      Returns:
      true if a receipt query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getReceiptQuery

      ReceiptQuery getReceiptQuery()
      Gets the query for the receipt.
      Returns:
      the receipt query
      Throws:
      UnimplementedException - supportsReceiptQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsReceiptQuery()} is {@code true} .
    • matchAnyReceipt

      void matchAnyReceipt(boolean match)
      Matches any received messages.
      Parameters:
      match - true to match any received messages, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • clearReceiptTerms

      void clearReceiptTerms()
      Clears the receipt terms.
      Compliance:
      mandatory - This method must be implemented.
    • matchMailboxId

      void matchMailboxId(Id mailboxId, boolean match)
      Sets the mailbox Id for this query.
      Parameters:
      mailboxId - the mailbox Id
      match - true for a positive match, false for a negative match
      Throws:
      NullArgumentException - mailboxId is null
      Compliance:
      mandatory - This method must be implemented.
    • clearMailboxIdTerms

      void clearMailboxIdTerms()
      Clears the mailbox Id terms.
      Compliance:
      mandatory - This method must be implemented.
    • supportsMailboxQuery

      boolean supportsMailboxQuery()
      Tests if a MailboxQuery is available.
      Returns:
      true if a mailbox query is available, false otherwise
      Compliance:
      mandatory - This method must be implemented.
    • getMailboxQuery

      MailboxQuery getMailboxQuery()
      Gets the query for a mailbox. Multiple retrievals produce a nested OR term.
      Returns:
      the mailbox query
      Throws:
      UnimplementedException - supportsMailboxQuery() is false
      Compliance:
      optional - This method must be implemented if {@code supportsMailboxQuery()} is {@code true} .
    • clearMailboxTerms

      void clearMailboxTerms()
      Clears the mailbox terms.
      Compliance:
      mandatory - This method must be implemented.
    • getMessageQueryRecord

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