net.sf.jagzilla
Class JagzillaTransportBaseImpl

java.lang.Object
  extended bynet.sf.jagzilla.JagzillaTransportBaseImpl
All Implemented Interfaces:
JagzillaTransport
Direct Known Subclasses:
JagzillaTransportHibernateImpl

public abstract class JagzillaTransportBaseImpl
extends java.lang.Object
implements JagzillaTransport

base class for JagzillaTransport implementations. This class provides helper methods to facilitate connectivity testing.

Author:
mike

Constructor Summary
JagzillaTransportBaseImpl()
           
 
Method Summary
 java.lang.String getLastError()
           
 java.lang.Exception getLastException()
          returns the last error that occurs when verifying transport.
 int getTimeout()
           
protected  boolean hostReachable(java.lang.String hostname)
          see if a host is reachable.
protected  void processException(java.lang.Exception e)
           
 void setTimeout(int timeout)
           
protected  boolean sockAvailable(java.lang.String hostname, int port)
          see if the given host is listening at specified port.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.jagzilla.JagzillaTransport
transportAvailable
 

Constructor Detail

JagzillaTransportBaseImpl

public JagzillaTransportBaseImpl()
Method Detail

hostReachable

protected boolean hostReachable(java.lang.String hostname)
see if a host is reachable.

Parameters:
hostname -
Returns:

sockAvailable

protected boolean sockAvailable(java.lang.String hostname,
                                int port)
see if the given host is listening at specified port. This method open a socket on the specified hostname and port. If the connection is successfull it closes the connection.

Parameters:
hostname - hostname of the host to connect to
port - port to connect to
Returns:
true if a socket can be connected to given host and port and false otherwise
See Also:
getLastError(), getLastException()

processException

protected void processException(java.lang.Exception e)

getTimeout

public int getTimeout()
Returns:
Returns the timeout.

setTimeout

public void setTimeout(int timeout)
Parameters:
timeout - The timeout to set.

getLastError

public java.lang.String getLastError()
Returns:
Returns the lastError.

getLastException

public java.lang.Exception getLastException()
Description copied from interface: JagzillaTransport
returns the last error that occurs when verifying transport.

Specified by:
getLastException in interface JagzillaTransport
Returns:
Returns the lastException.


Distributed under the GPL. By Miguel Griffa. See the Jagzilla project page for more info.