Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Minor: Change environment variable DATA_POINTS_MAX_AGE_DAYS to OR_DATA_POINTS_MAX_AGE_DAYS

Rich Turner8dfbf703755c
diff --git a/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java b/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java
index 325714bd8..7b0f792a0 100644
--- a/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java
+++ b/manager/src/main/java/org/openremote/manager/datapoint/AssetDatapointService.java
@@ -48,13 +48,13 @@ import static org.openremote.model.value.MetaItemType.STORE_DATA_POINTS;
/**
* Store and retrieve datapoints for asset attributes and periodically purge data points based on
* {@link MetaItemType#DATA_POINTS_MAX_AGE_DAYS} {@link org.openremote.model.attribute.MetaItem}
- * and {@link #DATA_POINTS_MAX_AGE_DAYS} setting; storage duration defaults to {@value #DATA_POINTS_MAX_AGE_DAYS_DEFAULT}
+ * and {@link #OR_DATA_POINTS_MAX_AGE_DAYS} setting; storage duration defaults to {@value #OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT}
* days.
*/
public class AssetDatapointService extends AbstractDatapointService<AssetDatapoint> implements AssetUpdateProcessor {
- public static final String DATA_POINTS_MAX_AGE_DAYS = "DATA_POINTS_MAX_AGE_DAYS";
- public static final int DATA_POINTS_MAX_AGE_DAYS_DEFAULT = 31;
+ public static final String OR_DATA_POINTS_MAX_AGE_DAYS = "OR_DATA_POINTS_MAX_AGE_DAYS";
+ public static final int OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT = 31;
public static final String OR_DATA_POINTS_EXPORT_DIR = "OR_DATA_POINTS_EXPORT_DIR";
public static final String OR_DATA_POINTS_EXPORT_DIR_DEFAULT = "/tmp";
private static final Logger LOG = Logger.getLogger(AssetDatapointService.class.getName());
@@ -74,10 +74,10 @@ public class AssetDatapointService extends AbstractDatapointService<AssetDatapoi
)
);
- maxDatapointAgeDays = getInteger(container.getConfig(), DATA_POINTS_MAX_AGE_DAYS, DATA_POINTS_MAX_AGE_DAYS_DEFAULT);
+ maxDatapointAgeDays = getInteger(container.getConfig(), OR_DATA_POINTS_MAX_AGE_DAYS, OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT);
if (maxDatapointAgeDays <= 0) {
- LOG.warning(DATA_POINTS_MAX_AGE_DAYS + " value is not a valid value so data points won't be auto purged");
+ LOG.warning(OR_DATA_POINTS_MAX_AGE_DAYS + " value is not a valid value so data points won't be auto purged");
}
exportPath = Paths.get(getString(container.getConfig(), OR_DATA_POINTS_EXPORT_DIR, OR_DATA_POINTS_EXPORT_DIR_DEFAULT));
diff --git a/profile/deploy.yml b/profile/deploy.yml
index 3333e483a..1bd8253f7 100644
--- a/profile/deploy.yml
+++ b/profile/deploy.yml
@@ -287,7 +287,7 @@ services:
# Configure the default max age for data points stored in the database (individual attributes can use a custom
# value by using the DATA_POINTS_MAX_AGE_DAYS AssetMeta item).
- # DATA_POINTS_MAX_AGE_DAYS = 30
+ # OR_DATA_POINTS_MAX_AGE_DAYS = 30
# App id for the API of OpenWeather: https://openweathermap.org
# OR_OPEN_WEATHER_API_APP_ID
diff --git a/test/src/test/groovy/org/openremote/test/assets/AssetDatapointTest.groovy b/test/src/test/groovy/org/openremote/test/assets/AssetDatapointTest.groovy
index c4d54adae..61de1446c 100644
--- a/test/src/test/groovy/org/openremote/test/assets/AssetDatapointTest.groovy
+++ b/test/src/test/groovy/org/openremote/test/assets/AssetDatapointTest.groovy
@@ -23,7 +23,7 @@ import java.util.concurrent.TimeUnit
import static java.util.concurrent.TimeUnit.DAYS
import static java.util.concurrent.TimeUnit.MINUTES
import static java.util.concurrent.TimeUnit.SECONDS
-import static org.openremote.manager.datapoint.AssetDatapointService.DATA_POINTS_MAX_AGE_DAYS_DEFAULT
+import static org.openremote.manager.datapoint.AssetDatapointService.OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT
import static org.openremote.test.setup.ManagerTestSetup.thingLightToggleAttributeName
import static spock.util.matcher.HamcrestMatchers.closeTo
@@ -35,7 +35,7 @@ class AssetDatapointTest extends Specification implements ManagerContainerTrait
def conditions = new PollingConditions(timeout: 10, delay: 0.2)
when: "the demo agent and thing have been deployed"
- def datapointPurgeDays = DATA_POINTS_MAX_AGE_DAYS_DEFAULT
+ def datapointPurgeDays = OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT
def container = startContainer(defaultConfig(), defaultServices())
def managerTestSetup = container.getService(SetupService.class).getTaskOfType(ManagerTestSetup.class)
def agentService = container.getService(AgentService.class)
diff --git a/test/src/test/java/org/openremote/test/setup/ManagerTestSetup.java b/test/src/test/java/org/openremote/test/setup/ManagerTestSetup.java
index 4315c5f8b..666c92b0d 100644
--- a/test/src/test/java/org/openremote/test/setup/ManagerTestSetup.java
+++ b/test/src/test/java/org/openremote/test/setup/ManagerTestSetup.java
@@ -41,7 +41,7 @@ import org.openremote.model.value.impl.ColourRGB;
import java.util.Arrays;
-import static org.openremote.manager.datapoint.AssetDatapointService.DATA_POINTS_MAX_AGE_DAYS_DEFAULT;
+import static org.openremote.manager.datapoint.AssetDatapointService.OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT;
import static org.openremote.model.Constants.*;
import static org.openremote.model.value.MetaItemType.*;
import static org.openremote.model.value.ValueType.*;
@@ -169,7 +169,7 @@ public class ManagerTestSetup extends ManagerSetup {
true),
new MetaItem<>(
DATA_POINTS_MAX_AGE_DAYS,
- DATA_POINTS_MAX_AGE_DAYS_DEFAULT*7
+ OR_DATA_POINTS_MAX_AGE_DAYS_DEFAULT *7
),
new MetaItem<>(
AGENT_LINK,