Package org.jboss.netty.handler.codec.http

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


                throw new NoTypeConversionAvailableException(body, ChannelBuffer.class);
            }
        }

        // update HTTP method accordingly as we know if we have a body or not
        HttpMethod method = NettyHttpHelper.createMethod(message, body != null);
        request.setMethod(method);

        // set the content type in the response.
        String contentType = MessageHelper.getContentType(message);
        if (contentType != null) {
View Full Code Here


                throw new NoTypeConversionAvailableException(body, ChannelBuffer.class);
            }
        }

        // update HTTP method accordingly as we know if we have a body or not
        HttpMethod method = NettyHttpHelper.createMethod(message, body != null);
        request.setMethod(method);

        // set the content type in the response.
        String contentType = MessageHelper.getContentType(message);
        if (contentType != null) {
View Full Code Here

     * @param message  the Camel message
     * @return the created method
     */
    public static HttpMethod createMethod(Message message, boolean hasPayload) {
        // use header first
        HttpMethod m = message.getHeader(Exchange.HTTP_METHOD, HttpMethod.class);
        if (m != null) {
            return m;
        }
        String name = message.getHeader(Exchange.HTTP_METHOD, String.class);
        if (name != null) {
View Full Code Here

                throw new NoTypeConversionAvailableException(body, ChannelBuffer.class);
            }
        }

        // update HTTP method accordingly as we know if we have a body or not
        HttpMethod method = NettyHttpHelper.createMethod(message, body != null);
        request.setMethod(method);

        // set the content type in the response.
        String contentType = MessageHelper.getContentType(message);
        if (contentType != null) {
View Full Code Here

     * @param message  the Camel message
     * @return the created method
     */
    public static HttpMethod createMethod(Message message, boolean hasPayload) {
        // use header first
        HttpMethod m = message.getHeader(Exchange.HTTP_METHOD, HttpMethod.class);
        if (m != null) {
            return m;
        }
        String name = message.getHeader(Exchange.HTTP_METHOD, String.class);
        if (name != null) {
View Full Code Here

     * @param message  the Camel message
     * @return the created method
     */
    public static HttpMethod createMethod(Message message, boolean hasPayload) {
        // use header first
        HttpMethod m = message.getHeader(Exchange.HTTP_METHOD, HttpMethod.class);
        if (m != null) {
            return m;
        }
        String name = message.getHeader(Exchange.HTTP_METHOD, String.class);
        if (name != null) {
View Full Code Here

            if(request.isChunked()) {
                readingChunks = true;
            } else {
                // Instantiate the appropriate error handler
                HttpMethod httpMethod = request.getMethod();
                if(httpMethod.equals(HttpMethod.GET)) {
                    if(logger.isDebugEnabled()) {
                        logger.debug("Received a Http GET request at " + System.currentTimeMillis() + " ms");
                    }
                    requestValidator = new RestGetRequestValidator(request, messageEvent);
                } else if(httpMethod.equals(HttpMethod.POST)) {
                    if(logger.isDebugEnabled()) {
                        logger.debug("Recieved a Http POST request at "
                                     + System.currentTimeMillis()+ " ms");
                    }
                    requestValidator = new RestPutRequestValidator(request,
                                                                   messageEvent,
                                                                   this.isVectorClockOptional);
                } else if(httpMethod.equals(HttpMethod.DELETE)) {
                    if(logger.isDebugEnabled()) {
                        logger.debug("Received a Http DELETE request at "
                                     + System.currentTimeMillis()+ " ms");
                    }
                    requestValidator = new RestDeleteRequestValidator(request,
View Full Code Here

                    if(requestUriSegments.length > 2) {
                        String csvStoreList = requestUriSegments[2];
                        String[] storeArray = csvStoreList.split(",");
                        storeList = Lists.newArrayList(storeArray);
                    }
                    HttpMethod httpMethod = request.getMethod();
                    if(httpMethod.equals(HttpMethod.GET)) {
                        response = handleGet(storeList);
                    } else if(httpMethod.equals(HttpMethod.POST)) {
                        Map<String, Properties> configsToPut = Maps.newHashMap();
                        ChannelBuffer content = this.request.getContent();
                        if(content != null) {
                            byte[] postBody = new byte[content.capacity()];
                            content.readBytes(postBody);
                            configsToPut = ClientConfigUtil.readMultipleClientConfigAvro(new String(postBody));
                        }
                        response = handlePut(configsToPut);
                    } else if(httpMethod.equals(HttpMethod.DELETE)) {
                        if(storeList.size() == 0) {
                            response = handleBadRequest(
                                    "Cannot delete config for all stores. Please specify at least one store name.");
                        } else {
                            response = handleDelete(storeList);
View Full Code Here

 
  public void messageReceived(HttpServerHandler parentHandler, MessageEvent e, HttpRequest request) throws IOException
  {
    // evaluate request method (GET, POST, etc.)
    final String allowedMethod = "GET";
    HttpMethod requestMethod = request.getMethod();
    if(!requestMethod.toString().equalsIgnoreCase(allowedMethod))
    {
      parentHandler.invalidRequestMethod(e, allowedMethod);
      return;
    }
   
View Full Code Here

  public void messageReceived(HttpServerHandler parentHandler, MessageEvent e, HttpRequest request) throws IOException
  {
    // evaluate request method (GET, POST, etc.)
    final String allowedMethod = "POST";
    HttpMethod requestMethod = request.getMethod();
    if(!requestMethod.toString().equalsIgnoreCase(allowedMethod))
    {
      parentHandler.invalidRequestMethod(e, allowedMethod);
      return;
    }
View Full Code Here

TOP

Related Classes of org.jboss.netty.handler.codec.http.HttpMethod

Copyright © 2018 www.massapicom. 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.