Java Code Examples for org.apache.commons.configuration.HierarchicalConfiguration#getBoolean()
The following examples show how to use
org.apache.commons.configuration.HierarchicalConfiguration#getBoolean() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NTGClientSettings.java From sailfish-core with Apache License 2.0 | 6 votes |
@Override public void load( HierarchicalConfiguration config ) { this.connectTimeout = config.getInt("connectTimeout", 30000); this.loginTimeout = config.getInt("loginTimeout", 30000); this.logoutTimeout = config.getInt("logoutTimeout", 5000); this.heartbeatTimeout = config.getInt("heartbeatTimeout", 30000); this.maxMissedHeartbeats = config.getInt("maxMissedHeartbeats", 5); this.serverPort = config.getInt( "serverPort", 8181); this.serverIP= config.getString("serverIP", "127.0.0.1"); this.reconnectAttempts = config.getInt("reconnectAttempts", 10); this.login = config.getString( "login", "user"); this.password= config.getString("password", "password"); this.newPassword = config.getString("newPassword", null); this.messageVersion = config.getByte("messageVersion", (byte)1 ); //this.dictionaryPath = config.getString("dictionaryPath"); this.lowlevelService = config.getBoolean("lowlevelService"); this.autosendHeartbeat = config.getBoolean("autosendHeartBeat"); try { this.dictionaryName = SailfishURI.parse(config.getString("dictionaryName")); } catch(SailfishURIException e) { throw new EPSCommonException(e); } }
Example 2
Source File: CustomPayloadsParam.java From zap-extensions with Apache License 2.0 | 6 votes |
private void loadPayloadsFromConfig(HierarchicalConfiguration rootConfig) { List<HierarchicalConfiguration> categories = rootConfig.configurationsAt(ALL_CATEGORIES_KEY); payloadCategories = new HashMap<>(); for (HierarchicalConfiguration category : categories) { List<HierarchicalConfiguration> fields = category.configurationsAt("payloads.payload"); String cat = category.getString(CATEGORY_NAME_KEY); List<CustomPayload> payloads = new ArrayList<>(); for (HierarchicalConfiguration sub : fields) { int id = sub.getInt(PAYLOAD_ID_KEY); boolean isEnabled = sub.getBoolean(PAYLOAD_ENABLED_KEY); String payload = sub.getString(PAYLOAD_KEY, ""); payloads.add(new CustomPayload(id, isEnabled, cat, payload)); } payloadCategories.put(cat, new PayloadCategory(cat, Collections.emptyList(), payloads)); } }
Example 3
Source File: DomainController.java From wings with Apache License 2.0 | 6 votes |
private void initializeDomainList(String domname) { PropertyListConfiguration config = this.getUserConfiguration(); List<HierarchicalConfiguration> domnodes = config.configurationsAt("user.domains.domain"); if(domname == null) domname= config.getString("user.domain"); for (HierarchicalConfiguration domnode : domnodes) { String domurl = domnode.getString("url"); Boolean isLegacy = domnode.getBoolean("legacy", false); String dname = domnode.getString("name"); Domain domain = new Domain(dname, domnode.getString("dir"), domurl, isLegacy); if(dname.equals(domname)) this.domain = domain; DomainInfo dominfo = new DomainInfo(domain); this.user_domains.put(dominfo.getName(), dominfo); } }
Example 4
Source File: CleanupConfiguration.java From sailfish-core with Apache License 2.0 | 5 votes |
@Override public void load(HierarchicalConfiguration config) { reports = config.getBoolean(REPORTS, false); matrices = config.getBoolean(MATRICES, false); messages = config.getBoolean(MESSAGES, false); events = config.getBoolean(EVENTS, false); trafficDump = config.getBoolean(TRAFFIC_DUMP, false); logs = config.getBoolean(LOGS, false); ml = config.getBoolean(ML, false); autoclean = config.getBoolean(AUTOCLEAN, false); cleanOlderThanDays = config.getInt(CLEAN_OLDER_THAN_DAYS, 1); }
Example 5
Source File: EnvironmentSettings.java From sailfish-core with Apache License 2.0 | 5 votes |
private void loadScriptRunSettings(HierarchicalConfiguration config) { notificationIfServicesNotStarted = config.getBoolean(NOTIFICATION_IF_SOME_SERVICES_NOT_STARTED, false); failUnexpected = config.getString(FAIL_UNEXPECTED_KEY, "N"); matrixCompilerPriority = config.getInt(MATRIX_COMPILER_PRIORITY, Thread.NORM_PRIORITY); reportOutputFormat = ReportOutputFormat.parse(config.getString(REPORT_OUTPUT_FORMAT, ReportOutputFormat.ZIP_FILES.getName())); excludedMessages = parseSet(config, EXCLUDED_MESSAGES_FROM_REPORT, IDictionaryValidator.NAME_REGEX, excludedMessages); relevantMessagesSortingMode = RelevantMessagesSortingMode.parse(config.getString(RELEVANT_MESSAGES_SORTING_MODE, RelevantMessagesSortingMode.ARRIVAL_TIME.getName())); verificationLimit = config.getInt(VERIFICATION_LIMIT, 200); }
Example 6
Source File: TCPIPSettingsServer.java From sailfish-core with Apache License 2.0 | 5 votes |
@Override public void load(HierarchicalConfiguration config) { this.host = config.getString( "host" ); this.port = config.getInt( "port" ); this.codecClassName = config.getString( "codecClass" ); this.storeMessages = config.getBoolean( "storeMessages" ); }
Example 7
Source File: TCPIPSettings.java From sailfish-core with Apache License 2.0 | 5 votes |
@Override public void load(HierarchicalConfiguration config) { this.host = config.getString( "host" ); this.port = config.getInt( "port" ); this.codecClassName = config.getString( "codecClass" ); this.storeMessages = config.getBoolean( "storeMessages" ); }
Example 8
Source File: ITCHClientSettings.java From sailfish-core with Apache License 2.0 | 5 votes |
@Override public void load(HierarchicalConfiguration config) { this.storeMessages = config.getBoolean("storeMessages", true); //this.address = config.getString("address"); //this.port = config.getInt("port", 0); }
Example 9
Source File: ScriptSettings.java From sailfish-core with Apache License 2.0 | 4 votes |
private void loadTestReportProperties(HierarchicalConfiguration config) { this.addMessagetoReport = config.getBoolean("AddMessagesToReport", true); }
Example 10
Source File: CustomPayloadsParam.java From zap-extensions with Apache License 2.0 | 4 votes |
private void loadConfirmRemoveTokenFromConfig(HierarchicalConfiguration rootConfig) { confirmRemoveToken = rootConfig.getBoolean(CONFIRM_REMOVE_PAYLOAD_KEY, true); }
Example 11
Source File: Domain.java From wings with Apache License 2.0 | 4 votes |
private void initializeDomain() { try { if(!new File(this.domainConfigFile).exists()) return; PropertyListConfiguration config = new PropertyListConfiguration(this.domainConfigFile); this.useSharedTripleStore = config.getBoolean("useSharedTripleStore", true); this.planEngine = config.getString("executions.engine.plan", "Local"); this.stepEngine = config.getString("executions.engine.step", "Local"); this.templateLibrary = new DomainLibrary(config.getString("workflows.library.url"), config.getString("workflows.library.map")); this.newTemplateDirectory = new UrlMapPrefix(config.getString("workflows.prefix.url"), config.getString("workflows.prefix.map")); this.executionLibrary = new DomainLibrary(config.getString("executions.library.url"), config.getString("executions.library.map")); this.newExecutionDirectory = new UrlMapPrefix(config.getString("executions.prefix.url"), config.getString("executions.prefix.map")); this.dataOntology = new DomainOntology(config.getString("data.ontology.url"), config.getString("data.ontology.map")); this.dataLibrary = new DomainLibrary(config.getString("data.library.url"), config.getString("data.library.map")); this.dataLibrary.setStorageDirectory(config.getString("data.library.storage")); this.componentLibraryNamespace = config.getString("components.namespace"); this.abstractComponentLibrary = new DomainLibrary( config.getString("components.abstract.url"), config.getString("components.abstract.map")); String concreteLibraryName = config.getString("components.concrete"); List<HierarchicalConfiguration> clibs = config.configurationsAt("components.libraries.library"); for (HierarchicalConfiguration clib : clibs) { String url = clib.getString("url"); String map = clib.getString("map"); String name = clib.getString("name"); String codedir = clib.getString("storage"); DomainLibrary concreteLib = new DomainLibrary(url, map, name, codedir); this.concreteComponentLibraries.add(concreteLib); if(name.equals(concreteLibraryName)) this.concreteComponentLibrary = concreteLib; } List<HierarchicalConfiguration> perms = config.configurationsAt("permissions.permission"); for (HierarchicalConfiguration perm : perms) { String userid = perm.getString("userid"); boolean canRead = perm.getBoolean("canRead", false); boolean canWrite = perm.getBoolean("canWrite", false); boolean canExecute = perm.getBoolean("canExecute", false); Permission permission = new Permission(userid, canRead, canWrite, canExecute); this.permissions.add(permission); } } catch (ConfigurationException e) { e.printStackTrace(); } }
Example 12
Source File: EnvironmentSettings.java From sailfish-core with Apache License 2.0 | 3 votes |
private void loadGeneralSettings(HierarchicalConfiguration config) { this.fileStoragePath = config.getString("FileStoragePath", "storage"); this.storeAdminMessages = config.getBoolean("StoreAdminMessages", true); this.asyncRunMatrix = config.getBoolean(ASYNC_RUN_MATRIX_KEY, false); this.maxQueueSize = config.getLong(MAX_STORAGE_QUEUE_SIZE, 1024*1024*512); this.storageType = StorageType.parse(config.getString("StorageType", StorageType.DB.getName())); this.comparisonPrecision = config.getBigDecimal(COMPARISON_PRECISION, MathProcessor.COMPARISON_PRECISION); }