Package org.jsmpp.util

Examples of org.jsmpp.util.RandomMessageIDGenerator


        BasicConfigurator.configure();
        try {
           
           
            // prepare generator of Message ID
            final MessageIDGenerator messageIdGenerator = new RandomMessageIDGenerator();
           
            // prepare the message receiver
            ServerMessageReceiverListener messageReceiverListener = new ServerMessageReceiverListener() {
                public MessageId onAcceptSubmitSm(SubmitSm submitSm,
                        SMPPServerSession source)
                        throws ProcessRequestException {
                    System.out.println("Receiving message : " + new String(submitSm.getShortMessage()));
                    // need message_id to response submit_sm
                    return messageIdGenerator.newMessageId();
                }
               
                public QuerySmResult onAcceptQuerySm(QuerySm querySm,
                        SMPPServerSession source)
                        throws ProcessRequestException {
View Full Code Here


                    reconnect(configuration.getInitialReconnectDelay());
                }
            }
        };
        this.messageReceiverListener = new MessageReceiverListener() {
            private final MessageIDGenerator messageIDGenerator = new RandomMessageIDGenerator();

            public void onAcceptAlertNotification(AlertNotification alertNotification) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received an alertNotification " + alertNotification);
                }

                try {
                    Exchange exchange = getEndpoint().createOnAcceptAlertNotificationExchange(
                            alertNotification);

                    LOG.trace("Processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("Processed the new smpp exchange");
                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                }
            }

            public void onAcceptDeliverSm(DeliverSm deliverSm) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received a deliverSm " + deliverSm);
                }

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDeliverSmExchange(deliverSm);

                    LOG.trace("processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("processed the new smpp exchange");
                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                }
            }

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

                MessageId newMessageId = messageIDGenerator.newMessageId();

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDataSm(dataSm,
                            newMessageId.getValue());
View Full Code Here

                    reconnect(configuration.getInitialReconnectDelay());
                }
            }
        };
        this.messageReceiverListener = new MessageReceiverListener() {
            private final MessageIDGenerator messageIDGenerator = new RandomMessageIDGenerator();

            public void onAcceptAlertNotification(AlertNotification alertNotification) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received an alertNotification " + alertNotification);
                }

                try {
                    Exchange exchange = getEndpoint().createOnAcceptAlertNotificationExchange(
                            alertNotification);

                    LOG.trace("Processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("Processed the new smpp exchange");
                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                }
            }

            public void onAcceptDeliverSm(DeliverSm deliverSm) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received a deliverSm " + deliverSm);
                }

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDeliverSmExchange(deliverSm);

                    LOG.trace("processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("processed the new smpp exchange");
                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                }
            }

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

                MessageId newMessageId = messageIDGenerator.newMessageId();

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDataSm(dataSm,
                            newMessageId.getValue());
View Full Code Here

                    reconnect(configuration.getInitialReconnectDelay());
                }
            }
        };
        this.messageReceiverListener = new MessageReceiverListener() {
            private final MessageIDGenerator messageIDGenerator = new RandomMessageIDGenerator();

            public void onAcceptAlertNotification(AlertNotification alertNotification) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received an alertNotification " + alertNotification);
                }

                try {
                    Exchange exchange = getEndpoint().createOnAcceptAlertNotificationExchange(
                            alertNotification);

                    LOG.trace("Processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("Processed the new smpp exchange");
                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                }
            }

            public void onAcceptDeliverSm(DeliverSm deliverSm) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Received a deliverSm " + deliverSm);
                }

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDeliverSmExchange(deliverSm);

                    LOG.trace("processing the new smpp exchange...");
                    getProcessor().process(exchange);
                    LOG.trace("processed the new smpp exchange");
                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                }
            }

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

                MessageId newMessageId = messageIDGenerator.newMessageId();

                try {
                    Exchange exchange = getEndpoint().createOnAcceptDataSm(dataSm,
                            newMessageId.getValue());
View Full Code Here

TOP

Related Classes of org.jsmpp.util.RandomMessageIDGenerator

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.