summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules
diff options
context:
space:
mode:
authorBrinda Santh <bs2796@att.com>2020-01-13 11:37:17 -0500
committerKAPIL SINGAL <ks220y@att.com>2020-01-13 18:22:25 +0000
commita31c304eaceaa579b4be976d987f1cdeddba05c2 (patch)
treec9f94e2b066d955e66c184ed8bb327ae8a150ad8 /ms/blueprintsprocessor/modules
parente9b1dfd73a2298cc9679e527ae90a651f5025dd2 (diff)
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 <bs2796@att.com> Change-Id: I049ea3bae2e2c546244136f15c3d89deda1e7053
Diffstat (limited to 'ms/blueprintsprocessor/modules')
-rw-r--r--ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt9
1 files changed, 9 insertions, 0 deletions
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
+}