snifos.server
Interface Server

All Superinterfaces:
java.lang.Runnable
All Known Implementing Classes:
DummyServer, SnifosServer

public interface Server
extends java.lang.Runnable

This interface describes class which can be used to run SNIFOS applications and communication modules server.

Version:
$Id: Server.java,v 1.2 2004/05/08 21:55:29 mwerla Exp $

Method Summary
 void disconnectUser(UserId userId)
          Disconnects user with given id from server.
 void receiveMessage(UserId userId, org.dom4j.Document message)
          Called by communication module to pass message from user to appropriate application.
 void sendMessage(UserId userId, org.dom4j.Document message)
          Called by application to send message to user.
 void unregisterUser(UserId userId)
          Unregisters user with given id from server application.
 
Methods inherited from interface java.lang.Runnable
run
 

Method Detail

sendMessage

public void sendMessage(UserId userId,
                        org.dom4j.Document message)
Called by application to send message to user.

Parameters:
userId - Id of user which should receive message.
message - Message to be sent.

receiveMessage

public void receiveMessage(UserId userId,
                           org.dom4j.Document message)
                    throws InvalidUserException,
                           ConfigurationException
Called by communication module to pass message from user to appropriate application.

Parameters:
userId - Id of user which sends message.
message - Received message.
Throws:
InvalidUserException - Thrown when user id is invalid.
ConfigurationException - Thrown when application instance with default configuration is created and the configuration is invalid.

disconnectUser

public void disconnectUser(UserId userId)
Disconnects user with given id from server.

Parameters:
userId - Id of the user.

unregisterUser

public void unregisterUser(UserId userId)
Unregisters user with given id from server application.

Parameters:
userId - Id of the user.


Copyright © 2001-2004 MoMaT & MWe Team. All Rights Reserved.