public String launch(CmsObject cms, Map<String, String> parameters) throws Exception {

        String maxAgeStr = parameters.get(PARAM_MAX_AGE);
        long maxAgeHours = parseMaxAge(maxAgeStr);
        if (maxAgeHours > 0) {
            long maxAgeMillis = maxAgeHours * 3600L * 1000L;
            long now = System.currentTimeMillis();
            CmsLogFilter filter = CmsLogFilter.ALL.filterTo(now - maxAgeMillis);
            LOG.info("Removing all entries from CMS_LOG older than " + maxAgeHours + " hours...");
            cms.deleteLogEntries(filter);
        } else {
            LOG.info("Not deleting any log entries because of a problem with the max-age format.");
        }
        return "remove old db log entries (max age : " + maxAgeStr + ")";
    }
public String launch ( CmsObject cms , Map < String , String > parameters ) throws Exception { String maxAgeStr = parameters . get ( PARAM_MAX_AGE ) ; long maxAgeHours = parseMaxAge ( maxAgeStr ) ; if ( maxAgeHours > 0 ) { long maxAgeMillis = maxAgeHours * 3600L * 1000L ; long now = System . currentTimeMillis ( ) ; CmsLogFilter filter = CmsLogFilter . ALL . filterTo ( now - maxAgeMillis ) ; LOG . info ( "Removing all entries from CMS_LOG older than " + maxAgeHours + " hours..." ) ; cms . deleteLogEntries ( filter ) ; } else { LOG . info ( "Not deleting any log entries because of a problem with the max-age format." ) ; } return "remove old db log entries (max age : " + maxAgeStr + ")" ; }
@see org.opencms.scheduler.I_CmsScheduledJob#launch(org.opencms.file.CmsObject, java.util.Map)