public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration (cfg); srcid = cfg.get ("srcid", "000000"); dstid = cfg.get ("dstid", "000000"); debugPoll = cfg.getBoolean("debug-poll", false); headerFormat = cfg.getInt("header-format", 2); replyKeepAlive = cfg.getBoolean("reply-keepalive", true); } }
public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; keyStore = cfg.get("keystore"); clientAuthNeeded = cfg.getBoolean("clientauth"); serverAuthNeeded = cfg.getBoolean("serverauth"); serverName = cfg.get("servername"); password = cfg.get("storepassword", null); keyPassword = cfg.get("keypassword", null); enabledCipherSuites = cfg.getAll("addEnabledCipherSuite"); enabledProtocols = cfg.getAll("addEnabledProtocol"); } public Configuration getConfiguration() {
/** * Default config params are: min-len Minimun length, * max-len Max length, break-on-error break condition. * @param cfg configuration instance * @throws ConfigurationException */ public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; this.minLen = cfg.getInt( "min-len", 0 ); this.maxLen = cfg.getInt( "max-len", 999999 ); this.breakOnError = cfg.getBoolean( "break-on-error", false ); }
public void setConfiguration(Configuration cfg) throws ConfigurationException { prepareDelay = cfg.getLong ("prepare-delay"); commitDelay = cfg.getLong ("commit-delay"); abortDelay = cfg.getLong ("abort-delay"); random = cfg.getBoolean ("random") ? new Random() : null; } void sleep (long delay) {
@Override public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; failOnError = cfg.getBoolean("failOnError", false); maxSendPerRequest = cfg.getInt("maxSendPerRequest", 1); senderThreads = cfg.getInt("senderThreads", DEFAULT_SENDER_THREADS); sslProviderClass = cfg.get("sslProvider", null); serverAuthNeeded = cfg.getBoolean("serverauth"); trustStore = cfg.get("truststore", System.getProperty("javax.net.ssl.trustStore")); trustStorePassword = cfg.get("truststorepassword", System.getProperty("javax.net.ssl.trustStorePassword", "changeit")); keyStore = cfg.get("keystore", System.getProperty("javax.net.ssl.keyStore")); String passwordProp = cfg.get("storepasswordprop", "javax.net.ssl.keyStorePassword"); password = cfg.get("storepassword", System.getProperty(passwordProp)); String keyPaswwordProp = cfg.get("keypassword", "jpos.ssl.keypass"); keyPassword = cfg.get("keypassword", System.getProperty(keyPaswwordProp)); enabledCipherSuites = cfg.getAll("addEnabledCipherSuite"); enabledProtocols = cfg.getAll("addEnabledProtocol"); }
@Override public void setConfiguration (Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); lazy.set(cfg.getBoolean("lazy")); pubKeyRing = cfg.get("pubkeyring", "cfg/keyring.pub"); privKeyRing = cfg.get("privkeyring", "cfg/keyring.priv"); waitTimeout = cfg.getLong("timeout", 30000L); ttl = cfg.getLong("ttl", 3600000L); duration = cfg.getLong("duration", 86400000L); maxRandomOperations = cfg.getInt("max-random-operations", 100000); String unlockPassword = cfg.get("unlock-password", null); if (unlockPassword != null) { try { unlock (new SensitiveString(unlockPassword)); } catch (NoSuchAlgorithmException | NoSuchPaddingException | InvalidKeyException | IllegalBlockSizeException | BadPaddingException | NoSuchProviderException | InvalidAlgorithmParameterException e) { throw new ConfigurationException(e); } } }
/** * @param cfg Configuration object * @throws ConfigurationException */ @Override public void setConfiguration(Configuration cfg) throws ConfigurationException { this.cfg = cfg; queueName = cfg.get("queue", null); if (queueName == null) throw new ConfigurationException("'queue' property not configured"); timeout = cfg.getLong("timeout", timeout); frozen = cfg.getBoolean("frozen", true); }
public void setConfiguration (Configuration cfg) { this.cfg = cfg; request = cfg.get ("request", ContextConstants.REQUEST.toString()); ignoreCardValidation = cfg.getBoolean("ignore-card-validation", false); }
public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; try { socket = new DatagramSocket(); port = cfg.getInt ("port", SYSLOG_PORT); host = InetAddress.getByName (cfg.get ("host", "localhost")); defaultFacility = cfg.getInt ("facility", LOG_USER); defaultSeverity = cfg.getInt ("severity", PRI_INFO); tags = cfg.get ("tags", "audit, syslog"); prefix = cfg.get ("prefix", null); } catch (Exception e) { throw new ConfigurationException (e); } } }
public void setConfiguration(Configuration cfg) throws ConfigurationException { super.setConfiguration(cfg); psp = SpaceFactory.getSpace(cfg.get("space")); String muxName = "mux." + cfg.get("mux"); try { mux = (MUX) NameRegistrar.get(muxName); } catch (NameRegistrar.NotFoundException e) { throw new ConfigurationException( "MUX '" + muxName + "' not found in registrar." ); } flagRetransmissions = cfg.get("flag-retransmissions", ""); initialDelay = cfg.getLong("initial-delay", 30000L); interMessageDelay = cfg.getLong("inter-message-delay", 1000L); waitForResponse = cfg.getLong("wait-for-response", 60000L); maxRetransmissions = cfg.getInt("max-retransmissions", 0); expiration = cfg.getLong("expire-after", 0L) * 1000L; validResponseCodes = cfg.get("valid-response-codes", "00"); retryResponseCodes = cfg.get("retry-response-codes", null); preMessageDelay = cfg.getLong("pre-message-delay", 0L); }
@SuppressWarnings("unchecked") public void setConfiguration (Configuration cfg) throws ConfigurationException { timeout = cfg.getLong ("timeout", 15000L); sp = (Space<String,Context>) SpaceFactory.getSpace (cfg.get ("space")); queue = cfg.get ("queue", null); if (queue == null) throw new ConfigurationException ("queue property not specified"); source = cfg.get ("source", ContextConstants.SOURCE.toString()); request = cfg.get ("request", ContextConstants.REQUEST.toString()); timestamp = cfg.get ("timestamp", ContextConstants.TIMESTAMP.toString()); remote = cfg.getBoolean("remote") || cfg.get("space").startsWith("rspace:"); Map<String,String> m = new HashMap<>(); cfg.keySet() .stream() .filter (s -> s.startsWith("ctx.")) .forEach(s -> m.put(s.substring(4), cfg.get(s))); if (m.size() > 0) additionalContextEntries = m; } public boolean process (ISOSource src, ISOMsg m) {
/** * @param cfg * <ul> * <li>delay (expressed in milliseconds) * </ul> */ public void setConfiguration (Configuration cfg) { delay = cfg.getInt ("delay"); }
@Override public void run () { shutdownServer (); if (!cfg.getBoolean ("keep-channels")) { shutdownChannels (); } } }.start();
/** * @param cfg * <ul> * <li>whitelist - supported message types (example: "1100,1220") * <li>source - BSH script(s) to run (can be more than one) * </ul> */ public void setConfiguration (Configuration cfg) throws ConfigurationException { this.cfg = cfg; bshSource = cfg.getAll ("source"); String[] mti = cfg.get ("whitelist", "*").split(","); whitelist = new HashSet<>( Arrays.asList(mti) ); }
debug = cfg.getBoolean ("debug", true); debugContext = cfg.getBoolean ("debug-context", debug); profiler = cfg.getBoolean ("profiler", debug); if (profiler || debugContext) debug = true; // profiler and/or debugContext needs debug doRecover = cfg.getBoolean ("recover", true); retryInterval = cfg.getLong ("retry-interval", retryInterval); retryTimeout = cfg.getLong ("retry-timeout", retryTimeout); pauseTimeout = cfg.getLong ("pause-timeout", pauseTimeout); abortOnPauseTimeout = cfg.getBoolean("abort-on-pause-timeout", true); maxActiveSessions = cfg.getInt ("max-active-sessions", 0); sessions = cfg.getInt ("sessions", 1); threshold = cfg.getInt ("threshold", sessions / 2); maxSessions = cfg.getInt ("max-sessions", sessions); if (maxSessions < sessions) throw new ConfigurationException("max-sessions < sessions"); throw new ConfigurationException("max-active-sessions < max-sessions"); callSelectorOnAbort = cfg.getBoolean("call-selector-on-abort", true); if (profiler) metrics = new Metrics(new AtomicHistogram(cfg.getLong("metrics-highest-trackable-value", 60000), 2));
boolean processed = false; try{ String[] sources = replace(cfg.getAll("source"), patterns, new String[] {ev.getTag(), ev.getRealm()}); for(int i=0; i<sources.length && ret != null; i++){ try{ bsh.set("cfg", cfg); File f = new File(sources[i]); if(!cfg.getBoolean("preload-scripts")){ if(f.exists() && f.canRead() && f.isFile()){ if(System.currentTimeMillis() > info.getLastCheck() + cfg.getLong("reload")){ info.setLastCheck(System.currentTimeMillis()); if(f.exists() && f.canRead() && f.isFile()){ Object saveNS = bsh.get("saveNameSpace"); boolean saveNameSpace = saveNS instanceof Boolean ? (Boolean) saveNS :cfg.getBoolean("save-name-space"); if(saveNameSpace) { if(info!=null) info.setNameSpace(bsh.getNameSpace()); return !processed && cfg.getBoolean("filter-by-default") ? null : ret; }catch(Exception e){ if (ret != null) {
@Override public void setConfiguration(Configuration cfg) throws ConfigurationException { dumpInterval = cfg.getLong("dump-interval", 0); } }