Class DatumDaoCleanerJob

java.lang.Object
net.solarnetwork.service.support.BasicIdentifiable
net.solarnetwork.node.service.support.BaseIdentifiable
net.solarnetwork.node.job.DatumDaoCleanerJob
All Implemented Interfaces:
JobService, net.solarnetwork.service.Identifiable, net.solarnetwork.settings.SettingSpecifierProvider

public class DatumDaoCleanerJob extends BaseIdentifiable implements JobService
Job to delete locally persisted datum that have been uploaded already and are safe to remove.

This job will call DatumDao.deleteUploadedDataOlderThan(int) and emit a log line if this returns a positive value.

Version:
2.0
Author:
matt
  • Field Details

    • DEFAULT_HOURS

      public static final int DEFAULT_HOURS
      The default value for the hours property.
      See Also:
  • Constructor Details

    • DatumDaoCleanerJob

      public DatumDaoCleanerJob(DatumDao datumDao)
      Constructor.
      Parameters:
      datumDao - the datum DAO to use
      Throws:
      IllegalArgumentException - if any argument is null
  • Method Details

    • getSettingUid

      public String getSettingUid()
      Specified by:
      getSettingUid in interface net.solarnetwork.settings.SettingSpecifierProvider
    • getSettingSpecifiers

      public List<net.solarnetwork.settings.SettingSpecifier> getSettingSpecifiers()
      Specified by:
      getSettingSpecifiers in interface net.solarnetwork.settings.SettingSpecifierProvider
    • executeJobService

      public void executeJobService() throws Exception
      Description copied from interface: JobService
      Execute the service job.
      Specified by:
      executeJobService in interface JobService
      Throws:
      Exception - if anything goes wrong
    • getHours

      public int getHours()
      Get he minimum age of data that has been uploaded to delete.
      Returns:
      the hours; defaults to DEFAULT_HOURS
    • setHours

      public void setHours(int hours)
      Set he minimum age of data that has been uploaded to delete.
      Parameters:
      hours - the hours to set