1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package snifos.server.test;
21
22 import org.dom4j.Document;
23
24 import snifos.common.UserId;
25
26 import snifos.server.Server;
27
28
29 /***
30 * Dummy implementation of server interface.
31 * @version $Id: DummyServer.java,v 1.2 2004/05/08 21:55:26 mwerla Exp $
32 */
33 public class DummyServer implements Server {
34 private UserId userId;
35 private Document message;
36
37 /***
38 * Returns last message which was passed to send message method.
39 * @return Last message which was passed to send message method.
40 */
41 public Document getMessage() {
42 return message;
43 }
44
45 /***
46 * Returns last user id which was passed to send message method.
47 * @return Last user id which was passed to send message method.
48 */
49 public UserId getUserId() {
50 return userId;
51 }
52
53 /***
54 * Just stores the message and user id inside the server.
55 * @see Server#sendMessage(UserId, Document)
56 */
57 public void sendMessage(UserId userId, Document message) {
58 this.userId = userId;
59 this.message = message;
60 }
61
62 /***
63 * @see Server#receiveMessage(UserId, Document)
64 */
65 public void receiveMessage(UserId userId, Document message) {
66
67 }
68
69 /***
70 * @see Server#disconnectUser(UserId)
71 */
72 public void disconnectUser(UserId userId) {
73
74 }
75
76 /***
77 * @see java.lang.Runnable#run()
78 */
79 public void run() {
80
81 }
82
83 /***
84 * @see Server#unregisterUser(UserId)
85 */
86 public void unregisterUser(UserId userId) {
87
88 }
89 }