org.jdiagnose.library
Class TcpDiagnostic

java.lang.Object
  extended byorg.jdiagnose.DiagnosticUnit
      extended byorg.jdiagnose.library.TcpDiagnostic
All Implemented Interfaces:
Diagnostic, DiagnosticContainer, DiagnosticUnitLifeCycle

public class TcpDiagnostic
extends DiagnosticUnit

Tries to open a Tcp Port and then closes it. This Diagnostic can be used to check connectivity to a particular host and port.

Author:
jamie

Constructor Summary
TcpDiagnostic()
           
TcpDiagnostic(java.lang.String host, int port)
           
TcpDiagnostic(java.lang.String name, java.lang.String host, int port)
          Create a new DiagnosticUnit with a Fully Qualified Name
 
Method Summary
 void diagnoseConnection()
           
 java.lang.String getHost()
           
 int getPort()
           
 void setHost(java.lang.String host)
           
 void setPort(int port)
           
 
Methods inherited from class org.jdiagnose.DiagnosticUnit
assertEquals, assertEquals, assertNotNull, assertNotNull, assertNull, assertNull, assertTrue, assertTrue, diagnose, getDiagnosticContainers, getDiagnostics, getName, setUp, tearDown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TcpDiagnostic

public TcpDiagnostic()

TcpDiagnostic

public TcpDiagnostic(java.lang.String name,
                     java.lang.String host,
                     int port)
Create a new DiagnosticUnit with a Fully Qualified Name

Parameters:
name - the name of this diagnostic.

TcpDiagnostic

public TcpDiagnostic(java.lang.String host,
                     int port)
Method Detail

diagnoseConnection

public void diagnoseConnection()
                        throws java.net.UnknownHostException,
                               java.io.IOException
Throws:
java.net.UnknownHostException
java.io.IOException

getHost

public java.lang.String getHost()
Returns:
Returns the host.

setHost

public void setHost(java.lang.String host)
Parameters:
host - The host to set.

getPort

public int getPort()
Returns:
Returns the port.

setPort

public void setPort(int port)
Parameters:
port - The port to set.


Copyright © 2004-2005 Grape Design Limited. All Rights Reserved.