|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opengts.util.AbstractClientPacketHandler org.opengts.servers.template.TrackClientPacketHandler
public class TrackClientPacketHandler
TrackClientPacketHandler
- This module contains the general
"business logic" for parsing incoming data packets from the remote tracking
Device.
Field Summary | |
---|---|
static int |
DATA_FORMAT_OPTION
|
static boolean |
ESTIMATE_ODOMETER
|
static double |
KILOMETERS_PER_KNOT
|
static double |
KNOTS_PER_KILOMETER
|
static double |
MINIMUM_SPEED_KPH
|
static long |
SIMEVENT_DIGITAL_INPUTS
|
static boolean |
SIMEVENT_GEOZONES
|
static boolean |
USE_STANDARD_TCP_SESSION_ID
|
Fields inherited from class org.opengts.util.AbstractClientPacketHandler |
---|
GMT_Timezone, PACKET_LEN_END_OF_STREAM, PACKET_LEN_LINE_TERMINATOR |
Constructor Summary | |
---|---|
TrackClientPacketHandler()
|
Method Summary | |
---|---|
static int |
_main(boolean fromMain)
Main entry point used for debug purposes only |
static void |
configInit()
Initialize runtime configuration |
static java.lang.String |
CreateTcpSessionID(Device dev)
|
int |
getActualPacketLength(byte[] packet,
int packetLen)
Callback to obtain the length of the next packet, based on the provided partial packet data. |
byte[] |
getFinalPacket(boolean hasError)
Returns the final packet that should be sent to the device before closing the socket connection. |
byte[] |
getHandlePacket(byte[] pktBytes)
Parse the provided packet information, and return any response that should be sent back to the remote device |
byte[] |
getInitialPacket()
Returns the initial packet that should be sent to the device upon openning the socket connection . |
java.lang.String |
getSessionID()
Returns the session ID (override only) |
static java.lang.String |
GetTcpSessionID(Device dev)
|
boolean |
getTerminateSession()
Callback to determine if the current session should be terminated |
static void |
main(java.lang.String[] argv)
Main entry point used for debug purposes only |
void |
sessionStarted(java.net.InetAddress inetAddr,
boolean isTCP,
boolean isText)
Called when the session has started |
void |
sessionTerminated(java.lang.Throwable err,
long readCount,
long writeCount)
Callback just before the session is terminated |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DATA_FORMAT_OPTION
public static boolean ESTIMATE_ODOMETER
public static boolean SIMEVENT_GEOZONES
public static long SIMEVENT_DIGITAL_INPUTS
public static double MINIMUM_SPEED_KPH
public static final double KILOMETERS_PER_KNOT
public static final double KNOTS_PER_KILOMETER
public static final boolean USE_STANDARD_TCP_SESSION_ID
Constructor Detail |
---|
public TrackClientPacketHandler()
Method Detail |
---|
public void sessionStarted(java.net.InetAddress inetAddr, boolean isTCP, boolean isText)
AbstractClientPacketHandler
sessionStarted
in interface ClientPacketHandler
sessionStarted
in class AbstractClientPacketHandler
inetAddr
- The host IP addressisTCP
- True if the connection is TCPisText
- True if the connection is textpublic void sessionTerminated(java.lang.Throwable err, long readCount, long writeCount)
AbstractClientPacketHandler
sessionTerminated
in interface ClientPacketHandler
sessionTerminated
in class AbstractClientPacketHandler
public java.lang.String getSessionID()
AbstractClientPacketHandler
getSessionID
in class AbstractClientPacketHandler
public static java.lang.String GetTcpSessionID(Device dev)
public static java.lang.String CreateTcpSessionID(Device dev)
public int getActualPacketLength(byte[] packet, int packetLen)
AbstractClientPacketHandler
getActualPacketLength
in interface ClientPacketHandler
getActualPacketLength
in class AbstractClientPacketHandler
public boolean getTerminateSession()
AbstractClientPacketHandler
getTerminateSession
in interface ClientPacketHandler
getTerminateSession
in class AbstractClientPacketHandler
public byte[] getInitialPacket() throws java.lang.Exception
AbstractClientPacketHandler
getInitialPacket
in interface ClientPacketHandler
getInitialPacket
in class AbstractClientPacketHandler
java.lang.Exception
public byte[] getHandlePacket(byte[] pktBytes)
AbstractClientPacketHandler
getHandlePacket
in interface ClientPacketHandler
getHandlePacket
in class AbstractClientPacketHandler
pktBytes
- The packet
public byte[] getFinalPacket(boolean hasError) throws java.lang.Exception
AbstractClientPacketHandler
getFinalPacket
in interface ClientPacketHandler
getFinalPacket
in class AbstractClientPacketHandler
java.lang.Exception
public static void configInit()
public static int _main(boolean fromMain)
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |