/*
 * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
 *
 * WSO2 Inc. licenses this file to you under the Apache License,
 * Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

package org.wso2.carbon.transport.http.netty.message;

import io.netty.handler.codec.http.HttpContent;

import java.nio.ByteBuffer;
import java.util.List;

/**
 * Collects entity of the request/response
 */
public interface EntityCollector {

    void addHttpContent(HttpContent httpContent);
    HttpContent getHttpContent();
    ByteBuffer getMessageBody();
    List<ByteBuffer> getFullMessageBody();
    boolean isEmpty();
    int getFullMessageLength();
    boolean isEndOfMsgAdded();
    void addMessageBody(ByteBuffer msgBody);
    void markMessageEnd();
    void setEndOfMsgAdded(boolean endOfMsgAdded);
    void release();
    boolean isAlreadyRead();
    void setAlreadyRead(boolean alreadyRead);
}

@@ -919,420 +919,1637 @@
     
-void addHttpContent(HttpContent httpContent);%0A    HttpContent getHttpContent();%0A    ByteBuffer getMessageBody();%0A    List%3CByteBuffer%3E getFullMessageBody();%0A    boolean isEmpty();%0A    int getFullMessageLength();%0A    boolean isEndOfMsgAdded();%0A    void addMessageBody(ByteBuffer msgBody);%0A    void markMessageEnd();%0A    void setEndOfMsgAdded(boolean endOfMsgAdded);%0A    void release();%0A    boolean isAlreadyRead();
+/**%0A     * Add httpContent to the queue.%0A     * @param httpContent httpContent%0A     */%0A    void addHttpContent(HttpContent httpContent);%0A%0A    /**%0A     * Get the first httpContent from the queue.%0A     * @return HttpContent%0A     */%0A    HttpContent getHttpContent();%0A%0A    /**%0A     * Get the first ByteBuffer version of the HttpContent from the queue.%0A     * @return ByteBuffer%0A     */%0A    ByteBuffer getMessageBody();%0A%0A    /**%0A     * Add the ByteBuffer version the httpContent to the queue.%0A     * @param msgBody ByteBuffer version of the httpContent.%0A     */%0A    void addMessageBody(ByteBuffer msgBody);%0A%0A    /**%0A     * Get the full message body%0A     * @return complete message body%0A     */%0A    List%3CByteBuffer%3E getFullMessageBody();%0A%0A    /**%0A     * Check if the queue is empty.%0A     * @return true or false%0A     */%0A    boolean isEmpty();%0A%0A    /**%0A     * Get the full message length%0A     * @return message length%0A     */%0A    int getFullMessageLength();%0A%0A    /**%0A     * Check if the last message is added to the queue.%0A     * @return true or false%0A     */%0A    boolean isEndOfMsgAdded();%0A%0A    /**%0A     * Mark end of message.%0A     */%0A    void markMessageEnd();%0A%0A    /**%0A     * Set end of message%0A     * @param endOfMsgAdded indicated using true or false%0A     */%0A    void setEndOfMsgAdded(boolean endOfMsgAdded);%0A%0A    /**%0A     * Release the allocated netty buffers%0A     */%0A    void release();%0A%0A    /**%0A     * Allows check if the stream is consumed or not.%0A     * @return true or false%0A     */%0A    boolean isAlreadyRead();%0A%0A    /**%0A     * Update the state if already read.%0A     * @param alreadyRead indicated using true or false%0A     */
 %0A   

Add doc comments for the api