Unwraps a {@link alluxio.proto.dataserver.Protocol.Response}.

@param response the response
16356
public static void unwrapResponse(Protocol.Response response) throws AlluxioStatusException {
    Status status = ProtoUtils.fromProto(response.getStatus());
    if (status != Status.OK) {
      throw AlluxioStatusException.from(status.withDescription(response.getMessage()));
    }
  }
933046
@RequestMapping(value = "/userLogout", method = RequestMethod.GET)
    @ResponseBody
    public JsonObject<?> logout(HttpServletResponse response) {
        JsonObject<?> ret = JsonObject.create();
        CookieUtils.resetCookieValue(response, UserWebConstant.CookieKey.USERNAME.getValue());
        CookieUtils.resetCookieValue(response, UserWebConstant.CookieKey.PWDMD5.getValue());
        return ret;
    }
624480
public synchronized void sendResponse(BinaryResponse response) {
        if (pending == null) {
            pending = new LinkedList<ByteBuffer>();
        }
        pending.add(response.getBuffer());
    }
451849
protected void sendServerResponse(HttpMessage response) {
        designer.http().server(httpServer).send()
                .response(response.getStatusCode())
                .message(response);
    }
1310174
def parse_response(self, response):
        
        parser, unmarshaller = self.getparser()
        parser.feed(response.text.encode('utf-8'))
        parser.close()
        return unmarshaller.close()
73585
public void removeResponseProp(String key) {
        if (responseProps != null && key != null) {
            responseProps.remove(key);
        }
    }
425481
private void processReturnOperations(final ResponseMessage response) {
    final List<OperationMessage> ops = response.getOperations();

    // If there are no observable effects, this will be null
    if (ops == null) {
      return;
    }

    for (final OperationMessage op : ops) {
      final SimpleProxyId<?> id = this.getId(op);
      WriteOperation[] toPropagate = null;

      // May be null if the server is returning an unpersisted object
      final WriteOperation effect = op.getOperation();
      if (effect != null) {
        switch (effect) {
          case DELETE:
            toPropagate = DELETE_ONLY;
            break;
          case PERSIST:
            toPropagate = PERSIST_AND_UPDATE;
            break;
          case UPDATE:
            toPropagate = UPDATE_ONLY;
            break;
          default:
            // Should never reach here
            throw new RuntimeException(effect.toString());
        }
      }
      this.processReturnOperation(id, op, toPropagate);
    }

    assert this.state.returnedProxies.size() == ops.size();
  }
1103402
public static HttpServletResponse getHttpServletResponse(final Response response)
	{
		final WebResponse webResponse = (WebResponse)response;
		final HttpServletResponse httpServletResponse = (HttpServletResponse)webResponse
			.getContainerResponse();
		return httpServletResponse;
	}
677417
public synchronized boolean tryDelegateResponseHandling(Response<ByteArray, Object> response) {
        if(responseHandlingCutoff) {
            return false;
        } else {
            responseQueue.offer(response);
            this.notifyAll();
            return true;
        }
    }
887198
@Override
    public <T> T unwrap(Class<T> arg0)
    {
        return query.unwrap(arg0);
    }
505614
public function unwrapResponse(ResponseInterface $response)
    {
        $contentType = $response->getHeaderLine('Content-Type');
        $contents = $response->getBody()->getContents();

        if (false !== stripos($contentType, 'json') || stripos($contentType, 'javascript')) {
            return json_decode($contents, true);
        } elseif (false !== stripos($contentType, 'xml')) {
            return json_decode(json_encode(simplexml_load_string($contents, 'SimpleXMLElement', LIBXML_NOCDATA), JSON_UNESCAPED_UNICODE), true);
        }

        return $contents;
    }
886326
public static <T> GenericResponseBuilder<T> fromResponse(GenericResponse<T> response) {
    GenericResponseBuilder<T> builder =
        genericResponseBuilderFactory.create(response.getStatus(), response.body());

    for (String headerName : response.getHeaders().keySet()) {
      List<Object> headerValues = response.getHeaders().get(headerName);
      for (Object headerValue : headerValues) {
        builder.header(headerName, headerValue);
      }
    }
    return builder;
  }
237702
public void releaseResponse(HttpResponseMessageImpl response) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "releaseResponse: " + response);
        }
        this.respPool.put(response);
    }
998405
public static Tag outcome(ContainerResponse response) {
        if (response != null) {
            int status = response.getStatus();
            switch (Response.Status.Family.familyOf(status)) {
                case INFORMATIONAL:
                    return OUTCOME_INFORMATIONAL;

                case SUCCESSFUL:
                    return OUTCOME_SUCCESS;

                case REDIRECTION:
                    return OUTCOME_REDIRECTION;

                case CLIENT_ERROR:
                    return OUTCOME_CLIENT_ERROR;

                case SERVER_ERROR:
                    return OUTCOME_SERVER_ERROR;

                default:
                    return OUTCOME_UNKNOWN;
            }
        }
        /* In case there is no response we are dealing with an unmapped exception. */
        return OUTCOME_SERVER_ERROR;
    }
95468
protected Bundle unmarshalFeed(HttpResponse response, String format) {
    Bundle feed = null;
    byte[] cnt = log(response);
    String contentType = response.getHeaders("Content-Type")[0].getValue();
    OperationOutcome error = null;
    try {
      if (cnt != null) {
        if(contentType.contains(ResourceFormat.RESOURCE_XML.getHeader()) || contentType.contains("text/xml+fhir")) {
          Resource rf = getParser(format).parse(cnt);
          if (rf instanceof Bundle)
            feed = (Bundle) rf;
          else if (rf instanceof OperationOutcome && hasError((OperationOutcome) rf)) {
            error = (OperationOutcome) rf;
          } else {
            throw new EFhirClientException("Error reading server response: a resource was returned instead");
          }
        }
      }
    } catch(IOException ioe) {
      throw new EFhirClientException("Error reading Http Response", ioe);
    } catch(Exception e) {
      throw new EFhirClientException("Error parsing response message", e);
    }
    if(error != null) {
      throw new EFhirClientException("Error from server: "+ResourceUtilities.getErrorDescription(error), error);
    }
    return feed;
  }
960144
public synchronized void setResponse(HttpServletResponse response) {

        if (perThreadResponse == null) {
            perThreadResponse = new ThreadLocal<HttpServletResponse>();
        }
        perThreadResponse.set(response);
    }
1255130
public function unwrapResponse(ResponseInterface $response)
    {
        if ($response->getStatusCode() != 200) {
            throw new ServerNetworkException($response->getStatusCode(), $response->getHeaders(), $response->getBody()->getContents());
        }
        $content = \GuzzleHttp\json_decode($response->getBody()->getContents(), true);
        if (isset($content['ActionStatus']) && $content['ActionStatus'] == 'OK') {
            $this->succeed = true;
            foreach ($content as $name => $value) {
                $setter = 'set' . $name;
                if (method_exists($this, $setter)) {
                    $this->$setter($value);
                } else if (property_exists($this, $name)) {
                    $this->{$name} = $value;
                } else {
                    $this->_content[$name] = $value;
                }
            }
        } else {
            $this->succeed = false;
            if (isset($content['ActionStatus']) && $content['ActionStatus'] == 'FAIL') {
                throw new ServerErrorHttpException($content['ErrorInfo'], $content['ErrorCode']);
            }
        }
    }