|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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
|
| 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 |
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 . |
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 |
boolean |
terminateSession()
Callback to determine if the current session should be 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
| Constructor Detail |
|---|
public TrackClientPacketHandler()
| Method Detail |
|---|
public void sessionStarted(java.net.InetAddress inetAddr,
boolean isTCP,
boolean isText)
AbstractClientPacketHandler
sessionStarted in interface ClientPacketHandlersessionStarted in class AbstractClientPacketHandlerinetAddr - The host IP addressisTCP - True if the connection is TCPisText - True if the connection is text
public void sessionTerminated(java.lang.Throwable err,
long readCount,
long writeCount)
AbstractClientPacketHandler
sessionTerminated in interface ClientPacketHandlersessionTerminated in class AbstractClientPacketHandler
public int getActualPacketLength(byte[] packet,
int packetLen)
AbstractClientPacketHandler
getActualPacketLength in interface ClientPacketHandlergetActualPacketLength in class AbstractClientPacketHandlerpublic boolean terminateSession()
AbstractClientPacketHandler
terminateSession in interface ClientPacketHandlerterminateSession in class AbstractClientPacketHandler
public byte[] getInitialPacket()
throws java.lang.Exception
AbstractClientPacketHandler
getInitialPacket in interface ClientPacketHandlergetInitialPacket in class AbstractClientPacketHandlerjava.lang.Exceptionpublic byte[] getHandlePacket(byte[] pktBytes)
AbstractClientPacketHandler
getHandlePacket in interface ClientPacketHandlergetHandlePacket in class AbstractClientPacketHandlerpktBytes - The packet
public byte[] getFinalPacket(boolean hasError)
throws java.lang.Exception
AbstractClientPacketHandler
getFinalPacket in interface ClientPacketHandlergetFinalPacket in class AbstractClientPacketHandlerjava.lang.Exceptionpublic 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 | ||||||||