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 | |
parent | 323a402e7b42eda9599c9518cb9f3a080dd746a6 (diff) |
Remove deprecated documentapi Response constructors
Diffstat (limited to 'documentapi')
6 files changed, 3 insertions, 99 deletions
diff --git a/documentapi/abi-spec.json b/documentapi/abi-spec.json index 3b4ffb11ca6..1a003d58d53 100644 --- a/documentapi/abi-spec.json +++ b/documentapi/abi-spec.json @@ -125,8 +125,6 @@ "methods": [ "public void <init>(long)", "public void <init>(long, com.yahoo.document.DocumentId)", - "public void <init>(long, java.lang.String, boolean)", - "public void <init>(long, com.yahoo.document.DocumentId, java.lang.String, boolean)", "public void <init>(long, com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.Response$Outcome)", "public void <init>(long, com.yahoo.document.DocumentId, java.lang.String, com.yahoo.documentapi.Response$Outcome, com.yahoo.messagebus.Trace)", "public com.yahoo.document.DocumentId getDocumentId()", @@ -185,8 +183,6 @@ "public void <init>(long)", "public void <init>(long, com.yahoo.document.Document)", "public void <init>(long, com.yahoo.document.Document, com.yahoo.messagebus.Trace)", - "public void <init>(long, java.lang.String, boolean)", - "public void <init>(long, com.yahoo.document.Document, java.lang.String, boolean)", "public void <init>(long, com.yahoo.document.Document, java.lang.String, com.yahoo.documentapi.Response$Outcome)", "public void <init>(long, com.yahoo.document.Document, java.lang.String, com.yahoo.documentapi.Response$Outcome, com.yahoo.messagebus.Trace)", "public com.yahoo.document.Document getDocument()", @@ -206,9 +202,7 @@ "methods": [ "public void <init>(long)", "public void <init>(long, com.yahoo.document.DocumentUpdate)", - "public void <init>(long, java.lang.String, boolean)", "public void <init>(long, java.lang.String, com.yahoo.documentapi.Response$Outcome)", - "public void <init>(long, com.yahoo.document.DocumentUpdate, java.lang.String, boolean)", "public void <init>(long, com.yahoo.document.DocumentUpdate, java.lang.String, com.yahoo.documentapi.Response$Outcome)", "public void <init>(long, com.yahoo.document.DocumentUpdate, java.lang.String, com.yahoo.documentapi.Response$Outcome, com.yahoo.messagebus.Trace)", "public com.yahoo.document.DocumentUpdate getDocumentUpdate()", @@ -424,7 +418,6 @@ "methods": [ "public void <init>(long)", "public void <init>(long, java.lang.String)", - "public void <init>(long, java.lang.String, boolean)", "public void <init>(long, java.lang.String, com.yahoo.documentapi.Response$Outcome)", "public void <init>(long, java.lang.String, com.yahoo.documentapi.Response$Outcome, com.yahoo.messagebus.Trace)", "public java.lang.String getTextMessage()", @@ -466,8 +459,7 @@ "fields": [ "public static final enum com.yahoo.documentapi.Result$ResultType SUCCESS", "public static final enum com.yahoo.documentapi.Result$ResultType TRANSIENT_ERROR", - "public static final enum com.yahoo.documentapi.Result$ResultType FATAL_ERROR", - "public static final enum com.yahoo.documentapi.Result$ResultType CONDITION_NOT_MET_ERROR" + "public static final enum com.yahoo.documentapi.Result$ResultType FATAL_ERROR" ] }, "com.yahoo.documentapi.Result": { 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()); } |