
com.ithit.webdav.integration.servlet.websocket.DavServerApplicationConfig Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jakarta-integration Show documentation
Show all versions of jakarta-integration Show documentation
IT Hit WebDAV integration for new Jakarta Java servlet containers
package com.ithit.webdav.integration.servlet.websocket;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import jakarta.websocket.Endpoint;
import jakarta.websocket.server.ServerApplicationConfig;
import jakarta.websocket.server.ServerEndpointConfig;
import jakarta.websocket.server.ServerEndpointConfig.Builder;
/**
* Configures WebSocket endpoints for DAV servlet.
*/
public class DavServerApplicationConfig implements ServerApplicationConfig {
/**
* Returns context where DAV WebSocket will be available;
* @return web socket context path.
*/
protected String getWebSocketPath() {
return "/";
}
@Override
public Set getEndpointConfigs(Set> endpointClasses) {
Set result = new HashSet<>();
for (Class> epClass : endpointClasses) {
if (DavWebSocketEndpoint.class.isAssignableFrom(epClass)) {
ServerEndpointConfig sec = Builder
.create(epClass, getWebSocketPath())
.configurator(new DavHttpSessionConfigurator())
.encoders(Collections.singletonList(DavWebSocketNotificationEncoder.class))
.build();
result.add(sec);
}
}
return result;
}
@Override
public Set> getAnnotatedEndpointClasses(Set> set) {
return set;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy