cdac.medinfo.sdk.hl7282.hl7net.upperlayer

## Class ServerSession

- java.lang.Object
- - cdac.medinfo.sdk.hl7282.hl7net.upperlayer.ServerSession

-     public class ServerSession
      extends java.lang.Object

  The Class SCPSession.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServerSession()` Constructs ServerSession

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` Closes the Server Session.
    `ISingleCollection<java.net.InetSocketAddress>` | `getClientsConnectionInfo()` Retrieves list of connection info for all currently active clients
    `IProcessHandler` | `getIProcessHandler()` Gets the IProcessHandler.
    `int` | `getTimeOut()` Returns setting for Socket read timeout of this session, 0 returns implies that the option is disabled (i.e., timeout of infinity).
    `boolean` | `isClientConnected(java.net.InetSocketAddress objAddress)` Shows current status of client,whether it is active or not, for given Inet Socket Address
    `int` | `noOfClientsConnected()` Retrieves number of clients currently connected to Service Provider.
    `void` | `setBatchProcessor(IBatchProcessor objIBatchProcessor)` Sets the Batch Processor
    `void` | `setFragmentProcessor(IFragmentProcessor objIFragmentProcessor)` Sets the Fragment Processor
    `void` | `setIProcessHandler(IProcessHandler objIProcessHandler)` Sets the IProcessHandler.
    `void` | `setMLLPProcessor(IMLLP objIMLLP)` Sets the MLLP Processor.
    `void` | `setReadWriteLength(int iReadLength, int iWriteLength)` Sets max length limit of reading and writing.
    `void` | `setTimeOut(int itimeout)` sets Socket read timeout of this session, in milliseconds.
    `void` | `start(java.net.InetAddress ip, int iPort)`
    `void` | `start(java.net.InetSocketAddress addr)` Starts UserSession on Socket Address
    `void` | `start(int iPort)`
    `void` | `start(java.net.Socket socket)` Starts ClientSession on Socket
    `void` | `start(java.lang.String strIP, int iPort)` Start.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServerSession

          public ServerSession()
                        throws java.io.IOException

      Constructs ServerSession
      Throws:
        `java.io.IOException`

  - ### Method Detail

    - #### setFragmentProcessor

          public void setFragmentProcessor(IFragmentProcessor objIFragmentProcessor)

      Sets the Fragment Processor
      Parameters:
        `objIFragmentProcessor` - the objIFragmentProcessor to set

    - #### setMLLPProcessor

          public void setMLLPProcessor(IMLLP objIMLLP)

      Sets the MLLP Processor.
      Parameters:
        `objIMLLP` - the MLLP processor to set.

    - #### setBatchProcessor

          public void setBatchProcessor(IBatchProcessor objIBatchProcessor)

      Sets the Batch Processor
      Parameters:
        `objIBatchProcessor` - the BatchProcessor to set

    - #### getIProcessHandler

          public IProcessHandler getIProcessHandler()

      Gets the IProcessHandler.
      Returns:
        IProcessHandler - the IProcessHandler

    - #### setIProcessHandler

          public void setIProcessHandler(IProcessHandler objIProcessHandler)

      Sets the IProcessHandler.
      Parameters:
        `objIProcessHandler` - new IIProcessHandler

    - #### setReadWriteLength

          public void setReadWriteLength(int iReadLength,
                                int iWriteLength)

      Sets max length limit of reading and writing.
      Parameters:
        `iReadLength` - value of Reading max length
        `iWriteLength` - value of Writing max length

    - #### start

          public void start(java.lang.String strIP,
                   int iPort)
                     throws java.io.IOException

      Start.
      Parameters:
        `strIP` - the ip address of server
        `iPort` - the port on which server should listen
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### start

          public void start(int iPort)
                     throws java.io.IOException

      Parameters:
        `iPort` - int value of port.
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### start

          public void start(java.net.InetAddress ip,
                   int iPort)
                     throws java.io.IOException

      Parameters:
        `ip` - instance of INet Address.
        `iPort` - int value of port.
      Throws:
        `java.io.IOException` - Signals that an I/O exception has occurred.

    - #### start

          public void start(java.net.InetSocketAddress addr)
                     throws java.io.IOException

      Starts UserSession on Socket Address
      Parameters:
        `addr` - specified address
      Throws:
        `java.io.IOException`

    - #### start

          public void start(java.net.Socket socket)
                     throws java.io.IOException

      Starts ClientSession on Socket
      Parameters:
        `objSocket` - Specifies object of Socket on Client Session.
      Throws:
        `java.io.IOException`

    - #### noOfClientsConnected

          public int noOfClientsConnected()

      Retrieves number of clients currently connected to Service Provider.
      Returns:
        int - no. of Clients connected

    - #### isClientConnected

          public boolean isClientConnected(java.net.InetSocketAddress objAddress)

      Shows current status of client,whether it is active or not, for given Inet Socket Address
      Parameters:
        `objAddress` - InetSocketAddress of client
      Returns:
        boolean - shows status as true or false.

    - #### getClientsConnectionInfo

          public ISingleCollection<java.net.InetSocketAddress> getClientsConnectionInfo()

      Retrieves list of connection info for all currently active clients
      Returns:
        ISingleCollection - list of InetSocketAddress for all active clients

    - #### close

          public void close()
                     throws java.io.IOException

      Closes the Server Session.
      Throws:
        `java.io.IOException`

    - #### getTimeOut

          public int getTimeOut()

      Returns setting for Socket read timeout of this session, 0 returns implies that the option is disabled (i.e., timeout of infinity).
      Returns:
        int - the setting for socket read timeout.

    - #### setTimeOut

          public void setTimeOut(int itimeout)

      sets Socket read timeout of this session, in milliseconds. With this option set to a non-zero timeout, a read() call on the InputStream associated with this Socket will block for only this amount of time.If the timeout expires, a session is closed,The timeout must be > 0. A timeout of zero is interpreted as an infinite timeout.
      Parameters:
        `timeout` - the specified timeout, in milliseconds.