當前位置: 首頁>>代碼示例>>Java>>正文


Java UnsuccessDelivery類代碼示例

本文整理匯總了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));
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:23,代碼來源:SmppSubmitMultiCommandTest.java

示例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;
}
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:25,代碼來源:DefaultDecomposer.java

示例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();
}
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:20,代碼來源:DefaultComposer.java

示例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;
}
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:9,代碼來源:DefaultPDUSender.java

示例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);
    }
}
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:9,代碼來源:SynchronizedPDUSender.java

示例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]);
}
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:13,代碼來源:SMPPServerSimulator.java

示例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]);
}
 
開發者ID:groupe-sii,項目名稱:ogham,代碼行數:10,代碼來源:JSMPPServerSimulator.java

示例8: submitMultiResp

import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
void submitMultiResp(int sequenceNumber, String messageId,
UnsuccessDelivery... unsuccessDeliveries) throws PDUException,
IOException;
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:4,代碼來源:SMPPServerOperation.java

示例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);
}
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:7,代碼來源:DefaultSMPPServerOperation.java

示例10: submitMultiResp

import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
byte[] submitMultiResp(int sequenceNumber, String messageId,
UnsuccessDelivery... unsuccessDeliveries) throws PDUStringException;
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:3,代碼來源:PDUComposer.java

示例11: sendSubmitMultiResp

import org.jsmpp.bean.UnsuccessDelivery; //導入依賴的package包/類
byte[] sendSubmitMultiResp(OutputStream os, int sequenceNumber,
String messageId, UnsuccessDelivery... unsuccessDeliveries)
throws PDUStringException, IOException;
 
開發者ID:opentelecoms-org,項目名稱:jsmpp,代碼行數:4,代碼來源:PDUSender.java


注:本文中的org.jsmpp.bean.UnsuccessDelivery類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。