com.limegroup.gnutella
Class BadConnectionSettingException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended bycom.limegroup.gnutella.BadConnectionSettingException
All Implemented Interfaces:
java.io.Serializable

public class BadConnectionSettingException
extends java.lang.Exception

The exception thrown when you try to set your incoming/outgoing connections to a bad value. Contains suggested new values for the settings and a reason for the exception.

Design note: some may argue that this should be multiple classes or an enum. But there could be multiple reasons for an exception, so we may use masks.

See Also:
Serialized Form

Field Summary
static int NEGATIVE_VALUE
           
static int TOO_HIGH_FOR_LEAF
           
static int TOO_HIGH_FOR_SPEED
           
static int TOO_LOW_FOR_ULTRAPEER
           
 
Constructor Summary
BadConnectionSettingException(int reason, int suggestedOutgoing)
           
 
Method Summary
 int getReason()
           
 int getSuggestedOutgoing()
           
 
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

NEGATIVE_VALUE

public static final int NEGATIVE_VALUE
See Also:
Constant Field Values

TOO_HIGH_FOR_SPEED

public static final int TOO_HIGH_FOR_SPEED
See Also:
Constant Field Values

TOO_HIGH_FOR_LEAF

public static final int TOO_HIGH_FOR_LEAF
See Also:
Constant Field Values

TOO_LOW_FOR_ULTRAPEER

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

BadConnectionSettingException

public BadConnectionSettingException(int reason,
                                     int suggestedOutgoing)
Parameters:
reason - why the settings were rejected. This value must be one of NEGATIVE_VALUE, TOO_HIGH_FOR_SPEED
suggestedOutgoing - the suggested KEEP_ALIVE
Method Detail

getReason

public int getReason()

getSuggestedOutgoing

public int getSuggestedOutgoing()