EPPTransportBase (EPP RTK Java API Documentation)
Keywords: com.tucows.oxrs.epp0604.rtk.transport.EPPTransportBase class

### com.tucows.oxrs.epp0604.rtk.transport

# Class EPPTransportBase

- `org.omg.CORBA.portable.ObjectImpl`
- - `com.tucows.oxrs.epp0604.rtk.RTKBase`
  - - `com.tucows.oxrs.epp0604.rtk.transport.EPPTransportBase`

Known Direct Subclasses:
  EPPTransportSMTP, EPPTransportTCP

`public abstract class EPPTransportBase`
`extends RTKBase`

Base abstract class for the Transport classes. Defines common methods and data members used by all or most Transport classes.

  ## Field Summary
  `static int` | `DEFAULT_SOCKET_TIMEOUT` The default timeout in waiting for server responses.
  `protected String` | `epp_host_name_` The Host name of the EPP server.
  `protected int` | `epp_host_port_` The Host port of the EPP server.
  `protected int` | `epp_timeout_` The timeout to apply to persistent connections to the server.

  ### Fields inherited from class com.tucows.oxrs.epp0604.rtk.RTKBase
  `CRLF`, `DATE_FMT`, `DEBUG_LEVEL_ONE`, `DEBUG_LEVEL_THREE`, `DEBUG_LEVEL_TWO`, `DEBUG_NONE`, `RTK_VERSION`, `UTC_FMT`

  ## Constructor Summary
  `EPPTransportBase()` Default constructor --
  `EPPTransportBase(String epp_host_name, int epp_host_port)` Constructor with EPP Hostname and EPP Host port.
  `EPPTransportBase(String epp_host_name, int epp_host_port, int epp_timeout)` Constructor with EPP Hostname, EPP Host port, and timeout.

  ## Method Summary
  `abstract void` | `connect()` Establishes the connection to the Server Abstract method to be implemented by subclasses.
  `abstract void` | `disconnect()` Closes the connection to the Server Abstract method to be implemented by subclasses.
  `String` | `getEPPHostName()` Accessor method for the EPP Hostname
  `int` | `getEPPHostPort()` Accessor method for the EPP Host port
  `int` | `getEPPTimeout()` Accessor method for the EPP server timeout, in milliseconds
  `void` | `initialize(String epp_host_name, int epp_host_port, int epp_timeout)` Initializes the transport object with host name, host port and timeout.
  `abstract String` | `readFromServer()` Reads from the Server Abstract method to be implemented by subclasses.
  `void` | `setEPPHostName(String value)` Accessor method for the EPP Hostname
  `void` | `setEPPHostPort(int value)` Accessor method for the EPP Host port
  `void` | `setEPPTimeout(int value)` Accessor method for the EPP server timeout, in milliseconds
  `abstract void` | `writeToServer(String string_to_server)` Writes to the Server Abstract method to be implemented by subclasses.

  ### Methods inherited from class com.tucows.oxrs.epp0604.rtk.RTKBase
  `_ids`, `debug`, `debug`, `getDebugLevel`, `getDebugPrintStream`, `getRTKProperties`, `setDebugLevel`, `setDebugLevel`, `setDebugPrintStream`

## Field Details

### DEFAULT_SOCKET_TIMEOUT

    public static final int DEFAULT_SOCKET_TIMEOUT

> The default timeout in waiting for server responses. Set to 20 seconds.
> Field Value:
>   20000

### epp_host_name_

    protected String epp_host_name_

> The Host name of the EPP server.

### epp_host_port_

    protected int epp_host_port_

> The Host port of the EPP server.

### epp_timeout_

    protected int epp_timeout_

> The timeout to apply to persistent connections to the server.

## Constructor Details

### EPPTransportBase

    public EPPTransportBase()

> Default constructor --

### EPPTransportBase

    public EPPTransportBase(String epp_host_name,
                            int epp_host_port)

> Constructor with EPP Hostname and EPP Host port. Default timeout value will be used, if applicable.
> Parameters:
>   `epp_host_name` - The EPP Hostname (eg. "host.domain.tld")
>   `epp_host_port` - The EPP port

### EPPTransportBase

    public EPPTransportBase(String epp_host_name,
                            int epp_host_port,
                            int epp_timeout)

> Constructor with EPP Hostname, EPP Host port, and timeout. Note that the timeout value might not have any effect on particular transports. See the documentation of the transport you wish to use to verify.
> Parameters:
>   `epp_host_name` - The EPP Hostname (eg. "host.domain.tld")
>   `epp_host_port` - The EPP port
>   `epp_timeout` - The timeout in milliseconds to apply to the connection.

## Method Details

### connect

    public abstract void connect()
                throws SocketException,
                       IOException,
                       UnknownHostException

> Establishes the connection to the Server Abstract method to be implemented by subclasses. Though in some subclasses (like SMTP) this method might not have any effect.

### disconnect

    public abstract void disconnect()
                throws IOException

> Closes the connection to the Server Abstract method to be implemented by subclasses. Though in some subclasses (like SMTP) this method might not have any effect.

### getEPPHostName

    public String getEPPHostName()

> Accessor method for the EPP Hostname
> Returns:
>   The EPP host name String

### getEPPHostPort

    public int getEPPHostPort()

> Accessor method for the EPP Host port

### getEPPTimeout

    public int getEPPTimeout()

> Accessor method for the EPP server timeout, in milliseconds

### initialize

    public void initialize(String epp_host_name,
                           int epp_host_port,
                           int epp_timeout)

> Initializes the transport object with host name, host port and timeout. Note that the timeout value might not be applicable to all transport subclasses.
> Parameters:
>   `epp_host_name` - The EPP Hostname (eg. "host.domain.tld")
>   `epp_host_port` - The EPP port
>   `epp_timeout` - The timeout value in milliseconds.

### readFromServer

    public abstract String readFromServer()
                throws epp_Exception

> Reads from the Server Abstract method to be implemented by subclasses. For asynchronous transports, like SMTP, this method should be periodically called to "check mail".
> Returns:
>   The EPP message from the server.
> Throws:
>   `epp_Exception` -

### setEPPHostName

    public void setEPPHostName(String value)

> Accessor method for the EPP Hostname
> Parameters:
>   `value` - The hostname string (eg. "host.domain.tld" or "100.101.200.201")

### setEPPHostPort

    public void setEPPHostPort(int value)

> Accessor method for the EPP Host port
> Parameters:
>   `value` - The int port value

### setEPPTimeout

    public void setEPPTimeout(int value)

> Accessor method for the EPP server timeout, in milliseconds
> Parameters:
>   `value` - The int timeout value, in milliseconds

### writeToServer

    public abstract void writeToServer(String string_to_server)
                throws epp_Exception

> Writes to the Server Abstract method to be implemented by subclasses.
> Parameters:
>   `string_to_server` - The EPP message to the server.
> Throws:
>   `epp_Exception` -

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