本文整理匯總了Java中org.jsmpp.bean.UnsuccessDelivery類的典型用法代碼示例。如果您正苦於以下問題:Java UnsuccessDelivery類的具體用法?Java UnsuccessDelivery怎麽用?Java UnsuccessDelivery使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
UnsuccessDelivery類屬於org.jsmpp.bean包,在下文中一共展示了UnsuccessDelivery類的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: executeWithConfigurationData
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
@Test
public void executeWithConfigurationData() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.ID, "1");
exchange.getIn().setBody("short message body");
expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1616"),
aryEq(new Address[]{new Address(TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, "1717")}),
eq(new ESMClass()), eq((byte) 0), eq((byte) 1), (String) isNull(), (String) isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
eq(ReplaceIfPresentFlag.DEFAULT), eq(DataCodings.newInstance((byte) 0)), eq((byte) 0), aryEq("short message body".getBytes())))
.andReturn(new SubmitMultiResult("1", new UnsuccessDelivery(new Address(TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, "1717"), 0)));
replay(session);
command.execute(exchange);
verify(session);
assertEquals(Arrays.asList("1"), exchange.getOut().getHeader(SmppConstants.ID));
assertEquals(1, exchange.getOut().getHeader(SmppConstants.SENT_MESSAGE_COUNT));
assertNotNull(exchange.getOut().getHeader(SmppConstants.ERROR));
}
示例2: submitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public SubmitMultiResp submitMultiResp(byte[] data)
throws PDUStringException {
SubmitMultiResp resp = new SubmitMultiResp();
SequentialBytesReader reader = new SequentialBytesReader(data);
assignHeader(resp, reader);
resp.setMessageId(reader.readCString());
StringValidator.validateString(resp.getMessageId(),
StringParameter.MESSAGE_ID);
int noUnsuccess = 0xff & reader.readByte();
UnsuccessDelivery[] unsuccessSmes = new UnsuccessDelivery[noUnsuccess];
for (int i = 0; i < noUnsuccess; i++) {
byte ton = reader.readByte();
byte npi = reader.readByte();
String addr = reader.readCString();
StringValidator.validateString(addr,
StringParameter.DESTINATION_ADDR);
int errorStatusCode = reader.readInt();
unsuccessSmes[i] = new UnsuccessDelivery(ton, npi, addr,
errorStatusCode);
}
resp.setUnsuccessSmes(unsuccessSmes);
return resp;
}
示例3: submitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public byte[] submitMultiResp(int sequenceNumber, String messageId,
UnsuccessDelivery... unsuccessDeliveries) throws PDUStringException {
StringValidator.validateString(messageId, StringParameter.MESSAGE_ID);
PDUByteBuffer buf = new PDUByteBuffer(
SMPPConstant.CID_SUBMIT_MULTI_RESP, 0, sequenceNumber);
buf.append(messageId);
buf.append((byte)unsuccessDeliveries.length); // no_unsuccess
for (UnsuccessDelivery delivery : unsuccessDeliveries) {
StringValidator.validateString(delivery.getDestinationAddress()
.getAddress(), StringParameter.DESTINATION_ADDR);
Address destAddr = delivery.getDestinationAddress();
buf.append(destAddr.getTon());
buf.append(destAddr.getNpi());
buf.append(destAddr.getAddress());
buf.append(delivery.getErrorStatusCode());
}
return buf.toBytes();
}
示例4: sendSubmitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public byte[] sendSubmitMultiResp(OutputStream os, int sequenceNumber,
String messageId, UnsuccessDelivery... unsuccessDeliveries)
throws PDUStringException, IOException {
byte[] b = pduComposer.submitMultiResp(sequenceNumber, messageId,
unsuccessDeliveries);
writeAndFlush(os, b);
return b;
}
示例5: sendSubmitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public byte[] sendSubmitMultiResp(OutputStream os, int sequenceNumber,
String messageId, UnsuccessDelivery... unsuccessDeliveries)
throws PDUStringException, IOException {
synchronized (os) {
return pduSender.sendSubmitMultiResp(os, sequenceNumber, messageId,
unsuccessDeliveries);
}
}
示例6: onAcceptSubmitMulti
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public SubmitMultiResult onAcceptSubmitMulti(SubmitMulti submitMulti, SMPPServerSession source)
throws ProcessRequestException {
MessageId messageId = messageIDGenerator.newMessageId();
LOGGER.debug("Receiving submit_multi_sm '{}', and return message id {}",
new String(submitMulti.getShortMessage()), messageId);
if (SMSCDeliveryReceipt.FAILURE.containedIn(submitMulti.getRegisteredDelivery())
|| SMSCDeliveryReceipt.SUCCESS_FAILURE.containedIn(submitMulti.getRegisteredDelivery())) {
execServiceDelReceipt.execute(new DeliveryReceiptTask(source, submitMulti, messageId));
}
return new SubmitMultiResult(messageId.getValue(), new UnsuccessDelivery[0]);
}
示例7: onAcceptSubmitMulti
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public SubmitMultiResult onAcceptSubmitMulti(SubmitMulti submitMulti, SMPPServerSession source) throws ProcessRequestException {
MessageId messageId = messageIDGenerator.newMessageId();
LOG.debug("Receiving submit_multi_sm '{}', and return message id {}", new String(submitMulti.getShortMessage()), messageId);
if (SMSCDeliveryReceipt.DEFAULT.containedIn(submitMulti.getRegisteredDelivery()) || SMSCDeliveryReceipt.SUCCESS_FAILURE.containedIn(submitMulti.getRegisteredDelivery())) {
execServiceDelReceipt.execute(new DeliveryReceiptTask(source, submitMulti, messageId));
}
return new SubmitMultiResult(messageId.getValue(), new UnsuccessDelivery[0]);
}
示例8: submitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
void submitMultiResp(int sequenceNumber, String messageId,
UnsuccessDelivery... unsuccessDeliveries) throws PDUException,
IOException;
示例9: submitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
public void submitMultiResp(int sequenceNumber, String messageId,
UnsuccessDelivery... unsuccessDeliveries) throws PDUException,
IOException {
pduSender().sendSubmitMultiResp(connection().getOutputStream(),
sequenceNumber, messageId, unsuccessDeliveries);
}
示例10: submitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
byte[] submitMultiResp(int sequenceNumber, String messageId,
UnsuccessDelivery... unsuccessDeliveries) throws PDUStringException;
示例11: sendSubmitMultiResp
import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
byte[] sendSubmitMultiResp(OutputStream os, int sequenceNumber,
String messageId, UnsuccessDelivery... unsuccessDeliveries)
throws PDUStringException, IOException;