Add support for blueprintprocessor runtime DB
authorAlexis de Talhouët <adetalhouet89@gmail.com>
Mon, 7 Jan 2019 21:33:02 +0000 (16:33 -0500)
committerAlexis de Talhouët <alexis.de_talhouet@bell.ca>
Wed, 9 Jan 2019 22:11:43 +0000 (22:11 +0000)
- created db-resources module to store controller blueprint
related controller blueprint repository and entities. Also
create an abstract BlueprintCatalogServiceImpl so it can be
used both by controllerblueprint and blueprintprocessor
- created blueprint-validation to store the implementation
of the validation interface.
- change controllerblueprint service to levrage db-resources
- implement CatalogService for blueprintprocessor db-lib by
using db-resources.

Change-Id: I0539e414e4ff3b7a6edf0f6304d6cbc5e6eac404
Issue-ID: CCSDK-664
Signed-off-by: Alexis de Talhouët <adetalhouet89@gmail.com>
13 files changed:
ms/blueprintsprocessor/application/src/test/java/org/onap/ccsdk/apps/blueprintsprocessor/BlueprintProcessorApplicationTest.java
ms/blueprintsprocessor/modules/commons/db-lib/pom.xml
ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt [new file with mode: 0755]
ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfiguration.kt
ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt [new file with mode: 0755]
ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt [new file with mode: 0644]
ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt [new file with mode: 0644]
ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt [new file with mode: 0644]
ms/blueprintsprocessor/modules/commons/db-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/PrimaryDatabaseConfigurationTest.kt
ms/blueprintsprocessor/modules/commons/db-lib/src/test/resources/application-test.properties
ms/blueprintsprocessor/modules/commons/rest-lib/src/test/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/rest/service/RestClientServiceTest.kt
ms/blueprintsprocessor/modules/inbounds/selfservice-api/pom.xml
ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt [deleted file]

index 8a4ebd0..5777a28 100644 (file)
@@ -21,6 +21,7 @@ import org.junit.Assert;
 import org.junit.Before;\r
 import org.junit.Test;\r
 import org.junit.runner.RunWith;\r
+import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration;\r
 import org.springframework.beans.factory.annotation.Autowired;\r
 import org.springframework.boot.test.context.SpringBootTest;\r
 import org.springframework.context.ApplicationContext;\r
@@ -35,7 +36,7 @@ import org.springframework.test.context.junit4.SpringRunner;
  */\r
 \r
 @RunWith(SpringRunner.class)\r
