All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.higgs.ws.protocol.WebSocketConfiguration Maven / Gradle / Ivy

There is a newer version: 0.0.24
Show newest version
package io.higgs.ws.protocol;

import io.higgs.core.ProtocolDetectorFactory;
import io.higgs.http.server.protocol.HttpProtocolConfiguration;
import io.higgs.ws.DefaultWebSocketEventHandler;
import io.higgs.ws.WebSocketEventHandler;

public class WebSocketConfiguration extends HttpProtocolConfiguration {
    private String websocketPath = "/";
    private WebSocketEventHandler webSocketEventHandler;

    @Override
    public ProtocolDetectorFactory getProtocol() {
        //this is the method to override to provide a WebSocket detector
        return new WebSocketDetectorFactory(this);
    }

    public String getWebsocketPath() {
        return websocketPath;
    }

    public void setWebsocketPath(String websocketPath) {
        this.websocketPath = websocketPath;
    }

    public WebSocketEventHandler getWebSocketEventHandler() {
        return webSocketEventHandler == null ? new DefaultWebSocketEventHandler() : webSocketEventHandler;
    }

    public void setWebSocketEventHandler(WebSocketEventHandler webSocketEventHandler) {
        this.webSocketEventHandler = webSocketEventHandler;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy