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) {}
       });
 }
Exemple #2
0
  @SuppressWarnings({"unchecked", "rawtypes"})
  @Override
  protected Endpoint createEndpoint(String uri, String remaining, Map parameters) throws Exception {
    if (this.configuration == null) {
      this.configuration = new SmppConfiguration();
    }

    // create a copy of the configuration as other endpoints can adjust their copy as well
    SmppConfiguration config = this.configuration.copy();

    config.configureFromURI(new URI(uri));
    // TODO Camel 3.0 cmueller: We should change the default in Camel 3.0 to '' so that we can
    // remove this special handling
    // special handling to set the system type to an empty string
    if (parameters.containsKey("systemType") && parameters.get("systemType") == null) {
      config.setSystemType("");
      parameters.remove("systemType");
    }
    // special handling to set the service type to an empty string
    if (parameters.containsKey("serviceType") && parameters.get("serviceType") == null) {
      config.setServiceType("");
      parameters.remove("serviceType");
    }
    setProperties(config, parameters);

    return createEndpoint(uri, config);
  }