本文整理匯總了Java中org.jsmpp.bean.SubmitMulti.setScheduleDeliveryTime方法的典型用法代碼示例。如果您正苦於以下問題:Java SubmitMulti.setScheduleDeliveryTime方法的具體用法?Java SubmitMulti.setScheduleDeliveryTime怎麽用?Java SubmitMulti.setScheduleDeliveryTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jsmpp.bean.SubmitMulti
的用法示例。
在下文中一共展示了SubmitMulti.setScheduleDeliveryTime方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: copySubmitMulti
import org.jsmpp.bean.SubmitMulti; //導入方法依賴的package包/類
public static SubmitMulti copySubmitMulti(SubmitMulti src) {
SubmitMulti dest = new SubmitMulti();
dest.setCommandId(src.getCommandId());
dest.setCommandLength(src.getCommandLength());
dest.setCommandStatus(src.getCommandStatus());
dest.setDataCoding(src.getDataCoding());
dest.setDestAddresses(src.getDestAddresses());
dest.setEsmClass(src.getEsmClass());
dest.setOptionalParameters(src.getOptionalParameters());
dest.setPriorityFlag(src.getPriorityFlag());
dest.setProtocolId(src.getProtocolId());
dest.setRegisteredDelivery(src.getRegisteredDelivery());
dest.setReplaceIfPresentFlag(src.getReplaceIfPresentFlag());
dest.setScheduleDeliveryTime(src.getScheduleDeliveryTime());
dest.setSequenceNumber(src.getSequenceNumber());
dest.setServiceType(src.getServiceType());
dest.setShortMessage(src.getShortMessage());
dest.setSmDefaultMsgId(src.getSmDefaultMsgId());
dest.setSourceAddr(src.getSourceAddr());
dest.setSourceAddrNpi(src.getSourceAddrNpi());
dest.setSourceAddrTon(src.getSourceAddrTon());
dest.setValidityPeriod(src.getValidityPeriod());
return dest;
}
示例2: submitMulti
import org.jsmpp.bean.SubmitMulti; //導入方法依賴的package包/類
public SubmitMulti submitMulti(byte[] data) throws PDUStringException,
InvalidNumberOfDestinationsException {
SubmitMulti req = new SubmitMulti();
SequentialBytesReader reader = new SequentialBytesReader(data);
assignHeader(req, reader);
req.setServiceType(reader.readCString());
StringValidator.validateString(req.getServiceType(),
StringParameter.SERVICE_TYPE);
req.setSourceAddrTon(reader.readByte());
req.setSourceAddrNpi(reader.readByte());
req.setSourceAddr(reader.readCString());
StringValidator.validateString(req.getSourceAddr(),
StringParameter.SOURCE_ADDR);
int totalDest = 0xff & reader.readByte();
if (totalDest > 255) {
throw new InvalidNumberOfDestinationsException(
"Number of destination is invalid. Should be no more than 255. Actual number is "
+ totalDest, totalDest);
}
DestinationAddress[] destAddresses = new DestinationAddress[totalDest];
for (int i = 0; i < totalDest; i++) {
byte flag = reader.readByte();
if (flag == Flag.SME_ADDRESS.getValue()) {
byte ton = reader.readByte();
byte npi = reader.readByte();
String addr = reader.readCString();
StringValidator.validateString(addr,
StringParameter.DESTINATION_ADDR);
Address destAddr = new Address(ton, npi, addr);
destAddresses[i] = destAddr;
} else if (flag == Flag.DISTRIBUTION_LIST.getValue()) {
destAddresses[i] = new DistributionList(reader.readCString());
} else {
logger.warn("Unknown destination address flag: {}", flag);
}
}
req.setDestAddresses(destAddresses);
req.setEsmClass(reader.readByte());
req.setProtocolId(reader.readByte());
req.setPriorityFlag(reader.readByte());
req.setScheduleDeliveryTime(reader.readCString());
StringValidator.validateString(req.getScheduleDeliveryTime(),
StringParameter.SCHEDULE_DELIVERY_TIME);
req.setValidityPeriod(reader.readCString());
StringValidator.validateString(req.getValidityPeriod(),
StringParameter.VALIDITY_PERIOD);
req.setRegisteredDelivery(reader.readByte());
req.setReplaceIfPresentFlag(reader.readByte());
req.setDataCoding(reader.readByte());
req.setSmDefaultMsgId(reader.readByte());
byte smLength = reader.readByte();
req.setShortMessage(reader.readBytes(smLength));
StringValidator.validateString(req.getShortMessage(),
StringParameter.SHORT_MESSAGE);
req.setOptionalParameters(readOptionalParameters(reader));
return req;
}