List of usage examples for java.util Properties contains
@Override public boolean contains(Object value)
From source file:raptor.service.UCIEngineService.java
protected UCIEngine uciEngineFromProperties(Properties properties) { UCIEngine engine = new UCIEngine(); engine.setDefault(properties.getProperty("isDefault").equals("true")); String fr = properties.getProperty("chess960"); engine.setSupportsFischerRandom(fr != null && fr.equals("true")); engine.setMultiplyBlackScoreByMinus1(properties.contains("multiplyBlackScoreByMinus1") && properties.getProperty("multiplyBlackScoreByMinus1").equals("true")); engine.setProcessPath(properties.getProperty("processPath")); engine.setUserName(properties.getProperty("userName")); engine.setGoAnalysisParameters(properties.getProperty("goAnalysisParams")); String parameters = properties.getProperty("parameters"); if (StringUtils.isNotBlank(parameters)) { engine.setParameters(RaptorStringUtils.stringArrayFromString(parameters, '@')); }/* w w w . java2 s . c o m*/ // Set the configured values. for (Entry<Object, Object> prop : properties.entrySet()) { String keyString = (String) prop.getKey(); if (!keyString.equals("isUCI") && !keyString.equals("processPath") && !keyString.equals("isDefault") && !keyString.equals("goAnalysisParams") && !keyString.equals("userName") && !keyString.equals("multiplyBlackScoreByMinus1") && !keyString.equals("parameters")) { engine.setOverrideOption(keyString, String.valueOf(prop.getValue())); } } return engine; }
From source file:org.apache.gobblin.cluster.GobblinClusterManager.java
/** * Create the service based application launcher and other associated services * @throws Exception//from w w w .j ava 2 s. c o m */ private void initializeAppLauncherAndServices() throws Exception { // Done to preserve backwards compatibility with the previously hard-coded timeout of 5 minutes Properties properties = ConfigUtils.configToProperties(this.config); if (!properties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS)) { properties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS, Long.toString(300)); } this.applicationLauncher = new ServiceBasedAppLauncher(properties, this.clusterName); // create a job catalog for keeping track of received jobs if a job config path is specified if (this.config.hasPath(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_PREFIX + ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY)) { String jobCatalogClassName = ConfigUtils.getString(config, GobblinClusterConfigurationKeys.JOB_CATALOG_KEY, GobblinClusterConfigurationKeys.DEFAULT_JOB_CATALOG); this.jobCatalog = (MutableJobCatalog) GobblinConstructorUtils .invokeFirstConstructor(Class.forName(jobCatalogClassName), ImmutableList.of(config .getConfig(StringUtils .removeEnd(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_PREFIX, ".")) .withFallback(this.config))); } else { this.jobCatalog = null; } SchedulerService schedulerService = new SchedulerService(properties); this.applicationLauncher.addService(schedulerService); this.jobScheduler = buildGobblinHelixJobScheduler(config, this.appWorkDir, getMetadataTags(clusterName, applicationId), schedulerService); this.applicationLauncher.addService(this.jobScheduler); this.jobConfigurationManager = buildJobConfigurationManager(config); this.applicationLauncher.addService(this.jobConfigurationManager); }
From source file:gobblin.service.modules.core.GobblinServiceManager.java
public GobblinServiceManager(String serviceName, String serviceId, Config config, Optional<Path> serviceWorkDirOptional) throws Exception { // Done to preserve backwards compatibility with the previously hard-coded timeout of 5 minutes Properties properties = ConfigUtils.configToProperties(config); if (!properties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS)) { properties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS, Long.toString(300)); }//from w w w. j ava 2s .co m this.config = config; this.serviceId = serviceId; this.serviceLauncher = new ServiceBasedAppLauncher(properties, serviceName); this.fs = buildFileSystem(config); this.serviceWorkDir = serviceWorkDirOptional.isPresent() ? serviceWorkDirOptional.get() : getServiceWorkDirPath(this.fs, serviceName, serviceId); // Initialize TopologyCatalog this.isTopologyCatalogEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_TOPOLOGY_CATALOG_ENABLED_KEY, true); if (isTopologyCatalogEnabled) { this.topologyCatalog = new TopologyCatalog(config, Optional.of(LOGGER)); this.serviceLauncher.addService(topologyCatalog); } // Initialize FlowCatalog this.isFlowCatalogEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_FLOW_CATALOG_ENABLED_KEY, true); if (isFlowCatalogEnabled) { this.flowCatalog = new FlowCatalog(config, Optional.of(LOGGER)); this.serviceLauncher.addService(flowCatalog); } // Initialize Helix Optional<String> zkConnectionString = Optional .fromNullable(ConfigUtils.getString(config, ServiceConfigKeys.ZK_CONNECTION_STRING_KEY, null)); if (zkConnectionString.isPresent()) { LOGGER.info("Using ZooKeeper connection string: " + zkConnectionString); // This will create and register a Helix controller in ZooKeeper this.helixManager = Optional.fromNullable(buildHelixManager(config, zkConnectionString.get())); } else { LOGGER.info("No ZooKeeper connection string. Running in single instance mode."); this.helixManager = Optional.absent(); } // Initialize ServiceScheduler this.isSchedulerEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_SCHEDULER_ENABLED_KEY, true); if (isSchedulerEnabled) { this.orchestrator = new Orchestrator(config, Optional.of(this.topologyCatalog), Optional.of(LOGGER)); SchedulerService schedulerService = new SchedulerService(properties); this.scheduler = new GobblinServiceJobScheduler(config, this.helixManager, Optional.of(this.flowCatalog), Optional.of(this.topologyCatalog), this.orchestrator, schedulerService, Optional.of(LOGGER)); } // Initialize RestLI this.isRestLIServerEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_RESTLI_SERVER_ENABLED_KEY, true); if (isRestLIServerEnabled) { Injector injector = Guice.createInjector(new Module() { @Override public void configure(Binder binder) { binder.bind(FlowCatalog.class).annotatedWith(Names.named("flowCatalog")) .toInstance(flowCatalog); binder.bindConstant().annotatedWith(Names.named("readyToUse")).to(Boolean.TRUE); } }); this.restliServer = EmbeddedRestliServer.builder() .resources(Lists.<Class<? extends BaseResource>>newArrayList(FlowConfigsResource.class)) .injector(injector).build(); this.serviceLauncher.addService(restliServer); } // Register Scheduler to listen to changes in Flows if (isSchedulerEnabled) { this.flowCatalog.addListener(this.scheduler); this.topologyCatalog.addListener(this.orchestrator); } // Initialize TopologySpecFactory this.isTopologySpecFactoryEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_TOPOLOGY_SPEC_FACTORY_ENABLED_KEY, true); if (this.isTopologySpecFactoryEnabled) { this.aliasResolver = new ClassAliasResolver<>(TopologySpecFactory.class); String topologySpecFactoryClass = ServiceConfigKeys.DEFAULT_TOPOLOGY_SPEC_FACTORY; if (config.hasPath(ServiceConfigKeys.TOPOLOGYSPEC_FACTORY_KEY)) { topologySpecFactoryClass = config.getString(ServiceConfigKeys.TOPOLOGYSPEC_FACTORY_KEY); } try { LOGGER.info("Using TopologySpecFactory class name/alias " + topologySpecFactoryClass); this.topologySpecFactory = (TopologySpecFactory) ConstructorUtils.invokeConstructor( Class.forName(this.aliasResolver.resolve(topologySpecFactoryClass)), config); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e) { throw new RuntimeException(e); } } }
From source file:org.apache.gobblin.service.modules.core.GobblinServiceManager.java
public GobblinServiceManager(String serviceName, String serviceId, Config config, Optional<Path> serviceWorkDirOptional) throws Exception { // Done to preserve backwards compatibility with the previously hard-coded timeout of 5 minutes Properties properties = ConfigUtils.configToProperties(config); if (!properties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS)) { properties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS, Long.toString(300)); }/*from w w w.j ava 2s . c o m*/ this.config = config; this.metricContext = Instrumented.getMetricContext(ConfigUtils.configToState(config), this.getClass()); this.metrics = new Metrics(this.metricContext, this.config); this.serviceName = serviceName; this.serviceId = serviceId; this.serviceLauncher = new ServiceBasedAppLauncher(properties, serviceName); this.fs = buildFileSystem(config); this.serviceWorkDir = serviceWorkDirOptional.isPresent() ? serviceWorkDirOptional.get() : getServiceWorkDirPath(this.fs, serviceName, serviceId); // Initialize TopologyCatalog this.isTopologyCatalogEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_TOPOLOGY_CATALOG_ENABLED_KEY, true); if (isTopologyCatalogEnabled) { this.topologyCatalog = new TopologyCatalog(config, Optional.of(LOGGER)); this.serviceLauncher.addService(topologyCatalog); } // Initialize FlowCatalog this.isFlowCatalogEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_FLOW_CATALOG_ENABLED_KEY, true); if (isFlowCatalogEnabled) { this.flowCatalog = new FlowCatalog(config, Optional.of(LOGGER)); this.flowCatalogLocalCommit = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_FLOW_CATALOG_LOCAL_COMMIT, ServiceConfigKeys.DEFAULT_GOBBLIN_SERVICE_FLOW_CATALOG_LOCAL_COMMIT); this.serviceLauncher.addService(flowCatalog); this.isGitConfigMonitorEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_GIT_CONFIG_MONITOR_ENABLED_KEY, false); if (this.isGitConfigMonitorEnabled) { this.gitConfigMonitor = new GitConfigMonitor(config, this.flowCatalog); this.serviceLauncher.addService(this.gitConfigMonitor); } } else { this.isGitConfigMonitorEnabled = false; } // Initialize Helix Optional<String> zkConnectionString = Optional .fromNullable(ConfigUtils.getString(config, ServiceConfigKeys.ZK_CONNECTION_STRING_KEY, null)); if (zkConnectionString.isPresent()) { LOGGER.info("Using ZooKeeper connection string: " + zkConnectionString); // This will create and register a Helix controller in ZooKeeper this.helixManager = Optional.fromNullable(buildHelixManager(config, zkConnectionString.get())); } else { LOGGER.info("No ZooKeeper connection string. Running in single instance mode."); this.helixManager = Optional.absent(); } // Initialize ServiceScheduler this.isSchedulerEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_SCHEDULER_ENABLED_KEY, true); if (isSchedulerEnabled) { this.orchestrator = new Orchestrator(config, Optional.of(this.topologyCatalog), Optional.of(LOGGER)); SchedulerService schedulerService = new SchedulerService(properties); this.scheduler = new GobblinServiceJobScheduler(this.serviceName, config, this.helixManager, Optional.of(this.flowCatalog), Optional.of(this.topologyCatalog), this.orchestrator, schedulerService, Optional.of(LOGGER)); this.serviceLauncher.addService(schedulerService); this.serviceLauncher.addService(this.scheduler); } // Initialize RestLI this.resourceHandler = new GobblinServiceFlowConfigResourceHandler(serviceName, this.flowCatalogLocalCommit, new FlowConfigResourceLocalHandler(this.flowCatalog), this.helixManager, this.scheduler); this.isRestLIServerEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_RESTLI_SERVER_ENABLED_KEY, true); if (isRestLIServerEnabled) { Injector injector = Guice.createInjector(new Module() { @Override public void configure(Binder binder) { binder.bind(FlowConfigsResourceHandler.class) .annotatedWith(Names.named("flowConfigsResourceHandler")) .toInstance(GobblinServiceManager.this.resourceHandler); binder.bindConstant().annotatedWith(Names.named("readyToUse")).to(Boolean.TRUE); } }); this.restliServer = EmbeddedRestliServer.builder() .resources(Lists.<Class<? extends BaseResource>>newArrayList(FlowConfigsResource.class)) .injector(injector).build(); if (config.hasPath(ServiceConfigKeys.SERVICE_PORT)) { this.restliServer.setPort(config.getInt(ServiceConfigKeys.SERVICE_PORT)); } this.serviceLauncher.addService(restliServer); } // Register Scheduler to listen to changes in Flows if (isSchedulerEnabled) { this.flowCatalog.addListener(this.scheduler); } // Initialize TopologySpecFactory this.isTopologySpecFactoryEnabled = ConfigUtils.getBoolean(config, ServiceConfigKeys.GOBBLIN_SERVICE_TOPOLOGY_SPEC_FACTORY_ENABLED_KEY, true); if (this.isTopologySpecFactoryEnabled) { this.aliasResolver = new ClassAliasResolver<>(TopologySpecFactory.class); String topologySpecFactoryClass = ServiceConfigKeys.DEFAULT_TOPOLOGY_SPEC_FACTORY; if (config.hasPath(ServiceConfigKeys.TOPOLOGYSPEC_FACTORY_KEY)) { topologySpecFactoryClass = config.getString(ServiceConfigKeys.TOPOLOGYSPEC_FACTORY_KEY); } try { LOGGER.info("Using TopologySpecFactory class name/alias " + topologySpecFactoryClass); this.topologySpecFactory = (TopologySpecFactory) ConstructorUtils.invokeConstructor( Class.forName(this.aliasResolver.resolve(topologySpecFactoryClass)), config); } catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException | InstantiationException | ClassNotFoundException e) { throw new RuntimeException(e); } } }
From source file:org.apache.ws.scout.registry.ConnectionImpl.java
public ConnectionImpl(Properties properties) throws InvalidRequestException { postalScheme = properties.getProperty(ConnectionFactoryImpl.POSTALADDRESSSCHEME_PROPERTY); String val = properties.getProperty(ConnectionFactoryImpl.MAXROWS_PROPERTY); maxRows = (val == null) ? -1 : Integer.valueOf(val); uddiVersion = properties.getProperty(ConnectionFactoryImpl.UDDI_VERSION_PROPERTY, DEFAULT_UDDI_VERSION); //The TCK does not set the UDDI_VERSION, so if the lifecycle URL contains 'v3' we //automagically set the version to be "3.0" if (!properties.contains(ConnectionFactoryImpl.UDDI_VERSION_PROPERTY) && (properties.contains(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY)) && properties.getProperty(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY).contains("v3")) { properties.setProperty(ConnectionFactoryImpl.UDDI_VERSION_PROPERTY, "3.0"); uddiVersion = "3.0"; String securityManager = properties.getProperty(ConnectionFactoryImpl.LIFECYCLEMANAGER_PROPERTY) .replace("publish", "security"); properties.setProperty(ConnectionFactoryImpl.SECURITYMANAGER_PROPERTY, securityManager); }//from www. j av a 2s . c o m String uddiConfigFile = properties.getProperty(JUDDI_CLIENT_CONFIG_FILE);// DEFAULT_JUDDI_CLIENT_CONFIG_FILE); if (isUDDIv3(uddiVersion)) { String nodeName = null; String managerName = null; if (manager == null && uddiConfigFile != null) { try { manager = new UDDIClerkManager(uddiConfigFile, properties); manager.start(); } catch (ConfigurationException e) { log.error(e.getMessage(), e); } } if (manager != null) { try { managerName = manager.getName(); nodeName = manager.getClientConfig().getHomeNode().getName(); } catch (ConfigurationException e) { log.error(e.getMessage(), e); } } registry = new RegistryV3Impl(properties, nodeName, managerName); } else { registry = new RegistryImpl(properties); } //this.postalScheme = postalScheme; //this.maxRows = maxRows; }
From source file:gobblin.cluster.GobblinClusterManager.java
/** * Create the service based application launcher and other associated services * @throws Exception/*from ww w . j av a 2 s . c o m*/ */ private void initializeAppLauncherAndServices() throws Exception { // Done to preserve backwards compatibility with the previously hard-coded timeout of 5 minutes Properties properties = ConfigUtils.configToProperties(this.config); if (!properties.contains(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS)) { properties.setProperty(ServiceBasedAppLauncher.APP_STOP_TIME_SECONDS, Long.toString(300)); } this.applicationLauncher = new ServiceBasedAppLauncher(properties, this.clusterName); // create a job catalog for keeping track of received jobs if a job config path is specified if (this.config.hasPath(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_PREFIX + ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY)) { String jobCatalogClassName = ConfigUtils.getString(config, GobblinClusterConfigurationKeys.JOB_CATALOG_KEY, GobblinClusterConfigurationKeys.DEFAULT_JOB_CATALOG); this.jobCatalog = (MutableJobCatalog) GobblinConstructorUtils.invokeFirstConstructor( Class.forName(jobCatalogClassName), ImmutableList.<Object>of(config.getConfig( StringUtils.removeEnd(GobblinClusterConfigurationKeys.GOBBLIN_CLUSTER_PREFIX, ".")))); } else { this.jobCatalog = null; } SchedulerService schedulerService = new SchedulerService(properties); this.applicationLauncher.addService(schedulerService); this.applicationLauncher.addService(buildGobblinHelixJobScheduler(config, this.appWorkDir, getMetadataTags(clusterName, applicationId), schedulerService)); this.applicationLauncher.addService(buildJobConfigurationManager(config)); }
From source file:com.mirth.connect.plugins.datapruner.DataPrunerService.java
private void applyPrunerSettings(Properties properties) { if (StringUtils.isNotEmpty(properties.getProperty("pruningBlockSize"))) { pruner.setBlockSize(Integer.parseInt(properties.getProperty("pruningBlockSize"))); } else {//from w w w. j a v a2 s . c o m pruner.setBlockSize(DEFAULT_PRUNING_BLOCK_SIZE); } pruner.setArchiveEnabled( Boolean.parseBoolean(properties.getProperty("archiveEnabled", Boolean.FALSE.toString()))); // boolean includeAttachments = Boolean.parseBoolean(properties.getProperty("includeAttachments", Boolean.FALSE.toString())); if (pruner.isArchiveEnabled()) { if (properties.contains("archiverOptions")) { pruner.setArchiverOptions(new MessageWriterOptions()); } else { pruner.setArchiverOptions(serializer.deserialize(properties.getProperty("archiverOptions"), MessageWriterOptions.class)); } } if (Boolean.parseBoolean(properties.getProperty("pruneEvents", Boolean.FALSE.toString()))) { pruner.setPruneEvents(true); pruner.setMaxEventAge(Integer.parseInt(properties.getProperty("maxEventAge"))); } else { pruner.setPruneEvents(false); pruner.setMaxEventAge(null); } }
From source file:com.example.android.nfcprovisioning.NfcProvisioningFragment.java
@Override public NdefMessage createNdefMessage(NfcEvent event) { if (mProvisioningValues == null) { return null; }/*from ww w . jav a 2 s . c o m*/ ByteArrayOutputStream stream = new ByteArrayOutputStream(); Properties properties = new Properties(); // Store all the values into the Properties object for (Map.Entry<String, String> e : mProvisioningValues.entrySet()) { if (!TextUtils.isEmpty(e.getValue())) { String value; if (e.getKey().equals(DevicePolicyManager.EXTRA_PROVISIONING_WIFI_SSID)) { // Make sure to surround SSID with double quotes value = e.getValue(); if (!value.startsWith("\"") || !value.endsWith("\"")) { value = "\"" + value + "\""; } } else { value = e.getValue(); } properties.put(e.getKey(), value); } } // Make sure to put local time in the properties. This is necessary on some devices to // reliably download the device owner APK from an HTTPS connection. if (!properties.contains(DevicePolicyManager.EXTRA_PROVISIONING_LOCAL_TIME)) { properties.put(DevicePolicyManager.EXTRA_PROVISIONING_LOCAL_TIME, String.valueOf(System.currentTimeMillis())); } try { properties.store(stream, getString(R.string.nfc_comment)); NdefRecord record = NdefRecord.createMime(DevicePolicyManager.MIME_TYPE_PROVISIONING_NFC, stream.toByteArray()); return new NdefMessage(new NdefRecord[] { record }); } catch (IOException e) { e.printStackTrace(); } return null; }
From source file:io.fabric8.maven.plugin.mojo.build.ResourceMojo.java
private void lateInit() throws MojoExecutionException { if (goalFinder.runningWithGoal(project, session, "fabric8:watch") || goalFinder.runningWithGoal(project, session, "fabric8:watch")) { Properties properties = project.getProperties(); properties.setProperty("fabric8.watch", "true"); }//from w ww.ja v a 2 s .co m platformMode = clusterAccess.resolvePlatformMode(mode, log); log.info("Running in [[B]]%s[[B]] mode", platformMode.getLabel()); if (isOpenShiftMode()) { Properties properties = project.getProperties(); if (!properties.contains(DOCKER_IMAGE_USER)) { String namespace = clusterAccess.getNamespace(); log.info("Using docker image name of namespace: " + namespace); properties.setProperty(DOCKER_IMAGE_USER, namespace); } if (!properties.contains(PlatformMode.FABRIC8_EFFECTIVE_PLATFORM_MODE)) { properties.setProperty(PlatformMode.FABRIC8_EFFECTIVE_PLATFORM_MODE, platformMode.toString()); } } openShiftConverters = new HashMap<>(); openShiftConverters.put("ReplicaSet", new ReplicSetOpenShiftConverter()); openShiftConverters.put("Deployment", new DeploymentOpenShiftConverter(platformMode, getOpenshiftDeployTimeoutSeconds())); // TODO : This converter shouldn't be here. See its javadoc. openShiftConverters.put("DeploymentConfig", new DeploymentConfigOpenShiftConverter(getOpenshiftDeployTimeoutSeconds())); openShiftConverters.put("Namespace", new NamespaceOpenShiftConverter()); handlerHub = new HandlerHub(project); }
From source file:com.mirth.connect.plugins.datapruner.DefaultDataPrunerController.java
private void applyPrunerSettings(Properties properties) { if (StringUtils.isNotEmpty(properties.getProperty("pruningBlockSize"))) { int blockSize = NumberUtils.toInt(properties.getProperty("pruningBlockSize")); if (blockSize < MIN_PRUNING_BLOCK_SIZE) { blockSize = MIN_PRUNING_BLOCK_SIZE; } else if (blockSize > MAX_PRUNING_BLOCK_SIZE) { blockSize = DataPruner.DEFAULT_PRUNING_BLOCK_SIZE; }//from w w w.j av a2s .c o m pruner.setPrunerBlockSize(blockSize); } else { pruner.setPrunerBlockSize(DataPruner.DEFAULT_PRUNING_BLOCK_SIZE); } isEnabled = Boolean.parseBoolean(properties.getProperty("enabled")); if (properties.containsKey("pollingProperties")) { pruner.setPollingProperties(serializer.deserialize(properties.getProperty("pollingProperties"), PollConnectorProperties.class)); } else { PollConnectorProperties defaultProperties = new PollConnectorProperties(); defaultProperties.setPollingFrequency(3600000); pruner.setPollingProperties(defaultProperties); } pruner.setArchiveEnabled( Boolean.parseBoolean(properties.getProperty("archiveEnabled", Boolean.FALSE.toString()))); if (pruner.isArchiveEnabled()) { if (properties.contains("archiverOptions")) { pruner.setArchiverOptions(new MessageWriterOptions()); } else { pruner.setArchiverOptions(serializer.deserialize(properties.getProperty("archiverOptions"), MessageWriterOptions.class)); } } if (Boolean.parseBoolean(properties.getProperty("pruneEvents", Boolean.FALSE.toString()))) { pruner.setPruneEvents(true); pruner.setMaxEventAge(Integer.parseInt(properties.getProperty("maxEventAge"))); } else { pruner.setPruneEvents(false); pruner.setMaxEventAge(null); } if (StringUtils.isNotEmpty(properties.getProperty("archiverBlockSize"))) { int blockSize = NumberUtils.toInt(properties.getProperty("archiverBlockSize")); if (blockSize <= 0 || blockSize > MAX_ARCHIVING_BLOCK_SIZE) { blockSize = DataPruner.DEFAULT_ARCHIVING_BLOCK_SIZE; } pruner.setArchiverBlockSize(blockSize); } else { pruner.setArchiverBlockSize(DataPruner.DEFAULT_ARCHIVING_BLOCK_SIZE); } }