Package org.apache.cassandra.net.http

Examples of org.apache.cassandra.net.http.HttpWriteResponse


    {
        HttpConnection.HttpRequestMessage httpRequestMessage = (HttpConnection.HttpRequestMessage)message.getMessageBody()[0];
        try
        {
            HttpRequest httpRequest = httpRequestMessage.getHttpRequest();
            HttpWriteResponse httpServerResponse = new HttpWriteResponse(httpRequest);
            if(httpRequest.getMethod().toUpperCase().equals("GET"))
            {
                // handle the get request type
                doGet(httpRequest, httpServerResponse);
            }
            else if(httpRequest.getMethod().toUpperCase().equals("POST"))
            {
                // handle the POST request type
                doPost(httpRequest, httpServerResponse);
            }

            // write the response we have constructed into the socket
            ByteBuffer buffer = httpServerResponse.flush();
            httpRequestMessage.getHttpConnection().write(buffer);
        }
        catch(Exception e)
        {
            logger_.warn(LogUtil.throwableToString(e));
View Full Code Here


    }

    public void run()
    {
        logger_.debug("Handling " + request_.getMethod());
        HttpWriteResponse httpServerResponse = new HttpWriteResponse(request_);
        if(request_.getMethod().toUpperCase().equals("GET"))
        {
            // handle the get request type
            doGet(request_, httpServerResponse);
        }
        else if(request_.getMethod().toUpperCase().equals("POST"))
        {
            // handle the POST request type
            doPost(request_, httpServerResponse);
        }

        // write the response we have constructed into the socket
        ByteBuffer buffer = null;
        buffer = httpServerResponse.flush();
        logger_.debug("http response is " + buffer.limit() + " bytes");
        request_.getHttpConnection().write(buffer);
    }
View Full Code Here

TOP

Related Classes of org.apache.cassandra.net.http.HttpWriteResponse

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.