Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.stc.connector.appconn.tcpip.model
Interface TCPIPServerApplication

All Known Implementing Classes:
  TCPIPEXTServerApplicationImpl, TCPIPServerApplicationImpl

    public interface TCPIPServerApplication

This interface represents the inbound TCP/IP application interface.

Version:
  cvs revision: $Revision: 1.8 $ Last Modified: $Date: 2008/04/23 07:15:11 $
Author:
  Harry Liu

Field Summary
`static java.lang.String` | `version`

Method Summary
`void` | `closeConnection()` Closes the server application connection.
`boolean` | `getDedicatedSessionMode()` Returns the dedicatedSessionMode.
`int` | `getMaxDataSize()` Returns the maxDataSize.
`java.net.Socket` | `getSocket()` Returns the underlying java.net.Socket instance which the e*Way relys on.
`java.lang.String` | `getState()` Returns the State which is set by user.
`TCPIPServerConfigInfoInterface` | `getTCPIPInboundConfigInfo()` Returns an object which represents the base TCP/IP inbound configuration information.
`boolean` | `isClosed()` Checks whether the connection is closed.
`byte[]` | `receiveBytes()` Reads all data which is available on TCP/IP connection.
`java.lang.String` | `receiveString()` Reads all data which is available on TCP/IP connection.
`java.lang.String` | `receiveString(java.lang.String encoding)` Reads all data which is available on TCP/IP connection.
`void` | `sendBytes(byte[] bytes)` Sends a byte array through the TCP/IP connection.
`void` | `sendString(java.lang.String str)` Sends a String with JVM default encoding through the TCP/IP connection.
`void` | `sendString(java.lang.String str, java.lang.String encoding)` Sends a String with the specified encoding through the TCP/IP connection.
`void` | `setDedicatedSessionMode(boolean dedicatedSessionMode)` Sets the dedicatedSessionMode.
`void` | `setMaxDataSize(int maxDataSize)` Sets the maxDataSize.
`void` | `setState(java.lang.String stateValue)` Sets State.

Field Detail

### version

    static final java.lang.String version

See Also:
  Constant Field Values

Method Detail

### isClosed

    boolean isClosed()
                     throws TCPIPApplicationException

  Checks whether the connection is closed.

  Returns:
    boolean Represents the status of the connection
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### closeConnection

    void closeConnection()
                         throws TCPIPApplicationException

  Closes the server application connection. Once the connection is closed, any action over this connection will be invalid and will get exception.

  Throws:
    `TCPIPApplicationException` - on error

### getDedicatedSessionMode

    boolean getDedicatedSessionMode()

  Returns the dedicatedSessionMode. The dedicatedSessionMode means that the server socket (on some port) may serve single client request (the first one connected) at the same time. See documentation for detail.

  Returns:
    true or false

### setDedicatedSessionMode

    void setDedicatedSessionMode(boolean dedicatedSessionMode)

  Sets the dedicatedSessionMode. The dedicatedSessionMode means that the server socket (on some port) may serve single client request (the first one connected) at the same time. See documentation for detail.

  Parameters:
    `dedicatedSessionMode` - The dedicatedSessionMode to set

### getTCPIPInboundConfigInfo

    TCPIPServerConfigInfoInterface getTCPIPInboundConfigInfo()

  Returns an object which represents the base TCP/IP inbound configuration information.

  Returns:
    TCPIPServerConfigInfo object

### getSocket

    java.net.Socket getSocket()
                              throws TCPIPApplicationException,
                                     java.io.IOException

  Returns the underlying java.net.Socket instance which the e*Way relys on. You can perform Socket operations through the returned Socket instance. Also, you can query/change some socket options dynamically at runtime through the corresponding getters/setters of the returned Socket instance. For more details, please refer the JDK javedoc on java.net.*.

  Returns:
    Socket instance
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### getMaxDataSize

    int getMaxDataSize()

  Returns the maxDataSize. This size defines the max size of data which the programs can hold internally. The valid range is from 1 to 2GB (the max value of java integer).

  Returns:
    The max size of data that can be held.

