1
2
3
4
5
6
7
8
9
10
11
12
13
14 package org.gscg.common.interactionlayer;
15
16 import java.rmi.RemoteException;
17
18 import nl.tudelft.simulation.event.EventListenerInterface;
19 import nl.tudelft.simulation.event.EventType;
20 import nl.tudelft.simulation.event.remote.RemoteEventListenerInterface;
21 import nl.tudelft.simulation.event.remote.RemoteEventProducerInterface;
22
23 /***
24 * Defines the methods for all the interaction layers present in a distributed
25 * interactive simulation, i.e. the single user and game leader interaction
26 * layers..
27 * <p>
28 *
29 * Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX
30 * Delft, the Netherlands. All rights reserved.
31 *
32 * See for project information <a href="http://www.simulation.tudelft.nl/">
33 * www.simulation.tudelft.nl </a>.
34 *
35 * The source code and binary code of this software is proprietary information
36 * of Delft University of Technology.
37 *
38 * @author <a
39 * href="http://www.tbm.tudelft.nl/webstaf/stijnh/index.htm">Stijn-Pieter
40 * van Houten </a>
41 * @version $Revision: 1.1 $ $Date: 2005/06/16 12:33:58 $
42 * @since 1.1.1
43 */
44 public interface GlobalInteractionLayerInterface extends
45 EventListenerInterface, RemoteEventProducerInterface
46 {
47 /***
48 * Method addEventTypeSentByClient. EventTypes added using this method are
49 * fired by a client. Object which are interested in these events subscribe
50 * them as listeners to these events. At the same time, when the interaction
51 * layer receives one of these events, the event is checked with a list of
52 * known events.
53 *
54 * @param eventType the event type to add
55 * @throws RemoteException thrown in case of a network error
56 */
57 void addEventTypeSentByClient(final EventType eventType)
58 throws RemoteException;
59
60 /***
61 * Method addEventTypeToAnnounceList. Adds an event type and the
62 * corresponding announce object to a hashmap.
63 *
64 * @param eventType the event type
65 * @param announceObject the object to announce
66 * @throws RemoteException thrown in case of a network error
67 */
68 void addEventTypeToAnnounceList(final EventType eventType,
69 final AnnounceInterface announceObject) throws RemoteException;
70
71 /***
72 * this method is used by a remote client to indicate that it is 'online'
73 * the server side object is then able to subscribe to client side events
74 * and to send cached data
75 *
76 * @param object the remote event producer or the remote event listener, may
77 * be null
78 * @param eventType the event type given as an argument for the announce
79 * method, may not be null
80 * @param announce true if this method is called during initialization of a
81 * client user interface; false in case of announcing for a statistic
82 * @throws RemoteException thrown in case of a network error
83 */
84 void getCache(Object object, EventType eventType, boolean announce)
85 throws RemoteException;
86
87 /***
88 * @return Returns an array with event types for statistics
89 * @throws RemoteException thrown in case of network failure
90 */
91 EventType[] getStatisticEventTypes() throws RemoteException;
92
93 /***
94 * @return Returns an integer representing the total number of days of the
95 * simulation. This integer is used for stastistics as a range.
96 * @throws RemoteException thrown in case of network failure
97 */
98 int getTotalNumberOfDays() throws RemoteException;
99
100 /***
101 *
102 * @param client The client to login
103 * @return Returns returns true if an interactionlayer is already logged in
104 * @throws RemoteException thrown in case of network failure
105 */
106 boolean login(final RemoteEventListenerInterface client)
107 throws RemoteException;
108 }