Class DocumentResponse


  • public class DocumentResponse
    extends Response
    The asynchronous response to a document put or get operation. This is a value object.
    Author:
    Einar M R Rosenvinge
    • Constructor Summary

      Constructors 
      Constructor Description
      DocumentResponse​(long requestId)
      Creates a successful response
      DocumentResponse​(long requestId, com.yahoo.document.Document document)
      Creates a successful response containing a document
      DocumentResponse​(long requestId, com.yahoo.document.Document document, com.yahoo.messagebus.Trace trace)
      Creates a successful response containing a document
      DocumentResponse​(long requestId, com.yahoo.document.Document document, java.lang.String textMessage, boolean success)
      Deprecated.
      DocumentResponse​(long requestId, com.yahoo.document.Document document, java.lang.String textMessage, Response.Outcome outcome)
      Creates a response containing a textual message and/or a document
      DocumentResponse​(long requestId, com.yahoo.document.Document document, java.lang.String textMessage, Response.Outcome outcome, com.yahoo.messagebus.Trace trace)
      Creates a response containing a textual message and/or a document
      DocumentResponse​(long requestId, java.lang.String textMessage, boolean success)
      Deprecated.
    • Constructor Detail

      • DocumentResponse

        public DocumentResponse​(long requestId)
        Creates a successful response
      • DocumentResponse

        public DocumentResponse​(long requestId,
                                com.yahoo.document.Document document)
        Creates a successful response containing a document
        Parameters:
        document - the Document to encapsulate in the Response
      • DocumentResponse

        public DocumentResponse​(long requestId,
                                com.yahoo.document.Document document,
                                com.yahoo.messagebus.Trace trace)
        Creates a successful response containing a document
        Parameters:
        document - the Document to encapsulate in the Response
      • DocumentResponse

        @Deprecated(since="7")
        public DocumentResponse​(long requestId,
                                java.lang.String textMessage,
                                boolean success)
        Deprecated.
        Creates a response containing a textual message
        Parameters:
        textMessage - the message to encapsulate in the Response
        success - true if the response represents a successful call
      • DocumentResponse

        @Deprecated(since="7")
        public DocumentResponse​(long requestId,
                                com.yahoo.document.Document document,
                                java.lang.String textMessage,
                                boolean success)
        Deprecated.
        Creates a response containing a textual message and/or a document
        Parameters:
        document - the Document to encapsulate in the Response
        textMessage - the message to encapsulate in the Response
        success - true if the response represents a successful call
      • DocumentResponse

        public DocumentResponse​(long requestId,
                                com.yahoo.document.Document document,
                                java.lang.String textMessage,
                                Response.Outcome outcome)
        Creates a response containing a textual message and/or a document
        Parameters:
        document - the Document to encapsulate in the Response
        textMessage - the message to encapsulate in the Response
        outcome - the outcome of this operation
      • DocumentResponse

        public DocumentResponse​(long requestId,
                                com.yahoo.document.Document document,
                                java.lang.String textMessage,
                                Response.Outcome outcome,
                                com.yahoo.messagebus.Trace trace)
        Creates a response containing a textual message and/or a document
        Parameters:
        document - the Document to encapsulate in the Response
        textMessage - the message to encapsulate in the Response
        outcome - the outcome of this operation
    • Method Detail

      • getDocument

        public com.yahoo.document.Document getDocument()
        Returns the document of this response, or null if there is none
        Returns:
        the Document, or null
      • isSuccess

        public boolean isSuccess()
        Description copied from class: Response
        Returns whether this response encodes a success or a failure
        Overrides:
        isSuccess in class Response
        Returns:
        true if success
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class Response
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Response