### setMaxDataSize

    void setMaxDataSize(int maxDataSize)
                        throws TCPIPApplicationException

  Sets the maxDataSize. This size defines the max size of data which the programs can hold internally. The valid range is from 1 to 2GB (the max value of java integer).

  Parameters:
    `maxDataSize` - The maxDataSize to set
  Throws:
    `TCPIPApplicationException` - on error

### getState

    java.lang.String getState()
                              throws TCPIPApplicationException

  Returns the State which is set by user. User can use this state to keep track the progress of the business rules. This state has same life cycle as the resource adapter, that is, it is attached with the resource adapter. Once you set the state, its value will be kept during the whole life cycle of the resource adapter.

  Returns:
    The state value.
  Throws:
    `TCPIPApplicationException` - on error

### setState

    void setState(java.lang.String stateValue)
                  throws TCPIPApplicationException

  Sets State. User can use this state to keep track the progress of the business rules. This state has same life cycle as the resource adapter, that is, it is attached with the resource adapter. Once you set the state, its value will be kept during the whole life cycle of the resource adapter.

  Parameters:
    `stateValue` - The state value to set
  Throws:
    `TCPIPApplicationException` - on error

### receiveString

    java.lang.String receiveString()
                                   throws TCPIPApplicationException,
                                          java.io.IOException

  Reads all data which is available on TCP/IP connection. Returns a String object with JVM default encoding.

       Followings are the end conditions of the read operation:
         - No more data in the socket stream (end of file)
         - Timeout occurs (note: here timeout is treated as an indication instead of error)

  Once one of the above conditions stands, the reading attempt will gracefully stop and all data will be returned. An empty string "" will be returned if no any data is received.

  Returns:
    A String
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### receiveString

    java.lang.String receiveString(java.lang.String encoding)
                                   throws TCPIPApplicationException,
                                          java.io.IOException

  Reads all data which is available on TCP/IP connection. Returns a String object with specified encoding.

       Followings are the end conditions of the read operation:
         - No more data in the socket stream (end of file)
         - Timeout occurs (note: here timeout is treated as an indication instead of error)

  Once one of the above conditions stands, the reading attempt will gracefully stop and all data will be returned. An empty string "" will be returned if no any data is received.

  Parameters:
    `encoding` - The encoding charset name.
  Returns:
    A String
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### receiveBytes

    byte[] receiveBytes()
                        throws TCPIPApplicationException,
                               java.io.IOException

  Reads all data which is available on TCP/IP connection. Returns a byte array.

       Followings are the end conditions of the read operation:
         - No more data in the socket stream (end of file)
         - Timeout occurs (note: here timeout is treated as an indication instead of error)

  Once one of the above conditions stands, the reading attempt will gracefully stop and all data will be returned. A zero-length byte array will be returned if no any data is received.

  Returns:
    A byte array
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### sendString

    void sendString(java.lang.String str)
                    throws TCPIPApplicationException,
                           java.io.IOException

  Sends a String with JVM default encoding through the TCP/IP connection.

  Parameters:
    `str` - A String to send
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### sendString

    void sendString(java.lang.String str,
                    java.lang.String encoding)
                    throws TCPIPApplicationException,
                           java.io.IOException

  Sends a String with the specified encoding through the TCP/IP connection.

  Parameters:
    `str` - A String to send
    `encoding` - The encoding charset name.
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

### sendBytes

    void sendBytes(byte[] bytes)
                   throws TCPIPApplicationException,
                          java.io.IOException

  Sends a byte array through the TCP/IP connection.

  Parameters:
    `bytes` - A byte array to send
  Throws:
    `TCPIPApplicationException` - on error
    `java.io.IOException` - on i/o error

Overview | Package | Class | Tree | Deprecated | Index | Help
| Sun Adapter for TCP/IP API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD