|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object triptracker.client.net.SocketConnection<GPSSocketListener> triptracker.client.net.GPSSocket
public class GPSSocket
Field Summary |
---|
Fields inherited from class triptracker.client.net.SocketConnection |
---|
in, inStream, listeners, loggedIn, out, outStream |
Constructor Summary | |
---|---|
GPSSocket()
|
Method Summary | |
---|---|
void |
addListener(GPSSocketListener listener)
Register a listener for server events. |
void |
lockRoute(int route)
For locking route when it is finnished. |
void |
logon(String user,
String pass)
Logon a user of the type Protocol.SENDCLIENT . |
void |
makeRoute(String description)
Generates new route |
protected boolean |
messageHandler(String message)
Message handler for data received on socket. |
void |
removeListener(GPSSocketListener listener)
Remove listener from listener queue. |
protected void |
routeCreated(int routeId)
Publish a route created message event to all listeners. |
protected void |
routesReceived(List<Route> routes)
|
void |
sendCoord(Coordinate coord)
Sends coordinates to server. |
boolean |
sendTmpCoords(StringBuilder coordBuffer)
Sends buffered coordinates to server. |
Methods inherited from class triptracker.client.net.SocketConnection |
---|
brokenListener, connect, connect, connectionUpdate, disconnect, getHost, getPort, getRoutes, getUsername, invalidMessage, isClosed, isConnected, isLoggedIn, logon, messageLoop, sendMessage, setHost, setPort, setRoute, socketErrorEvent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GPSSocket()
Method Detail |
---|
public void logon(String user, String pass) throws IOException
Protocol.SENDCLIENT
.
user
- usernamepass
- password
IOException
- on connection failurepublic void sendCoord(Coordinate coord)
coord
- coordinate to send to serverpublic boolean sendTmpCoords(StringBuilder coordBuffer)
coordBuffer
- string buffer of all coordinates
public void makeRoute(String description)
description
- public void lockRoute(int route)
protected void routesReceived(List<Route> routes)
public void addListener(GPSSocketListener listener)
addListener
in class SocketConnection<GPSSocketListener>
listener
- event receiver to registerpublic void removeListener(GPSSocketListener listener)
removeListener
in class SocketConnection<GPSSocketListener>
listener
- event receiver to removeprotected boolean messageHandler(String message)
messageHandler
in class SocketConnection<GPSSocketListener>
message
- received message from server
protected void routeCreated(int routeId)
routeId
- route ID of the new route
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |