本文整理汇总了Java中org.jsmpp.bean.MessageClass类的典型用法代码示例。如果您正苦于以下问题:Java MessageClass类的具体用法?Java MessageClass怎么用?Java MessageClass使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MessageClass类属于org.jsmpp.bean包,在下文中一共展示了MessageClass类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.jsmpp.bean.MessageClass; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
SMPPSession session = null; // 1. initialize
// 2. Initiate bind
// 3. Set message receiver listener if needed
// this is how to write "house" in arabic
String house = "\u0628" + "\u064e" + "\u064a" +
"\u0652" + "\u067a" + "\u064f";
TimeFormatter timeFormatter = new RelativeTimeFormatter();
// 4. Specify the data coding using UCS2
DataCoding dataCoding = new GeneralDataCoding(Alphabet.ALPHA_UCS2, MessageClass.CLASS1, false);
// 5. UTF-16BE is equals to UCS2
byte[] data = house.getBytes("UTF-16BE");
// 6. Submit the short message
String messageId = session.submitShortMessage("CMT",
TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
"1616", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.UNKNOWN,
"628176504657", new ESMClass(), (byte)0, (byte)1,
timeFormatter.format(new Date()), null,
new RegisteredDelivery(SMSCDeliveryReceipt.DEFAULT), (byte)0,
dataCoding,
(byte)0, data);
}