com.tucows.oxrs.epp0402.rtk.transport

Class EPPTransportTCP

Known Direct Subclasses:
EPPTransportTCPTLS

public class EPPTransportTCP
extends EPPTransportBase

Provides methods necessary to establish connection and to communicate with an EPP Server using plain socket (no encryption).

Field Summary

protected boolean
preset_
Flag to indicate if the transports socket has been preset externally.
protected BufferedReader
reader_from_server_
Input stream from the server.
protected Socket
socket_to_server_
The socket to the server.
protected PrintWriter
writer_to_server_
Output stream to the server.

Fields inherited from class com.tucows.oxrs.epp0402.rtk.transport.EPPTransportBase

DEFAULT_SOCKET_TIMEOUT, epp_host_name_, epp_host_port_, epp_timeout_

Fields inherited from class com.tucows.oxrs.epp0402.rtk.RTKBase

CRLF, DATE_FMT, DEBUG_LEVEL_ONE, DEBUG_LEVEL_THREE, DEBUG_LEVEL_TWO, DEBUG_NONE, RTK_VERSION, UTC_FMT

Constructor Summary

EPPTransportTCP()
Default Construtor
EPPTransportTCP(Socket socket, int timeout)
Construtor with established socket and timeout value If the timeout value is zero, the default timeout value from EPPTransportBase is used.
EPPTransportTCP(String host_name, int host_port, int timeout)
Construtor with Hostname, Host port and timeout value If the timeout value is zero, the default timeout value from EPPTransportBase is used.

Method Summary

void
connect()
Connects to the Server using previously set Hostname and port.
void
disconnect()
Closes the connection to the Server
String
readFromServer()
Reads a complete XML message from the Server.
void
writeToServer(String xml_to_server)
Sends an XML string to the Server

Methods inherited from class com.tucows.oxrs.epp0402.rtk.transport.EPPTransportBase

connect, disconnect, getEPPHostName, getEPPHostPort, getEPPTimeout, initialize, readFromServer, setEPPHostName, setEPPHostPort, setEPPTimeout, writeToServer

Methods inherited from class com.tucows.oxrs.epp0402.rtk.RTKBase

_ids, debug, debug, getDebugLevel, getDebugPrintStream, getRTKProperties, setDebugLevel, setDebugLevel, setDebugPrintStream

Field Details

preset_

protected boolean preset_
Flag to indicate if the transports socket has been preset externally.

reader_from_server_

protected BufferedReader reader_from_server_
Input stream from the server. Begotten from the socket.

socket_to_server_

protected Socket socket_to_server_
The socket to the server.

writer_to_server_

protected PrintWriter writer_to_server_
Output stream to the server. Begotten from the socket.

Constructor Details

EPPTransportTCP

public EPPTransportTCP()
Default Construtor

EPPTransportTCP

public EPPTransportTCP(Socket socket,
                       int timeout)
Construtor with established socket and timeout value If the timeout value is zero, the default timeout value from EPPTransportBase is used.
Parameters:
socket - The Socket to the server
timeout - The int socket timeout value, in milliseconds

EPPTransportTCP

public EPPTransportTCP(String host_name,
                       int host_port,
                       int timeout)
Construtor with Hostname, Host port and timeout value If the timeout value is zero, the default timeout value from EPPTransportBase is used.
Parameters:
host_name - The server Hostname
host_port - The server Host port
timeout - The int socket timeout value, in milliseconds

Method Details

connect

public void connect()
            throws SocketException,
                   IOException,
                   UnknownHostException
Connects to the Server using previously set Hostname and port. If the socket was provided externally, the connection operation is skipped, but the input and output buffers are still extracted. The method also sets the SO timeout of the socket regardless of its origins.
Overrides:
connect in interface EPPTransportBase

disconnect

public void disconnect()
            throws IOException
Closes the connection to the Server
Overrides:
disconnect in interface EPPTransportBase

readFromServer

public String readFromServer()
            throws epp_Exception
Reads a complete XML message from the Server.
Overrides:
readFromServer in interface EPPTransportBase
Returns:
Full XML String
Throws:
epp_Exception - if there was a socket error in reading from the EPP Server

writeToServer

public void writeToServer(String xml_to_server)
            throws epp_Exception
Sends an XML string to the Server
Overrides:
writeToServer in interface EPPTransportBase
Throws:
epp_Exception - if there was a socket error in writing to the EPP Server. The epp_Exception will contain a result with the code epp_Session.RTK_COMMUNICATIONS_FAILURE

Copyright © 2001-2002 - Tucows, Inc., 2003 - LibertyRMS