Search in sources :

Example 1 with Session

use of org.jsmpp.session.Session 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);
}
Also used : SessionState(org.jsmpp.extra.SessionState) SessionStateListener(org.jsmpp.session.SessionStateListener) HashMap(java.util.HashMap) Session(org.jsmpp.session.Session)

Example 2 with Session

use of org.jsmpp.session.Session 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());
}
Also used : SessionState(org.jsmpp.extra.SessionState) SessionStateListener(org.jsmpp.session.SessionStateListener) SimpleRegistry(org.apache.camel.impl.SimpleRegistry) Session(org.jsmpp.session.Session) Test(org.junit.Test)

Aggregations

SessionState (org.jsmpp.extra.SessionState)2 Session (org.jsmpp.session.Session)2 SessionStateListener (org.jsmpp.session.SessionStateListener)2 HashMap (java.util.HashMap)1 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)1 Test (org.junit.Test)1