Package org.jsmpp.util

Examples of org.jsmpp.util.MessageId


       
        listener = new MessageReceiverListenerImpl(endpoint, processor, exceptionHandler);
        listener.setMessageIDGenerator(new MessageIDGenerator() {
            public MessageId newMessageId() {
                try {
                    return new MessageId("1");
                } catch (PDUStringException e) {
                    throw new RuntimeException(e);
                }
            }
        });
View Full Code Here


    }

    public DataSmResult onAcceptDataSm(DataSm dataSm, Session session) throws ProcessRequestException {
        LOG.debug("Received a dataSm {}", dataSm);

        MessageId newMessageId = messageIDGenerator.newMessageId();
        Exchange exchange = endpoint.createOnAcceptDataSm(dataSm, newMessageId.getValue());
        try {
            processor.process(exchange);
        } catch (Exception e) {
            exchange.setException(e);
        }
View Full Code Here

                throws ProcessRequestException {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received a dataSm " + dataSm);
                }

                MessageId newMessageId = messageIDGenerator.newMessageId();

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDataSm(dataSm,
                            newMessageId.getValue());

                    LOG.trace("processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("processed the new smpp exchange");
                } catch (Exception e) {
View Full Code Here

        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(DataCoding.newInstance((byte) 0))))
            .andReturn(new DataSmResult(new MessageId("1"), null));

        replay(session);

        command.execute(exchange);
View Full Code Here

        exchange.getIn().setHeader(SmppConstants.DEST_ADDR, "1919");
        exchange.getIn().setHeader(SmppConstants.REGISTERED_DELIVERY, new RegisteredDelivery(SMSCDeliveryReceipt.SUCCESS).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(DataCoding.newInstance((byte) 0))))
            .andReturn(new DataSmResult(new MessageId("1"), null));

        replay(session);

        command.execute(exchange);
View Full Code Here

                eq(new OptionalParameter.COctetString(Tag.ADDITIONAL_STATUS_INFO_TEXT.code(), "urgent")),
                eq(new OptionalParameter.Byte(Tag.DEST_ADDR_SUBUNIT, (byte) 4)),
                eq(new OptionalParameter.Short(Tag.DEST_TELEMATICS_ID.code(), (short) 2)),
                eq(new OptionalParameter.Int(Tag.QOS_TIME_TO_LIVE, 3600000)),
                eq(new OptionalParameter.Null(Tag.ALERT_ON_MESSAGE_DELIVERY))))
            .andReturn(new DataSmResult(new MessageId("1"), new OptionalParameter[]{
                new OptionalParameter.OctetString(Tag.SOURCE_SUBADDRESS, "1292"), new OptionalParameter.COctetString(Tag.ADDITIONAL_STATUS_INFO_TEXT.code(), "urgent"),
                new OptionalParameter.Byte(Tag.DEST_ADDR_SUBUNIT, (byte) 4), new OptionalParameter.Short(Tag.DEST_TELEMATICS_ID.code(), (short) 2),
                new OptionalParameter.Int(Tag.QOS_TIME_TO_LIVE, 3600000), new OptionalParameter.Null(Tag.ALERT_ON_MESSAGE_DELIVERY)}));

        replay(session);
View Full Code Here

  public MessageId onAcceptSubmitSm(SubmitSm submitSm,
                    SMPPServerSession source) throws ProcessRequestException {
        onSpecialHandling(submitSm, source);

    MessageId messageId = messageIDGenerator.newMessageId();
    logger.debug("Receiving submit_sm '{}', and will return message id {}",
        new String(submitSm.getShortMessage()), messageId);
    if (SMSCDeliveryReceipt.SUCCESS.containedIn(submitSm.getRegisteredDelivery())
        || SMSCDeliveryReceipt.SUCCESS_FAILURE.containedIn(submitSm.getRegisteredDelivery())) {
      execServiceDelReceipt.execute(new DeliveryReceiptTask(source, submitSm, messageId));
View Full Code Here

    logger.debug("submit_sm_resp with message_id {} has been sent", messageId);
  }

  public SubmitMultiResult onAcceptSubmitMulti(SubmitMulti submitMulti,
                         SMPPServerSession source) throws ProcessRequestException {
    MessageId messageId = messageIDGenerator.newMessageId();
    logger.debug("Receiving submit_multi_sm '{}', and will return message id {}",
        new String(submitMulti.getShortMessage()), messageId);
    if (SMSCDeliveryReceipt.SUCCESS.containedIn(submitMulti.getRegisteredDelivery())
        || SMSCDeliveryReceipt.SUCCESS_FAILURE.containedIn(submitMulti.getRegisteredDelivery())) {
      execServiceDelReceipt.execute(new DeliveryReceiptTask(source, submitMulti, messageId));
    }

    return new SubmitMultiResult(messageId.getValue(), new UnsuccessDelivery[0]);
  }
View Full Code Here

                throws ProcessRequestException {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received a dataSm " + dataSm);
                }

                MessageId newMessageId = messageIDGenerator.newMessageId();

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDataSm(dataSm,
                            newMessageId.getValue());

                    LOG.trace("processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("processed the new smpp exchange");
                } catch (Exception e) {
View Full Code Here

TOP

Related Classes of org.jsmpp.util.MessageId

Copyright © 2018 www.massapicom. 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.