/*
 *  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.connector.framework.websocket;

import javax.websocket.Session;

/**
 * Message processor for WebSocket inbound messages.
 */
public interface WebSocketMessageProcessor {

    void receiveInitMessage(WebSocketInitMessage initMessage, Session session);

    void receiveTextMessage(WebSocketTextMessage textMessage, Session session);

    void receiveBinaryMessage(WebSocketBinaryMessage binaryMessage, Session session);

    void receivePongMessage(WebSocketControlMessage controlMessage, Session session);

    void receiveCloseMessage(WebSocketCloseMessage closeMessage, Session session);
}

@@ -740,41 +740,8 @@
 t;%0A%0A
-import javax.websocket.Session;%0A%0A
 /**%0A
@@ -851,339 +851,1260 @@
     
-void receiveInitMessage(WebSocketInitMessage initMessage, Session session);%0A%0A    void receiveTextMessage(WebSocketTextMessage textMessage, Session session);%0A%0A    void receiveBinaryMessage(WebSocketBinaryMessage binaryMessage, Session session);%0A%0A    void receivePongMessage(WebSocketControlMessage controlMessage, Session session);%0A
+/**%0A     * This method is used to trigger WebSocket handshake. This will initialize a client connection for WebSocket%0A     * server connector.%0A     *%0A     * @param initMessage %7B@link WebSocketInitMessage%7D to initialize connection.%0A     */%0A    void receiveInitMessage(WebSocketInitMessage initMessage);%0A%0A    /**%0A     * This method is used to process incoming WebSocket text messages.%0A     *%0A     * @param textMessage %7B@link WebSocketTextMessage%7D to process text messages.%0A     */%0A    void receiveTextMessage(WebSocketTextMessage textMessage);%0A%0A    /**%0A     * This method is used to process incoming WebSocket binary messages.%0A     *%0A     * @param binaryMessage %7B@link WebSocketBinaryMessage%7D to process binary messages.%0A     */%0A    void receiveBinaryMessage(WebSocketBinaryMessage binaryMessage);%0A%0A    /**%0A     * This method is used to process incoming WebSocket binary messages.%0A     *%0A     * @param controlMessage %7B@link WebSocketControlMessage%7D to indicate a incoming pong messages.%0A     */%0A    void receivePongMessage(WebSocketControlMessage controlMessage);%0A%0A    /**%0A     * This method is used to process incoming WebSocket close messages.%0A     *%0A     * @param closeMessage %7B@link WebSocketCloseMessage%7D to indicate incoming close messages.%0A     */
 %0A   
@@ -2167,26 +2167,10 @@
 sage
-, Session session
 );%0A
+%0A
 %7D%0A

Refactor WebSocketMessageProcessor and add doc comments.