triptracker.server
Class MapHandler

java.lang.Object
  extended by triptracker.server.ClientHandler
      extended by triptracker.server.MapHandler
All Implemented Interfaces:
CoordListener

public class MapHandler
extends ClientHandler
implements CoordListener

Handler for map clients.


Field Summary
 
Fields inherited from class triptracker.server.ClientHandler
db, in, inStream, out, outStream, route, server, user
 
Constructor Summary
MapHandler(Server server, Socket socket, User user)
          Sets up socket streams for communication with a map client and creates the message reader thread for message processing.
 
Method Summary
 void coordinateBufferUpdate(String[] coords)
          Invoked when a new buffered coordinates is received from a GPS client.
 void coordinateUpdate(Coordinate coord)
          Sends newly recieved coordinate to mapClient.
protected  void getRoute(int routeId)
          For recieving a complete route from database.
protected  void getUsers()
          Sends a list of users to client.
protected  boolean messageHandler(String message)
          Invoked when a new message has been recieved.
 void startLogging(GPSHandler gpsHandler)
          Signals that tracking will start
protected  void stopHandler()
          TODO (harald) Not finished yet!!! The method making sure everything is being shutdown before the handler deletes itself.
 void stopLogging(GPSHandler gpsHandler)
          Will stop the logging of a tracker.
 
Methods inherited from class triptracker.server.ClientHandler
getActiveRoute, log, messageLoop, sendMessage, sendMessage, sendZipMessage, startHandler, viewRoutes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapHandler

public MapHandler(Server server,
                  Socket socket,
                  User user)
           throws IOException
Sets up socket streams for communication with a map client and creates the message reader thread for message processing.

Parameters:
server - main server instance
socket - client communication socket
user - client user data
Throws:
IOException - on connection failure
Method Detail

stopHandler

protected void stopHandler()
TODO (harald) Not finished yet!!! The method making sure everything is being shutdown before the handler deletes itself.

Overrides:
stopHandler in class ClientHandler

messageHandler

protected boolean messageHandler(String message)
Invoked when a new message has been recieved. Sub-classes must implement this method to provide handing of recieved messages.

Specified by:
messageHandler in class ClientHandler
Parameters:
message - received message from client

coordinateUpdate

public void coordinateUpdate(Coordinate coord)
Sends newly recieved coordinate to mapClient.

Specified by:
coordinateUpdate in interface CoordListener
Parameters:
coord - new coordinate

coordinateBufferUpdate

public void coordinateBufferUpdate(String[] coords)
Description copied from interface: CoordListener
Invoked when a new buffered coordinates is received from a GPS client.

Specified by:
coordinateBufferUpdate in interface CoordListener
Parameters:
coords - String of buffered coordinates

stopLogging

public void stopLogging(GPSHandler gpsHandler)
Will stop the logging of a tracker.

Specified by:
stopLogging in interface CoordListener

startLogging

public void startLogging(GPSHandler gpsHandler)
Signals that tracking will start


getUsers

protected void getUsers()
Sends a list of users to client.


getRoute

protected void getRoute(int routeId)
For recieving a complete route from database. Will allso check if route is beeing plotted realtime, and start listening to route



Copyright © 2006 Team Trip Tracker. All Rights Reserved.