com.tucows.oxrs.epp.rtk.transport
Class EPPTransportTCP
java.lang.Object
|
+--org.omg.CORBA.portable.ObjectImpl
|
+--com.tucows.oxrs.epp.rtk.RTKBase
|
+--com.tucows.oxrs.epp.rtk.transport.EPPTransportBase
|
+--com.tucows.oxrs.epp.rtk.transport.EPPTransportTCP
- All Implemented Interfaces:
- org.omg.CORBA.Object
- Direct Known 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 java.io.BufferedReader |
reader_from_server_
Input stream from the server. |
protected java.net.Socket |
socket_to_server_
The socket to the server. |
protected java.io.PrintWriter |
writer_to_server_
Output stream to the server. |
Constructor Summary |
EPPTransportTCP()
Default Construtor |
EPPTransportTCP(java.net.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(java.lang.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 |
java.lang.String |
readFromServer()
Reads a complete XML message from the Server. |
void |
writeToServer(java.lang.String xml_to_server)
Sends an XML string to the Server |
Methods inherited from class org.omg.CORBA.portable.ObjectImpl |
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
socket_to_server_
protected java.net.Socket socket_to_server_
- The socket to the server.
reader_from_server_
protected java.io.BufferedReader reader_from_server_
- Input stream from the server.
Begotten from the socket.
writer_to_server_
protected java.io.PrintWriter writer_to_server_
- Output stream to the server.
Begotten from the socket.
preset_
protected boolean preset_
- Flag to indicate if the transports socket has been
preset externally.
EPPTransportTCP
public EPPTransportTCP()
- Default Construtor
EPPTransportTCP
public EPPTransportTCP(java.net.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 servertimeout
- The int socket timeout value, in milliseconds
EPPTransportTCP
public EPPTransportTCP(java.lang.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 Hostnamehost_port
- The server Host porttimeout
- The int socket timeout value, in milliseconds
connect
public void connect()
throws java.net.SocketException,
java.io.IOException,
java.net.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 class EPPTransportBase
- Following copied from class:
com.tucows.oxrs.epp.rtk.transport.EPPTransportBase
- Throws:
java.net.SocketException
- java.io.IOException
- java.net.UnknownHostException
-
readFromServer
public java.lang.String readFromServer()
throws epp_Exception
- Reads a complete XML message from the Server.
- Overrides:
readFromServer
in class EPPTransportBase
- Returns:
- Full XML String
- Throws:
epp_Exception
- if there was a socket error in
reading from the EPP Server- See Also:
epp_Session.RTK_COMMUNICATIONS_FAILURE
,
epp_Session.RTK_UNEXPECTED_SERVER_DISCONNECT
writeToServer
public void writeToServer(java.lang.String xml_to_server)
throws epp_Exception
- Sends an XML string to the Server
- Overrides:
writeToServer
in class 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- See Also:
epp_Session.RTK_COMMUNICATIONS_FAILURE
disconnect
public void disconnect()
throws java.io.IOException
- Closes the connection to the Server
- Overrides:
disconnect
in class EPPTransportBase
- Throws:
java.io.IOException
- if there was a Socket problem
Copyright © 2001 - Tucows, Inc.