|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.continuent.tungsten.common.sockets.SocketWrapper
com.continuent.tungsten.common.sockets.ClientSocketWrapper
public class ClientSocketWrapper
Provides a wrapper for client connections via sockets. This class encapsulates logic for timeouts, SSL vs. non-SSL operation, and closing the connection. This class assumes properties required for SSL operation have been previously set before SSL sockets are allocated.
| Field Summary |
|---|
| Fields inherited from class com.continuent.tungsten.common.sockets.SocketWrapper |
|---|
socket |
| Constructor Summary | |
|---|---|
ClientSocketWrapper()
Creates a new wrapper for client connections. |
|
| Method Summary | |
|---|---|
void |
close()
Close socket. |
java.net.Socket |
connect()
Connect to the server. |
java.net.InetSocketAddress |
getAddress()
|
long |
getConnectTimeout()
|
java.io.InputStream |
getInputStream()
Returns an input stream that can read data from the socket. |
java.io.OutputStream |
getOutputStream()
Returns an output stream that can write data to the socket. |
long |
getReadTimeout()
|
java.net.Socket |
getSocket()
Returns the socket. |
boolean |
isUseSSL()
|
void |
setAddress(java.net.InetSocketAddress address)
Sets the address to which we should connect. |
void |
setConnectTimeout(int connectTimeout)
Time in milliseconds before timeout when connecting to a server. |
void |
setReadTimeout(int readTimeout)
Time in milliseconds before timeout when waiting for responses after connection. |
void |
setUseSSL(boolean useSSL)
If set to true, use an SSL socket, otherwise use plain TCP/IP. |
| Methods inherited from class com.continuent.tungsten.common.sockets.SocketWrapper |
|---|
setSocket, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClientSocketWrapper()
| Method Detail |
|---|
public java.net.InetSocketAddress getAddress()
public void setAddress(java.net.InetSocketAddress address)
public boolean isUseSSL()
public void setUseSSL(boolean useSSL)
public long getConnectTimeout()
public void setConnectTimeout(int connectTimeout)
public long getReadTimeout()
public void setReadTimeout(int readTimeout)
public java.net.Socket connect()
throws java.io.IOException
java.io.IOExceptionpublic java.net.Socket getSocket()
getSocket in class SocketWrapper
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in class SocketWrapperjava.io.IOExceptionSocketWrapper.getInputStream()
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in class SocketWrapperjava.io.IOExceptionSocketWrapper.getOutputStream()public void close()
close in class SocketWrapper
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||