snifos.server.test
Class DummyServer

java.lang.Object
  extended bysnifos.server.test.DummyServer
All Implemented Interfaces:
java.lang.Runnable, Server

public class DummyServer
extends java.lang.Object
implements Server

Dummy implementation of server interface.

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

Constructor Summary
DummyServer()
           
 
Method Summary
 void disconnectUser(UserId userId)
          Disconnects user with given id from server.
 org.dom4j.Document getMessage()
          Returns last message which was passed to send message method.
 UserId getUserId()
          Returns last user id which was passed to send message method.
 void receiveMessage(UserId userId, org.dom4j.Document message)
          Called by communication module to pass message from user to appropriate application.
 void run()
           
 void sendMessage(UserId userId, org.dom4j.Document message)
          Just stores the message and user id inside the server.
 void unregisterUser(UserId userId)
          Unregisters user with given id from server application.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DummyServer

public DummyServer()
Method Detail

getMessage

public org.dom4j.Document getMessage()
Returns last message which was passed to send message method.

Returns:
Last message which was passed to send message method.

getUserId

public UserId getUserId()
Returns last user id which was passed to send message method.

Returns:
Last user id which was passed to send message method.

sendMessage

public void sendMessage(UserId userId,
                        org.dom4j.Document message)
Just stores the message and user id inside the server.

Specified by:
sendMessage in interface Server
Parameters:
userId - Id of user which should receive message.
message - Message to be sent.
See Also:
Server.sendMessage(UserId, Document)

receiveMessage

public void receiveMessage(UserId userId,
                           org.dom4j.Document message)
Description copied from interface: Server
Called by communication module to pass message from user to appropriate application.

Specified by:
receiveMessage in interface Server
Parameters:
userId - Id of user which sends message.
message - Received message.
See Also:
Server.receiveMessage(UserId, Document)

disconnectUser

public void disconnectUser(UserId userId)
Description copied from interface: Server
Disconnects user with given id from server.

Specified by:
disconnectUser in interface Server
Parameters:
userId - Id of the user.
See Also:
Server.disconnectUser(UserId)

run

public void run()
Specified by:
run in interface java.lang.Runnable
See Also:
Runnable.run()

unregisterUser

public void unregisterUser(UserId userId)
Description copied from interface: Server
Unregisters user with given id from server application.

Specified by:
unregisterUser in interface Server
Parameters:
userId - Id of the user.
See Also:
Server.unregisterUser(UserId)


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