net.zortrium.p2proto
Class PeerException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.io.IOException
              extended by net.zortrium.p2proto.PeerException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PeerErrorException, PeerTimeoutException

public class PeerException
extends IOException

Base class for exceptions resulting from requests sent to remote peers.

Author:
Sean Barker - www.zortrium.net
See Also:
Serialized Form

Constructor Summary
PeerException(String message, InetAddress peer, Msg request)
          Construct a new exception for the given host and query message.
 
Method Summary
 InetAddress getPeer()
          Get the host that caused the error.
 Msg getRequest()
          Get the request message that resulted in the error.
 String toString()
           
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeerException

public PeerException(String message,
                     InetAddress peer,
                     Msg request)
Construct a new exception for the given host and query message.

Parameters:
message - The exception detail message.
peer - The host from which the response was not received.
request - The query message that received no response.
Method Detail

getPeer

public InetAddress getPeer()
Get the host that caused the error.

Returns:
The host that caused the exception to be thrown.

getRequest

public Msg getRequest()
Get the request message that resulted in the error.

Returns:
The request message previously sent to the host.

toString

public String toString()
Overrides:
toString in class Throwable