Package net.solarnetwork.node.job
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
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default value for thehoursproperty.Fields inherited from class net.solarnetwork.node.service.support.BaseIdentifiable
logFields inherited from interface net.solarnetwork.service.Identifiable
GROUP_UID_PROPERTY, UID_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class net.solarnetwork.node.service.support.BaseIdentifiable
baseIdentifiableSettings, baseIdentifiableSettings, getExpressionServices, getPlaceholderService, populateExpressionDatumProperties, resolvePlaceholders, resolvePlaceholders, setExpressionServices, setPlaceholderServiceMethods inherited from class net.solarnetwork.service.support.BasicIdentifiable
basicIdentifiableMetadataSettings, basicIdentifiableSettings, basicIdentifiableSettings, basicIdentifiableSettings, doubleMetadataValue, getDisplayName, getGroupUid, getGroupUID, getMessageSource, getMetadata, getMetadataCount, getUid, getUID, integerMetadataValue, metadataValue, numberMetadataValue, saveMetadataValue, saveMetadataValue, setDisplayName, setGroupUid, setGroupUID, setMessageSource, setMetadata, setMetadataCount, setUid, setUID, smartMetadataValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.service.Identifiable
getDisplayName, getGroupUid, getUidMethods inherited from interface net.solarnetwork.settings.SettingSpecifierProvider
getDisplayName, getMessageSource
-
Field Details
-
DEFAULT_HOURS
public static final int DEFAULT_HOURSThe default value for thehoursproperty.- See Also:
-
-
Constructor Details
-
DatumDaoCleanerJob
Constructor.- Parameters:
datumDao- the datum DAO to use- Throws:
IllegalArgumentException- if any argument is null
-
-
Method Details
-
getSettingUid
- Specified by:
getSettingUidin interfacenet.solarnetwork.settings.SettingSpecifierProvider
-
getSettingSpecifiers
- Specified by:
getSettingSpecifiersin interfacenet.solarnetwork.settings.SettingSpecifierProvider
-
executeJobService
Description copied from interface:JobServiceExecute the service job.- Specified by:
executeJobServicein interfaceJobService- 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
-