/**
 * Copyright (c) 2015-2017, Michael Yang 杨福海 (fuhai999@gmail.com).
 * <p>
 * Licensed 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
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * 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 io.jboot.server;

import io.jboot.config.annotation.PropertieConfig;


@PropertieConfig(prefix = "jboot.server")
public class JbootServerConfig {

    public static final String TYPE_UNDERTOW = "undertow";
    public static final String TYPE_TOMCAT = "tomcat";
    public static final String TYPE_JETTY = "jetty";

    private String type = TYPE_UNDERTOW;
    private String host = "0.0.0.0";
    private int port = 8080;
    private String contextPath = "/";
    private boolean websocketEnable = false;
    private int websocketBufferPoolSize = 100;
    private String websocketEndpoint;


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getContextPath() {
        return contextPath;
    }

    public void setContextPath(String contextPath) {
        this.contextPath = contextPath;
    }

    public boolean isWebsocketEnable() {
        return websocketEnable;
    }

    public void setWebsocketEnable(boolean websocketEnable) {
        this.websocketEnable = websocketEnable;
    }

    public int getWebsocketBufferPoolSize() {
        return websocketBufferPoolSize;
    }

    public void setWebsocketBufferPoolSize(int websocketBufferPoolSize) {
        this.websocketBufferPoolSize = websocketBufferPoolSize;
    }

    public String getWebsocketEndpoint() {
        return websocketEndpoint;
    }

    public void setWebsocketEndpoint(String websocketEndpoint) {
        this.websocketEndpoint = websocketEndpoint;
    }

    @Override
    public String toString() {
        return "JbootServerConfig {" +
                "type='" + type + '\'' +
                ", host='" + host + '\'' +
                ", port='" + port + '\'' +
                ", contextPath='" + contextPath + '\'' +
                '}';
    }
}

@@ -1101,16 +1101,163 @@
 h = %22/%22;
+%0A%0A    //websocket %E7%9A%84%E7%9B%B8%E5%85%B3%E9%85%8D%E7%BD%AE%0A    //%E5%85%B7%E4%BD%93%E4%BD%BF%E7%94%A8%E8%AF%B7%E5%8F%82%E8%80%83%EF%BC%9Ahttps://github.com/undertow-io/undertow/tree/master/examples/src/main/java/io/undertow/examples/jsrwebsockets
 %0A    pri
@@ -2772,17 +2772,16 @@
 %22, port=
-'
 %22 + port
@@ -2782,23 +2782,16 @@
 + port +
- '%5C'' +
 %0A       
@@ -2832,32 +2832,231 @@
 xtPath + '%5C'' +%0A
+                %22, websocketEnable=%22 + websocketEnable +%0A                %22, websocketBufferPoolSize=%22 + websocketBufferPoolSize +%0A                %22, websocketEndpoint='%22 + websocketEndpoint + '%5C'' +%0A
                 

add websocket support