Package com.google.appengine.api.search
Class RequestStatusUtil
- java.lang.Object
-
- com.google.appengine.api.search.RequestStatusUtil
-
public final class RequestStatusUtil extends Object
Collection of utility methods for SearchServicePb.RequestStatus.
-
-
Constructor Summary
Constructors Constructor Description RequestStatusUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.google.appengine.api.search.proto.SearchServicePb.RequestStatusnewInvalidRequestStatus(IllegalArgumentException e)Creates a RequestStatus message suitable for reporting an invalid request.static com.google.appengine.api.search.proto.SearchServicePb.RequestStatusnewStatus(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode code)Creates a SearchServicePb.RequestStatus from the given code.static com.google.appengine.api.search.proto.SearchServicePb.RequestStatusnewStatus(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode code, String message)Creates a SearchServicePb.RequestStatus from the given code and message.static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus.BuildernewStatusBuilder(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode code, String message)Creates a SearchServicePb.RequestStatus.Builder from the given code and message.static com.google.appengine.api.search.proto.SearchServicePb.RequestStatusnewUnknownIndexStatus(com.google.appengine.api.search.proto.SearchServicePb.IndexSpec indexSpec)Creates a RequestStatus message suitable for reporting an unknown index.static com.google.appengine.api.search.proto.SearchServicePb.RequestStatusreduce(Collection<com.google.appengine.api.search.proto.SearchServicePb.RequestStatus> statuses)For a 'batch' request, determines a single status to stand for all.static com.google.apphosting.base.protos.Codes.CodetoCanonicalCode(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode appCode)Converts SearchServicePb.SearchServiceError.ErrorCode to canonical error code.
-
-
-
Method Detail
-
toCanonicalCode
public static com.google.apphosting.base.protos.Codes.Code toCanonicalCode(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode appCode)
Converts SearchServicePb.SearchServiceError.ErrorCode to canonical error code.
-
newStatusBuilder
public static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus.Builder newStatusBuilder(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode code, String message)Creates a SearchServicePb.RequestStatus.Builder from the given code and message.
-
newStatus
public static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus newStatus(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode code, String message)Creates a SearchServicePb.RequestStatus from the given code and message.
-
newStatus
public static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus newStatus(com.google.appengine.api.search.proto.SearchServicePb.SearchServiceError.ErrorCode code)
Creates a SearchServicePb.RequestStatus from the given code.
-
newInvalidRequestStatus
public static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus newInvalidRequestStatus(IllegalArgumentException e)
Creates a RequestStatus message suitable for reporting an invalid request.
-
newUnknownIndexStatus
public static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus newUnknownIndexStatus(com.google.appengine.api.search.proto.SearchServicePb.IndexSpec indexSpec)
Creates a RequestStatus message suitable for reporting an unknown index. We useSearchServicePb.SearchServiceError.ErrorCode.OKbecause the unknown index isn't an error condition but just a notice to the user.
-
reduce
public static com.google.appengine.api.search.proto.SearchServicePb.RequestStatus reduce(Collection<com.google.appengine.api.search.proto.SearchServicePb.RequestStatus> statuses)
For a 'batch' request, determines a single status to stand for all. Code will be OK if and only if the collection contains no non-OK statuses.If the collection is empty, the result will be an OK status with no detail.
If the collection has one element, the result will be that element.
If the collection has multiple elements with the same error code, the result will have that error code and the corresponding canonical code.
If there are multiple error statuses in the collection, the one with the highest numerical code in the ErrorCode enum will be chosen as representative, and the errorDetail field of the result will contain at least the errorDetail of that status.
-
-