|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object triptracker.server.ClientHandler triptracker.server.GPSHandler
public class GPSHandler
Handler for coordinate submitter/sender clients.
Field Summary |
---|
Fields inherited from class triptracker.server.ClientHandler |
---|
db, in, inStream, out, outStream, route, server, user |
Constructor Summary | |
---|---|
GPSHandler(Server server,
Socket socket,
User user)
Sets up socket streams for communication with a GPS client and creates the message reader thread for message processing. |
Method Summary | |
---|---|
void |
addCoordListener(CoordListener listener)
MapHandlers can add themselves to the listener list and recieve updates when coordinates are added. |
void |
coordBufferAdd(int size)
For storing coordinates that have been buffered on the client for some time. |
void |
coordinateBufferUpdate(String[] coords)
Notifies all listeners and send them the buffered coordinates. |
void |
coordinateUpdate(Coordinate coord)
Notifies all listeners and send them the coordinate. |
protected boolean |
messageHandler(String message)
Invoked when a new message has been recieved. |
void |
removeCoordListener(CoordListener listener)
MapHandlers can add themselves to the listener list and recieve updates when coordinates are added. |
protected void |
stopHandler()
The method making sure everything is being shutdown before the handler deletes itself. |
void |
stopLogging()
|
void |
storeCoordinate(Coordinate coord)
Publish a coordinate to all coordinate listeners and then lets the persistency layer store it permanently. |
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 |
---|
public GPSHandler(Server server, Socket socket, User user) throws IOException
server
- main server instancesocket
- client communication socketuser
- client user data
IOException
- on connection failureMethod Detail |
---|
protected void stopHandler()
stopHandler
in class ClientHandler
protected boolean messageHandler(String message)
messageHandler
in class ClientHandler
message
- received message from clientpublic void storeCoordinate(Coordinate coord)
coord
- coordinate to publish and permanently storepublic void coordBufferAdd(int size)
public void coordinateUpdate(Coordinate coord)
coord
- public void coordinateBufferUpdate(String[] coords)
coord
- public void stopLogging()
public void addCoordListener(CoordListener listener)
listener
- listener to add for notification eventspublic void removeCoordListener(CoordListener listener)
listener
- listener to add for notification events
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |