View Javadoc

1   /*
2    * Trip Tracker, a real-time position tracking system for the Internet.
3    * Copyright (C) 2006  Team Trip Tracker
4    *
5    * This program is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU General Public License as published by the
7    * Free Software Foundation; either version 2 of the License, or (at your
8    * option) any later version.
9    *
10   * This program is distributed in the hope that it will be useful, but
11   * WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13   * General Public License for more details.
14   *
15   * You should have received a copy of the GNU General Public License along
16   * with this program; if not, write to the Free Software Foundation, Inc.,
17   * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
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  		// XXX States below are uncertain.
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  }