• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java TypeOfNumber类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.jsmpp.bean.TypeOfNumber的典型用法代码示例。如果您正苦于以下问题:Java TypeOfNumber类的具体用法?Java TypeOfNumber怎么用?Java TypeOfNumber使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

TypeOfNumber类属于org.jsmpp.bean包,在下文中一共展示了TypeOfNumber类的40个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createSession

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
private SMPPSession createSession() throws IOException {
    LOG.debug("Connecting to: " + getEndpoint().getConnectionString() + "...");
    
    SMPPSession session = createSMPPSession();
    session.setEnquireLinkTimer(this.configuration.getEnquireLinkTimer());
    session.setTransactionTimer(this.configuration.getTransactionTimer());
    session.addSessionStateListener(internalSessionStateListener);
    session.connectAndBind(
            this.configuration.getHost(),
            this.configuration.getPort(),
            new BindParameter(
                    BindType.BIND_TX,
                    this.configuration.getSystemId(),
                    this.configuration.getPassword(), 
                    this.configuration.getSystemType(),
                    TypeOfNumber.valueOf(configuration.getTypeOfNumber()),
                    NumberingPlanIndicator.valueOf(configuration.getNumberingPlanIndicator()),
                    ""));
    
    LOG.info("Connected to: " + getEndpoint().getConnectionString());
    
    return session;
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:24,
代码来源:SmppProducer.java

示例2: execute

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void execute() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "CancelSm");
    exchange.getIn().setHeader(SmppConstants.ID, "1");
    exchange.getIn().setHeader(SmppConstants.SERVICE_TYPE, "XXX");
    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, "1919");
    session.cancelShortMessage("XXX", "1", TypeOfNumber.NATIONAL, NumberingPlanIndicator.NATIONAL, "1818", TypeOfNumber.INTERNATIONAL, NumberingPlanIndicator.INTERNET, "1919");
    
    replay(session);
    
    command.execute(exchange);
    
    verify(session);
    
    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:23,
代码来源:SmppCancelSmCommandTest.java

示例3: executeWithConfigurationData

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitSm");
    exchange.getIn().setHeader(SmppConstants.ID, "1");
    exchange.getIn().setBody("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890");
    expect(session.submitShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1616"),
            eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1717"), eq(new ESMClass()), eq((byte) 0), eq((byte) 1),
            (String) isNull(), (String) isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)), eq(ReplaceIfPresentFlag.DEFAULT.value()),
            eq(DataCodings.newInstance((byte) 0)), eq((byte) 0),
            aryEq("1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890".getBytes())))
            .andReturn("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));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:23,
代码来源:SmppSubmitSmCommandTest.java

示例4: alphabetUpdatesDataCoding

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void alphabetUpdatesDataCoding() throws Exception {
    final byte incorrectDataCoding = (byte)0x00;
    byte[] body = {'A', 'B', 'C'};

    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "SubmitSm");
    exchange.getIn().setHeader(SmppConstants.ALPHABET, Alphabet.ALPHA_8_BIT.value());
    exchange.getIn().setBody(body);
    expect(session.submitShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1616"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN),
            eq("1717"), eq(new ESMClass()), eq((byte) 0), eq((byte) 1), (String) isNull(), (String) isNull(), eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
            eq(ReplaceIfPresentFlag.DEFAULT.value()), not(eq(DataCodings.newInstance(incorrectDataCoding))), eq((byte) 0), aryEq(body)))
            .andReturn("1");

    replay(session);

    command.execute(exchange);

    verify(session);
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:21,
代码来源:SmppSubmitSmCommandTest.java

示例5: executeWithConfigurationData

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "DataSm");
    expect(session.dataShortMessage(eq("CMT"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1616"),
            eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1717"), eq(new ESMClass()),
            eq(new RegisteredDelivery((byte) 1)), eq(DataCodings.newInstance((byte) 0))))
        .andReturn(new DataSmResult(new MessageId("1"), null));

    replay(session);

    command.execute(exchange);

    verify(session);

    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
    assertNull(exchange.getOut().getHeader(SmppConstants.OPTIONAL_PARAMETERS));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:19,
代码来源:SmppDataSmCommandTest.java

示例6: execute

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void execute() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "DataSm");
    exchange.getIn().setHeader(SmppConstants.SERVICE_TYPE, "XXX");
    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, "1919");
    exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE).value());
    expect(session.dataShortMessage(eq("XXX"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL), eq("1818"),
            eq(TypeOfNumber.INTERNATIONAL), eq(NumberingPlanIndicator.INTERNET), eq("1919"), eq(new ESMClass()),
            eq(new RegisteredDelivery((byte) 2)), eq(DataCodings.newInstance((byte) 0))))
        .andReturn(new DataSmResult(new MessageId("1"), null));

    replay(session);

    command.execute(exchange);

    verify(session);

    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
    assertNull(exchange.getOut().getHeader(SmppConstants.OPTIONAL_PARAMETERS));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:27,
