@ManagedAttribute( description = "Purge flows older than given duration " + "(e.g. \"30d\" will purge flows older than 30 days)") public void setPurgeFlowsOlderThan(String purgeFlowsOlderThan) { ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application); applicationConfig.setPurgeFlowsOlderThan(formatInput(purgeFlowsOlderThan)); flowManager.mergeApplicationConfig(applicationConfig); }
@ManagedAttribute( description = "Set to true to exclude ERROR flows from being purged. " + "Set to false to purge CLEAN and ERROR flows") public void setDoNotPurgeErrorFlows(boolean doNotPurgeErrorFlows) { ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application); applicationConfig.setDoNotPurgeErrorFlows(doNotPurgeErrorFlows); flowManager.mergeApplicationConfig(applicationConfig); }
@ManagedAttribute( description = "Set to true to exclude ERROR flows from being purged. " + "Set to false to purge CLEAN and ERROR flows") public boolean isDoNotPurgeErrorFlows() { return flowManager.getApplicationConfig(application).isDoNotPurgeErrorFlows(); }
@ManagedAttribute( description = "Purge flows older than given duration " + "(e.g. \"30d\" will purge flows older than 30 days)") public String getPurgeFlowsOlderThan() { return flowManager.getApplicationConfig(application).getPurgeFlowsOlderThan(); }
private void initJobs() { LOG.info("Initialize flow purge jobs ... "); for (ApplicationConfig config : flowManager.findApplicationConfigs()) { if (config.isFlowPurgeScheduled()) { scheduleJob(config); } else { LOG.info("Skip scheduling of job for application " + config.getApplication()); } } LOG.info("Initialization done. "); }
@ManagedAttribute(description = "Purge job status for current application") public boolean isPurgeScheduled() { return flowManager.getApplicationConfig(application).isFlowPurgeScheduled(); }
@ManagedAttribute(description = "Cron expression for purge schedule") public String getPurgeSchedule() { return flowManager.getApplicationConfig(application).getFlowPurgeSchedule(); }
@ManagedOperation(description = "Unschedules a purge job for current application and schedule") public void unschedule() { unscheduleJob(flowManager.getApplicationConfig(application)); }
@ManagedOperation(description = "Executes a purge job once for current application") public void execute() { executeJob(flowManager.getApplicationConfig(application)); }
@ManagedAttribute(description = "Cron expression for purge schedule") public void setPurgeSchedule(String purgeSchedule) { ApplicationConfig applicationConfig = flowManager.getApplicationConfig(application); applicationConfig.setFlowPurgeSchedule(formatInput(purgeSchedule)); flowManager.mergeApplicationConfig(applicationConfig); }