ecologylab.services.exceptions
Class BadClientException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by ecologylab.services.exceptions.BadClientException
All Implemented Interfaces:
java.io.Serializable

public class BadClientException
extends java.lang.Exception

Throw this Exception when we detect that the client is evil or lame.

Author:
andruid
See Also:
Serialized Form

Field Summary
static int BAD_OFFENSE_THRESHOLD
           
static long LOCKOUT_INTERVAL
          Time for which a seemingly evil host gets locked out.
static long REPEAT_OFFENDER_INTERVAL
          Time in which bad responses from a host define it as evil host.
 
Constructor Summary
BadClientException(java.lang.String ipNumber, long timeStamp, java.lang.String message)
          Report that the client has behaved badly, by timing out.
BadClientException(java.lang.String ipNumber, java.lang.String message)
          Report that the client has behaved badly, by sending an improperly formed message.
 
Method Summary
static boolean isEvilHostByNumber(java.lang.String ipNumber)
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCKOUT_INTERVAL

public static final long LOCKOUT_INTERVAL
Time for which a seemingly evil host gets locked out. Currently 20 minutes.

See Also:
Constant Field Values

REPEAT_OFFENDER_INTERVAL

public static final long REPEAT_OFFENDER_INTERVAL
Time in which bad responses from a host define it as evil host. Currently 1 minute.

See Also:
Constant Field Values

BAD_OFFENSE_THRESHOLD

public static final int BAD_OFFENSE_THRESHOLD
See Also:
Constant Field Values
Constructor Detail

BadClientException

public BadClientException(java.lang.String ipNumber,
                          java.lang.String message)
Report that the client has behaved badly, by sending an improperly formed message.

Parameters:
message -

BadClientException

public BadClientException(java.lang.String ipNumber,
                          long timeStamp,
                          java.lang.String message)
Report that the client has behaved badly, by timing out.

Parameters:
message -
Method Detail

isEvilHostByNumber

public static boolean isEvilHostByNumber(java.lang.String ipNumber)