org.openuat.util
Class RemoteTCPConnection

java.lang.Object
  extended by org.openuat.util.RemoteTCPConnection
All Implemented Interfaces:
RemoteConnection

public class RemoteTCPConnection
extends java.lang.Object
implements RemoteConnection

This is a private implementation of RemoteConnection for TCP.


Constructor Summary
RemoteTCPConnection(java.net.Socket s)
          Only stores the Socket reference s in socket.
 
Method Summary
 void close()
          Implementation of RemoteConnection.close.
 boolean equals(java.lang.Object other)
          Implementation of equals, comparing the target IP address and target port.
 java.io.InputStream getInputStream()
          Implementation of RemoteConnection.getInputStream.
 java.io.OutputStream getOutputStream()
          Implementation of RemoteConnection.getOutputStream.
 java.lang.Object getRemoteAddress()
          Implementation of RemoteConnection.getRemoteAddress.
 java.lang.String getRemoteName()
          Implementation of RemoteConnection.getRemoteName.
 java.net.Socket getSocketReference()
          Returns the underlying reference to the Socket object.
 boolean isOpen()
          Implementation of RemoteConnection.isOpen.
 boolean open()
          Implementation of RemoteConnection.open, will always return false in this implementation.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RemoteTCPConnection

public RemoteTCPConnection(java.net.Socket s)
Only stores the Socket reference s in socket.

Method Detail

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
Implementation of RemoteConnection.getInputStream.

Specified by:
getInputStream in interface RemoteConnection
Throws:
java.io.IOException
See Also:
RemoteConnection.getInputStream

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Implementation of RemoteConnection.getOutputStream.

Specified by:
getOutputStream in interface RemoteConnection
Throws:
java.io.IOException
See Also:
RemoteConnection.getOutputStream

getRemoteAddress

public java.lang.Object getRemoteAddress()
                                  throws java.io.IOException
Implementation of RemoteConnection.getRemoteAddress.

Specified by:
getRemoteAddress in interface RemoteConnection
Throws:
java.io.IOException
See Also:
RemoteConnection.getRemoteAddress

getRemoteName

public java.lang.String getRemoteName()
Implementation of RemoteConnection.getRemoteName.

Specified by:
getRemoteName in interface RemoteConnection
See Also:
RemoteConnection.getRemoteName

open

public boolean open()
             throws java.io.IOException
Implementation of RemoteConnection.open, will always return false in this implementation.

Specified by:
open in interface RemoteConnection
Returns:
true if the connection could be (re-)opened, false otherwise.
Throws:
java.io.IOException
See Also:
RemoteConnection.open

close

public void close()
Implementation of RemoteConnection.close.

Specified by:
close in interface RemoteConnection
See Also:
RemoteConnection.close

isOpen

public boolean isOpen()
Implementation of RemoteConnection.isOpen.

Specified by:
isOpen in interface RemoteConnection
Returns:
true if the connection can be used for sending and receiving, false if either (or both) of the channels is unusable (closed).

getSocketReference

public java.net.Socket getSocketReference()
Returns the underlying reference to the Socket object. This method should generally not be used if it can be avoided!


equals

public boolean equals(java.lang.Object other)
Implementation of equals, comparing the target IP address and target port. Local port are ignored in this comparison, as we refer to Remote_TCP_Connections.

Specified by:
equals in interface RemoteConnection
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


2005-2009, Rene Mayrhofer.