Package com.yahoo.documentapi
Class Response
java.lang.Object
com.yahoo.documentapi.Response
- Direct Known Subclasses:
DocumentIdResponse
,DocumentResponse
,DocumentUpdateResponse
,RemoveResponse
,UpdateResponse
An asynchronous response from the document api. Subclasses of this provide additional response information for particular operations.
This is a value object.
- Author:
- bratseth
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionResponse
(long requestId) Creates a successful response containing no informationCreates a successful response containing a textual messageResponse
(long requestId, String textMessage, Response.Outcome outcome) Creates a response containing a textual messageResponse
(long requestId, String textMessage, Response.Outcome outcome, com.yahoo.messagebus.Trace trace) Creates a response containing a textual message -
Method Summary
Modifier and TypeMethodDescriptionboolean
long
Returns the text message of this response or null if there is nonecom.yahoo.messagebus.Trace
getTrace()
Returns the trace of this operation, or null if there is none.int
hashCode()
boolean
Returns whether this response encodes a success or a failureoutcome()
Returns the outcome of this operation.toString()
-
Constructor Details
-
Response
public Response(long requestId) Creates a successful response containing no information -
Response
Creates a successful response containing a textual message- Parameters:
textMessage
- the message to encapsulate in the Response
-
Response
Creates a response containing a textual message- Parameters:
textMessage
- the message to encapsulate in the Responseoutcome
- the outcome of the operation
-
Response
public Response(long requestId, String textMessage, Response.Outcome outcome, com.yahoo.messagebus.Trace trace) Creates a response containing a textual message- Parameters:
textMessage
- the message to encapsulate in the Responseoutcome
- the outcome of the operation
-
-
Method Details
-
getTextMessage
Returns the text message of this response or null if there is none- Returns:
- the message, or null
-
isSuccess
public boolean isSuccess()Returns whether this response encodes a success or a failure- Returns:
- true if success
-
outcome
Returns the outcome of this operation. -
getRequestId
public long getRequestId() -
getTrace
public com.yahoo.messagebus.Trace getTrace()Returns the trace of this operation, or null if there is none. -
equals
-
hashCode
public int hashCode() -
toString
-