Package com.yahoo.documentapi
Class Response
- java.lang.Object
-
- com.yahoo.documentapi.Response
-
- Direct Known Subclasses:
DocumentIdResponse
,DocumentResponse
,DocumentUpdateResponse
,RemoveResponse
,UpdateResponse
public class Response extends java.lang.Object
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
Nested Classes Modifier and Type Class Description static class
Response.Outcome
-
Constructor Summary
Constructors Constructor Description Response(long requestId)
Creates a successful response containing no informationResponse(long requestId, java.lang.String textMessage)
Creates a successful response containing a textual messageResponse(long requestId, java.lang.String textMessage, boolean success)
Deprecated.Response(long requestId, java.lang.String textMessage, Response.Outcome outcome)
Creates a response containing a textual messageResponse(long requestId, java.lang.String textMessage, Response.Outcome outcome, com.yahoo.messagebus.Trace trace)
Creates a response containing a textual message
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
long
getRequestId()
java.lang.String
getTextMessage()
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
isSuccess()
Returns whether this response encodes a success or a failureResponse.Outcome
outcome()
Returns the outcome of this operation.java.lang.String
toString()
-
-
-
Constructor Detail
-
Response
public Response(long requestId)
Creates a successful response containing no information
-
Response
public Response(long requestId, java.lang.String textMessage)
Creates a successful response containing a textual message- Parameters:
textMessage
- the message to encapsulate in the Response
-
Response
@Deprecated(since="7") public Response(long requestId, java.lang.String textMessage, boolean success)
Deprecated.Creates a response containing a textual message- Parameters:
textMessage
- the message to encapsulate in the Responsesuccess
- true if the response represents a successful call
-
Response
public Response(long requestId, java.lang.String textMessage, Response.Outcome outcome)
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, java.lang.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 Detail
-
getTextMessage
public java.lang.String 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
public Response.Outcome 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
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-