com.interfaceware.chameleon
Interface LlpServerListener


public interface LlpServerListener

The listener interface for receiving LlpServer events. A class that is interested in processing a LlpServer event must implement this interface (and all the methods it contains). The listener object created from that class is then registered with a LlpServer object using the LlpServer's addListener method. When the LlpServer's state changes, the relevant method in the listener object is invoked. If you wish the LlpServer object to stop receiving notifications, use the LlpServer's removeListener method.

See Also:
LlpServer

Method Summary
 void clientConnected(LlpConnection Client)
          Fired when a connection is made to the server by a new client.
 void clientDisconnected(LlpConnection Client)
          Fired when a client disconnects from the server, or a previous disconnect call on a Connection succeeds.
 void clientErrorReceived(LlpConnection Client, java.lang.String ErrorMessage, int ErrorCode)
          Fired when a networking error occurs with a specific client connection.
 void dataIgnored(LlpConnection Client, java.lang.String Data)
          Fired when data has been received that is not within the header and trailer block envelope.
 void errorReceived(java.lang.String ErrorMessage, int Code)
          Fired when an issue occurs with the server socket itself rather than a specific client.
 void messageReceived(LlpConnection Client, java.lang.String Message)
          Fired each time we receive a message from a connected HL7 client.
 

Method Detail

errorReceived

void errorReceived(java.lang.String ErrorMessage,
                   int Code)

Fired when an issue occurs with the server socket itself rather than a specific client.

Parameters:
ErrorMessage - A message describing the error.
Code - A code describing the error.

clientConnected

void clientConnected(LlpConnection Client)

Fired when a connection is made to the server by a new client.

This event is useful for logging.

Parameters:
Client - The client object that is connecting.

clientDisconnected

void clientDisconnected(LlpConnection Client)

Fired when a client disconnects from the server, or a previous disconnect call on a Connection succeeds.

This event is useful for logging.

Parameters:
Client - The client object that is disconnecting.

clientErrorReceived

void clientErrorReceived(LlpConnection Client,
                         java.lang.String ErrorMessage,
                         int ErrorCode)

Fired when a networking error occurs with a specific client connection.

The context on when this is received is often determined by a previous operation, although that is not necessary. The connection will always be closed once this event is received so there is no need to close the connection within the application code.

Parameters:
Client - The client that had an error.
ErrorMessage - The description of the error.
ErrorCode - The code that describes the error.

messageReceived

void messageReceived(LlpConnection Client,
                     java.lang.String Message)

Fired each time we receive a message from a connected HL7 client.

Typically, the message should be processed and only then should an HL7 ACKnowledgement message be sent.

Received without any Trailer or Header characters.

Parameters:
Client - The client that has sent the message.
Message - The HL7 message (in string format) that has been sent.

dataIgnored

void dataIgnored(LlpConnection Client,
                 java.lang.String Data)

Fired when data has been received that is not within the header and trailer block envelope.

This is for dealing with an incorrect LLP implementation. The data is provided to the user's application through this event. This allows it to be logged since this is likely to be a very significant error with the counterparty's LLP implementation.

Parameters:
Client - The client that has sent the data.
Data - Data in string format that has been sent.