Examples of HTTPStatus


Examples of com.apitrary.api.client.common.HttpStatus

    }
  }

  private <T> Response<T> toResponse(Timer timer, TransportResult transportResult, Request<T> request) {
    Response<T> response = null;
    HttpStatus status = HttpStatus.getStatus(transportResult.getStatusCode());
    response = deserialize(transportResult.getResult(), request);
    response.setStatusCode(status.getCode());
    response.setResponseTime(timer.getDifference());
    return response;
  }
View Full Code Here

Examples of com.badlogic.gdx.net.HttpStatus

    private Response response;
    private HttpStatus status;

    public HttpClientResponse (Response response) {
      this.response = response;
      this.status = new HttpStatus(response.getStatusCode());
    }
View Full Code Here

Examples of com.baulsupp.kolja.widefinder.format.HttpStatus

    if ("GET".equals(line.getValue(WideFinderConstants.ACTION))) {
      String url = (String) line.getValue(WideFinderConstants.URL);

      boolean isArticle = matchArticle(url);
      Long bytes = (Long) line.getValue(WideFinderConstants.SIZE);
      HttpStatus status = (HttpStatus) line.getValue(WideFinderConstants.STATUS);
      String client = (String) line.getValue(WideFinderConstants.IPADDRESS);
      String referrer = (String) line.getValue(WideFinderConstants.REFERRER);

      if (isArticle && status.isHit()) {
        articles.increment(url);
        clients.increment(client);

        if (isExternalReferrer(referrer)) {
          referrers.increment(referrer);
        }
      }

      if (bytes != null && status.equals(HttpStatus.SUCCESS_OK)) {
        byBytes.incrementBy(url, bytes);
      }

      if (status.equals(HttpStatus.CLIENT_ERROR_NOT_FOUND)) {
        _404.increment(url);
      }
    }
  }
View Full Code Here

Examples of com.cloudcontrolled.api.client.util.HttpStatus

      createTokenResponse = send(createTokenRequest);
    } catch (ValidationConstraintViolationException vcve) {
      throw new AuthorizationException(vcve);
    }

    HttpStatus status = HttpStatus.getStatus(createTokenResponse.getStatusCode());
    if (status.isError()) {
      if (status.equals(HttpStatus.Unauthorized)) {
        throw new AuthorizationException(HttpStatus.Unauthorized.toString());
      } else {
        throw new CommunicationErrorException(status);
      }
    }
View Full Code Here

Examples of com.linkedin.restli.common.HttpStatus

  @Override
  public AugmentedRestLiResponseData buildRestLiResponseData(RestRequest request, RoutingResult routingResult,
                                                             Object result, Map<String, String> headers)
  {
    final RecordTemplate record;
    final HttpStatus status;
    if (result instanceof GetResult)
    {
      final GetResult<?> getResult = (GetResult<?>) result;
      record = getResult.getValue();
      status = getResult.getStatus();
View Full Code Here

Examples of com.planet_ink.coffee_web.http.HTTPStatus

 
  @Override
  public void setStatusCode(int httpStatusCode)
  {
    statusCode = httpStatusCode;
    HTTPStatus status = HTTPStatus.find(httpStatusCode);
    if(status!=null)
      statusString = status.description();
    else
      statusString = "Unknown";
  }
View Full Code Here

Examples of com.stormpath.samples.todos.http.HttpStatus

        return throwable;
    }

    public Map<String,?> toMap() {
        Map<String,Object> m = new LinkedHashMap<String,Object>();
        HttpStatus status = getStatus();
        m.put(STATUS_PROP_NAME, status.value());

        int code = getCode();
        if (code <= 0) {
            code = status.value();
        }
        m.put(CODE_PROP_NAME, code);

        String httpStatusMessage = null;
View Full Code Here

Examples of org.apache.mina.http.api.HttpStatus

            final String[] header = HEADER_VALUE_PATTERN.split(headerFields[i]);
            generalHeaders.put(header[0].toLowerCase(), header[1]);
        }

        final String[] elements = RESPONSE_LINE_PATTERN.split(requestLine);
        HttpStatus status = null;
        final int statusCode = Integer.valueOf(elements[1]);
        for (int i = 0; i < HttpStatus.values().length; i++) {
            status = HttpStatus.values()[i];
            if (statusCode == status.code()) {
                break;
            }
        }
        final HttpVersion version = HttpVersion.fromString(elements[0]);
View Full Code Here

Examples of org.apache.wink.common.http.HttpStatus

     */
    @Test
    public void testHttpStatus() {
        assertEquals(200, HttpStatus.OK.getCode());
        assertEquals(HttpStatus.valueOf(HttpStatus.OK.getCode()), HttpStatus.OK);
        HttpStatus new200 = HttpStatus.OK.duplicate("test");
        assertEquals(new200.getMessage(), "test");
        assertEquals(new200.getCode(), HttpStatus.OK.getCode());

    }
View Full Code Here

Examples of org.exquery.http.HttpStatus

    protected void processHttpResponse(final Element httpResponse, final Map<SerializationProperty, String> serializationProperties, final HttpResponse response) throws RestXqServiceException {
       
        //get the status code (if present)
        final String strStatus = httpResponse.getAttribute(STATUS_ATTR_NAME);
        HttpStatus httpStatus = null;
        if(strStatus != null && !strStatus.isEmpty()) {
            final int status = Integer.parseInt(strStatus);
            try {
                httpStatus = HttpStatus.fromStatus(status);
            } catch(final IllegalArgumentException iae) {
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.