Package org.jsmpp.session

Examples of org.jsmpp.session.SMPPSession$BoundSessionStateListener


        assertTrue(command instanceof SmppSubmitMultiCommand);
    }
   
    @Test
    public void createSmppDataSmCommand() {
        SMPPSession session = new SMPPSession();
        Exchange exchange = new DefaultExchange(new DefaultCamelContext());
        exchange.getIn().setHeader(SmppConstants.COMMAND, "DataSm");
       
        SmppCommand command = binding.createSmppCommand(session, exchange);
       
View Full Code Here


        assertTrue(command instanceof SmppDataSmCommand);
    }
   
    @Test
    public void createSmppReplaceSmCommand() {
        SMPPSession session = new SMPPSession();
        Exchange exchange = new DefaultExchange(new DefaultCamelContext());
        exchange.getIn().setHeader(SmppConstants.COMMAND, "ReplaceSm");
       
        SmppCommand command = binding.createSmppCommand(session, exchange);
       
View Full Code Here

        assertTrue(command instanceof SmppReplaceSmCommand);
    }
   
    @Test
    public void createSmppQuerySmCommand() {
        SMPPSession session = new SMPPSession();
        Exchange exchange = new DefaultExchange(new DefaultCamelContext());
        exchange.getIn().setHeader(SmppConstants.COMMAND, "QuerySm");
       
        SmppCommand command = binding.createSmppCommand(session, exchange);
       
View Full Code Here

        assertTrue(command instanceof SmppQuerySmCommand);
    }
   
    @Test
    public void createSmppCancelSmCommand() {
        SMPPSession session = new SMPPSession();
        Exchange exchange = new DefaultExchange(new DefaultCamelContext());
        exchange.getIn().setHeader(SmppConstants.COMMAND, "CancelSm");
       
        SmppCommand command = binding.createSmppCommand(session, exchange);
       
View Full Code Here

        LOG.info("Connected to: " + getEndpoint().getConnectionString());
    }

    private SMPPSession createSession() throws IOException {
        SMPPSession session = createSMPPSession();
        session.setEnquireLinkTimer(configuration.getEnquireLinkTimer());
        session.setTransactionTimer(configuration.getTransactionTimer());
        session.addSessionStateListener(internalSessionStateListener);
        session.setMessageReceiverListener(messageReceiverListener);
        session.connectAndBind(this.configuration.getHost(), this.configuration.getPort(),
                new BindParameter(BindType.BIND_RX, this.configuration.getSystemId(),
                        this.configuration.getPassword(), this.configuration.getSystemType(),
                        TypeOfNumber.UNKNOWN, NumberingPlanIndicator.UNKNOWN,
                                  configuration.getAddressRange()));
View Full Code Here

     * Factory method to easily instantiate a mock SMPPSession
     *
     * @return the SMPPSession
     */
    SMPPSession createSMPPSession() {
        return new SMPPSession(new SynchronizedPDUSender(new DefaultPDUSender(
                    new DefaultComposer())), new DefaultPDUReader(), SmppConnectionFactory
                    .getInstance(configuration));
    }
View Full Code Here

      }
    });
    Assert.assertEquals(extendedSmppSession.getClass(), ExtendedSmppSessionAdaptingDelegate.class);
    Assert.assertNotNull(es.getTargetClientSession());
    Assert.assertTrue(es.getTargetClientSession() != null);
    final SMPPSession s = es.getTargetClientSession();

    ReflectionUtils.doWithFields(ExtendedSmppSessionAdaptingDelegate.class, new ReflectionUtils.FieldCallback() {
      public void doWith(Field field) throws IllegalArgumentException, IllegalAccessException {
        if (field.getName().equalsIgnoreCase("messageReceiverListener")) {
          field.setAccessible(true);
View Full Code Here

   * Creating new SMPPSession. This will create default SMPPSession for non-SSL connection or create SMPPSession
   * using different factory for SSL connection.
   * @return SMPP session
   */
  private SMPPSession createNewSession() {
    final SMPPSession newSession;
    if (!ssl) {
      newSession = new SMPPSession();
    } else {
      newSession = new SMPPSession(new SynchronizedPDUSender(new DefaultPDUSender(
          new DefaultComposer())), new DefaultPDUReader(), sslConnectionFactory);
    }
    newSession.setTransactionTimer(transactionTimeout);
    return newSession;
  }
View Full Code Here

   * Logic to build smpp session
   * @return the configured SMPPSession
   * @throws Exception should anything go wrong
   */
  private ExtendedSmppSessionAdaptingDelegate buildSmppSession() throws Exception {
    final SMPPSession smppSession = createNewSession();
    final ExtendedSmppSessionAdaptingDelegate extendedSmppSessionAdaptingDelegate;
    if (reconnect) {
      sessionFactoryBean.setAutodetectInterfaces(false);
      sessionFactoryBean.setTarget(smppSession);
      final SMPPSession proxiedSession = (SMPPSession)sessionFactoryBean.getObject();

      extendedSmppSessionAdaptingDelegate = new ExtendedSmppSessionAdaptingDelegate(
          proxiedSession, new AutoReconnectLifecycle(proxiedSession));
    } else {
      extendedSmppSessionAdaptingDelegate = new ExtendedSmppSessionAdaptingDelegate(
View Full Code Here

          if (newState.equals(SessionState.CLOSED)) {
            running = false;
            if (!destroyed) {
              log.info("Session to {}:{} has been closed. Try to reconnect later", host, port);

              final SMPPSession newSession = createNewSession();
              newSession.setMessageReceiverListener(product.getDelegateMessageListener());
              if (sessionStateListener != null) {
                session.addSessionStateListener(sessionStateListener);
              }
              sessionFactoryBean.setTarget(newSession);
View Full Code Here

TOP

Related Classes of org.jsmpp.session.SMPPSession$BoundSessionStateListener

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.