|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.mina.core.filterchain.IoFilterAdapter org.apache.mina.filter.firewall.ConnectionThrottleFilter
public class ConnectionThrottleFilter
A IoFilter
which blocks connections from connecting
at a rate faster than the specified interval.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.apache.mina.core.filterchain.IoFilter |
---|
IoFilter.NextFilter |
Constructor Summary | |
---|---|
ConnectionThrottleFilter()
Default constructor. |
|
ConnectionThrottleFilter(long allowedInterval)
Constructor that takes in a specified wait time. |
Method Summary | |
---|---|
protected boolean |
isConnectionOk(IoSession session)
Method responsible for deciding if a connection is OK to continue |
void |
sessionCreated(IoFilter.NextFilter nextFilter,
IoSession session)
Filters IoHandler.sessionCreated(IoSession) event. |
void |
setAllowedInterval(long allowedInterval)
Sets the interval between connections from a client. |
Methods inherited from class org.apache.mina.core.filterchain.IoFilterAdapter |
---|
destroy, exceptionCaught, filterClose, filterWrite, init, messageReceived, messageSent, onPostAdd, onPostRemove, onPreAdd, onPreRemove, sessionClosed, sessionIdle, sessionOpened, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConnectionThrottleFilter()
public ConnectionThrottleFilter(long allowedInterval)
allowedInterval
- The number of milliseconds a client is allowed to wait
before making another successful connectionMethod Detail |
---|
public void setAllowedInterval(long allowedInterval)
allowedInterval
- The number of milliseconds a client is allowed to wait
before making another successful connectionprotected boolean isConnectionOk(IoSession session)
session
- The new session that will be verified
public void sessionCreated(IoFilter.NextFilter nextFilter, IoSession session) throws Exception
IoFilterAdapter
IoHandler.sessionCreated(IoSession)
event.
sessionCreated
in interface IoFilter
sessionCreated
in class IoFilterAdapter
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |