|
|||||||||
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.db.CommandPacketHandler
public abstract class CommandPacketHandler
Field Summary | |
---|---|
static java.lang.String |
ARG_ACCOUNT
|
static java.lang.String[] |
ARG_ARG0
|
static java.lang.String |
ARG_ARG1
|
static java.lang.String |
ARG_ARG2
|
static java.lang.String |
ARG_ARG3
|
static java.lang.String |
ARG_ARG4
|
static java.lang.String |
ARG_ARG5
|
static java.lang.String |
ARG_ARG6
|
static java.lang.String |
ARG_ARG7
|
static java.lang.String |
ARG_ARG8
|
static java.lang.String |
ARG_ARG9
|
static java.lang.String |
ARG_CMDNAME
|
static java.lang.String |
ARG_CMDTYPE
|
static java.lang.String |
ARG_DEVICE
|
static java.lang.String |
ARG_IP
|
static java.lang.String |
ARG_LASTCONNECT
|
static java.lang.String |
ARG_MESSAGE
|
static java.lang.String |
ARG_PHONE
|
static java.lang.String |
ARG_RESULT
|
static java.lang.String |
ARG_SERVER
|
static java.lang.String |
ARG_USER
|
static java.lang.String[] |
CMD_ARGS
|
static java.lang.String |
INTERNCMD_COMMANDS
|
static java.lang.String |
INTERNCMD_SESSIONS
|
static java.lang.String |
INTERNCMD_STACKTRACE
|
Fields inherited from class org.opengts.util.AbstractClientPacketHandler |
---|
GMT_Timezone, PACKET_LEN_END_OF_STREAM, PACKET_LEN_LINE_TERMINATOR |
Constructor Summary | |
---|---|
CommandPacketHandler()
|
Method Summary | |
---|---|
static RTProperties |
EncodeCommand(java.lang.String cmdType,
java.lang.String cmdName,
java.lang.String[] cmdArgs)
Encode the specified command into an RTProperties instance |
int |
getActualPacketLength(byte[] packet,
int packetLen)
Callback to obtain the length of the next packet, based on the provided partial packet data. |
static java.lang.String |
getFromEmailCommand(Account account)
|
static java.lang.String |
getFromEmailCommand(BasicPrivateLabel bpl)
|
byte[] |
getHandlePacket(byte[] pktBytes)
Parse the provided packet information, and return any response that should be sent back to the remote device |
int |
getResponsePort()
Returns the client response port# |
abstract java.lang.String |
getServerName()
|
boolean |
getTerminateSession()
Callback to determine if the current session should be terminated |
abstract DCServerFactory.ResultCode |
handleCommand(Device device,
java.lang.String cmdType,
java.lang.String cmdName,
java.lang.String[] args)
|
static void |
main(java.lang.String[] argv)
|
protected static byte[] |
RESULT(RTProperties rtp,
DCServerFactory.ResultCode result)
|
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 |
static RTProperties |
setResult(RTProperties rtp,
DCServerFactory.ResultCode result)
|
void |
setTerminateSession()
Sets the terminate-session state to true |
boolean |
terminateSession()
Callback to determine if the current session should be terminated |
static boolean |
validateAddress(java.lang.String addr)
|
static boolean |
validateAddresses(java.lang.String addrs)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ARG_ACCOUNT
public static final java.lang.String ARG_DEVICE
public static final java.lang.String ARG_USER
public static final java.lang.String ARG_CMDTYPE
public static final java.lang.String ARG_CMDNAME
public static final java.lang.String[] ARG_ARG0
public static final java.lang.String ARG_ARG1
public static final java.lang.String ARG_ARG2
public static final java.lang.String ARG_ARG3
public static final java.lang.String ARG_ARG4
public static final java.lang.String ARG_ARG5
public static final java.lang.String ARG_ARG6
public static final java.lang.String ARG_ARG7
public static final java.lang.String ARG_ARG8
public static final java.lang.String ARG_ARG9
public static final java.lang.String[] CMD_ARGS
public static final java.lang.String ARG_SERVER
public static final java.lang.String ARG_IP
public static final java.lang.String ARG_PHONE
public static final java.lang.String ARG_LASTCONNECT
public static final java.lang.String ARG_RESULT
public static final java.lang.String ARG_MESSAGE
public static final java.lang.String INTERNCMD_COMMANDS
public static final java.lang.String INTERNCMD_STACKTRACE
public static final java.lang.String INTERNCMD_SESSIONS
Constructor Detail |
---|
public CommandPacketHandler()
Method Detail |
---|
public static RTProperties setResult(RTProperties rtp, DCServerFactory.ResultCode result)
protected static byte[] RESULT(RTProperties rtp, DCServerFactory.ResultCode result)
public abstract java.lang.String getServerName()
public abstract DCServerFactory.ResultCode handleCommand(Device device, java.lang.String cmdType, java.lang.String cmdName, java.lang.String[] args)
public int getResponsePort()
AbstractClientPacketHandler
getResponsePort
in interface ClientPacketHandler
getResponsePort
in class AbstractClientPacketHandler
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 int getActualPacketLength(byte[] packet, int packetLen)
AbstractClientPacketHandler
getActualPacketLength
in interface ClientPacketHandler
getActualPacketLength
in class AbstractClientPacketHandler
public void setTerminateSession()
AbstractClientPacketHandler
setTerminateSession
in interface ClientPacketHandler
setTerminateSession
in class AbstractClientPacketHandler
public boolean getTerminateSession()
AbstractClientPacketHandler
getTerminateSession
in interface ClientPacketHandler
getTerminateSession
in class AbstractClientPacketHandler
public boolean terminateSession()
AbstractClientPacketHandler
terminateSession
in interface ClientPacketHandler
terminateSession
in class AbstractClientPacketHandler
public byte[] getHandlePacket(byte[] pktBytes)
AbstractClientPacketHandler
getHandlePacket
in interface ClientPacketHandler
getHandlePacket
in class AbstractClientPacketHandler
pktBytes
- The packet
public static RTProperties EncodeCommand(java.lang.String cmdType, java.lang.String cmdName, java.lang.String[] cmdArgs)
cmdType
- The command typecmdName
- The command namecmdArgs
- The array of command arguments
public static boolean validateAddress(java.lang.String addr)
public static boolean validateAddresses(java.lang.String addrs)
public static java.lang.String getFromEmailCommand(Account account)
public static java.lang.String getFromEmailCommand(BasicPrivateLabel bpl)
public static void main(java.lang.String[] argv)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |