Listing of Source server/TelnetHost.java
package se.entra.phantom.server;

import java.io.IOException;

/**
 * The Host Telnet communication. It establishes the connection to the
 * host and initiates the 3270 or 5250 data stream.
 */
public interface TelnetHost
{
  /**
   * Enables the Telnet NEW-ENVIRON TN5250E negotiation.
   * "kbdType" may be null in order to the the default *SYSVAL keyboard.
   */
  public abstract void enableNewEnviron(int codepage,String kbdType);

  /**
   * Initializes the Telnet session after the construction
   * for a 3270/5250 terminal type list.
   *
   * @exception  IOException   if an I/O error occurs.
   */
  public abstract void initialize(TelnetInterface i,String terminalList) throws IOException;

  /**
   * Opens the connection to the host at a specified port number.
   *
   * @exception  IOException   if an I/O error occurs.
   */
  public abstract void open(String host,int port) throws IOException;

  /**
   * Closes the current connection.
   */
  public abstract void close();

  /**
   * Writes an amount of bytes. The data is appended with and
   * end-of-record (IAC EOR). Each 0xFF character in the buffer
   * is escaped with 0xFF (i.e. IAC IAC).
   *
   * @exception  IOException   if an I/O error occurs.
   */
  public abstract void write(short buf[], int n) throws IOException;
  
  /**
   * Gets the device name of the session.
   *
   * @return  null  if no device name exists.
   */
  public abstract String getDeviceName();

  /**
   * Sets associate printer for a printer session. The printer
   * session will associate to the LU name returned from the
   * TN3270E terminal session.
   */
  public abstract void setAssociatePrinterWithTerminal(String terminalName);

  /**
   * Sends TN3270E special key (param=0 is Attention and param=1 is SysReq).
   *
   * @return   false  if this special key is not supported.
   *
   * @exception  IOException   if an I/O error occurs.
   */
  public abstract boolean sendSpecialKey(int param) throws IOException;

  /**
   * Sends SSCP LU data for a TN3270E session.
   *
   * @exception  IOException   if an I/O error occurs.
   */
  public abstract void sendSSCPLUData(short [] data,int length) throws IOException;
  
  /**
   * Checks if the communication is secured with e.g. SSL.
   */
  public abstract boolean isSecured();
}