Package org.jsmpp.session

Examples of org.jsmpp.session.DataSmResult


        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()),
                    dataSm.getOptionalParametes());
        } catch (Exception e) {
            throw new SmppException(e);
        }

        if (log.isDebugEnabled()) {
            log.debug("Sent a data short message for exchange id '{}' and message id '{}'",
                    exchange.getExchangeId(), result.getMessageId());
        }

        Message message = getResponseMessage(exchange);
        message.setHeader(SmppConstants.ID, result.getMessageId());
        message.setHeader(SmppConstants.OPTIONAL_PARAMETERS, getOptionalParametersAsMap(result.getOptionalParameters()));
    }
View Full Code Here


    for (MessageReceiverListener l : this.messageReceiverListenerSet)
      l.onAcceptAlertNotification(alertNotification);
  }

  public DataSmResult onAcceptDataSm(DataSm dataSm, Session source) throws ProcessRequestException {
    DataSmResult dataSmResult = null;
    for (MessageReceiverListener l : this.messageReceiverListenerSet) {
      DataSmResult tmpV = l.onAcceptDataSm(dataSm, source);
      if (tmpV != null) {
        dataSmResult = tmpV;
      }
    }
    return dataSmResult; // could still be null
View Full Code Here

                } catch (Exception e) {
                    getExceptionHandler().handleException(e);
                    throw new ProcessRequestException(e.getMessage(), 255, e);
                }

                return new DataSmResult(newMessageId, dataSm.getOptionalParametes());
            }
        };
    }
View Full Code Here

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

        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);
        }

        log.debug("Sent a data short message for exchange id '{}' and message id '{}'",
                exchange.getExchangeId(), result.getMessageId());

        Message message = getResponseMessage(exchange);
        message.setHeader(SmppConstants.ID, result.getMessageId());
    }
View Full Code Here

TOP

Related Classes of org.jsmpp.session.DataSmResult

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.