aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/pom.xml2
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt4
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt27
-rw-r--r--ms/controllerblueprints/modules/blueprint-validation/pom.xml2
-rw-r--r--ms/controllerblueprints/modules/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/utils/PropertyAssignmentValidationUtils.kt5
-rw-r--r--ms/controllerblueprints/modules/pom.xml2
-rw-r--r--ms/controllerblueprints/modules/resource-dict/pom.xml2
-rw-r--r--ms/controllerblueprints/parent/pom.xml2
-rw-r--r--ms/controllerblueprints/pom.xml4
9 files changed, 41 insertions, 9 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/pom.xml b/ms/controllerblueprints/modules/blueprint-core/pom.xml
index 1c1385b9c..1cb912c1b 100644
--- a/ms/controllerblueprints/modules/blueprint-core/pom.xml
+++ b/ms/controllerblueprints/modules/blueprint-core/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
<artifactId>modules</artifactId>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
</parent>
<artifactId>blueprint-core</artifactId>
<name>Controller Blueprints Core</name>
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt
index 08bc6c3fd..b74b7e4cf 100644
--- a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/CustomFunctions.kt
@@ -54,6 +54,10 @@ fun String.asJsonPrimitive(): TextNode {
return TextNode(this)
}
+inline fun <reified T : Any> String.jsonAsType(): T {
+ return JacksonUtils.readValue<T>(this.trim())
+}
+
// If you know the string is json content, then use the function directly
fun String.jsonAsJsonType(): JsonNode {
return JacksonUtils.jsonNode(this.trim())
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt
new file mode 100644
index 000000000..e01ba805d
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/utils/DateUtils.kt
@@ -0,0 +1,27 @@
+/*
+ * Copyright © 2019 IBM.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.cds.controllerblueprints.core.utils
+
+import java.time.LocalDateTime
+import java.time.ZoneId
+import java.time.format.DateTimeFormatter
+
+fun currentTimestamp(): String {
+ val now = LocalDateTime.now(ZoneId.systemDefault())
+ val formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+ return formatter.format(now)
+}
diff --git a/ms/controllerblueprints/modules/blueprint-validation/pom.xml b/ms/controllerblueprints/modules/blueprint-validation/pom.xml
index 57865fcf0..04c751127 100644
--- a/ms/controllerblueprints/modules/blueprint-validation/pom.xml
+++ b/ms/controllerblueprints/modules/blueprint-validation/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
<artifactId>modules</artifactId>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
</parent>
<artifactId>blueprint-validation</artifactId>
<name>Controller Blueprints Validation Service</name>
diff --git a/ms/controllerblueprints/modules/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/utils/PropertyAssignmentValidationUtils.kt b/ms/controllerblueprints/modules/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/utils/PropertyAssignmentValidationUtils.kt
index 2ef70164a..d49348152 100644
--- a/ms/controllerblueprints/modules/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/utils/PropertyAssignmentValidationUtils.kt
+++ b/ms/controllerblueprints/modules/blueprint-validation/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/validation/utils/PropertyAssignmentValidationUtils.kt
@@ -1,5 +1,6 @@
/*
* Copyright © 2019 IBM.
+ * Modifications Copyright © 2019 Bell Canada.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -51,7 +52,7 @@ open class PropertyAssignmentValidationUtils(private val bluePrintContext: BlueP
properties: MutableMap<String, JsonNode>) {
properties.forEach { propertyName, propertyAssignment ->
val propertyDefinition: PropertyDefinition = nodeTypeProperties[propertyName]
- ?: throw BluePrintException("failed to get definition for the property ($propertyName)")
+ ?: throw BluePrintException("validatePropertyAssignments failed to get definition for the property ($propertyName)")
validatePropertyAssignment(propertyName, propertyDefinition, propertyAssignment)
@@ -91,7 +92,7 @@ open class PropertyAssignmentValidationUtils(private val bluePrintContext: BlueP
}
check(isValid) {
- throw BluePrintException("property($propertyName) defined of type($propertyType) is not comptable with the value ($propertyAssignment)")
+ throw BluePrintException("property($propertyName) defined of type($propertyType) is not compatible with the value ($propertyAssignment)")
}
}
diff --git a/ms/controllerblueprints/modules/pom.xml b/ms/controllerblueprints/modules/pom.xml
index 4bc962f04..73b231316 100644
--- a/ms/controllerblueprints/modules/pom.xml
+++ b/ms/controllerblueprints/modules/pom.xml
@@ -20,7 +20,7 @@
<parent>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
<artifactId>parent</artifactId>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
<relativePath>../parent</relativePath>
</parent>
<artifactId>modules</artifactId>
diff --git a/ms/controllerblueprints/modules/resource-dict/pom.xml b/ms/controllerblueprints/modules/resource-dict/pom.xml
index b210b100b..4ee4f91a0 100644
--- a/ms/controllerblueprints/modules/resource-dict/pom.xml
+++ b/ms/controllerblueprints/modules/resource-dict/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
<artifactId>modules</artifactId>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
</parent>
<artifactId>resource-dict</artifactId>
<name>Controller Blueprints Resource Dictionary</name>
diff --git a/ms/controllerblueprints/parent/pom.xml b/ms/controllerblueprints/parent/pom.xml
index 3021c4032..925b1678a 100644
--- a/ms/controllerblueprints/parent/pom.xml
+++ b/ms/controllerblueprints/parent/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
<artifactId>controllerblueprints</artifactId>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
</parent>
<groupId>org.onap.ccsdk.cds.controllerblueprints</groupId>
<artifactId>parent</artifactId>
diff --git a/ms/controllerblueprints/pom.xml b/ms/controllerblueprints/pom.xml
index 909dfa4fe..8abb36e67 100644
--- a/ms/controllerblueprints/pom.xml
+++ b/ms/controllerblueprints/pom.xml
@@ -18,13 +18,13 @@
<parent>
<groupId>org.onap.ccsdk.cds</groupId>
<artifactId>ms</artifactId>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>controllerblueprints</artifactId>
<name>Controller Blueprints Root</name>
- <version>0.6.1-SNAPSHOT</version>
+ <version>0.7.0-SNAPSHOT</version>
<properties>
<service.name>ControllerBlueprints</service.name>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>