Search in sources :

Example 1 with DefaultSmppServer

use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.

the class ActiveStandbySmppTest method initialization.

@BeforeClass
public static void initialization() {
    boolean enableSslLbPort = false;
    boolean terminateTLSTraffic = true;
    // start lb
    balancer = new BalancerRunner();
    balancer.start(ConfigInit.getLbProperties(enableSslLbPort, terminateTLSTraffic, false));
    // start servers
    serverArray = new DefaultSmppServer[serverNumbers];
    serverHandlerArray = new DefaultSmppServerHandler[serverNumbers];
    for (int i = 0; i < serverNumbers; i++) {
        serverHandlerArray[i] = new DefaultSmppServerHandler();
        serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
        logger.info("Starting SMPP server...");
        try {
            serverArray[i].start();
        } catch (SmppChannelException e) {
            logger.info("SMPP server does not started");
            e.printStackTrace();
        }
        logger.info("SMPP server started");
    }
    sleep(2000);
}
Also used : DefaultSmppServer(com.cloudhopper.smpp.impl.DefaultSmppServer) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) SmppChannelException(com.cloudhopper.smpp.type.SmppChannelException) BeforeClass(org.junit.BeforeClass)

Example 2 with DefaultSmppServer

use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.

the class ErroreResponseFromServerTest method initialization.

@BeforeClass
public static void initialization() {
    // start lb
    balancer = new BalancerRunner();
    LoadBalancerConfiguration lbConfig = ConfigInit.getLbPropertiesWithOneServer();
    lbConfig.getSmppConfiguration().setReconnectPeriod(2000);
    balancer.start(lbConfig);
    // start servers
    serverHandler = new DefaultSmppServerHandler();
    server = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(0, false), serverHandler, executor, monitorExecutor);
    logger.info("Starting SMPP server...");
    try {
        server.start();
    } catch (SmppChannelException e) {
        logger.info("SMPP server does not started");
        e.printStackTrace();
    }
    logger.info("SMPP server started");
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
Also used : DefaultSmppServer(com.cloudhopper.smpp.impl.DefaultSmppServer) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) LoadBalancerConfiguration(org.mobicents.tools.configuration.LoadBalancerConfiguration) SmppChannelException(com.cloudhopper.smpp.type.SmppChannelException) BeforeClass(org.junit.BeforeClass)

Example 3 with DefaultSmppServer

use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.

the class RebindingWithOneServer method initialization.

@BeforeClass
public static void initialization() {
    // start lb
    balancer = new BalancerRunner();
    balancer.start(ConfigInit.getLbPropertiesWithOneServer());
    // start servers
    serverHandler = new DefaultSmppServerHandler();
    server = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(0, false), serverHandler, executor, monitorExecutor);
    logger.info("Starting SMPP server...");
    try {
        server.start();
    } catch (SmppChannelException e) {
        logger.info("SMPP server does not started");
        e.printStackTrace();
    }
    logger.info("SMPP server started");
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
Also used : DefaultSmppServer(com.cloudhopper.smpp.impl.DefaultSmppServer) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) SmppChannelException(com.cloudhopper.smpp.type.SmppChannelException) BeforeClass(org.junit.BeforeClass)

Example 4 with DefaultSmppServer

use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.

the class RuntimeAddServerTest method initialization.

@BeforeClass
public static void initialization() {
    // start lb
    balancer = new BalancerRunner();
    pathToConfig = UrlRewriteTest.class.getClassLoader().getResource("lb-configuration-smpp.xml").getFile();
    balancer.start(pathToConfig);
    // start servers
    serverArray = new DefaultSmppServer[serverNumbers];
    serverHandlerArray = new DefaultSmppServerHandler[serverNumbers];
    for (int i = 0; i < serverNumbers; i++) {
        serverHandlerArray[i] = new DefaultSmppServerHandler();
        serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
        logger.info("Starting SMPP server...");
        try {
            serverArray[i].start();
        } catch (SmppChannelException e) {
            logger.info("SMPP server does not started");
            e.printStackTrace();
        }
        logger.info("SMPP server started");
    }
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
}
Also used : DefaultSmppServer(com.cloudhopper.smpp.impl.DefaultSmppServer) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) UrlRewriteTest(org.mobicents.tools.http.balancer.UrlRewriteTest) SmppChannelException(com.cloudhopper.smpp.type.SmppChannelException) BeforeClass(org.junit.BeforeClass)

Example 5 with DefaultSmppServer

use of com.cloudhopper.smpp.impl.DefaultSmppServer in project load-balancer by RestComm.

the class SpliterModeStatisticTest method initialization.

@BeforeClass
public static void initialization() {
    boolean enableSslLbPort = false;
    boolean terminateTLSTraffic = true;
    // start lb
    balancer = new BalancerRunner();
    balancer.start(ConfigInit.getLbSpliterProperties(enableSslLbPort, terminateTLSTraffic));
    // start servers
    serverArray = new DefaultSmppServer[serverNumbers];
    serverHandlerArray = new DefaultSmppServerHandler[serverNumbers];
    for (int i = 0; i < serverNumbers; i++) {
        serverHandlerArray[i] = new DefaultSmppServerHandler();
        serverArray[i] = new DefaultSmppServer(ConfigInit.getSmppServerConfiguration(i, false), serverHandlerArray[i], executor, monitorExecutor);
        logger.info("Starting SMPP server...");
        try {
            serverArray[i].start();
        } catch (SmppChannelException e) {
            logger.info("SMPP server does not started");
            e.printStackTrace();
        }
        logger.info("SMPP server started");
    }
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
}
Also used : DefaultSmppServer(com.cloudhopper.smpp.impl.DefaultSmppServer) BalancerRunner(org.mobicents.tools.sip.balancer.BalancerRunner) SmppChannelException(com.cloudhopper.smpp.type.SmppChannelException) BeforeClass(org.junit.BeforeClass)

Aggregations

DefaultSmppServer (com.cloudhopper.smpp.impl.DefaultSmppServer)24 SmppChannelException (com.cloudhopper.smpp.type.SmppChannelException)20 BeforeClass (org.junit.BeforeClass)19 BalancerRunner (org.mobicents.tools.sip.balancer.BalancerRunner)19 SmppServerConfiguration (com.cloudhopper.smpp.SmppServerConfiguration)3 LoadBalancerConfiguration (org.mobicents.tools.configuration.LoadBalancerConfiguration)3 SmppProcessingException (com.cloudhopper.smpp.type.SmppProcessingException)2 ArrayList (java.util.ArrayList)2 ThreadFactory (java.util.concurrent.ThreadFactory)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 Test (org.junit.Test)2 BalancerDispatcher (org.mobicents.tools.smpp.balancer.core.BalancerDispatcher)2 SmppServer (com.cloudhopper.smpp.SmppServer)1 SmppSessionConfiguration (com.cloudhopper.smpp.SmppSessionConfiguration)1 DefaultSmppSessionHandler (com.cloudhopper.smpp.impl.DefaultSmppSessionHandler)1 Address (com.cloudhopper.smpp.type.Address)1 CharacterCodingException (java.nio.charset.CharacterCodingException)1 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)1 ThreadPoolExecutor (java.util.concurrent.ThreadPoolExecutor)1 TestSmppClient (org.mobicents.smsc.tools.smppsimulator.testsmpp.TestSmppClient)1