org.opengts.util
Class RemoteLogServer.RemoteLogHandler

java.lang.Object
  extended by org.opengts.util.AbstractClientPacketHandler
      extended by org.opengts.util.RemoteLogServer.RemoteLogHandler
All Implemented Interfaces:
ClientPacketHandler
Enclosing class:
RemoteLogServer

public class RemoteLogServer.RemoteLogHandler
extends AbstractClientPacketHandler


Field Summary
 
Fields inherited from class org.opengts.util.AbstractClientPacketHandler
GMT_Timezone, PACKET_LEN_END_OF_STREAM, PACKET_LEN_LINE_TERMINATOR
 
Constructor Summary
RemoteLogServer.RemoteLogHandler()
           
 
Method Summary
 int getActualPacketLength(byte[] packet, int packetLen)
          Callback to obtain the length of the next packet, based on the provided partial packet data.
 byte[] getHandlePacket(byte[] pkt)
          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 .
 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 org.opengts.util.AbstractClientPacketHandler
clearSavedEventCount, clearTerminateSession, equals, equalsSessionID, forceCloseTCPSession, GetDebugMode, getFinalPacket, getHostAddress, getInetAddress, getIPAddress, getLocalPort, getMaximumPacketLength, getMinimumPacketLength, getName, getPromptEnabled, getRemotePort, getResponsePort, getSavedEventCount, getSequenceID, getSessionID, getSessionInfo, getSessionStartTime, getSessionStartTimeMS, getSessionType, getTerminateSession, getThreadName, hasHostAddress, hasIPAddress, hasSavedEvents, idleTimeoutInterrupt, incrementSavedEventCount, IsDebugMode, isDuplex, isInputStream, isTCP, isTextPackets, isUDP, printSessionStart, printSessionTerminated, SetDebugMode, setPromptEnabled, setSavedEventCount, setSessionInfo, setTerminateSession, setTerminateSession, tcpWrite, terminateSession
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteLogServer.RemoteLogHandler

public RemoteLogServer.RemoteLogHandler()
Method Detail

getInitialPacket

public byte[] getInitialPacket()
Description copied from class: AbstractClientPacketHandler
Returns the initial packet that should be sent to the device upon openning the socket connection .

Specified by:
getInitialPacket in interface ClientPacketHandler
Overrides:
getInitialPacket in class AbstractClientPacketHandler
Returns:
The initial response to be sent when the session opens

sessionStarted

public void sessionStarted(java.net.InetAddress inetAddr,
                           boolean isTCP,
                           boolean isText)
Description copied from class: AbstractClientPacketHandler
Called when the session has started

Specified by:
sessionStarted in interface ClientPacketHandler
Overrides:
sessionStarted in class AbstractClientPacketHandler
Parameters:
inetAddr - The host IP address
isTCP - True if the connection is TCP
isText - True if the connection is text

sessionTerminated

public void sessionTerminated(java.lang.Throwable err,
                              long readCount,
                              long writeCount)
Description copied from class: AbstractClientPacketHandler
Callback just before the session is terminated

Specified by:
sessionTerminated in interface ClientPacketHandler
Overrides:
sessionTerminated in class AbstractClientPacketHandler

getActualPacketLength

public int getActualPacketLength(byte[] packet,
                                 int packetLen)
Description copied from class: AbstractClientPacketHandler
Callback to obtain the length of the next packet, based on the provided partial packet data.

Specified by:
getActualPacketLength in interface ClientPacketHandler
Overrides:
getActualPacketLength in class AbstractClientPacketHandler

getHandlePacket

public byte[] getHandlePacket(byte[] pkt)
                       throws java.lang.Exception
Description copied from class: AbstractClientPacketHandler
Parse the provided packet information, and return any response that should be sent back to the remote device

Specified by:
getHandlePacket in interface ClientPacketHandler
Specified by:
getHandlePacket in class AbstractClientPacketHandler
Parameters:
pkt - The packet
Returns:
The response
Throws:
java.lang.Exception