1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package triptracker.client.net;
21
22 import java.util.List;
23
24 import triptracker.core.Coordinate;
25 import triptracker.core.Route;
26 import triptracker.core.User;
27
28 public interface MapSocketListener extends SocketListener {
29 public enum RouteState {
30 SUBSCRIBED,
31 UNSUBSCRIBED,
32
33 ACTIVATED,
34 DEACTIVATED,
35 LOCKED,
36 UNLOCKED,
37 }
38
39 /***
40 * Invoked when a coordinate is received.
41 *
42 * @param routeId route the coordinate belongs to
43 * @param coordinate coordinate received
44 */
45 public void coordReceived(int routeId, Coordinate coordinate);
46
47 /***
48 * Invoked when buffered coordinates is received.
49 *
50 * @param coords list of coordinates
51 */
52 public void coordsReceived(List<Coordinate> coords);
53
54 /***
55 * Invoked when a list of routes is received.
56 *
57 * @param routes list of routes
58 */
59 public void routeList(List<Route> routes);
60
61 /***
62 * Invoked when the state of a route is changed.
63 *
64 * @param routeId route the state change applies to
65 * @param state the new state
66 */
67 public void routeUpdate(int routeId, RouteState state);
68
69 /***
70 * Invoked when a list of coordinates for a given route is received.
71 *
72 * @param routeId route the list of coordinates belongs to
73 * @param coordinates list of coordinates
74 */
75 public void routeReceived(int routeId, List<Coordinate> coordinates);
76
77 /***
78 * Invoked when a list of registered users is received.
79 *
80 * @param users list of users
81 */
82 public void usersReceived(List<User> users);
83
84 /***
85 * Invoked when a rouser is received.
86 */
87 public void userReceived(User user);
88 }