@@ -0,0 +1,2697 @@
+/*%0A *  Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.%0A *%0A *  WSO2 Inc. licenses this file to you under the Apache License,%0A *  Version 2.0 (the %22License%22); you may not use this file except%0A *  in compliance with the License.%0A *  You may obtain a copy of the License at%0A *%0A *  http://www.apache.org/licenses/LICENSE-2.0%0A *%0A *  Unless required by applicable law or agreed to in writing,%0A *  software distributed under the License is distributed on an%0A *  %22AS IS%22 BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY%0A *  KIND, either express or implied.  See the License for the%0A *  specific language governing permissions and limitations%0A *  under the License.%0A *%0A */%0A%0Apackage org.wso2.carbon.connector.framework.websocket;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0Aimport javax.websocket.Session;%0A%0A/**%0A * This interface can be used to set the common details of a given WebSocket message. %3Cbr%3E%0A * %3Cb%3ENote: Use this class in the application level only and only if the user needs to set the parameters of a given%0A * WebSocket message or need transport properties in any mean. %3Cbr%3E%0A *%0A * Casting any WebSocket message to this class in the application level is not recommended. If user needs this class%0A * for any casting in application level indicates that there is a missing functionality from the given WebSocket%0A * message type.%3Cbr%3E%0A *%0A * Also note that this class is public since developers might need to create WebSocket messages in the application%0A * level for testing purposes and this class can be extended to use the setter methods for those purposes.%3C/b%3E%0A */%0Apublic abstract class WebSocketMessagePropertiesManager %7B%0A%0A    private Map%3CString, Object%3E properties = new HashMap%3C%3E();%0A%0A    public void setProperty(String key, Object value) %7B%0A        properties.put(key, value);%0A    %7D%0A%0A    public void setProperties(Map%3CString, Object%3E properties) %7B%0A        properties.entrySet().forEach(%0A                entry -%3E this.properties.put(entry.getKey(), entry.getValue())%0A        );%0A    %7D%0A%0A    public Object getProperty(String key) %7B%0A        return properties.get(key);%0A    %7D%0A%0A    public Map%3CString, Object%3E getProperties() %7B%0A        return properties;%0A    %7D%0A%0A    // WebSocket channel context related setters%0A    abstract void setSubProtocol(String subProtocol);%0A    abstract void setTarget(String target);%0A    abstract void setListenerPort(String listenerPort);%0A    abstract void setWebSocketProtocolVersion(String protocolVersion);%0A    abstract void setIsConnectionSecured(boolean isConnectionSecured);%0A%0A    // WebSocket Session context related setters%0A    abstract void setServerSession(Session serverSession);%0A    abstract void addClientSession(Session clientSession);%0A%7D%0A

Introduce WebSocket message properties manager