use of com.cloudhopper.smpp.SmppSessionConfiguration in project load-balancer by RestComm.
the class BalancerDispatcher method bindRequested.
@Override
public void bindRequested(Long sessionId, ServerConnectionImpl serverConnection, Pdu packet) {
// InvocationContext invocationContext = balancerRunner.getLatestInvocationContext();
balancerRunner.balancerContext.smppRequestsToServer.getAndIncrement();
balancerRunner.incMessages();
balancerRunner.balancerContext.smppRequestsProcessedById.get(packet.getCommandId()).incrementAndGet();
balancerRunner.balancerContext.smppBytesToServer.addAndGet(packet.getCommandLength());
serverSessions.put(sessionId, serverConnection);
SmppSessionConfiguration sessionConfig = serverConnection.getConfig();
if (!serverConnection.getConfig().isUseSsl())
sessionConfig.setUseSsl(false);
else
sessionConfig.setUseSsl(!balancerRunner.balancerContext.terminateTLSTraffic);
counterConnections.compareAndSet(Integer.MAX_VALUE, 0);
Node currNode = ctx.smppToProviderBalancerAlgorithm.processBindToProvider();
sessionConfig.setHost(currNode.getIp());
sessionConfig.setPort(Integer.parseInt((String) currNode.getProperties().get("smppPort")));
clientSessions.put(sessionId, new ClientConnectionImpl(sessionId, sessionConfig, this, monitorExecutor, balancerRunner, packet, currNode));
handlerService.execute(new BinderRunnable(sessionId, packet, serverSessions, clientSessions, currNode, balancerRunner));
}
use of com.cloudhopper.smpp.SmppSessionConfiguration in project load-balancer by RestComm.
the class MBinderRunnable method run.
@Override
public void run() {
if (!cancelled) {
SmppSessionConfiguration config = client.getConfig();
config.setName("Loadbalancer");
config.setHost(node.getIp());
config.setPort(Integer.parseInt(node.getProperties().get("smppPort").toString()));
config.setSystemId(systemId);
config.setPassword(password);
config.setSystemType(systemType);
config.setUseSsl(isUseSsl);
if (client.connect())
client.bind();
}
}
use of com.cloudhopper.smpp.SmppSessionConfiguration in project load-balancer by RestComm.
the class ConfigInit method getSmppSessionConfiguration.
static SmppSessionConfiguration getSmppSessionConfiguration(int i, boolean isSslClient) {
SmppSessionConfiguration config = new SmppSessionConfiguration();
config.setWindowSize(1);
config.setName("Client " + i);
config.setType(SmppBindType.TRANSCEIVER);
config.setHost("127.0.0.1");
config.setConnectTimeout(10000);
config.setSystemId("RestComm");
config.setPassword("password");
config.getLoggingOptions().setLogBytes(true);
// to enable monitoring (request expiration)
config.setRequestExpiryTimeout(30000);
config.setWindowMonitorInterval(15000);
config.setCountersEnabled(true);
if (isSslClient) {
config.setPort(2876);
SslConfiguration sslConfig = new SslConfiguration();
sslConfig.setTrustAll(true);
sslConfig.setValidateCerts(true);
sslConfig.setValidatePeerCerts(true);
config.setSslConfiguration(sslConfig);
config.setUseSsl(true);
} else {
config.setPort(2776);
}
return config;
}
Aggregations