Class ResponseStatusConverter

java.lang.Object
com.couchbase.client.core.endpoint.ResponseStatusConverter

public class ResponseStatusConverter
extends Object
Helper class to easily convert different handler status types to a common one.
Since:
1.1.2
Author:
Michael Nitschinger
See Also:
ResponseStatus, KeyValueStatus
  • Field Details

  • Constructor Details

    • ResponseStatusConverter

      public ResponseStatusConverter()
  • Method Details

    • fromBinary

      public static ResponseStatus fromBinary​(short code)
      Convert the binary protocol status in a typesafe enum that can be acted upon later.
      Parameters:
      code - the status to convert.
      Returns:
      the converted response status.
    • readErrorCodeFromErrorMap

      public static ErrorMap.ErrorCode readErrorCodeFromErrorMap​(short code)
      Get the error code from Key Value error map
      Parameters:
      code - the status to convert.
    • fromHttp

      public static ResponseStatus fromHttp​(int code)
      Convert the http protocol status in a typesafe enum that can be acted upon later.
      Parameters:
      code - the status to convert.
      Returns:
      the converted response status.
    • detailsFromBinary

      public static ResponseStatusDetails detailsFromBinary​(byte dataType, ByteBuf content)
    • updateBinaryErrorMap

      public static void updateBinaryErrorMap​(ErrorMap map)
      Updates the current error map in use for all uses of the response status converter. If the provided one is older than the one stored, this update operation will be ignored.
      Parameters:
      map - the map in use, it always uses the latest one.
    • getBinaryErrorMap

      public static ErrorMap getBinaryErrorMap()
      Get the current error map used by the response status converter
      Returns:
      error map