代码来源:SmppDataSmCommandTest.java

示例7: doStartExpectations

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
private void doStartExpectations() throws IOException {
    expect(endpoint.getConnectionString())
        .andReturn("smpp://[email protected]:2775")
        .times(2);
    session.setEnquireLinkTimer(5000); //expectation
    session.setTransactionTimer(10000); //expectation
    session.addSessionStateListener(isA(SessionStateListener.class));
    expect(session.connectAndBind(
        "localhost",
        new Integer(2775),
        new BindParameter(
                BindType.BIND_TX,
                "smppclient",
                "password",
                "cp",
                TypeOfNumber.UNKNOWN,
                NumberingPlanIndicator.UNKNOWN,
                ""))).andReturn("1");
    expect(endpoint.getConnectionString())
        .andReturn("smpp://[email protected]:2775");
    expect(endpoint.isSingleton()).andReturn(true);
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:23,
代码来源:SmppProducerTest.java

示例8: executeWithConfigurationData

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的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

示例9: executeWithConfigurationData

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "QuerySm");
    exchange.getIn().setHeader(SmppConstants.ID, "1");
    expect(session.queryShortMessage("1", TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN, "1616"))
            .andReturn(new QuerySmResult("-300101010000004+", MessageState.DELIVERED, (byte) 0));
    
    replay(session);
    
    command.execute(exchange);
    
    verify(session);
    
    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
    assertEquals("DELIVERED", exchange.getOut().getHeader(SmppConstants.MESSAGE_STATE));
    assertEquals((byte) 0, exchange.getOut().getHeader(SmppConstants.ERROR));
    assertNotNull(exchange.getOut().getHeader(SmppConstants.FINAL_DATE));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:20,
代码来源:SmppQuerySmCommandTest.java

示例10: execute

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void execute() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "QuerySm");
    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");
    expect(session.queryShortMessage("1", TypeOfNumber.NATIONAL, NumberingPlanIndicator.NATIONAL, "1818"))
            .andReturn(new QuerySmResult("-300101010000004+", MessageState.DELIVERED, (byte) 0));
    
    replay(session);
    
    command.execute(exchange);
    
    verify(session);
    
    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
    assertEquals("DELIVERED", exchange.getOut().getHeader(SmppConstants.MESSAGE_STATE));
    assertEquals((byte) 0, exchange.getOut().getHeader(SmppConstants.ERROR));
    assertNotNull(exchange.getOut().getHeader(SmppConstants.FINAL_DATE));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:23,
代码来源:SmppQuerySmCommandTest.java

