Package org.smpp

Examples of org.smpp.TCPIPConnection


      BindRequest request = null;
      BindResponse response = null;

      request = new BindTransmitter();

      TCPIPConnection connection = new TCPIPConnection(ipAddress, port);
      connection.setReceiveTimeout(20 * 1000);
      session = new Session(connection);

      // set values
      request.setSystemId(systemId);
      request.setPassword(password);
View Full Code Here


     */
    public void testBindAndUnbindHandleSynchronousAndAsynchronous()
            throws MessageException, WrongSessionStateException,
            TimeoutException, IOException, PDUException {
        // Verify that binding using an asynchronous factory is fine.
        Session session = new Session(new TCPIPConnection(ADDRESS, PORT));
        sessionFactory.bind(session);
        sessionFactory.unbind(session);

        // Verify that binding using a synchronous factory is fine.
        sessionFactory = new PoolableSessionFactory(
                ADDRESS, PORT, USERNAME, PASSWORD, SYNC_BINDTYPE);
        session = new Session(new TCPIPConnection(ADDRESS, PORT));
        sessionFactory.bind(session);
        sessionFactory.unbind(session);
    }
View Full Code Here

        this.SMSCBindType = SMSCBindType;
    }

    // Javadoc inherited.
    public Object makeObject() throws MessageException {
        Connection connection = new TCPIPConnection(address, port);
        connection.setReceiveTimeout(20 * 1000);
        Session session = new Session(connection);
        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Created a new org.smpp.Session : "+ session);
        }
        bind(session);
View Full Code Here

                mockFactory.createOrderedBuilder();
        PoolableSessionFactoryMock sessionFactory =
                new PoolableSessionFactoryMock("sessionFactory",
                        orderedExpectations, ADDRESS, PORT, SMSC_USERNAME,
                        SMSC_PASSWORD, SYNC_BINDTYPE);
        Session badSession = new Session(new TCPIPConnection(ADDRESS, PORT));
        Session goodSession = new Session(new TCPIPConnection(ADDRESS, PORT));
        // Set expectations.
        sessionFactory.expects.validateObject(badSession).returns(false);
        sessionFactory.expects.makeObject().returns(goodSession);
        sessionFactory.expects.validateObject(goodSession).returns(true);
View Full Code Here

                mockFactory.createOrderedBuilder();
        PoolableSessionFactoryMock sessionFactory =
                new PoolableSessionFactoryMock("sessionFactory",
                        orderedExpectations, ADDRESS, PORT, SMSC_USERNAME,
                        SMSC_PASSWORD, SYNC_BINDTYPE);
        Session badSession = new Session(new TCPIPConnection(ADDRESS, PORT));
        Session badSessionTwo = new Session(new TCPIPConnection(ADDRESS, PORT));
        // Set expectations.
        sessionFactory.expects.validateObject(badSession).returns(false);
        sessionFactory.expects.makeObject().returns(badSessionTwo);
        sessionFactory.expects.validateObject(badSessionTwo).returns(false);
View Full Code Here

        HashMap channelInfo = createChannelInfoMap();
        channelInfo.put(LogicaSMSChannelAdapter.BINDTYPE, SYNC_BINDTYPE);
        SessionPoolMock sessionPool =
                new SessionPoolMock("sessionPool", orderedExpectations);
        mockMessage = new MultiChannelMessageMock("mockMessage", orderedExpectations);
        Session badSession = new Session(new TCPIPConnection(ADDRESS, PORT));
        PoolableSessionFactory sessionFactory = new PoolableSessionFactory(
                ADDRESS,  PORT, USERNAME, PASSWORD, SYNC_BINDTYPE);
        Session goodSession = (Session) sessionFactory.makeObject();

        // Set expectations.
View Full Code Here

TOP

Related Classes of org.smpp.TCPIPConnection

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.