mx.udlap.kjProtocol.packets
Class AdminKMessage

java.lang.Object
  extended bymx.udlap.kjProtocol.packets.BasicPacket
      extended bymx.udlap.kjProtocol.packets.AdminKMessage
All Implemented Interfaces:
BasicKannelProtocolMessage

public class AdminKMessage
extends BasicPacket
implements BasicKannelProtocolMessage

Kannel's protocol admin message.

Author:
Oscar Medina Duarte

Field Summary
static int CMD_IDENTIFY
          Identify command
static int CMD_RESTART
          Restart command
static int CMD_RESUME
          Resume command
static int CMD_SHUTDOWN
          Shutdown command
static int CMD_SUSPEND
          Suspend command
 
Fields inherited from class mx.udlap.kjProtocol.packets.BasicPacket
ACK_PKT, ADMIN_PKT, HEARTBEAT_PKT, length, NODATA, SMS_PKT, type, WDP_PKT
 
Constructor Summary
AdminKMessage()
          Constructor for the AdminKMessage object
AdminKMessage(byte[] data)
          Constructor for the AdminKMessage object
AdminKMessage(int command, java.lang.String boxc_id)
          Constructor for the AdminKMessage object
 
Method Summary
 KInteger getAdm_command()
          Gets the adm_command attribute of the AdminKMessage object
 KString getBoxc_id()
          Gets the boxc_id attribute of the AdminKMessage object
 byte[] getMessage()
          Gets the message bytes of the AdminKMessage object
static void main(java.lang.String[] args)
          Class testing
 void setAdm_command(KInteger adm_command)
          Sets the adm_command attribute of the AdminKMessage object
 void setBoxc_id(KString boxc_id)
          Sets the boxc_id attribute of the AdminKMessage object
 void setMessage(byte[] data)
          Sets the message attribute of the HeartBeatKMessage object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CMD_SHUTDOWN

public static final int CMD_SHUTDOWN
Shutdown command

See Also:
Constant Field Values

CMD_SUSPEND

public static final int CMD_SUSPEND
Suspend command

See Also:
Constant Field Values

CMD_RESUME

public static final int CMD_RESUME
Resume command

See Also:
Constant Field Values

CMD_IDENTIFY

public static final int CMD_IDENTIFY
Identify command

See Also:
Constant Field Values

CMD_RESTART

public static final int CMD_RESTART
Restart command

See Also:
Constant Field Values
Constructor Detail

AdminKMessage

public AdminKMessage()
Constructor for the AdminKMessage object


AdminKMessage

public AdminKMessage(int command,
                     java.lang.String boxc_id)
Constructor for the AdminKMessage object

Parameters:
command - Command
boxc_id - Name of the box

AdminKMessage

public AdminKMessage(byte[] data)
              throws PacketParseException
Constructor for the AdminKMessage object

Parameters:
data - byte array containing an Admin packet as it was received over a tcp link
Throws:
PacketParseException - Exception thrown when parsing fails
Method Detail

getMessage

public byte[] getMessage()
Gets the message bytes of the AdminKMessage object

This is the actual message package to be sent over a tco link.

Specified by:
getMessage in interface BasicKannelProtocolMessage
Returns:
The message value

setMessage

public void setMessage(byte[] data)
                throws PacketParseException
Sets the message attribute of the HeartBeatKMessage object

This is the way to parse a packet received from a tcp link.

Specified by:
setMessage in interface BasicKannelProtocolMessage
Parameters:
data - The new message value
Throws:
PacketParseException - Exception thrown when parsing fails

setAdm_command

public void setAdm_command(KInteger adm_command)
Sets the adm_command attribute of the AdminKMessage object

Parameters:
adm_command - The new adm_command value

setBoxc_id

public void setBoxc_id(KString boxc_id)
Sets the boxc_id attribute of the AdminKMessage object

Parameters:
boxc_id - The new boxc_id value

getAdm_command

public KInteger getAdm_command()
Gets the adm_command attribute of the AdminKMessage object

Returns:
The adm_command value

getBoxc_id

public KString getBoxc_id()
Gets the boxc_id attribute of the AdminKMessage object

Returns:
The boxc_id value

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Class testing

Parameters:
args - Description of the Parameter
Throws:
java.lang.Exception - Exception thrown when