Class SysControllerFilterChain
java.lang.Object
com.smartfoxserver.controllers.filter.SysControllerFilterChain
- All Implemented Interfaces:
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:
- Bypass Public/Private/Buddy Message filtering, adding your own custom filter or a third party solution
- Bypass the Anti-Flood Filter with a custom or third party implementation
- Add custom logic on top of requests such as JoinRoom and CreateRoom
- Add custom filtering or logic to requests such as SetUserVariables and SetRoomVariables
A complete description of the process is found in this tutorial.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddFilter(String filterName, SysControllerFilter filter) Add a filter to the Filter Chain.final voidclearAll()Remove all current filterfinal voidRemove a Filter from the Filter Chain.runRequest(User sender, ISFSObject params) final intsize()Get the size of the Filter Chain.
-
Constructor Details
-
SysControllerFilterChain
public SysControllerFilterChain()
-
-
Method Details
-
addFilter
Description copied from interface:ISystemFilterChainAdd a filter to the Filter Chain. Filters will be executed in the same order in which they were added to the Filter Chain.- Specified by:
addFilterin interfaceISystemFilterChain- Parameters:
filterName- the name of the filterfilter- the filter that is going to be added
-
remove
Description copied from interface:ISystemFilterChainRemove a Filter from the Filter Chain.- Specified by:
removein interfaceISystemFilterChain- Parameters:
filterName- the name of the Filter
-
clearAll
public final void clearAll()Description copied from interface:ISystemFilterChainRemove all current filter- Specified by:
clearAllin interfaceISystemFilterChain
-
size
public final int size()Description copied from interface:ISystemFilterChainGet the size of the Filter Chain.- Specified by:
sizein interfaceISystemFilterChain- Returns:
- the size of the Filter Chain.
-
runRequest
- Specified by:
runRequestin interfaceISystemFilterChain
-