diff options
author | jonmv <venstad@gmail.com> | 2022-06-01 14:03:08 +0200 |
---|---|---|
committer | gjoranv <gv@verizonmedia.com> | 2022-06-08 11:45:23 +0200 |
commit | 43ee6cdb08ebf33787eeb0d977f52a33531eb735 (patch) | |
tree | ae4986fa416dae1f50dcf57b463aa4211b511024 /documentapi/src/main/java/com | |
parent | 323a402e7b42eda9599c9518cb9f3a080dd746a6 (diff) |
Remove deprecated documentapi Response constructors
Diffstat (limited to 'documentapi/src/main/java/com')
5 files changed, 2 insertions, 90 deletions
diff --git a/documentapi/src/main/java/com/yahoo/documentapi/DocumentIdResponse.java b/documentapi/src/main/java/com/yahoo/documentapi/DocumentIdResponse.java index 9625a7c92ad..68e43edf082 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/DocumentIdResponse.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/DocumentIdResponse.java @@ -31,30 +31,6 @@ public class DocumentIdResponse extends Response { } /** - * Creates a response containing a textual message - * - * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public DocumentIdResponse(long requestId, String textMessage, boolean success) { - this(requestId, null, textMessage, success ? Outcome.SUCCESS : Outcome.ERROR); - } - - /** - * Creates a response containing a textual message and/or a document id - * - * @param documentId the DocumentId to encapsulate in the Response - * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public DocumentIdResponse(long requestId, DocumentId documentId, String textMessage, boolean success) { - this(requestId, documentId, textMessage, success ? Outcome.SUCCESS : Outcome.ERROR); - } - - - /** * Creates a response containing a textual message and/or a document id * * @param documentId the DocumentId to encapsulate in the Response diff --git a/documentapi/src/main/java/com/yahoo/documentapi/DocumentResponse.java b/documentapi/src/main/java/com/yahoo/documentapi/DocumentResponse.java index 4b17fef7f59..4bc5fb400a7 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/DocumentResponse.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/DocumentResponse.java @@ -39,31 +39,6 @@ public class DocumentResponse extends Response { } /** - * Creates a response containing a textual message - * - * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public DocumentResponse(long requestId, String textMessage, boolean success) { - super(requestId, textMessage, success ? Outcome.NOT_FOUND : Outcome.ERROR); - document = null; - } - - /** - * Creates a response containing a textual message and/or a document - * - * @param document the Document to encapsulate in the Response - * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public DocumentResponse(long requestId, Document document, String textMessage, boolean success) { - this(requestId, document, textMessage, success ? Outcome.SUCCESS : Outcome.ERROR); - } - - - /** * Creates a response containing a textual message and/or a document * * @param document the Document to encapsulate in the Response diff --git a/documentapi/src/main/java/com/yahoo/documentapi/DocumentUpdateResponse.java b/documentapi/src/main/java/com/yahoo/documentapi/DocumentUpdateResponse.java index d9c286446ac..109ec2523fe 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/DocumentUpdateResponse.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/DocumentUpdateResponse.java @@ -34,17 +34,6 @@ public class DocumentUpdateResponse extends Response { * Creates a response containing a textual message * * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public DocumentUpdateResponse(long requestId, String textMessage, boolean success) { - this(requestId, null, textMessage, success ? Outcome.SUCCESS : Outcome.ERROR); - } - - /** - * Creates a response containing a textual message - * - * @param textMessage the message to encapsulate in the Response * @param outcome the outcome of this operation */ public DocumentUpdateResponse(long requestId, String textMessage, Outcome outcome) { @@ -56,19 +45,6 @@ public class DocumentUpdateResponse extends Response { * * @param documentUpdate the DocumentUpdate to encapsulate in the Response * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public DocumentUpdateResponse(long requestId, DocumentUpdate documentUpdate, String textMessage, boolean success) { - this(requestId, documentUpdate, textMessage, success ? Outcome.SUCCESS : Outcome.ERROR); - } - - - /** - * Creates a response containing a textual message and/or a document update - * - * @param documentUpdate the DocumentUpdate to encapsulate in the Response - * @param textMessage the message to encapsulate in the Response * @param outcome the outcome of this operation */ public DocumentUpdateResponse(long requestId, DocumentUpdate documentUpdate, String textMessage, Outcome outcome) { diff --git a/documentapi/src/main/java/com/yahoo/documentapi/Response.java b/documentapi/src/main/java/com/yahoo/documentapi/Response.java index aee9dc010ab..3778189e272 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/Response.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/Response.java @@ -41,17 +41,6 @@ public class Response { * Creates a response containing a textual message * * @param textMessage the message to encapsulate in the Response - * @param success true if the response represents a successful call - */ - @Deprecated(since = "7") // TODO: Remove on Vespa 8 - public Response(long requestId, String textMessage, boolean success) { - this(requestId, textMessage, success ? SUCCESS : ERROR); - } - - /** - * Creates a response containing a textual message - * - * @param textMessage the message to encapsulate in the Response * @param outcome the outcome of the operation */ public Response(long requestId, String textMessage, Outcome outcome) { diff --git a/documentapi/src/main/java/com/yahoo/documentapi/Result.java b/documentapi/src/main/java/com/yahoo/documentapi/Result.java index 6c83797cd89..d6f444a3f63 100644 --- a/documentapi/src/main/java/com/yahoo/documentapi/Result.java +++ b/documentapi/src/main/java/com/yahoo/documentapi/Result.java @@ -110,17 +110,13 @@ public class Result { /** The request failed, but may be successful if retried at a later time. */ TRANSIENT_ERROR, /** The request failed, and retrying is pointless. */ - FATAL_ERROR, - /** Condition specified in operation not met error */ - @Deprecated(since = "7", forRemoval = true) // TODO: Remove on Vespa 8 — this is a Response outcome, not a Result outcome. - CONDITION_NOT_MET_ERROR + FATAL_ERROR } + public static Error toError(ResultType result) { switch (result) { case TRANSIENT_ERROR: return new Error(ErrorCode.TRANSIENT_ERROR, ResultType.TRANSIENT_ERROR.name()); - case CONDITION_NOT_MET_ERROR: - return new Error(ErrorCode.FATAL_ERROR, ResultType.CONDITION_NOT_MET_ERROR.name()); case FATAL_ERROR: return new Error(ErrorCode.FATAL_ERROR, ResultType.FATAL_ERROR.name()); } |