Class SFSExtensionFilterChain
java.lang.Object
com.smartfoxserver.extensions.filter.SFSExtensionFilterChain
- All Implemented Interfaces:
IFilterChain
The Filter Chain allows the developer to configure a number of Filters that will run prior to executing a Client request or dispatching a Server side
event.
By using the addFilter method you can add filters to the Extension. Filters will be executed in the same order in which they were added to the Filter Chain
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFilter(String filterName, SFSExtensionFilter filter) Add a filter to the Filter Chain.voiddestroy()Shut down the Filter Chain.voidRemove a Filter from the Filter Chain.runEventInChain(ISFSEvent event) runRequestInChain(String requestId, User sender, ISFSObject params) intsize()Get the size of the Filter Chain.
-
Constructor Details
-
SFSExtensionFilterChain
-
-
Method Details
-
addFilter
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:
addFilterin interfaceIFilterChain- Parameters:
filterName- the name of the filterfilter- the filter that is going to be added
-
remove
Remove a Filter from the Filter Chain.- Specified by:
removein interfaceIFilterChain- Parameters:
filterName- the name of the Filter
-
runEventInChain
- Specified by:
runEventInChainin interfaceIFilterChain- Throws:
SFSException
-
runRequestInChain
- Specified by:
runRequestInChainin interfaceIFilterChain
-
size
public int size()Get the size of the Filter Chain.- Specified by:
sizein interfaceIFilterChain- Returns:
- the size of the Filter Chain.
-
destroy
public void destroy()Shut down the Filter Chain.- Specified by:
destroyin interfaceIFilterChain
-