Examples of DataSm


Examples of com.cloudhopper.smpp.pdu.DataSm

            } else if (commandId == SmppConstants.CMD_ID_DELIVER_SM) {
                pdu = new DeliverSm();
            } else if (commandId == SmppConstants.CMD_ID_SUBMIT_SM) {
                pdu = new SubmitSm();
            } else if (commandId == SmppConstants.CMD_ID_DATA_SM) {
                pdu = new DataSm();
            } else if (commandId == SmppConstants.CMD_ID_CANCEL_SM) {
                pdu = new CancelSm();
            } else if (commandId == SmppConstants.CMD_ID_QUERY_SM) {
                pdu = new QuerySm();
            } else if (commandId == SmppConstants.CMD_ID_BIND_TRANSCEIVER) {
View Full Code Here

Examples of com.cloudhopper.smpp.pdu.DataSm

            } else if (commandId == SmppConstants.CMD_ID_DELIVER_SM) {
                pdu = new DeliverSm();
            } else if (commandId == SmppConstants.CMD_ID_SUBMIT_SM) {
                pdu = new SubmitSm();
            } else if (commandId == SmppConstants.CMD_ID_DATA_SM) {
                pdu = new DataSm();
            } else if (commandId == SmppConstants.CMD_ID_BIND_TRANSCEIVER) {
                pdu = new BindTransceiver();
            } else if (commandId == SmppConstants.CMD_ID_BIND_TRANSMITTER) {
                pdu = new BindTransmitter();
            } else if (commandId == SmppConstants.CMD_ID_BIND_RECEIVER) {
View Full Code Here

Examples of com.logica.smpp.pdu.DataSM

        }

        return true;
      }
      else if (pdu instanceof DataSM) {
        DataSM data = (DataSM)pdu;
        myLog.error ("receive - data message not supported: {}", data.debugString ());
        return false;
      }
      else {
        myLog.error ("receive - pdu not recognised {}", pdu.debugString ());
        return false;
View Full Code Here

Examples of com.logica.smpp.pdu.DataSM

   * @param event The {@link com.logica.smpp.ServerPDUEvent} should contain
   *              a {@link com.logica.smpp.pdu.DataSM} PDU.
   */
  protected void handleDataEvent (ServerPDUEvent event)
  {
    DataSM pdu = (DataSM)(event.getPDU ());
    myLog.debug ("handleDataEvent - async response: {}", pdu.debugString ());

    try {
      mySession.respond (pdu.getResponse ());
    }
    catch (ValueNotSetException exc) {
      myLog.error ("handleDataEvent - exception in pdu", exc);
    }
    catch (WrongSessionStateException exc) {
View Full Code Here

Examples of ie.omk.smpp.message.DataSM

        case SMPPPacket.SUBMIT_SM_RESP:
            response = new SubmitSMResp();
            break;

        case SMPPPacket.DATA_SM:
            response = new DataSM();
            break;

        case SMPPPacket.DATA_SM_RESP:
            response = new DataSMResp();
            break;
View Full Code Here

Examples of org.jsmpp.bean.DataSm

        super(session, config);
    }

    @Override
    public void execute(Exchange exchange) throws SmppException {
        DataSm dataSm = createDataSm(exchange);

        if (log.isDebugEnabled()) {
            log.debug("Sending a data short message for exchange id '{}'...", exchange.getExchangeId());
        }
       
        DataSmResult result;
        try {
            result = session.dataShortMessage(
                    dataSm.getServiceType(),
                    TypeOfNumber.valueOf(dataSm.getSourceAddrTon()),
                    NumberingPlanIndicator.valueOf(dataSm.getSourceAddrNpi()),
                    dataSm.getSourceAddr(),
                    TypeOfNumber.valueOf(dataSm.getDestAddrTon()),
                    NumberingPlanIndicator.valueOf(dataSm.getDestAddrNpi()),
                    dataSm.getDestAddress(),
                    new ESMClass(dataSm.getEsmClass()),
                    new RegisteredDelivery(dataSm.getRegisteredDelivery()),
                    DataCoding.newInstance(dataSm.getDataCoding()));
        } catch (Exception e) {
            throw new SmppException(e);
        }

        if (log.isDebugEnabled()) {
View Full Code Here

Examples of org.jsmpp.bean.DataSm

        message.setHeader(SmppConstants.ID, result.getMessageId());
    }

    protected DataSm createDataSm(Exchange exchange) {
        Message in = exchange.getIn();
        DataSm dataSm = new DataSm();

        if (in.getHeaders().containsKey(SmppConstants.DATA_CODING)) {
            dataSm.setDataCoding(in.getHeader(SmppConstants.DATA_CODING, Byte.class));
        } else {
            dataSm.setDataCoding(config.getDataCoding());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR)) {
            dataSm.setDestAddress(in.getHeader(SmppConstants.DEST_ADDR, String.class));
        } else {
            dataSm.setDestAddress(config.getDestAddr());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_TON)) {
            dataSm.setDestAddrTon(in.getHeader(SmppConstants.DEST_ADDR_TON, Byte.class));
        } else {
            dataSm.setDestAddrTon(config.getDestAddrTon());
        }

        if (in.getHeaders().containsKey(SmppConstants.DEST_ADDR_NPI)) {
            dataSm.setDestAddrNpi(in.getHeader(SmppConstants.DEST_ADDR_NPI, Byte.class));
        } else {
            dataSm.setDestAddrNpi(config.getDestAddrNpi());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR)) {
            dataSm.setSourceAddr(in.getHeader(SmppConstants.SOURCE_ADDR, String.class));
        } else {
            dataSm.setSourceAddr(config.getSourceAddr());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_TON)) {
            dataSm.setSourceAddrTon(in.getHeader(SmppConstants.SOURCE_ADDR_TON, Byte.class));
        } else {
            dataSm.setSourceAddrTon(config.getSourceAddrTon());
        }

        if (in.getHeaders().containsKey(SmppConstants.SOURCE_ADDR_NPI)) {
            dataSm.setSourceAddrNpi(in.getHeader(SmppConstants.SOURCE_ADDR_NPI, Byte.class));
        } else {
            dataSm.setSourceAddrNpi(config.getSourceAddrNpi());
        }

        if (in.getHeaders().containsKey(SmppConstants.SERVICE_TYPE)) {
            dataSm.setServiceType(in.getHeader(SmppConstants.SERVICE_TYPE, String.class));
        } else {
            dataSm.setServiceType(config.getServiceType());
        }

        if (in.getHeaders().containsKey(SmppConstants.REGISTERED_DELIVERY)) {
            dataSm.setRegisteredDelivery(in.getHeader(SmppConstants.REGISTERED_DELIVERY, Byte.class));
        } else {
            dataSm.setRegisteredDelivery(config.getRegisteredDelivery());
        }

        return dataSm;
    }