-@ContextConfiguration(classes = BlueprintProcessorApplication.class)\r
+@ContextConfiguration(classes = {BlueprintProcessorApplication.class, BluePrintLoadConfiguration.class})\r
 @SpringBootTest(classes = BlueprintProcessorApplication.class,\r
         webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)\r
 public class BlueprintProcessorApplicationTest {\r
index 4b11f83..cf265fc 100644 (file)
@@ -15,7 +15,7 @@
   ~  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">
+  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>
     <description>Blueprints Processor DB Lib</description>
 
     <dependencies>
+        <dependency>
+            <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId>
+            <artifactId>db-resources</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.onap.ccsdk.apps.controllerblueprints</groupId>
+            <artifactId>blueprint-validation</artifactId>
+            <version>${project.version}</version>
+        </dependency>
         <dependency>
             <groupId>org.onap.ccsdk.apps.blueprintsprocessor</groupId>
             <artifactId>core</artifactId>
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/BlueprintProcessorCatalogServiceImpl.kt
new file mode 100755 (executable)
index 0000000..7c0eb6b
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ * 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.
+ * 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.db
+
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModel
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModelContent
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.repository.BlueprintProcessorModelContentRepository
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.repository.BlueprintProcessorModelRepository
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintConstants
+import org.onap.ccsdk.apps.controllerblueprints.core.common.ApplicationConstants
+import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintValidatorService
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintArchiveUtils
+import org.onap.ccsdk.apps.controllerblueprints.core.utils.BluePrintMetadataUtils
+import org.onap.ccsdk.apps.controllerblueprints.db.resources.BlueprintCatalogServiceImpl
+import org.springframework.stereotype.Service
+import java.io.File
+import java.nio.file.Files
+
+/**
+Similar/Duplicate implementation in [org.onap.ccsdk.apps.controllerblueprints.service.load.ControllerBlueprintCatalogServiceImpl]
+ */
+@Service
+class BlueprintProcessorCatalogServiceImpl(bluePrintLoadConfiguration: BluePrintLoadConfiguration,
+                                           private val bluePrintValidatorService: BluePrintValidatorService,
+                                           private val blueprintModelContentRepository: BlueprintProcessorModelContentRepository,
+                                           private val blueprintModelRepository: BlueprintProcessorModelRepository)
+    : BlueprintCatalogServiceImpl(bluePrintLoadConfiguration) {
+
+    override fun saveToDataBase(extractedDirectory: File, id: String, archiveFile: File, checkValidity: Boolean?) {
+        var valid = false
+        val firstItem = BluePrintArchiveUtils.getFirstItemInDirectory(extractedDirectory)
+        val blueprintBaseDirectory = extractedDirectory.absolutePath + "/" + firstItem
+        // Validate Blueprint
+        val bluePrintRuntimeService = BluePrintMetadataUtils.getBluePrintRuntime(id, blueprintBaseDirectory)
+
+        // Check Validity of blueprint
+        if (checkValidity!!) {
+            valid = bluePrintValidatorService.validateBluePrints(bluePrintRuntimeService)
+        }
+
+        if ((valid && checkValidity!!) || (!valid && !checkValidity!!)) {
+            val metaData = bluePrintRuntimeService.bluePrintContext().metadata!!
+            // FIXME("Check Duplicate for Artifact Name and Artifact Version")
+            val blueprintModel = BlueprintProcessorModel()
+            blueprintModel.id = id
+            blueprintModel.artifactType = ApplicationConstants.ASDC_ARTIFACT_TYPE_SDNC_MODEL
+            blueprintModel.published = ApplicationConstants.ACTIVE_N
+            blueprintModel.artifactName = metaData[BluePrintConstants.METADATA_TEMPLATE_NAME]
+            blueprintModel.artifactVersion = metaData[BluePrintConstants.METADATA_TEMPLATE_VERSION]
+            blueprintModel.updatedBy = metaData[BluePrintConstants.METADATA_TEMPLATE_AUTHOR]
+            blueprintModel.tags = metaData[BluePrintConstants.METADATA_TEMPLATE_TAGS]
+            blueprintModel.artifactDescription = "Controller Blueprint for ${blueprintModel.artifactName}:${blueprintModel.artifactVersion}"
+
+            val blueprintModelContent = BlueprintProcessorModelContent()
+            blueprintModelContent.id = id // For quick access both id's are same.always have one to one mapping.
+            blueprintModelContent.contentType = "CBA_ZIP"
+            blueprintModelContent.name = "${blueprintModel.artifactName}:${blueprintModel.artifactVersion}"
+            blueprintModelContent.description = "(${blueprintModel.artifactName}:${blueprintModel.artifactVersion} CBA Zip Content"
+            blueprintModelContent.content = Files.readAllBytes(archiveFile.toPath())
+
+            // Set the Blueprint Model into blueprintModelContent
+            blueprintModelContent.blueprintModel = blueprintModel
+
+            // Set the Blueprint Model Content into blueprintModel
+            blueprintModel.blueprintModelContent = blueprintModelContent
+
+            blueprintModelRepository.saveAndFlush(blueprintModel)
+        }
+    }
+}
\ No newline at end of file
index bf76e21..98b6221 100644 (file)
@@ -45,8 +45,7 @@ open class PrimaryDatabaseConfiguration(private val primaryDataSourceProperties:
     open fun primaryEntityManager(): LocalContainerEntityManagerFactoryBean {
         val em = LocalContainerEntityManagerFactoryBean()
         em.dataSource = primaryDataSource()
-        em.setPackagesToScan(
-                "org.onap.ccsdk.apps.blueprintsprocessor.db.primary")
+        em.setPackagesToScan("org.onap.ccsdk.apps.blueprintsprocessor.db.primary")
 
         val vendorAdapter = HibernateJpaVendorAdapter()
         em.jpaVendorAdapter = vendorAdapter
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModel.kt
new file mode 100755 (executable)
index 0000000..00d4830
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ * 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.db.primary.domain
+
+import com.fasterxml.jackson.annotation.JsonFormat
+import io.swagger.annotations.ApiModelProperty
+import javax.persistence.Entity
+import javax.persistence.EntityListeners
+import javax.persistence.Table
+import org.hibernate.annotations.Proxy
+import org.springframework.data.annotation.LastModifiedDate
+import org.springframework.data.jpa.domain.support.AuditingEntityListener
+import java.io.Serializable
+import java.util.*
+import javax.persistence.CascadeType
+import javax.persistence.Column
+import javax.persistence.FetchType
+import javax.persistence.Id
+import javax.persistence.Lob
+import javax.persistence.OneToOne
+import javax.persistence.Temporal
+import javax.persistence.TemporalType
+
+@EntityListeners(AuditingEntityListener::class)
+@Entity
+@Table(name = "BLUEPRINT_RUNTIME")
+@Proxy(lazy = false)
+class BlueprintProcessorModel : Serializable {
+    @Id
+    @Column(name = "config_model_id")
+    var id: String? = null
+
+    @Column(name = "artifact_uuid")
+    var artifactUUId: String? = null
+
+    @Column(name = "artifact_type")
+    var artifactType: String? = null
+
+    @Column(name = "artifact_version", nullable = false)
+    @ApiModelProperty(required = true)
+    var artifactVersion: String? = null
+
+    @Lob
+    @Column(name = "artifact_description")
+    var artifactDescription: String? = null
+
+    @Column(name = "internal_version")
+    var internalVersion: Int? = null
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+    @LastModifiedDate
+    @Temporal(TemporalType.TIMESTAMP)
+    @Column(name = "creation_date")
+    var createdDate = Date()
+
+    @Column(name = "artifact_name", nullable = false)
+    @ApiModelProperty(required = true)
+    var artifactName: String? = null
+
+    @Column(name = "published", nullable = false)
+    @ApiModelProperty(required = true)
+    var published: String? = null
+
+    @Column(name = "updated_by", nullable = false)
+    @ApiModelProperty(required = true)
+    var updatedBy: String? = null
+
+    @Lob
+    @Column(name = "tags", nullable = false)
+    @ApiModelProperty(required = true)
+    var tags: String? = null
+
+    @OneToOne(mappedBy = "blueprintModel", fetch = FetchType.EAGER, orphanRemoval = true, cascade = [CascadeType.ALL])
+    var blueprintModelContent: BlueprintProcessorModelContent? = null
+
+    companion object {
+        private const val serialVersionUID = 1L
+    }
+}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/domain/BlueprintProcessorModelContent.kt
new file mode 100644 (file)
index 0000000..d012af5
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ * 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.db.primary.domain
+
+import com.fasterxml.jackson.annotation.JsonFormat
+import io.swagger.annotations.ApiModelProperty
+import java.io.Serializable
+import java.util.Date
+import java.util.Objects
+import javax.persistence.Column
+import javax.persistence.Entity
+import javax.persistence.EntityListeners
+import javax.persistence.Id
+import javax.persistence.JoinColumn
+import javax.persistence.Lob
+import javax.persistence.OneToOne
+import javax.persistence.Table
+import javax.persistence.Temporal
+import javax.persistence.TemporalType
+import org.springframework.data.annotation.LastModifiedDate
+import org.springframework.data.jpa.domain.support.AuditingEntityListener
+
+@EntityListeners(AuditingEntityListener::class)
+@Entity
+@Table(name = "BLUEPRINT_CONTENT_RUNTIME")
+class BlueprintProcessorModelContent : Serializable {
+
+    @Id
+    @Column(name = "config_model_content_id")
+    var id: String? = null
+
+    @Column(name = "name", nullable = false)
+    @ApiModelProperty(required = true)
+    var name: String? = null
+
+    @Column(name = "content_type", nullable = false)
+    @ApiModelProperty(required = true)
+    var contentType: String? = null
+
+    @OneToOne
+    @JoinColumn(name = "config_model_id")
+    var blueprintModel: BlueprintProcessorModel? = null
+
+    @Lob
+    @Column(name = "description")
+    var description: String? = null
+
+    @Lob
+    @Column(name = "content", nullable = false)
+    @ApiModelProperty(required = true)
+    var content: ByteArray? = null
+
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
+    @LastModifiedDate
+    @Temporal(TemporalType.TIMESTAMP)
+    @Column(name = "updated_date")
+    var creationDate = Date()
+
+    override fun toString(): String {
+        return "[" + "id = " + id +
+                ", name = " + name +
+                ", contentType = " + contentType +
+                "]"
+    }
+
+    override fun equals(o: Any?): Boolean {
+
+        if (o === this) {
+            return true
+        }
+        if (o !is BlueprintProcessorModelContent) {
+            return false
+        }
+        val blueprintModelContent = o as BlueprintProcessorModelContent?
+        return (id == blueprintModelContent!!.id && name == blueprintModelContent.name
+                && contentType == blueprintModelContent.contentType)
+    }
+
+    override fun hashCode(): Int {
+        return Objects.hash(id, name, contentType)
+    }
+
+    companion object {
+        private const val serialVersionUID = 1L
+    }
+
+}
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelContentRepository.kt
new file mode 100644 (file)
index 0000000..e614544
--- /dev/null
@@ -0,0 +1,22 @@
+/*
+ * Copyright (C) 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.
+ * 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.db.primary.repository
+
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModel
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModelContent
+import org.onap.ccsdk.apps.controllerblueprints.db.resources.repository.ModelContentRepository
+
+interface BlueprintProcessorModelContentRepository : ModelContentRepository<BlueprintProcessorModel, BlueprintProcessorModelContent>
\ No newline at end of file
diff --git a/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt b/ms/blueprintsprocessor/modules/commons/db-lib/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/db/primary/repository/BlueprintProcessorModelRepository.kt
new file mode 100644 (file)
index 0000000..25f3dac
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 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.
+ * 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.db.primary.repository
+
+import org.onap.ccsdk.apps.blueprintsprocessor.db.primary.domain.BlueprintProcessorModel
+import org.onap.ccsdk.apps.controllerblueprints.db.resources.repository.ModelRepository
+
+interface BlueprintProcessorModelRepository : ModelRepository<BlueprintProcessorModel>
index aa48c8e..3f737e3 100644 (file)
@@ -21,7 +21,10 @@ import org.junit.runner.RunWith
 import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintProperties
 import org.onap.ccsdk.apps.blueprintsprocessor.core.BlueprintPropertyConfiguration
 import org.onap.ccsdk.apps.blueprintsprocessor.db.BluePrintDBLibConfiguration
+import org.onap.ccsdk.apps.controllerblueprints.core.config.BluePrintLoadConfiguration
 import org.springframework.beans.factory.annotation.Autowired
+import org.springframework.boot.autoconfigure.EnableAutoConfiguration
+import org.springframework.context.annotation.ComponentScan
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.TestPropertySource
 import org.springframework.test.context.junit4.SpringRunner
@@ -30,8 +33,10 @@ import kotlin.test.assertNotNull
 
 @RunWith(SpringRunner::class)
 @ContextConfiguration(classes = [BlueprintPropertyConfiguration::class, BluePrintProperties::class,
-    BluePrintDBLibConfiguration::class])
+    BluePrintDBLibConfiguration::class, BluePrintLoadConfiguration::class])
 @TestPropertySource(locations = ["classpath:application-test.properties"])
+@ComponentScan(basePackages = ["org.onap.ccsdk.apps.blueprintsprocessor", "org.onap.ccsdk.apps.controllerblueprints"])
+@EnableAutoConfiguration
 class PrimaryDatabaseConfigurationTest {
 
     @Autowired
index 672ff80..6f10626 100644 (file)
@@ -21,4 +21,8 @@ blueprintsprocessor.db.primary.driverClassName=org.h2.Driver
 blueprintsprocessor.db.primary.hibernateHbm2ddlAuto=create-drop
 blueprintsprocessor.db.primary.hibernateDDLAuto=update
 blueprintsprocessor.db.primary.hibernateNamingStrategy=org.hibernate.cfg.ImprovedNamingStrategy
-blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect
\ No newline at end of file
+blueprintsprocessor.db.primary.hibernateDialect=org.hibernate.dialect.H2Dialect
+
+# Controller Blueprints Core Configuration
+blueprintsprocessor.blueprintDeployPath=./target/blueprints/deploy
+blueprintsprocessor.blueprintArchivePath=./target/blueprints/archive
\ No newline at end of file
index 502758a..1481406 100644 (file)
@@ -22,6 +22,7 @@ import org.onap.ccsdk.apps.blueprintsprocessor.core.BlueprintPropertyConfigurati
 import org.onap.ccsdk.apps.blueprintsprocessor.rest.BluePrintRestLibConfiguration
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration
+import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
 import org.springframework.boot.test.context.SpringBootTest
 import org.springframework.test.context.ContextConfiguration
 import org.springframework.test.context.TestPropertySource
@@ -32,8 +33,8 @@ import org.springframework.web.bind.annotation.RestController
 import kotlin.test.Test
 import kotlin.test.assertNotNull
 
-@EnableAutoConfiguration
 @RunWith(SpringRunner::class)
+@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class])
 @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)
 @ContextConfiguration(classes = [BluePrintRestLibConfiguration::class, BlueprintPropertyConfiguration::class,
     SampleController::class, BluePrintProperties::class])
index f319ca4..2c6da2e 100644 (file)
@@ -15,7 +15,7 @@
   ~  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">
+  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>
diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/apps/blueprintsprocessor/selfservice/api/BluePrintCatalogServiceImpl.kt
deleted file mode 100755 (executable)
index 484972a..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * 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.selfservice.api
-
-import org.onap.ccsdk.apps.blueprintsprocessor.core.BluePrintCoreConfiguration
-import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BluePrintCatalogService
-import org.springframework.stereotype.Service
-import java.io.File
-
-@Service
-class BluePrintCatalogServiceImpl(private val bluePrintCoreConfiguration: BluePrintCoreConfiguration) : BluePrintCatalogService {
-
-    override fun uploadToDataBase(file: String, validate : Boolean): String {
-        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
-    }
-
-    override fun downloadFromDataBase(name: String, version: String, path: String): String {
-        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
-    }
-
-    override fun prepareBluePrint(name: String, version: String): String {
-        //TODO("Get the Blueprint from the DB")
-        return bluePrintCoreConfiguration.deployPath.plus(File.separator)
-                .plus(name).plus(File.separator).plus(version)
-
-    }
-
-    override fun downloadFromDataBase(uuid: String, path: String): String {
-        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
-    }
-}
\ No newline at end of file