@ManagedObject(value="WebSocket Upgrade Filter") public class WebSocketUpgradeFilter extends Object implements Filter, MappedWebSocketCreator, Dumpable
WebSocketCreator objects.| Modifier and Type | Field and Description |
|---|---|
static String |
ATTR_KEY |
static String |
CONFIG_ATTRIBUTE_KEY |
static 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(String spec,
WebSocketCreator creator)
Add a mapping, of a pathspec to a WebSocketCreator.
|
static WebSocketUpgradeFilter |
configure(ServletContextHandler context)
Configure the default WebSocketUpgradeFilter.
|
static WebSocketUpgradeFilter |
configureContext(ServletContext context)
Deprecated.
use
configureContext(ServletContextHandler) instead |
static WebSocketUpgradeFilter |
configureContext(ServletContextHandler context)
Deprecated.
use
configure(ServletContextHandler) instead |
void |
destroy() |
void |
doFilter(ServletRequest request,
ServletResponse response,
FilterChain chain) |
String |
dump() |
void |
dump(Appendable out,
String indent)
Dump this object (and children) into an Appendable using the provided indent after any new lines.
|
NativeWebSocketConfiguration |
getConfiguration() |
WebSocketServletFactory |
getFactory() |
WebSocketCreator |
getMapping(String target)
/**
Returns the creator for the given path spec.
|
void |
init(FilterConfig config) |
boolean |
removeMapping(String spec)
Removes the mapping based on the given path spec.
|
void |
setToAttribute(ServletContext context,
String key) |
String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitdump, dumpContainer, dumpIterable, dumpMapEntries, dumpObject, dumpObjects, dumpSelf, namedpublic static final String CONTEXT_ATTRIBUTE_KEY
public static final String CONFIG_ATTRIBUTE_KEY
public static final String ATTR_KEY
public WebSocketUpgradeFilter()
public WebSocketUpgradeFilter(WebSocketServerFactory factory)
public WebSocketUpgradeFilter(NativeWebSocketConfiguration configuration)
public static WebSocketUpgradeFilter configure(ServletContextHandler context) throws ServletException
This will return the default WebSocketUpgradeFilter on the
provided ServletContextHandler, creating the filter if necessary.
The default WebSocketUpgradeFilter is also available via
the ServletContext attribute named org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter
context - the ServletContextHandler to useWebSocketUpgradeFilter instanceServletException - if the filer cannot be configured@Deprecated public static WebSocketUpgradeFilter configureContext(ServletContextHandler context) throws ServletException
configure(ServletContextHandler) insteadcontext - the ServletContextHandler to useWebSocketUpgradeFilter instanceServletException - if the filer cannot be configured@Deprecated public static WebSocketUpgradeFilter configureContext(ServletContext context) throws ServletException
configureContext(ServletContextHandler) insteadcontext - the ServletContext to useWebSocketUpgradeFilter instanceServletException - if the filer cannot be configuredpublic void addMapping(PathSpec spec, WebSocketCreator creator)
MappedWebSocketCreatoraddMapping in interface MappedWebSocketCreatorspec - 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) insteadMappedWebSocketCreatoraddMapping in interface MappedWebSocketCreatorspec - the path spec to usecreator - the creator for the mappingpublic void addMapping(String spec, WebSocketCreator creator)
MappedWebSocketCreatorRecognized Path Spec syntaxes
/path/to or / or *.ext or servlet|{spec}^{spec} or regex|{spec}uri-template|{spec}addMapping in interface MappedWebSocketCreatorspec - the path spec to use.creator - the websocket creator for this specific mappingpublic boolean removeMapping(String spec)
MappedWebSocketCreatorremoveMapping in interface MappedWebSocketCreatorspec - 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 FilterIOExceptionServletExceptionpublic void dump(Appendable out, String indent) throws IOException
Dumpabledump in interface Dumpableout - The appendable to dump toindent - The indent to apply after any new lines.IOException - if unable to write to Appendablepublic WebSocketServletFactory getFactory()
@ManagedAttribute(value="configuration", readonly=true) public NativeWebSocketConfiguration getConfiguration()
public WebSocketCreator getMapping(String target)
MappedWebSocketCreatorgetMapping in interface MappedWebSocketCreatortarget - 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 FilterServletExceptionpublic void setToAttribute(ServletContext context, String key) throws ServletException
ServletExceptionCopyright © 2010 - 2020 Adobe. All Rights Reserved