Class SFSExtensionFilterChain
- java.lang.Object
-
- com.smartfoxserver.v2.extensions.filter.SFSExtensionFilterChain
-
- All Implemented Interfaces:
IFilterChain
public class SFSExtensionFilterChain extends java.lang.Object implements 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 Constructor Description SFSExtensionFilterChain(SFSExtension parentExtension)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFilter(java.lang.String filterName, SFSExtensionFilter filter)Add a filter to the Filter Chain.voiddestroy()Shut down the Filter Chain.voidremove(java.lang.String filterName)Remove a Filter from the Filter Chain.FilterActionrunEventInChain(ISFSEvent event)FilterActionrunRequestInChain(java.lang.String requestId, User sender, ISFSObject params)intsize()Get the size of the Filter Chain.
-
-
-
Constructor Detail
-
SFSExtensionFilterChain
public SFSExtensionFilterChain(SFSExtension parentExtension)
-
-
Method Detail
-
addFilter
public void addFilter(java.lang.String filterName, SFSExtensionFilter filter)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
public void remove(java.lang.String filterName)
Remove a Filter from the Filter Chain.- Specified by:
removein interfaceIFilterChain- Parameters:
filterName- the name of the Filter
-
runEventInChain
public FilterAction runEventInChain(ISFSEvent event) throws SFSException
- Specified by:
runEventInChainin interfaceIFilterChain- Throws:
SFSException
-
runRequestInChain
public FilterAction runRequestInChain(java.lang.String requestId, User sender, ISFSObject params)
- 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
-
-