示例11: addressRangeFromConfigurationIsUsed

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void addressRangeFromConfigurationIsUsed() throws Exception {
    resetToNice(endpoint, session);

    configuration.setAddressRange("(111*|222*|333*)");

    expect(session.connectAndBind(
            "localhost",
            new Integer(2775),
            new BindParameter(
                    BindType.BIND_RX,
                    "smppclient",
                    "password",
                    "cp",
                    TypeOfNumber.UNKNOWN,
                    NumberingPlanIndicator.UNKNOWN,
                    "(111*|222*|333*)"))).andReturn("1");

    replay(endpoint, processor, session);

    consumer.doStart();

    verify(endpoint, processor, session);
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:25,
代码来源:SmppConsumerTest.java

示例12: createSmppMessageFromAlertNotificationShouldReturnASmppMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void createSmppMessageFromAlertNotificationShouldReturnASmppMessage() {
    AlertNotification alertNotification = new AlertNotification();
    alertNotification.setCommandId(1);
    alertNotification.setSequenceNumber(1);
    alertNotification.setSourceAddr("1616");
    alertNotification.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
    alertNotification.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
    alertNotification.setEsmeAddr("1717");
    alertNotification.setEsmeAddrNpi(NumberingPlanIndicator.NATIONAL.value());
    alertNotification.setEsmeAddrTon(TypeOfNumber.NATIONAL.value());
    SmppMessage smppMessage = binding.createSmppMessage(alertNotification);
    
    assertNull(smppMessage.getBody());
    assertEquals(10, smppMessage.getHeaders().size());
    assertEquals(1, smppMessage.getHeader(SmppConstants.SEQUENCE_NUMBER));
    assertEquals(1, smppMessage.getHeader(SmppConstants.COMMAND_ID));
    assertEquals(0, smppMessage.getHeader(SmppConstants.COMMAND_STATUS));
    assertEquals("1616", smppMessage.getHeader(SmppConstants.SOURCE_ADDR));
    assertEquals((byte) 8, smppMessage.getHeader(SmppConstants.SOURCE_ADDR_NPI));
    assertEquals((byte) 2, smppMessage.getHeader(SmppConstants.SOURCE_ADDR_TON));
    assertEquals("1717", smppMessage.getHeader(SmppConstants.ESME_ADDR));
    assertEquals((byte) 8, smppMessage.getHeader(SmppConstants.ESME_ADDR_NPI));
    assertEquals((byte) 2, smppMessage.getHeader(SmppConstants.ESME_ADDR_TON));
    assertEquals(SmppMessageType.AlertNotification.toString(), smppMessage.getHeader(SmppConstants.MESSAGE_TYPE));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:27,
代码来源:SmppBindingTest.java

示例13: executeWithConfigurationData

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void executeWithConfigurationData() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "ReplaceSm");
    exchange.getIn().setHeader(SmppConstants.ID, "1");
    exchange.getIn().setBody("new short message body");
    session.replaceShortMessage(eq("1"), eq(TypeOfNumber.UNKNOWN), eq(NumberingPlanIndicator.UNKNOWN), eq("1616"), (String) isNull(), (String) isNull(),
            eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)), eq((byte) 0), aryEq("new short message body".getBytes()));
    
    replay(session);
    
    command.execute(exchange);
    
    verify(session);
    
    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:18,
代码来源:SmppReplaceSmCommandTest.java

示例14: execute

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void execute() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "ReplaceSm");
    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.SCHEDULE_DELIVERY_TIME, new Date(1111111));
    exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD, new Date(2222222));
    exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE).value());
    exchange.getIn().setBody("new short message body");
    session.replaceShortMessage(eq("1"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL), eq("1818"), eq("-300101001831100+"), eq("-300101003702200+"),
            eq(new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE)), eq((byte) 0), aryEq("new short message body".getBytes()));
    
    replay(session);
    
    command.execute(exchange);
    
    verify(session);
    
    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:24,
代码来源:SmppReplaceSmCommandTest.java

示例15: executeWithValidityPeriodAsString

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void executeWithValidityPeriodAsString() throws Exception {
    Exchange exchange = new DefaultExchange(new DefaultCamelContext(), ExchangePattern.InOut);
    exchange.getIn().setHeader(SmppConstants.COMMAND, "ReplaceSm");
    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.SCHEDULE_DELIVERY_TIME, new Date(1111111));
    exchange.getIn().setHeader(SmppConstants.VALIDITY_PERIOD, "000003000000000R"); // three days
    exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE).value());
    exchange.getIn().setBody("new short message body");
    session.replaceShortMessage(eq("1"), eq(TypeOfNumber.NATIONAL), eq(NumberingPlanIndicator.NATIONAL), eq("1818"), eq("-300101001831100+"), eq("000003000000000R"),
            eq(new RegisteredDelivery(SMSCDeliveryReceipt.FAILURE)), eq((byte) 0), aryEq("new short message body".getBytes()));
    
    replay(session);
    
    command.execute(exchange);
    
    verify(session);
    
    assertEquals("1", exchange.getOut().getHeader(SmppConstants.ID));
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:24,
代码来源:SmppReplaceSmCommandTest.java

示例16: bodyWithSMPP8bitDataCodingNotModified

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void bodyWithSMPP8bitDataCodingNotModified() throws Exception {
    final int dataCoding = 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, "ReplaceSm");
    exchange.getIn().setHeader(SmppConstants.DATA_CODING, dataCoding);
    exchange.getIn().setBody(body);

    session.replaceShortMessage((String) isNull(),
                                eq(TypeOfNumber.UNKNOWN),
                                eq(NumberingPlanIndicator.UNKNOWN),
                                eq("1616"),
                                (String) isNull(),
                                (String) isNull(),
                                eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
                                eq((byte) 0),
                                aryEq(body));

    replay(session);
    
    command.execute(exchange);
    
    verify(session);
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:27,
代码来源:SmppReplaceSmCommandTest.java

