本文整理匯總了Java中org.jsmpp.bean.SubmitMultiResult類的典型用法代碼示例。如果您正苦於以下問題:Java SubmitMultiResult類的具體用法?Java SubmitMultiResult怎麽用?Java SubmitMultiResult使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SubmitMultiResult類屬於org.jsmpp.bean包,在下文中一共展示了SubmitMultiResult類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: executeWithConfigurationData
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的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: submitMulti
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
public SubmitMultiResult submitMulti(String serviceType,
TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
String sourceAddr, Address[] destinationAddresses,
ESMClass esmClass, byte protocolId, byte priorityFlag,
String scheduleDeliveryTime, String validityPeriod,
RegisteredDelivery registeredDelivery,
ReplaceIfPresentFlag replaceIfPresentFlag, DataCoding dataCoding,
byte smDefaultMsgId, byte[] shortMessage,
OptionalParameter[] optionalParameters) throws PDUException,
ResponseTimeoutException, InvalidResponseException,
NegativeResponseException, IOException {
SubmitMultiCommandTask task = new SubmitMultiCommandTask(pduSender(),
serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr,
destinationAddresses, esmClass, protocolId, priorityFlag,
scheduleDeliveryTime, validityPeriod, registeredDelivery,
replaceIfPresentFlag, dataCoding, smDefaultMsgId, shortMessage,
optionalParameters);
SubmitMultiResp resp = (SubmitMultiResp)executeSendCommand(task,
getTransactionTimer());
return new SubmitMultiResult(resp.getMessageId(), resp
.getUnsuccessSmes());
}
示例3: execute
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void execute() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.ID, "1");
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_TON, TypeOfNumber.NATIONAL.value());
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_NPI, NumberingPlanIndicator.NATIONAL.value());
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR, "1818");
exchange.getIn().setHeader(SmppConstants.DEST_ADDR_TON, TypeOfNumber.INTERNATIONAL.value());
exchange.getIn().setHeader(SmppConstants.DEST_ADDR_NPI, NumberingPlanIndicator.INTERNET.value());
exchange.getIn().setHeader(SmppConstants.DEST_ADDR, Arrays.asList("1919"));
exchange.getIn().setHeader(SmppConstants.SCHEDULE_DELIVERY_TIME, new Date(1111111));
exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD, new Date(2222222));
exchange.getIn().setHeader(SmppConstants.PROTOCOL_ID, (byte) 1);
exchange.getIn().setHeader(SmppConstants.PRIORITY_FLAG, (byte) 2);
exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE).value());
exchange.getIn().setHeader(SmppConstants.REPLACE_IF_PRESENT_FLAG, ReplaceIfPresentFlag.REPLACE.value());
exchange.getIn().setBody("short message body");
expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL), eq("1818"),
aryEq(new Address[]{new Address(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.INTERNET, "1919")}),
eq(new ESMClass()), eq((byte) 1), eq((byte) 2), eq("-300101001831100+"), eq("-300101003702200+"), eq(new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE)),
eq(ReplaceIfPresentFlag.REPLACE), eq(DataCodings.newInstance((byte) 0)), eq((byte) 0), aryEq("short message body".getBytes())))
.andReturn(new SubmitMultiResult("1"));
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));
assertNull(exchange.getOut().getHeader(SmppConstants.ERROR));
}
示例4: executeWithValidityPeriodAsString
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void executeWithValidityPeriodAsString() throws Exception {
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.ID, "1");
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_TON, TypeOfNumber.NATIONAL.value());
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR_NPI, NumberingPlanIndicator.NATIONAL.value());
exchange.getIn().setHeader(SmppConstants.SOURCE_ADDR, "1818");
exchange.getIn().setHeader(SmppConstants.DEST_ADDR_TON, TypeOfNumber.INTERNATIONAL.value());
exchange.getIn().setHeader(SmppConstants.DEST_ADDR_NPI, NumberingPlanIndicator.INTERNET.value());
exchange.getIn().setHeader(SmppConstants.DEST_ADDR, Arrays.asList("1919"));
exchange.getIn().setHeader(SmppConstants.SCHEDULE_DELIVERY_TIME, new Date(1111111));
exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD, "000003000000000R"); // three days
exchange.getIn().setHeader(SmppConstants.PROTOCOL_ID, (byte) 1);
exchange.getIn().setHeader(SmppConstants.PRIORITY_FLAG, (byte) 2);
exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE).value());
exchange.getIn().setHeader(SmppConstants.REPLACE_IF_PRESENT_FLAG, ReplaceIfPresentFlag.REPLACE.value());
exchange.getIn().setBody("short message body");
expect(session.submitMultiple(eq("CMT"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL), eq("1818"),
aryEq(new Address[]{new Address(TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.INTERNET, "1919")}),
eq(new ESMClass()), eq((byte) 1), eq((byte) 2), eq("-300101001831100+"), eq("000003000000000R"), eq(new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE)),
eq(ReplaceIfPresentFlag.REPLACE), eq(DataCodings.newInstance((byte) 0)), eq((byte) 0), aryEq("short message body".getBytes())))
.andReturn(new SubmitMultiResult("1"));
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));
assertNull(exchange.getOut().getHeader(SmppConstants.ERROR));
}
示例5: bodyWithSmscDefaultDataCodingNarrowedToCharset
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void bodyWithSmscDefaultDataCodingNarrowedToCharset() throws Exception {
final byte dataCoding = (byte)0x00; /* SMSC-default */
byte[] body = {(byte)0xFF, 'A', 'B', (byte)0x00, (byte)0xFF, (byte)0x7F, 'C', (byte)0xFF};
byte[] bodyNarrowed = {'?', 'A', 'B', '\0', '?', (byte)0x7F, 'C', '?'};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.DATA_CODING, dataCoding);
exchange.getIn().setBody(body);
Address[] destAddrs = new Address[] {
new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN,
"1717")
};
expect(session.submitMultiple(eq("CMT"),
eq(TypeOfNumber.UNKNOWN),
eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
aryEq(destAddrs),
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(dataCoding)),
eq((byte) 0),
aryEq(bodyNarrowed)))
.andReturn(new SubmitMultiResult("1"));
replay(session);
command.execute(exchange);
verify(session);
}
示例6: bodyWithLatin1DataCodingNarrowedToCharset
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void bodyWithLatin1DataCodingNarrowedToCharset() throws Exception {
final byte dataCoding = (byte)0x03; /* ISO-8859-1 (Latin1) */
byte[] body = {(byte)0xFF, 'A', 'B', (byte)0x00, (byte)0xFF, (byte)0x7F, 'C', (byte)0xFF};
byte[] bodyNarrowed = {'?', 'A', 'B', '\0', '?', (byte)0x7F, 'C', '?'};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.DATA_CODING, dataCoding);
exchange.getIn().setBody(body);
Address[] destAddrs = new Address[] {
new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN,
"1717")
};
expect(session.submitMultiple(eq("CMT"),
eq(TypeOfNumber.UNKNOWN),
eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
aryEq(destAddrs),
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(dataCoding)),
eq((byte) 0),
aryEq(bodyNarrowed)))
.andReturn(new SubmitMultiResult("1"));
replay(session);
command.execute(exchange);
verify(session);
}
示例7: bodyWithSMPP8bitDataCodingNotModified
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void bodyWithSMPP8bitDataCodingNotModified() throws Exception {
final byte dataCoding = (byte)0x04; /* SMPP 8-bit */
byte[] body = {(byte)0xFF, 'A', 'B', (byte)0x00, (byte)0xFF, (byte)0x7F, 'C', (byte)0xFF};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.DATA_CODING, dataCoding);
exchange.getIn().setBody(body);
Address[] destAddrs = new Address[] {
new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN,
"1717")
};
expect(session.submitMultiple(eq("CMT"),
eq(TypeOfNumber.UNKNOWN),
eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
aryEq(destAddrs),
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(dataCoding)),
eq((byte) 0),
aryEq(body)))
.andReturn(new SubmitMultiResult("1"));
replay(session);
command.execute(exchange);
verify(session);
}
示例8: bodyWithGSM8bitDataCodingNotModified
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void bodyWithGSM8bitDataCodingNotModified() throws Exception {
final byte dataCoding = (byte)0xF7; /* GSM 8-bit class 3 */
byte[] body = {(byte)0xFF, 'A', 'B', (byte)0x00, (byte)0xFF, (byte)0x7F, 'C', (byte)0xFF};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.DATA_CODING, dataCoding);
exchange.getIn().setBody(body);
Address[] destAddrs = new Address[] {
new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN,
"1717")
};
expect(session.submitMultiple(eq("CMT"),
eq(TypeOfNumber.UNKNOWN),
eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
aryEq(destAddrs),
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(dataCoding)),
eq((byte) 0),
aryEq(body)))
.andReturn(new SubmitMultiResult("1"));
replay(session);
command.execute(exchange);
verify(session);
}
示例9: eightBitDataCodingOverridesDefaultAlphabet
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void eightBitDataCodingOverridesDefaultAlphabet() throws Exception {
final byte binDataCoding = (byte)0x04; /* SMPP 8-bit */
byte[] body = {(byte)0xFF, 'A', 'B', (byte)0x00, (byte)0xFF, (byte)0x7F, 'C', (byte)0xFF};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.ALPHABET, Alphabet.ALPHA_DEFAULT.value());
exchange.getIn().setHeader(SmppConstants.DATA_CODING, binDataCoding);
exchange.getIn().setBody(body);
Address[] destAddrs = new Address[] {
new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN,
"1717")
};
expect(session.submitMultiple(eq("CMT"),
eq(TypeOfNumber.UNKNOWN),
eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
aryEq(destAddrs),
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(binDataCoding)),
eq((byte) 0),
aryEq(body)))
.andReturn(new SubmitMultiResult("1"));
replay(session);
command.execute(exchange);
verify(session);
}
示例10: latin1DataCodingOverridesEightBitAlphabet
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
@Test
public void latin1DataCodingOverridesEightBitAlphabet() throws Exception {
final byte latin1DataCoding = (byte)0x03; /* ISO-8859-1 (Latin1) */
byte[] body = {(byte)0xFF, 'A', 'B', (byte)0x00, (byte)0xFF, (byte)0x7F, 'C', (byte)0xFF};
byte[] bodyNarrowed = {'?', 'A', 'B', '\0', '?', (byte)0x7F, 'C', '?'};
Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitMulti");
exchange.getIn().setHeader(SmppConstants.ALPHABET, Alphabet.ALPHA_8_BIT.value());
exchange.getIn().setHeader(SmppConstants.DATA_CODING, latin1DataCoding);
exchange.getIn().setBody(body);
Address[] destAddrs = new Address[] {
new Address(TypeOfNumber.UNKNOWN,
NumberingPlanIndicator.UNKNOWN,
"1717")
};
expect(session.submitMultiple(eq("CMT"),
eq(TypeOfNumber.UNKNOWN),
eq(NumberingPlanIndicator.UNKNOWN),
eq("1616"),
aryEq(destAddrs),
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(latin1DataCoding)),
eq((byte) 0),
aryEq(bodyNarrowed)))
.andReturn(new SubmitMultiResult("1"));
replay(session);
command.execute(exchange);
verify(session);
}
示例11: submitMultiple
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
public SubmitMultiResult submitMultiple(String serviceType,
TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
String sourceAddr, Address[] destinationAddresses,
ESMClass esmClass, byte protocolId, byte priorityFlag,
String scheduleDeliveryTime, String validityPeriod,
RegisteredDelivery registeredDelivery,
ReplaceIfPresentFlag replaceIfPresentFlag, DataCoding dataCoding,
byte smDefaultMsgId, byte[] shortMessage,
OptionalParameter... optionalParameters) throws PDUException,
ResponseTimeoutException, InvalidResponseException,
NegativeResponseException, IOException {
ensureTransmittable("submitMultiple");
SubmitMultiCommandTask task = new SubmitMultiCommandTask(pduSender(),
serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr,
destinationAddresses, esmClass, protocolId, priorityFlag,
scheduleDeliveryTime, validityPeriod, registeredDelivery,
replaceIfPresentFlag, dataCoding, smDefaultMsgId, shortMessage,
optionalParameters);
SubmitMultiResp resp = (SubmitMultiResp)executeSendCommand(task,
getTransactionTimer());
return new SubmitMultiResult(resp.getMessageId(), resp
.getUnsuccessSmes());
}
示例12: fireAcceptSubmitMulti
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
private SubmitMultiResult fireAcceptSubmitMulti(SubmitMulti submitMulti) throws ProcessRequestException {
if (messageReceiverListener != null) {
return messageReceiverListener.onAcceptSubmitMulti(submitMulti, this);
}
logger.warn(MESSAGE_RECEIVER_LISTENER_IS_NULL);
throw new ProcessRequestException(NO_MESSAGE_RECEIVER_LISTENER_REGISTERED,
SMPPConstant.STAT_ESME_RX_R_APPN);
}
示例13: fireSubmitMultiRespSentError
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
private void fireSubmitMultiRespSentError(
SubmitMultiResult submitMultiResult, Exception cause) {
if (responseDeliveryListener != null) {
responseDeliveryListener.onSubmitMultiRespError(
submitMultiResult, cause, this);
}
}
示例14: processSubmitMulti
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
public SubmitMultiResult processSubmitMulti(SubmitMulti submitMulti)
throws ProcessRequestException {
try {
return fireAcceptSubmitMulti(submitMulti);
} catch(Exception e) {
String msg = "Invalid runtime exception thrown when processing SubmitMultiSm";
logger.error(msg, e);
throw new ProcessRequestException(msg, SMPPConstant.STAT_ESME_RSYSERR);
}
}
示例15: submitMulti
import org.jsmpp.bean.SubmitMultiResult; //導入依賴的package包/類
SubmitMultiResult submitMulti(String serviceType,
TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
String sourceAddr, Address[] destinationAddresses,
ESMClass esmClass, byte protocolId, byte priorityFlag,
String scheduleDeliveryTime, String validityPeriod,
RegisteredDelivery registeredDelivery,
ReplaceIfPresentFlag replaceIfPresentFlag, DataCoding dataCoding,
byte smDefaultMsgId, byte[] shortMessage,
OptionalParameter[] optionalParameters) throws PDUException,
ResponseTimeoutException, InvalidResponseException,
NegativeResponseException, IOException;