use of org.jsmpp.session.SessionStateListener in project camel by apache.
the class SmppConfigurationTest method setNoneDefaultValues.
private void setNoneDefaultValues(SmppConfiguration config) {
config.setDestAddr("1919");
config.setDestAddrNpi(NumberingPlanIndicator.NATIONAL.value());
config.setDestAddrTon(TypeOfNumber.NATIONAL.value());
config.setEnquireLinkTimer(new Integer(5001));
config.setHost("127.0.0.1");
config.setPassword("secret");
config.setPort(new Integer(2776));
config.setPriorityFlag((byte) 0);
config.setProtocolId((byte) 1);
config.setRegisteredDelivery(SMSCDeliveryReceipt.DEFAULT.value());
config.setReplaceIfPresentFlag((byte) 1);
config.setServiceType("XXX");
config.setSourceAddr("1818");
config.setSourceAddrNpi(NumberingPlanIndicator.NATIONAL.value());
config.setSourceAddrTon(TypeOfNumber.NATIONAL.value());
config.setSystemId("client");
config.setSystemType("xx");
config.setTransactionTimer(new Integer(10001));
config.setEncoding("UTF-8");
config.setNumberingPlanIndicator(NumberingPlanIndicator.NATIONAL.value());
config.setTypeOfNumber(TypeOfNumber.NATIONAL.value());
config.setUsingSSL(true);
config.setInitialReconnectDelay(5001);
config.setReconnectDelay(5002);
config.setHttpProxyHost("127.0.0.1");
config.setHttpProxyPort(new Integer(3129));
config.setHttpProxyUsername("user");
config.setHttpProxyPassword("secret");
config.setSessionStateListener(new SessionStateListener() {
public void onStateChange(SessionState arg0, SessionState arg1, Session arg2) {
}
});
Map<String, String> proxyHeaders = new HashMap<String, String>();
proxyHeaders.put("X-Proxy-Header", "1");
config.setProxyHeaders(proxyHeaders);
}
use of org.jsmpp.session.SessionStateListener in project camel by apache.
the class SmppComponentTest method createEndpointWithSessionStateListener.
@Test
public void createEndpointWithSessionStateListener() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("sessionStateListener", new SessionStateListener() {
@Override
public void onStateChange(SessionState arg0, SessionState arg1, Session arg2) {
}
});
context.setRegistry(registry);
component = new SmppComponent(context);
SmppEndpoint endpoint = (SmppEndpoint) component.createEndpoint("smpp://smppclient@localhost:2775?password=password&sessionStateListener=#sessionStateListener");
assertNotNull(endpoint.getConfiguration().getSessionStateListener());
}
Aggregations