summaryrefslogtreecommitdiffstats
path: root/ms/blueprintsprocessor/modules/commons
diff options
context:
space:
mode:
Diffstat (limited to 'ms/blueprintsprocessor/modules/commons')
-rw-r--r--ms/blueprintsprocessor/modules/commons/adaptors/pom.xml34
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/pom.xml45
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt131
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt48
-rw-r--r--ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties16
-rw-r--r--ms/blueprintsprocessor/modules/commons/db-lib/pom.xml54
-rw-r--r--ms/blueprintsprocessor/modules/commons/pom.xml62
-rw-r--r--ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml37
8 files changed, 427 insertions, 0 deletions
diff --git a/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml
new file mode 100644
index 000000000..efd7d74b3
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/adaptors/pom.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>commons</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>adaptors</artifactId>
+ <packaging>pom</packaging>
+ <name>Blueprints Processor Adaptors POM</name>
+ <description>Blueprints Processor Adaptors</description>
+ <modules>
+
+ </modules>
+
+</project>
diff --git a/ms/blueprintsprocessor/modules/commons/core/pom.xml b/ms/blueprintsprocessor/modules/commons/core/pom.xml
new file mode 100644
index 000000000..a601560bb
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/core/pom.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>commons</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>core</artifactId>
+ <packaging>jar</packaging>
+ <name>Blueprints Processor Core</name>
+ <description>Blueprints Processor Core</description>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>db-lib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>rest-lib</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.onap.ccsdk.apps</groupId>
+ <artifactId>controllerblueprints-resource-dict</artifactId>
+ </dependency>
+ </dependencies>
+</project>
diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt
new file mode 100644
index 000000000..4836cd243
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorData.kt
@@ -0,0 +1,131 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * 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.apps.blueprintsprocessor.core.api.data
+
+import com.fasterxml.jackson.annotation.JsonFormat
+import com.fasterxml.jackson.databind.node.ObjectNode
+import io.swagger.annotations.ApiModelProperty
+import org.onap.ccsdk.apps.controllerblueprints.resource.dict.ResourceAssignment
+
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * 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.
+ */
+
+/**
+ * BlueprintProcessorData
+ * @author Brinda Santh
+ * DATE : 8/15/2018
+ */
+
+open class ResourceResolutionInput {
+ @get:ApiModelProperty(required=true)
+ lateinit var commonHeader: CommonHeader
+ @get:ApiModelProperty(required=true)
+ lateinit var actionIdentifiers: ActionIdentifiers
+ @get:ApiModelProperty(required=true)
+ lateinit var resourceAssignments: List<ResourceAssignment>
+ @get:ApiModelProperty(required=true )
+ lateinit var payload: ObjectNode
+}
+
+open class ResourceResolutionOutput {
+ @get:ApiModelProperty(required=true)
+ lateinit var commonHeader: CommonHeader
+ @get:ApiModelProperty(required=true)
+ lateinit var actionIdentifiers: ActionIdentifiers
+ @get:ApiModelProperty(required=true)
+ lateinit var status: Status
+ @get:ApiModelProperty(required=true)
+ lateinit var resourceAssignments: List<ResourceAssignment>
+}
+
+open class ExecutionServiceInput {
+ @get:ApiModelProperty(required=true)
+ lateinit var commonHeader: CommonHeader
+ @get:ApiModelProperty(required=true)
+ lateinit var actionIdentifiers: ActionIdentifiers
+ @get:ApiModelProperty(required=true)
+ lateinit var payload: ObjectNode
+}
+
+open class ExecutionServiceOutput {
+ @get:ApiModelProperty(required=true)
+ lateinit var commonHeader: CommonHeader
+ @get:ApiModelProperty(required=true)
+ lateinit var actionIdentifiers: ActionIdentifiers
+ @get:ApiModelProperty(required=true)
+ lateinit var status: Status
+ @get:ApiModelProperty(required=true)
+ lateinit var payload: ObjectNode
+}
+
+open class ActionIdentifiers {
+ @get:ApiModelProperty(required=false)
+ lateinit var blueprintName: String
+ @get:ApiModelProperty(required=false)
+ lateinit var blueprintVersion: String
+ @get:ApiModelProperty(required=true)
+ lateinit var actionName: String
+ @get:ApiModelProperty(required=true, allowableValues = "sync, async")
+ lateinit var mode: String
+}
+
+open class CommonHeader {
+ @get:ApiModelProperty(required=true, example = "2012-04-23T18:25:43.511Z")
+ @get:JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+ lateinit var timestamp: String
+ @get:ApiModelProperty(required=true)
+ lateinit var originatorId: String
+ @get:ApiModelProperty(required=true)
+ lateinit var requestId: String
+ @get:ApiModelProperty(required=true)
+ lateinit var subRequestId: String
+ @get:ApiModelProperty(required=false)
+ var flags: Flags? = null
+}
+
+open class Flags {
+ var isForce: Boolean = false
+ @get:ApiModelProperty(value = "3600")
+ var ttl: Int = 3600
+}
+
+open class Status {
+ @get:ApiModelProperty(required=true)
+ var code: Int = 200
+ @get:ApiModelProperty(required=false)
+ var errorMessage: String? = null
+ @get:ApiModelProperty(required=true)
+ lateinit var message: String
+}
+
+
+
+
+
diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt
new file mode 100644
index 000000000..df4d67038
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/core/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/core/api/data/BlueprintProcessorException.kt
@@ -0,0 +1,48 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * 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.apps.blueprintsprocessor.core.api.data
+
+/**
+ * BlueprintProcessorException
+ * @author Brinda Santh
+ * DATE : 8/15/2018
+ */
+open class BlueprintProcessorException : Exception {
+ var code: Int = 100
+
+ constructor(cause: Throwable) : super(cause)
+ constructor(message: String) : super(message)
+ constructor(message: String, cause: Throwable) : super(message, cause)
+ constructor(cause: Throwable, message: String, vararg args: Any?) : super(String.format(message, *args), cause)
+
+ constructor(code: Int, cause: Throwable) : super(cause) {
+ this.code = code
+ }
+
+ constructor(code: Int, message: String) : super(message) {
+ this.code = code
+ }
+
+ constructor(code: Int, message: String, cause: Throwable) : super(message, cause) {
+ this.code = code
+ }
+
+ constructor(code: Int, cause: Throwable, message: String, vararg args: Any?)
+ : super(String.format(message, *args), cause) {
+ this.code = code
+ }
+} \ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties b/ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties
new file mode 100644
index 000000000..2ce871476
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/core/src/main/resources/application.properties
@@ -0,0 +1,16 @@
+#
+# Copyright © 2017-2018 AT&T Intellectual Property.
+#
+# 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.
+#
+
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml
new file mode 100644
index 000000000..31abb40df
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/db-lib/pom.xml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>commons</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>db-lib</artifactId>
+ <packaging>jar</packaging>
+ <name>Blueprints Processor DB Lib</name>
+ <description>Blueprints Processor DB Lib</description>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-data-jpa</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>com.h2database</groupId>
+ <artifactId>h2</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-testing</artifactId>
+ <scope>test</scope>
+ </dependency>
+
+ </dependencies>
+
+</project>
diff --git a/ms/blueprintsprocessor/modules/commons/pom.xml b/ms/blueprintsprocessor/modules/commons/pom.xml
new file mode 100644
index 000000000..83a3cb8b6
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>modules</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>commons</artifactId>
+ <packaging>pom</packaging>
+ <name>Blueprints Processor Commons POM</name>
+ <description>Blueprints Processor Commons</description>
+
+ <modules>
+ <module>db-lib</module>
+ <module>rest-lib</module>
+ <module>adaptors</module>
+ <module>core</module>
+ </modules>
+ <dependencies>
+ <dependency>
+ <groupId>com.fasterxml.jackson.module</groupId>
+ <artifactId>jackson-module-kotlin</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib-jdk8</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-reflect</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>io.projectreactor</groupId>
+ <artifactId>reactor-test</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+
+</project>
diff --git a/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml
new file mode 100644
index 000000000..d671f120e
--- /dev/null
+++ b/ms/blueprintsprocessor/modules/commons/rest-lib/pom.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ Copyright © 2017-2018 AT&T Intellectual Property.
+ ~
+ ~ 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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
+ <artifactId>commons</artifactId>
+ <version>0.0.3-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>rest-lib</artifactId>
+ <packaging>jar</packaging>
+ <name>Blueprints Processor Rest Lib</name>
+ <description>Blueprints Processor Rest Lib</description>
+ <dependencies>
+ <dependency>
+ <groupId>org.springframework.boot</groupId>
+ <artifactId>spring-boot-starter-webflux</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>