Examples of HttpStatus


Examples of org.glassfish.grizzly.http.util.HttpStatus

    public void onMissingResource(Request req, Response res) {

        LogHelper.getDefaultLogger().log(Level.FINER, "Received something on {0}", req.getRequestURI());
        LogHelper.getDefaultLogger().log(Level.FINER, "QueryString = {0}", req.getQueryString());
       
        HttpStatus statusCode = HttpStatus.OK_200;

        String requestURI = req.getRequestURI();
    /*    if (requestURI.startsWith("/__asadmin/ADMINGUI")) {
            super.service(req, res);

View Full Code Here

Examples of org.glassfish.grizzly.http.util.HttpStatus

        }

        // tyrusConnection == null

        // proxy
        final HttpStatus httpStatus = ((HttpResponsePacket) message.getHttpHeader()).getHttpStatus();

        if (httpStatus.getStatusCode() != 101) {
            if (proxy && !PROXY_CONNECTED.get(grizzlyConnection)) {
                if (httpStatus == HttpStatus.OK_200) {

                    PROXY_CONNECTED.set(grizzlyConnection, true);

                    // TYRUS-221: Proxy handshake is complete, we need to enable SSL layer for secure ("wss")
                    // connections now.
                    if (sslFilter != null) {
                        ((GrizzlyClientSocket.FilterWrapper) sslFilter).enable();
                    }

                    httpCodecFilter.resetResponseProcessing(grizzlyConnection);

                    final UpgradeRequest upgradeRequest = UPGRADE_REQUEST.get(grizzlyConnection);
                    ctx.write(getHttpContent(upgradeRequest));
                    UPGRADE_REQUEST.remove(grizzlyConnection);
                } else {
                    throw new IOException(String.format("Proxy error. %s: %s", httpStatus.getStatusCode(),
                            new String(httpStatus.getReasonPhraseBytes(), "UTF-8")));
                }

                return ctx.getInvokeAction();
            }
        }
View Full Code Here

Examples of org.glassfish.grizzly.http.util.HttpStatus

    public void onMissingResource(Request req, Response res) {

        LogHelper.getDefaultLogger().log(Level.FINER, "Received something on {0}", req.getRequestURI());
        LogHelper.getDefaultLogger().log(Level.FINER, "QueryString = {0}", req.getQueryString());
       
        HttpStatus statusCode = HttpStatus.OK_200;

        String requestURI = req.getRequestURI();
    /*    if (requestURI.startsWith("/__asadmin/ADMINGUI")) {
            super.service(req, res);

View Full Code Here

Examples of org.springframework.http.HttpStatus

  // check if error is caused by wrong credentials
  public static boolean isWrongCredentialsException(CoreException e) {
    Throwable cause = e.getCause();
    if (cause instanceof HttpClientErrorException) {
      HttpClientErrorException httpException = (HttpClientErrorException) cause;
      HttpStatus statusCode = httpException.getStatusCode();
      if (statusCode.equals(HttpStatus.FORBIDDEN) && httpException instanceof CloudFoundryException) {
        return ((CloudFoundryException) httpException).getDescription().equals("Operation not permitted"); //$NON-NLS-1$
      }
    }
    return false;
  }
View Full Code Here

Examples of org.springframework.http.HttpStatus

   * returns null.
   */
  public static HttpClientErrorException getBadRequestException(Exception t) {
    HttpClientErrorException httpException = getHttpClientError(t);
    if (httpException != null) {
      HttpStatus statusCode = httpException.getStatusCode();
      if (HttpStatus.BAD_REQUEST.equals(statusCode)) {
        return httpException;
      }
    }
    return null;
View Full Code Here

Examples of org.springframework.http.HttpStatus

  public static boolean isHttpException(Throwable t, HttpStatus status) {

    HttpClientErrorException httpException = getHttpClientError(t);

    if (httpException != null) {
      HttpStatus statusCode = httpException.getStatusCode();
      return statusCode.equals(status);
    }

    return false;
  }
View Full Code Here

Examples of org.springframework.http.HttpStatus

    Map<String, Object> multipartMap = new HashMap<String, Object>();
    multipartMap.put("company", new String[]{"SpringSource", "VMWare"});
    multipartMap.put("company-logo", s2logo);
    logger.info("Created multipart request: " + multipartMap);
    MultipartRequestGateway requestGateway = context.getBean("requestGateway", MultipartRequestGateway.class);
    HttpStatus reply = requestGateway.postMultipartRequest(multipartMap);
    System.out.println("Replied with HttpStatus code: " + reply);
  }
View Full Code Here

Examples of org.springframework.http.HttpStatus

  protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {

    response.setContentType("application/jrd+json");


    HttpStatus code = (HttpStatus) model.get("code");
    if (code == null) {
      code = HttpStatus.OK; // default to 200
    }

    response.setStatus(code.value());

    try {

      String resource = (String)model.get("resource");
      String issuer = (String)model.get("issuer");
View Full Code Here

Examples of org.springframework.http.HttpStatus

  protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {

    response.setContentType("application/json");


    HttpStatus code = (HttpStatus) model.get("code");
    if (code == null) {
      code = HttpStatus.OK; // default to 200
    }

    response.setStatus(code.value());

    try {

      Writer out = response.getWriter();
      Object obj = model.get("entity");
View Full Code Here

Examples of org.springframework.http.HttpStatus

  public static final String VIEWNAME = "httpCodeView";
 
  @Override
  protected void renderMergedOutputModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {
    HttpStatus code = (HttpStatus) model.get("code");
    if (code == null) {
      code = HttpStatus.OK; // default to 200
    }

    response.setStatus(code.value());

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.