Examples of HttpResponseStatus


Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

            throw new RuntimeException(e);
        }
    }

    private void upgradeResponseHixie75(HttpRequest req, HttpResponse res) {
        res.setStatus(new HttpResponseStatus(101, "Web Socket Protocol Handshake"));
        res.addHeader(UPGRADE, WEBSOCKET);
        res.addHeader(CONNECTION, HttpHeaders.Values.UPGRADE);
        res.addHeader(WEBSOCKET_ORIGIN, req.getHeader(ORIGIN));
        res.addHeader(WEBSOCKET_LOCATION, getWebSocketLocation(req));
        String protocol = req.getHeader(WEBSOCKET_PROTOCOL);
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

  }

  private void returnPlainStatus(DatabusRequest request) throws IOException
  {
    String statusString;
    HttpResponseStatus statusCode;
    if (null != _status && _status.getStatus() != DatabusComponentStatus.Status.RUNNING)
    {
      statusString = "BAD\n";
      statusCode = HttpResponseStatus.SERVICE_UNAVAILABLE;
    }
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

    @Override
    public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception {
        if (!handshakeCompleted) {
            HttpResponse response = (HttpResponse)e.getMessage();
            final HttpResponseStatus status = new HttpResponseStatus(101, "Web Socket Protocol Handshake");

            final boolean validStatus = response.getStatus().equals(status);
            final boolean validUpgrade = response.getHeader(Names.UPGRADE).equals(Values.WEBSOCKET);
            final boolean validConnection = response.getHeader(Names.CONNECTION).equals(Values.UPGRADE);
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

            WEBSOCKET.equalsIgnoreCase(req.getHeader(Names.UPGRADE))) {

            // Create the WebSocket handshake response.
            HttpResponse res = new DefaultHttpResponse(
                    HTTP_1_1,
                    new HttpResponseStatus(101, "Web Socket Protocol Handshake"));
            res.addHeader(Names.UPGRADE, WEBSOCKET);
            res.addHeader(CONNECTION, Values.UPGRADE);
            res.addHeader(WEBSOCKET_ORIGIN, req.getHeader(ORIGIN));
            res.addHeader(WEBSOCKET_LOCATION, getWebSocketLocation(req));
            String protocol = req.getHeader(WEBSOCKET_PROTOCOL);
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

            WEBSOCKET.equalsIgnoreCase(req.getHeader(Names.UPGRADE))) {

            // Create the WebSocket handshake response.
            HttpResponse res = new DefaultHttpResponse(
                    HTTP_1_1,
                    new HttpResponseStatus(101, "Web Socket Protocol Handshake"));
            res.addHeader(Names.UPGRADE, WEBSOCKET);
            res.addHeader(CONNECTION, Values.UPGRADE);
            res.addHeader(WEBSOCKET_ORIGIN, req.getHeader(ORIGIN));
            res.addHeader(WEBSOCKET_LOCATION, getWebSocketLocation(req));
            String protocol = req.getHeader(WEBSOCKET_PROTOCOL);
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

        if(storeList == null || storeList.isEmpty()) {
            response = storeClientConfigs.getAllConfigs();
        } else {
            response = storeClientConfigs.getSpecificConfigs(storeList);
        }
        HttpResponseStatus responseStatus;
        if(response.contains(StoreClientConfigService.ERROR_MESSAGE_PARAM_KEY)
           && response.contains(StoreClientConfigService.STORE_NOT_FOUND_ERROR)) {
            responseStatus = NOT_FOUND;
        } else {
            responseStatus = OK;
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

    }

    private HttpResponse handlePut(Map<String, Properties> configsToPut) {
        logger.info("Handling a Http POST Admin request");
        String response = storeClientConfigs.putConfigs(configsToPut);
        HttpResponseStatus responseStatus;
        if(response.contains(StoreClientConfigService.ERROR_MESSAGE_PARAM_KEY)) {
            responseStatus = BAD_REQUEST;
        } else {
            responseStatus = OK;
        }
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

    }

    private HttpResponse handleDelete(List<String> storeList) {
        logger.info("Handling a Http DELETE Admin request");
        String response = storeClientConfigs.deleteSpecificConfigs(storeList);
        HttpResponseStatus responseStatus;
        if(response.contains(StoreClientConfigService.ERROR_MESSAGE_PARAM_KEY)
           && response.contains(StoreClientConfigService.STORE_ALREADY_DOES_NOT_EXIST_WARNING)) {
            responseStatus = NOT_FOUND;
        } else {
            responseStatus = OK;
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

    
     */
    // Create the WebSocket handshake response.
        HttpResponse res = new DefaultHttpResponse(
                HTTP_1_1,
                new HttpResponseStatus(101, "Web Socket Protocol Handshake"));
        res.addHeader(Names.UPGRADE, WEBSOCKET);
        res.addHeader(CONNECTION, Values.UPGRADE);

        // Fill in the headers and contents depending on handshake method.
        if (request.containsHeader(SEC_WEBSOCKET_KEY1) &&
View Full Code Here

Examples of org.jboss.netty.handler.codec.http.HttpResponseStatus

   *
   * @param status
   * @return
   */
  public ResponseBuilder status(int code, String message) {
    this.response.setStatus(new HttpResponseStatus(code, message));
    return this;
  }
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.