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 void
addFilter(java.lang.String filterName, SFSExtensionFilter filter)
Add a filter to the Filter Chain.void
destroy()
Shut down the Filter Chain.void
remove(java.lang.String filterName)
Remove a Filter from the Filter Chain.FilterAction
runEventInChain(ISFSEvent event)
FilterAction
runRequestInChain(java.lang.String requestId, User sender, ISFSObject params)
int
size()
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:
addFilter
in 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:
remove
in interfaceIFilterChain
- Parameters:
filterName
- the name of the Filter
-
runEventInChain
public FilterAction runEventInChain(ISFSEvent event) throws SFSException
- Specified by:
runEventInChain
in interfaceIFilterChain
- Throws:
SFSException
-
runRequestInChain
public FilterAction runRequestInChain(java.lang.String requestId, User sender, ISFSObject params)
- Specified by:
runRequestInChain
in interfaceIFilterChain
-
size
public int size()
Get the size of the Filter Chain.- Specified by:
size
in interfaceIFilterChain
- Returns:
- the size of the Filter Chain.
-
destroy
public void destroy()
Shut down the Filter Chain.- Specified by:
destroy
in interfaceIFilterChain
-
-