示例17: bodyWithGSM8bitDataCodingNotModified

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
@Test
public void bodyWithGSM8bitDataCodingNotModified() throws Exception {
    final int dataCoding = 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, "ReplaceSm");
    exchange.getIn().setHeader(SmppConstants.DATA_CODING, dataCoding);
    exchange.getIn().setBody(body);

    session.replaceShortMessage((String) isNull(),
                                eq(TypeOfNumber.UNKNOWN),
                                eq(NumberingPlanIndicator.UNKNOWN),
                                eq("1616"),
                                (String) isNull(),
                                (String) isNull(),
                                eq(new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS_FAILURE)),
                                eq((byte) 0),
                                aryEq(body));

    replay(session);
    
    command.execute(exchange);
    
    verify(session);
}
 

开发者ID:HydAu,
项目名称:Camel,
代码行数:27,
代码来源:SmppReplaceSmCommandTest.java

示例18: DeliverSmCommandTask

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public DeliverSmCommandTask(PDUSender pduSender,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocoId,
        byte priorityFlag, RegisteredDelivery registeredDelivery,
        DataCoding dataCoding, byte[] shortMessage,
        OptionalParameter[] optionalParameters) {
    
    super(pduSender);
    this.serviceType = serviceType;
    this.sourceAddrTon = sourceAddrTon;
    this.sourceAddrNpi = sourceAddrNpi;
    this.sourceAddr = sourceAddr;
    this.destAddrTon = destAddrTon;
    this.destAddrNpi = destAddrNpi;
    this.destinationAddr = destinationAddr;
    this.esmClass = esmClass;
    this.protocoId = protocoId;
    this.priorityFlag = priorityFlag;
    this.registeredDelivery = registeredDelivery;
    this.dataCoding = dataCoding;
    this.shortMessage = shortMessage;
    this.optionalParameters = optionalParameters;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:26,
代码来源:DeliverSmCommandTask.java

示例19: sendBind

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
/**
 * Sending bind.
 * 
 * @param bindType is the bind type.
 * @param systemId is the system id.
 * @param password is the password.
 * @param systemType is the system type.
 * @param interfaceVersion is the interface version.
 * @param addrTon is the address TON.
 * @param addrNpi is the address NPI.
 * @param addressRange is the address range.
 * @param timeout is the max time waiting for bind response. 
 * @return SMSC system id.
 * @throws PDUException if we enter invalid bind parameter(s).
 * @throws ResponseTimeoutException if there is no valid response after defined millisecond.
 * @throws InvalidResponseException if there is invalid response found.
 * @throws NegativeResponseException if we receive negative response.
 * @throws IOException if there is an IO error occur.
 */
private String sendBind(BindType bindType, String systemId,
		String password, String systemType,
		InterfaceVersion interfaceVersion, TypeOfNumber addrTon,
		NumberingPlanIndicator addrNpi, String addressRange, long timeout)
		throws PDUException, ResponseTimeoutException,
		InvalidResponseException, NegativeResponseException, IOException {
    
    BindCommandTask task = new BindCommandTask(pduSender(), bindType,
               systemId, password, systemType, interfaceVersion, addrTon,
               addrNpi, addressRange);
    
    BindResp resp = (BindResp)executeSendCommand(task, timeout);
    OptionalParameter.Sc_interface_version scVersion = resp.getOptionalParameter(Sc_interface_version.class);
    if(scVersion != null) {
	    logger.info("Other side reports SMPP interface version {}", scVersion);
    }
       
	return resp.getSystemId();
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:39,
代码来源:SMPPSession.java

示例20: submitShortMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public String submitShortMessage(String serviceType,
        TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
        String sourceAddr, TypeOfNumber destAddrTon,
        NumberingPlanIndicator destAddrNpi, String destinationAddr,
        ESMClass esmClass, byte protocolId, byte priorityFlag,
        String scheduleDeliveryTime, String validityPeriod,
        RegisteredDelivery registeredDelivery, byte replaceIfPresentFlag,
        DataCoding dataCoding, byte smDefaultMsgId, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUException,
        ResponseTimeoutException, InvalidResponseException,
        NegativeResponseException, IOException {
	
    ensureTransmittable("submitShortMessage");
	
    SubmitSmCommandTask submitSmTask = new SubmitSmCommandTask(
            pduSender(), serviceType, sourceAddrTon, sourceAddrNpi,
            sourceAddr, destAddrTon, destAddrNpi, destinationAddr,
            esmClass, protocolId, priorityFlag, scheduleDeliveryTime,
            validityPeriod, registeredDelivery, replaceIfPresentFlag,
            dataCoding, smDefaultMsgId, shortMessage, optionalParameters);
	
    SubmitSmResp resp = (SubmitSmResp)executeSendCommand(submitSmTask, getTransactionTimer());
	return resp.getMessageId();
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:25,
代码来源:SMPPSession.java

示例21: queryShortMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public QuerySmResult queryShortMessage(String messageId,
        TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
        String sourceAddr) throws PDUException, ResponseTimeoutException,
        InvalidResponseException, NegativeResponseException, IOException {
    
    ensureTransmittable("queryShortMessage");
    
    QuerySmCommandTask task = new QuerySmCommandTask(pduSender(),
            messageId, sourceAddrTon, sourceAddrNpi, sourceAddr);
    
    QuerySmResp resp = (QuerySmResp)executeSendCommand(task,
            getTransactionTimer());

    if (resp.getMessageId().equals(messageId)) {
        return new QuerySmResult(resp.getFinalDate(), resp
                .getMessageState(), resp.getErrorCode());
    } else {
        // message id requested not same as the returned
        throw new InvalidResponseException(
                "Requested message_id doesn't match with the result");
    }
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:23,
代码来源:SMPPSession.java

示例22: replaceShortMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public void replaceShortMessage(String messageId,
        TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
        String sourceAddr, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        byte smDefaultMsgId, byte[] shortMessage) throws PDUException,
        ResponseTimeoutException, InvalidResponseException,
        NegativeResponseException, IOException {
    
    ensureTransmittable("replaceShortMessage");
    
    ReplaceSmCommandTask replaceSmTask = new ReplaceSmCommandTask(
            pduSender(), messageId, sourceAddrTon, sourceAddrNpi,
            sourceAddr, scheduleDeliveryTime, validityPeriod,
            registeredDelivery, smDefaultMsgId, shortMessage);

    executeSendCommand(replaceSmTask, getTransactionTimer());
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:18,
代码来源:SMPPSession.java

示例23: ReplaceSmCommandTask

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public ReplaceSmCommandTask(PDUSender pduSender, String messageId,
        TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
        String sourceAddr, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        byte smDefaultMsgId, byte[] shortMessage) {
    super(pduSender);
    this.messageId = messageId;
    this.sourceAddrTon = sourceAddrTon;
    this.sourceAddrNpi = sourceAddrNpi;
    this.sourceAddr = sourceAddr;
    this.scheduleDeliveryTime = scheduleDeliveryTime;
    this.validityPeriod = validityPeriod;
    this.registeredDelivery = registeredDelivery;
    this.smDefaultMsgId = smDefaultMsgId;
    this.shortMessage = shortMessage;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:17,
代码来源:ReplaceSmCommandTask.java

示例24: DataSmCommandTask

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public DataSmCommandTask(PDUSender pduSender, String serviceType,
        TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
        String sourceAddr, TypeOfNumber destAddrTon,
        NumberingPlanIndicator destAddrNpi, String destinationAddr,
        ESMClass esmClass, RegisteredDelivery registeredDelivery,
        DataCoding dataCoding, OptionalParameter[] optionalParameters) {
    
    super(pduSender);
    this.serviceType = serviceType;
    this.sourceAddrTon = sourceAddrTon;
    this.sourceAddrNpi = sourceAddrNpi;
    this.sourceAddr = sourceAddr;
    this.destAddrTon = destAddrTon;
    this.destAddrNpi = destAddrNpi;
    this.destinationAddr = destinationAddr;
    this.esmClass = esmClass;
    this.registeredDelivery = registeredDelivery;
    this.dataCoding = dataCoding;
    this.optionalParameters = optionalParameters;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:DataSmCommandTask.java

示例25: deliverShortMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public void deliverShortMessage(String serviceType,
                                TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
                                String sourceAddr, TypeOfNumber destAddrTon,
                                NumberingPlanIndicator destAddrNpi, String destinationAddr,
                                ESMClass esmClass, byte protocoId, byte priorityFlag,
                                RegisteredDelivery registeredDelivery, DataCoding dataCoding,
                                byte[] shortMessage, OptionalParameter... optionalParameters)
    throws PDUException, ResponseTimeoutException,
    InvalidResponseException, NegativeResponseException, IOException {

  ensureReceivable("deliverShortMessage");

  DeliverSmCommandTask task = new DeliverSmCommandTask(pduSender(),
      serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr,
      destAddrTon, destAddrNpi, destinationAddr, esmClass, protocoId,
      protocoId, registeredDelivery, dataCoding, shortMessage,
      optionalParameters);

  executeSendCommand(task, getTransactionTimer());
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:SMPPOutboundSession.java

示例26: submitSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public String submitSm(String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocolId,
        byte priorityFlag, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        byte replaceIfPresentFlag, DataCoding dataCoding,
        byte smDefaultMsgId, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUException,
        ResponseTimeoutException, InvalidResponseException,
        NegativeResponseException, IOException {

    SubmitSmCommandTask submitSmTask = new SubmitSmCommandTask(
            pduSender(), serviceType, sourceAddrTon, sourceAddrNpi,
            sourceAddr, destAddrTon, destAddrNpi, destinationAddr,
            esmClass, protocolId, priorityFlag, scheduleDeliveryTime,
            validityPeriod, registeredDelivery, replaceIfPresentFlag,
            dataCoding, smDefaultMsgId, shortMessage, optionalParameters);

    SubmitSmResp resp = (SubmitSmResp)executeSendCommand(submitSmTask,
            getTransactionTimer());
    return resp.getMessageId();
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:24,
代码来源:DefaultSMPPClientOperation.java

示例27: submitMulti

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的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());
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:26,
代码来源:DefaultSMPPClientOperation.java

示例28: querySm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public QuerySmResult querySm(String messageId, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr)
        throws PDUException, ResponseTimeoutException,
        InvalidResponseException, NegativeResponseException, IOException {

    QuerySmCommandTask task = new QuerySmCommandTask(pduSender(),
            messageId, sourceAddrTon, sourceAddrNpi, sourceAddr);

    QuerySmResp resp = (QuerySmResp)executeSendCommand(task,
            getTransactionTimer());

    if (resp.getMessageId().equals(messageId)) {
        return new QuerySmResult(resp.getFinalDate(), resp
                .getMessageState(), resp.getErrorCode());
    } else {
        // message id requested not same as the returned
        throw new InvalidResponseException(
                "Requested message_id doesn't match with the result");
    }
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:DefaultSMPPClientOperation.java

示例29: deliverShortMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public void deliverShortMessage(String serviceType,
        TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
        String sourceAddr, TypeOfNumber destAddrTon,
        NumberingPlanIndicator destAddrNpi, String destinationAddr,
        ESMClass esmClass, byte protocoId, byte priorityFlag,
        RegisteredDelivery registeredDelivery, DataCoding dataCoding,
        byte[] shortMessage, OptionalParameter... optionalParameters)
        throws PDUException, ResponseTimeoutException,
        InvalidResponseException, NegativeResponseException, IOException {
    
    ensureReceivable("deliverShortMessage");
    
    DeliverSmCommandTask task = new DeliverSmCommandTask(pduSender(),
            serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr,
            destAddrTon, destAddrNpi, destinationAddr, esmClass, protocoId,
            protocoId, registeredDelivery, dataCoding, shortMessage,
            optionalParameters);
    
    executeSendCommand(task, getTransactionTimer());
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:SMPPServerSession.java

示例30: deliverSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public void deliverSm(String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocoId,
        byte priorityFlag, RegisteredDelivery registeredDelivery,
        DataCoding dataCoding, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUException,
        ResponseTimeoutException, InvalidResponseException,
        NegativeResponseException, IOException {

    DeliverSmCommandTask task = new DeliverSmCommandTask(pduSender(),
            serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr,
            destAddrTon, destAddrNpi, destinationAddr, esmClass, protocoId,
            protocoId, registeredDelivery, dataCoding, shortMessage,
            optionalParameters);

    executeSendCommand(task, getTransactionTimer());
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:19,
代码来源:DefaultSMPPServerOperation.java

示例31: sendBind

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
/**
 * Sending bind.
 *
 * @param bindType is the bind type.
 * @param systemId is the system id.
 * @param password is the password.
 * @param systemType is the system type.
 * @param interfaceVersion is the interface version.
 * @param addrTon is the address TON.
 * @param addrNpi is the address NPI.
 * @param addressRange is the address range.
 * @param timeout is the max time waiting for bind response.
 * @return SMSC system id.
 * @throws PDUException if we enter invalid bind parameter(s).
 * @throws ResponseTimeoutException if there is no valid response after defined millisecond.
 * @throws InvalidResponseException if there is invalid response found.
 * @throws NegativeResponseException if we receive negative response.
 * @throws IOException if there is an IO error occur.
 */
private String sendBind(BindType bindType, String systemId,
                        String password, String systemType,
                        InterfaceVersion interfaceVersion, TypeOfNumber addrTon,
                        NumberingPlanIndicator addrNpi, String addressRange, long timeout)
    throws PDUException, ResponseTimeoutException,
    InvalidResponseException, NegativeResponseException, IOException {

  BindCommandTask task = new BindCommandTask(pduSender(), bindType,
      systemId, password, systemType, interfaceVersion, addrTon,
      addrNpi, addressRange);

  BindResp resp = (BindResp)executeSendCommand(task, timeout);
  OptionalParameter.Sc_interface_version scVersion = resp.getOptionalParameter(Sc_interface_version.class);
  if(scVersion != null) {
    logger.debug("Other side reports SMPP interface version {}", scVersion);
  }

  logger.info("Bind response systemId '{}'", resp.getSystemId());
  return resp.getSystemId();
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:40,
代码来源:SMPPOutboundServerSession.java

示例32: dataSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public DataSmResult dataSm(String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass,
        RegisteredDelivery registeredDelivery, DataCoding dataCoding,
        OptionalParameter... optionalParameters) throws PDUException,
        ResponseTimeoutException, InvalidResponseException,
        NegativeResponseException, IOException {

    DataSmCommandTask task = new DataSmCommandTask(pduSender,
            serviceType, sourceAddrTon, sourceAddrNpi, sourceAddr,
            destAddrTon, destAddrNpi, destinationAddr, esmClass,
            registeredDelivery, dataCoding, optionalParameters);

    DataSmResp resp = (DataSmResp)executeSendCommand(task, getTransactionTimer());

    return new DataSmResult(resp.getMessageId(), resp.getOptionalParameters());
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:19,
代码来源:AbstractSMPPOperation.java

示例33: sendSubmitSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendSubmitSm(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocoId,
        byte priorityFlag, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        byte replaceIfPresent, DataCoding dataCoding, byte smDefaultMsgId,
        byte[] shortMessage, OptionalParameter... optionalParameters)
        throws PDUStringException, IOException {
    byte[] b = pduComposer.submitSm(sequenceNumber, serviceType,
            sourceAddrTon.value(), sourceAddrNpi.value(), sourceAddr,
            destAddrTon.value(), destAddrNpi.value(), destinationAddr,
            esmClass.value(), protocoId, priorityFlag,
            scheduleDeliveryTime, validityPeriod, registeredDelivery
                    .value(), replaceIfPresent, dataCoding.toByte(),
            smDefaultMsgId, shortMessage, optionalParameters);
    writeAndFlush(os, b);
    return b;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:DefaultPDUSender.java

示例34: sendDeliverSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendDeliverSm(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocoId,
        byte priorityFlag, RegisteredDelivery registeredDelivery,
        DataCoding dataCoding, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUStringException,
        IOException {

    byte[] b = pduComposer.deliverSm(sequenceNumber, serviceType,
            sourceAddrTon.value(), sourceAddrNpi.value(), sourceAddr,
            destAddrTon.value(), destAddrNpi.value(), destinationAddr,
            esmClass.value(), protocoId, priorityFlag, registeredDelivery
                    .value(), dataCoding.toByte(), shortMessage,
            optionalParameters);
    writeAndFlush(os, b);
    return b;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:20,
代码来源:DefaultPDUSender.java

示例35: sendDataSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendDataSm(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass,
        RegisteredDelivery registeredDelivery, DataCoding dataCoding,
        OptionalParameter... optionalParameters) throws PDUStringException,
        IOException {
    byte[] b = pduComposer.dataSm(sequenceNumber, serviceType,
            sourceAddrTon.value(), sourceAddrNpi.value(), sourceAddr,
            destAddrTon.value(), destAddrNpi.value(), destinationAddr,
            esmClass.value(), registeredDelivery.value(), dataCoding
                    .toByte(), optionalParameters);
    writeAndFlush(os, b);
    return b;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:17,
代码来源:DefaultPDUSender.java

示例36: sendSubmiMulti

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendSubmiMulti(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        DestinationAddress[] destinationAddresses, ESMClass esmClass,
        byte protocolId, byte priorityFlag, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        ReplaceIfPresentFlag replaceIfPresentFlag, DataCoding dataCoding,
        byte smDefaultMsgId, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUStringException,
        InvalidNumberOfDestinationsException, IOException {
    byte[] b = pduComposer.submitMulti(sequenceNumber, serviceType,
            sourceAddrTon.value(), sourceAddrNpi.value(), sourceAddr,
            destinationAddresses, esmClass.value(), protocolId,
            priorityFlag, scheduleDeliveryTime, validityPeriod,
            registeredDelivery.value(), replaceIfPresentFlag.value(),
            dataCoding.toByte(), smDefaultMsgId, shortMessage,
            optionalParameters);
    writeAndFlush(os, b);
    return b;
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:DefaultPDUSender.java

示例37: sendSubmitSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendSubmitSm(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocolId,
        byte priorityFlag, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        byte replaceIfPresent, DataCoding dataCoding, byte smDefaultMsgId,
        byte[] shortMessage, OptionalParameter... optionalParameters)
        throws PDUStringException, IOException {
    synchronized (os) {
        return pduSender.sendSubmitSm(os, sequenceNumber, serviceType,
                sourceAddrTon, sourceAddrNpi, sourceAddr, destAddrTon,
                destAddrNpi, destinationAddr, esmClass, protocolId,
                priorityFlag, scheduleDeliveryTime, validityPeriod,
                registeredDelivery, replaceIfPresent, dataCoding,
                smDefaultMsgId, shortMessage, optionalParameters);
    }

}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:21,
代码来源:SynchronizedPDUSender.java

示例38: sendDeliverSm

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendDeliverSm(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        TypeOfNumber destAddrTon, NumberingPlanIndicator destAddrNpi,
        String destinationAddr, ESMClass esmClass, byte protocoId,
        byte priorityFlag, RegisteredDelivery registeredDelivery,
        DataCoding dataCoding, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUStringException,
        IOException {
    synchronized (os) {
        return pduSender.sendDeliverSm(os, sequenceNumber, serviceType,
                sourceAddrTon, sourceAddrNpi, sourceAddr, destAddrTon,
                destAddrNpi, destinationAddr, esmClass, protocoId,
                priorityFlag, registeredDelivery, dataCoding, shortMessage,
                optionalParameters);
    }
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:18,
代码来源:SynchronizedPDUSender.java

示例39: sendSubmiMulti

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public byte[] sendSubmiMulti(OutputStream os, int sequenceNumber,
        String serviceType, TypeOfNumber sourceAddrTon,
        NumberingPlanIndicator sourceAddrNpi, String sourceAddr,
        DestinationAddress[] destinationAddresses, ESMClass esmClass,
        byte protocolId, byte priorityFlag, String scheduleDeliveryTime,
        String validityPeriod, RegisteredDelivery registeredDelivery,
        ReplaceIfPresentFlag replaceIfPresentFlag, DataCoding dataCoding,
        byte smDefaultMsgId, byte[] shortMessage,
        OptionalParameter... optionalParameters) throws PDUStringException,
        InvalidNumberOfDestinationsException, IOException {
    synchronized (os) {
        return pduSender.sendSubmiMulti(os, sequenceNumber, serviceType,
                sourceAddrTon, sourceAddrNpi, sourceAddr,
                destinationAddresses, esmClass, protocolId, priorityFlag,
                scheduleDeliveryTime, validityPeriod, registeredDelivery,
                replaceIfPresentFlag, dataCoding, smDefaultMsgId,
                shortMessage, optionalParameters);
    }
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:20,
代码来源:SynchronizedPDUSender.java

示例40: submitShortMessage

点赞 3

import org.jsmpp.bean.TypeOfNumber; //导入依赖的package包/类
public String submitShortMessage(String serviceType,
                                 TypeOfNumber sourceAddrTon, NumberingPlanIndicator sourceAddrNpi,
                                 String sourceAddr, TypeOfNumber destAddrTon,
                                 NumberingPlanIndicator destAddrNpi, String destinationAddr,
                                 ESMClass esmClass, byte protocolId, byte priorityFlag,
                                 String scheduleDeliveryTime, String validityPeriod,
                                 RegisteredDelivery registeredDelivery, byte replaceIfPresentFlag,
                                 DataCoding dataCoding, byte smDefaultMsgId, byte[] shortMessage,
                                 OptionalParameter... optionalParameters) throws PDUException,
    ResponseTimeoutException, InvalidResponseException,
    NegativeResponseException, IOException {

  return getSession().submitShortMessage(serviceType, sourceAddrTon,
      sourceAddrNpi, sourceAddr, destAddrTon, destAddrNpi,
      destinationAddr, esmClass, protocolId, priorityFlag,
      scheduleDeliveryTime, validityPeriod, registeredDelivery,
      replaceIfPresentFlag, dataCoding, smDefaultMsgId, shortMessage,
      optionalParameters);
}
 

开发者ID:opentelecoms-org,
项目名称:jsmpp,
代码行数:20,
代码来源:AutoReconnectGateway.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)