@ManagedObject(value="WebSocket Upgrade Filter") public class WebSocketUpgradeFilter extends java.lang.Object implements javax.servlet.Filter, MappedWebSocketCreator, Dumpable
WebSocketCreator
objects.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CONFIG_ATTRIBUTE_KEY |
static java.lang.String |
CONTEXT_ATTRIBUTE_KEY |
Constructor and Description |
---|
WebSocketUpgradeFilter() |
WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration) |
WebSocketUpgradeFilter(WebSocketServerFactory factory) |
Modifier and Type | Method and Description |
---|---|
void |
addMapping(PathSpec spec,
WebSocketCreator creator)
Add a mapping.
|
void |
addMapping(PathSpec spec,
WebSocketCreator creator)
Deprecated.
|
void |
addMapping(java.lang.String spec,
WebSocketCreator creator)
Add a mapping, of a pathspec to a WebSocketCreator.
|
static WebSocketUpgradeFilter |
configureContext(javax.servlet.ServletContext context)
Deprecated.
use
configureContext(ServletContextHandler) instead |
static WebSocketUpgradeFilter |
configureContext(ServletContextHandler context) |
void |
destroy() |
void |
doFilter(javax.servlet.ServletRequest request,
javax.servlet.ServletResponse response,
javax.servlet.FilterChain chain) |
java.lang.String |
dump() |
void |
dump(java.lang.Appendable out,
java.lang.String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
NativeWebSocketConfiguration |
getConfiguration() |
WebSocketServletFactory |
getFactory() |
WebSocketCreator |
getMapping(java.lang.String target)
/**
Returns the creator for the given path spec.
|
void |
init(javax.servlet.FilterConfig config) |
boolean |
removeMapping(java.lang.String spec)
Removes the mapping based on the given path spec.
|
void |
setToAttribute(javax.servlet.ServletContext context,
java.lang.String key) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
dump, dumpObject, dumpObjects, dumpSelf
public static final java.lang.String CONTEXT_ATTRIBUTE_KEY
public static final java.lang.String CONFIG_ATTRIBUTE_KEY
public WebSocketUpgradeFilter()
public WebSocketUpgradeFilter(WebSocketServerFactory factory)
public WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration)
public static WebSocketUpgradeFilter configureContext(ServletContextHandler context) throws javax.servlet.ServletException
context
- the ServletContextHandler
to useWebSocketUpgradeFilter
instancejavax.servlet.ServletException
- if the filer cannot be configured@Deprecated public static WebSocketUpgradeFilter configureContext(javax.servlet.ServletContext context) throws javax.servlet.ServletException
configureContext(ServletContextHandler)
insteadcontext
- the ServletContext to useWebSocketUpgradeFilter
instancejavax.servlet.ServletException
- if the filer cannot be configuredpublic 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(java.lang.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(java.lang.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 destroy()
destroy
in interface javax.servlet.Filter
public void doFilter(javax.servlet.ServletRequest request, javax.servlet.ServletResponse response, javax.servlet.FilterChain chain) throws java.io.IOException, javax.servlet.ServletException
doFilter
in interface javax.servlet.Filter
java.io.IOException
javax.servlet.ServletException
public void dump(java.lang.Appendable out, java.lang.String indent) throws java.io.IOException
Dumpable
public WebSocketServletFactory getFactory()
@ManagedAttribute(value="configuration", readonly=true) public NativeWebSocketConfiguration getConfiguration()
public WebSocketCreator getMapping(java.lang.String target)
MappedWebSocketCreator
getMapping
in interface MappedWebSocketCreator
target
- the spec to test for (using the same spec syntax as seen in MappedWebSocketCreator.addMapping(String, WebSocketCreator)
)public void init(javax.servlet.FilterConfig config) throws javax.servlet.ServletException
init
in interface javax.servlet.Filter
javax.servlet.ServletException
public void setToAttribute(javax.servlet.ServletContext context, java.lang.String key) throws javax.servlet.ServletException
javax.servlet.ServletException
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 1995–2023 Webtide. All rights reserved.