From a31c304eaceaa579b4be976d987f1cdeddba05c2 Mon Sep 17 00:00:00 2001 From: Brinda Santh Date: Mon, 13 Jan 2020 11:37:17 -0500 Subject: Prioritization expiry and clean scheduler service Add prioritization expiry and clean scheduler service implementation. Optimizing message passing between processors. Added message sorting utils. Issue-ID: CCSDK-1917 Signed-off-by: Brinda Santh Change-Id: I049ea3bae2e2c546244136f15c3d89deda1e7053 --- .../onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ms/blueprintsprocessor/modules/blueprints/blueprint-core') diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt index 4fd907a5a..02dd2027d 100644 --- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt +++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt @@ -21,6 +21,7 @@ import java.text.SimpleDateFormat import java.time.LocalDateTime import java.time.ZoneId import java.time.format.DateTimeFormatter +import java.util.Calendar import java.util.Date fun controllerDate(): Date { @@ -45,3 +46,11 @@ fun Date.currentTimestamp(): String { val formatter = SimpleDateFormat(BluePrintConstants.DATE_TIME_PATTERN) return formatter.format(this) } + +/** Return incremented date for [number] of days */ +fun Date.addDate(number: Int): Date { + val calendar = Calendar.getInstance() + calendar.time = this + calendar.add(Calendar.DATE, number) + return calendar.time +} -- cgit 1.2.3-korg