Secure iNet Factory

com.jscape.inet.util.connection
Interface Connection

All Known Implementing Classes:
SshConnection

public interface Connection

Abstract TCP connection.

Version:
1.0
Author:
Alex Usun

Method Summary
 void close()
          Closes the current connection.
 java.io.InputStream getInputStream()
          Returns connection input stream.
 java.lang.String getLocalAddress()
          Returns local address.
 int getLocalPort()
          Returns local port.
 java.io.OutputStream getOutputStream()
          Returns connection output stream.
 java.lang.String getRemoteAddress()
          Returns remote end address.
 int getRemotePort()
          Returns remote end port.
 long getTimeout()
          Returns connection timeout.
 boolean isClosed()
          Checks if connection is already closed.
 void setTimeout(long timeout)
          Setups connection timeout.
 

Method Detail

getRemoteAddress

java.lang.String getRemoteAddress()
Returns remote end address.

Returns:
remote end address

getRemotePort

int getRemotePort()
Returns remote end port.

Returns:
remote rns port

getLocalAddress

java.lang.String getLocalAddress()
Returns local address.

Returns:
local address

getLocalPort

int getLocalPort()
Returns local port.

Returns:
local port

getTimeout

long getTimeout()
                throws java.io.IOException
Returns connection timeout.

Returns:
connection timeout
Throws:
java.io.IOException - if an error occurs

setTimeout

void setTimeout(long timeout)
                throws java.io.IOException
Setups connection timeout.

Parameters:
timeout - new timeout value
Throws:
java.io.IOException - if an error occurs

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Returns connection input stream.

Returns:
connection input stream
Throws:
java.io.IOException - if an I/O error occurs

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns connection output stream.

Returns:
connection output stream
Throws:
java.io.IOException - if an I/O error occurs

close

void close()
Closes the current connection.


isClosed

boolean isClosed()
Checks if connection is already closed.

Returns:
true if connection is closed; false otherwise

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved