Class SysControllerFilterChain
- java.lang.Object
-
- com.smartfoxserver.v2.controllers.filter.SysControllerFilterChain
-
- All Implemented Interfaces:
ISystemFilterChain
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:
- 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.
- Since:
- version 2.3.0
- See Also:
SysControllerFilter
,Zone.setFilterChain(com.smartfoxserver.v2.controllers.SystemRequest, ISystemFilterChain)
-
-
Constructor Summary
Constructors Constructor Description SysControllerFilterChain()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilter(java.lang.String filterName, SysControllerFilter filter)
Add a filter to the Filter Chain.void
clearAll()
Remove all current filtervoid
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.
-
-
-
Method Detail
-
addFilter
public final void addFilter(java.lang.String filterName, SysControllerFilter filter)
Description copied from interface:ISystemFilterChain
Add 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:
addFilter
in interfaceISystemFilterChain
- Parameters:
filterName
- the name of the filterfilter
- the filter that is going to be added
-
remove
public final void remove(java.lang.String filterName)
Description copied from interface:ISystemFilterChain
Remove a Filter from the Filter Chain.- Specified by:
remove
in interfaceISystemFilterChain
- Parameters:
filterName
- the name of the Filter
-
clearAll
public final void clearAll()
Description copied from interface:ISystemFilterChain
Remove all current filter- Specified by:
clearAll
in interfaceISystemFilterChain
-
size
public final int size()
Description copied from interface:ISystemFilterChain
Get the size of the Filter Chain.- Specified by:
size
in interfaceISystemFilterChain
- Returns:
- the size of the Filter Chain.
-
runRequest
public FilterAction runRequest(User sender, ISFSObject params)
- Specified by:
runRequest
in interfaceISystemFilterChain
-
-