public class SysControllerFilterChain extends java.lang.Object implements ISystemFilterChain
The SystemFilterChain can contain one or several SystemController Filter instances that can be applied before a client request is executed by the SystemController. Filters allow to interact with the request parameters, add extra logic and validation etc...
Here are a few example use cases:
A complete description of the process is found in this tutorial.
SysControllerFilter
,
Zone.setFilterChain(com.smartfoxserver.v2.controllers.SystemRequest, ISystemFilterChain)
Constructor and Description |
---|
SysControllerFilterChain() |
Modifier and Type | Method and Description |
---|---|
void |
addFilter(java.lang.String filterName,
SysControllerFilter filter)
Add a filter to the Filter Chain.
|
void |
clearAll()
Remove all current filter
|
void |
remove(java.lang.String filterName)
Remove a Filter from the Filter Chain.
|
FilterAction |
runRequest(User sender,
ISFSObject params) |
int |
size()
Get the size of the Filter Chain.
|
public final void addFilter(java.lang.String filterName, SysControllerFilter filter)
ISystemFilterChain
addFilter
in interface ISystemFilterChain
filterName
- the name of the filterfilter
- the filter that is going to be addedpublic final void remove(java.lang.String filterName)
ISystemFilterChain
remove
in interface ISystemFilterChain
filterName
- the name of the Filterpublic final void clearAll()
ISystemFilterChain
clearAll
in interface ISystemFilterChain
public final int size()
ISystemFilterChain
size
in interface ISystemFilterChain
public FilterAction runRequest(User sender, ISFSObject params)
runRequest
in interface ISystemFilterChain