以下是二次开发包里的示例程序:
public class InboundNotification implements IInboundMessageNotification
{
public void process(String gatewayId, MessageTypes msgType, InboundMessage msg)
{
if (msgType == MessageTypes.INBOUND) System.out.println(">>> New Inbound message detected from Gateway: " + gatewayId);
else if (msgType == MessageTypes.STATUSREPORT) System.out.println(">>> New Inbound Status Report message detected from Gateway: " + gatewayId);
System.out.println(msg);
try
{
// Uncomment following line if you wish to delete the message upon arrival.
// srv.deleteMessage(msg);
}
catch (Exception e)
{
System.out.println("Oops!!! Something gone bad...");
e.printStackTrace();
}
}
}