Package com.cloudhopper.smpp

Examples of com.cloudhopper.smpp.SmppSessionConfiguration


        // threads it will ever use, despite the "max pool size", etc. set on
        // the executor passed in here
        DefaultSmppClient clientBootstrap = new DefaultSmppClient(Executors.newCachedThreadPool(), SESSION_COUNT, monitorExecutor);

        // same configuration for each client runner
        SmppSessionConfiguration config = new SmppSessionConfiguration();
        config.setWindowSize(WINDOW_SIZE);
        config.setName("Tester.Session.0");
        config.setType(SmppBindType.TRANSCEIVER);
        config.setHost("127.0.0.1");
        config.setPort(2776);
        config.setConnectTimeout(10000);
        config.setSystemId("1234567890");
        config.setPassword("password");
        config.getLoggingOptions().setLogBytes(false);
        // to enable monitoring (request expiration)
        config.setRequestExpiryTimeout(30000);
        config.setWindowMonitorInterval(15000);
        config.setCountersEnabled(true);

        // various latches used to signal when things are ready
        CountDownLatch allSessionsBoundSignal = new CountDownLatch(SESSION_COUNT);
        CountDownLatch startSendingSignal = new CountDownLatch(1);
       
View Full Code Here


        //
        // setup configuration for a client session
        //
        DefaultSmppSessionHandler sessionHandler = new ClientSmppSessionHandler();

        SmppSessionConfiguration config0 = new SmppSessionConfiguration();
        config0.setWindowSize(1);
        config0.setName("Tester.Session.0");
        config0.setType(SmppBindType.TRANSCEIVER);
        config0.setHost("127.0.0.1");
        config0.setPort(2776);
        config0.setConnectTimeout(10000);
        config0.setSystemId("smppclient1");
        config0.setPassword("password");
        config0.getLoggingOptions().setLogBytes(true);
        // to enable monitoring (request expiration)
        config0.setRequestExpiryTimeout(30000);
        config0.setWindowMonitorInterval(15000);
        config0.setCountersEnabled(true);

        //
        // create session, enquire link, submit an sms, close session
        //
        SmppSession session0 = null;
View Full Code Here

        DefaultSmppServer smppServer = new DefaultSmppServer(configuration, serverHandler);
        return smppServer;
    }

    public SmppSessionConfiguration createDefaultConfiguration() {
        SmppSessionConfiguration configuration = new SmppSessionConfiguration();
        configuration.setWindowSize(1);
        configuration.setName("Tester.Session.0");
        configuration.setType(SmppBindType.TRANSCEIVER);
        configuration.setHost("localhost");
        configuration.setPort(PORT);
        configuration.setConnectTimeout(100);
        configuration.setBindTimeout(100);
        configuration.setSystemId(SYSTEMID);
        configuration.setPassword(PASSWORD);
        configuration.getLoggingOptions().setLogBytes(true);
        return configuration;
    }
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();
            // this should actually work
            SmppSession session0 = client0.bind(sessionConfig0);

            Thread.sleep(100);
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();
            sessionConfig0.setSystemId("TESTID");

            // this should fail (invalid system id)
            try {
                SmppSession session0 = client0.bind(sessionConfig0);
                Assert.fail();
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();
            sessionConfig0.setSystemId(SYSTEMID);
            sessionConfig0.setPassword("BADPASS");

            // this should fail (invalid password)
            try {
                SmppSession session0 = client0.bind(sessionConfig0);
                Assert.fail();
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();

            // set back to version 3.3
            sessionConfig0.setInterfaceVersion(SmppConstants.VERSION_3_3);

            // we will not use the proper method of binding since we need to
            // access the bind response to verify it's correct
            DefaultSmppSession session0 = client0.doOpen(sessionConfig0, new DefaultSmppSessionHandler());
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();

            // set to version 3.1
            sessionConfig0.setInterfaceVersion((byte)0x31);

            // we will not use the proper method of binding since we need to
            // access the bind response to verify it's correct
            DefaultSmppSession session0 = client0.doOpen(sessionConfig0, new DefaultSmppSessionHandler());
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();

            // set to version 3.4
            sessionConfig0.setInterfaceVersion((byte)0x34);

            // we will not use the proper method of binding since we need to
            // access the bind response to verify it's correct
            DefaultSmppSession session0 = client0.doOpen(sessionConfig0, new DefaultSmppSessionHandler());
View Full Code Here

        DefaultSmppServer server0 = createSmppServer();
        server0.start();

        try {
            DefaultSmppClient client0 = new DefaultSmppClient();
            SmppSessionConfiguration sessionConfig0 = createDefaultConfiguration();

            // set to version 3.5
            sessionConfig0.setInterfaceVersion((byte)0x35);

            // we will not use the proper method of binding since we need to
            // access the bind response to verify it's correct
            DefaultSmppSession session0 = client0.doOpen(sessionConfig0, new DefaultSmppSessionHandler());
View Full Code Here

TOP

Related Classes of com.cloudhopper.smpp.SmppSessionConfiguration

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.