@ManagedObject(value="WebSocket Upgrade Filter") public class WebSocketUpgradeFilter extends Object implements Filter, MappedWebSocketCreator, Dumpable
WebSocketCreator
objects.Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_ATTRIBUTE_KEY |
static String |
CONTEXT_ATTRIBUTE_KEY |
Constructor and Description |
---|
WebSocketUpgradeFilter() |
WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration) |
WebSocketUpgradeFilter(WebSocketServerFactory factory) |
public static final String CONTEXT_ATTRIBUTE_KEY
public static final String CONFIG_ATTRIBUTE_KEY
public WebSocketUpgradeFilter()
public WebSocketUpgradeFilter(WebSocketServerFactory factory)
public WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration)
public static WebSocketUpgradeFilter configureContext(ServletContextHandler context) throws ServletException
ServletException
@Deprecated public static WebSocketUpgradeFilter configureContext(ServletContext context) throws ServletException
configureContext(ServletContextHandler)
insteadServletException
public void addMapping(PathSpec spec, WebSocketCreator creator)
MappedWebSocketCreator
addMapping
in interface MappedWebSocketCreator
spec
- the path spec to usecreator
- the creator for the mapping@Deprecated public void addMapping(PathSpec spec, WebSocketCreator creator)
addMapping(org.eclipse.jetty.http.pathmap.PathSpec, WebSocketCreator)
insteadMappedWebSocketCreator
addMapping
in interface MappedWebSocketCreator
spec
- the path spec to usecreator
- the creator for the mappingpublic void addMapping(String spec, WebSocketCreator creator)
MappedWebSocketCreator
Recognized Path Spec syntaxes
/path/to
or /
or *.ext
or servlet|{spec}
^{spec}
or regex|{spec}
uri-template|{spec}
addMapping
in interface MappedWebSocketCreator
spec
- the path spec to use.creator
- the websocket creator for this specific mappingpublic boolean removeMapping(String spec)
MappedWebSocketCreator
removeMapping
in interface MappedWebSocketCreator
spec
- the path spec to remove (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator)
)public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
doFilter
in interface Filter
IOException
ServletException
public void dump(Appendable out, String indent) throws IOException
dump
in interface Dumpable
IOException
public WebSocketServletFactory getFactory()
@ManagedAttribute(value="configuration", readonly=true) public NativeWebSocketConfiguration getConfiguration()
public WebSocketCreator getMapping(String target)
MappedWebSocketCreator
getMapping
in interface MappedWebSocketCreator
target
- @param spec the spec to test for (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator)
)public void init(FilterConfig config) throws ServletException
init
in interface Filter
ServletException
public void setToAttribute(ServletContext context, String key) throws ServletException
ServletException
Copyright © 1995–2017 Webtide. All rights reserved.