View Full Code Here

Examples of org.jsmpp.bean.DataSm

        assertSame(ExchangePattern.InOut, exchange.getPattern());
    }
   
    @Test
    public void createOnAcceptDataSm() throws Exception {
        DataSm dataSm = createMock(DataSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(eq(dataSm), isA(String.class))).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(dataSm, binding, message);
View Full Code Here

Examples of org.jsmpp.bean.DataSm

        assertSame(ExchangePattern.InOnly, exchange.getPattern());
    }
   
    @Test
    public void createOnAcceptDataSmWithExchangePattern() throws Exception {
        DataSm dataSm = createMock(DataSm.class);
        SmppMessage message = createMock(SmppMessage.class);
        expect(binding.createSmppMessage(eq(dataSm), isA(String.class))).andReturn(message);
        message.setExchange(isA(Exchange.class));
       
        replay(dataSm, binding, message);
View Full Code Here

Examples of org.jsmpp.bean.DataSm

        assertEquals(SmppMessageType.DeliverSm.toString(), smppMessage.getHeader(SmppConstants.MESSAGE_TYPE));
    }
   
    @Test
    public void createSmppMessageFromDataSmShouldReturnASmppMessage() throws Exception {
        DataSm dataSm = new DataSm();
        dataSm.setSequenceNumber(1);
        dataSm.setCommandId(1);
        dataSm.setCommandStatus(0);
        dataSm.setSourceAddr("1818");
        dataSm.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setDestAddress("1919");
        dataSm.setDestAddrNpi(NumberingPlanIndicator.NATIONAL.value());
        dataSm.setDestAddrTon(TypeOfNumber.NATIONAL.value());
        dataSm.setServiceType("WAP");
        dataSm.setRegisteredDelivery((byte) 0);
        SmppMessage smppMessage = binding.createSmppMessage(dataSm, "1");
       
        assertNull(smppMessage.getBody());
        assertEquals(14, smppMessage.getHeaders().size());
        assertEquals("1", smppMessage.getHeader(SmppConstants.ID));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.