aboutsummaryrefslogtreecommitdiffstats
path: root/ms
diff options
context:
space:
mode:
authorBrinda Santh Muthuramalingam <brindasanth@in.ibm.com>2020-03-19 12:51:30 +0000
committerGerrit Code Review <gerrit@onap.org>2020-03-19 12:51:30 +0000
commitfa12b4f311e77612e4e856b209a8c81c71f0b29d (patch)
tree0811c8b874e97a60213ab18d208b779a146f0ca3 /ms
parent114c5c16fe51231af038f30ed7ffaee2b22a3431 (diff)
parent8865ccde1a486e203a3812813f5350ddb726265f (diff)
Merge "Fix GroupId and package name in Error Catalog"
Diffstat (limited to 'ms')
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintDatabaseConfiguration.kt4
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt2
-rw-r--r--ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorExceptionHandler.kt4
-rwxr-xr-xms/blueprintsprocessor/application/src/main/resources/application.properties2
-rw-r--r--ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/ErrorCatalogTestConfiguration.kt2
-rw-r--r--ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/error/ErrorCatalogServiceTest.kt10
-rw-r--r--ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintProcessorException.kt9
-rw-r--r--ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt2
-rw-r--r--ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCatalogException.kt (renamed from ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCatalogException.kt)2
-rw-r--r--ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCatalogExtensions.kt (renamed from ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCatalogExtensions.kt)2
-rw-r--r--ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCodes.kt (renamed from ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCodes.kt)2
-rw-r--r--ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorLibData.kt (renamed from ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorLibData.kt)4
-rw-r--r--ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorMessageLibConstants.kt (renamed from ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorMessageLibConstants.kt)9
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogConfiguration.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt)4
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogDBService.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogDBService.kt)12
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogExceptionHandler.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogExceptionHandler.kt)6
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogLoadService.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt)22
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogService.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogService.kt)26
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogServiceExtensions.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogServiceExtensions.kt)4
-rwxr-xr-xms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/domain/Domain.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/domain/Domain.kt)2
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/domain/ErrorMessageModel.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/domain/ErrorMessageModel.kt)2
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/repository/DomainRepository.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/repository/DomainRepository.kt)4
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/repository/ErrorMessageModelRepository.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/repository/ErrorMessageModelRepository.kt)4
-rw-r--r--ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/utils/ErrorCatalogUtils.kt (renamed from ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/utils/ErrorCatalogUtils.kt)2
24 files changed, 73 insertions, 69 deletions
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintDatabaseConfiguration.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintDatabaseConfiguration.kt
index 2e268c356..e9557aed9 100644
--- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintDatabaseConfiguration.kt
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintDatabaseConfiguration.kt
@@ -32,7 +32,7 @@ import javax.sql.DataSource
@Import(BluePrintDBLibConfiguration::class)
@EnableJpaRepositories(
basePackages = ["org.onap.ccsdk.cds.controllerblueprints", "org.onap.ccsdk.cds.blueprintsprocessor",
- "org.onap.ccsdk.error.catalog"],
+ "org.onap.ccsdk.cds.error.catalog"],
entityManagerFactoryRef = "primaryEntityManager",
transactionManagerRef = "primaryTransactionManager"
)
@@ -45,7 +45,7 @@ open class BlueprintDatabaseConfiguration(primaryDataSourceProperties: PrimaryDa
return primaryEntityManager(
"org.onap.ccsdk.cds.controllerblueprints",
"org.onap.ccsdk.cds.blueprintsprocessor",
- "org.onap.ccsdk.error.catalog"
+ "org.onap.ccsdk.cds.error.catalog"
)
}
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt
index 7a888f95c..97b7d28b0 100644
--- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorApplication.kt
@@ -31,7 +31,7 @@ import org.springframework.context.annotation.ComponentScan
@SpringBootApplication
@EnableAutoConfiguration(exclude = [DataSourceAutoConfiguration::class, HazelcastAutoConfiguration::class])
@ComponentScan(
- basePackages = ["org.onap.ccsdk.error.catalog",
+ basePackages = ["org.onap.ccsdk.cds.error.catalog",
"org.onap.ccsdk.cds.blueprintsprocessor", "org.onap.ccsdk.cds.controllerblueprints"]
)
open class BlueprintProcessorApplication
diff --git a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorExceptionHandler.kt b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorExceptionHandler.kt
index 6fcbdfdb7..f241e3f42 100644
--- a/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorExceptionHandler.kt
+++ b/ms/blueprintsprocessor/application/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/BlueprintProcessorExceptionHandler.kt
@@ -16,8 +16,8 @@
package org.onap.ccsdk.cds.blueprintsprocessor
-import org.onap.ccsdk.error.catalog.services.ErrorCatalogExceptionHandler
-import org.onap.ccsdk.error.catalog.services.ErrorCatalogService
+import org.onap.ccsdk.cds.error.catalog.services.ErrorCatalogExceptionHandler
+import org.onap.ccsdk.cds.error.catalog.services.ErrorCatalogService
import org.springframework.web.bind.annotation.RestControllerAdvice
@RestControllerAdvice("org.onap.ccsdk.cds")
diff --git a/ms/blueprintsprocessor/application/src/main/resources/application.properties b/ms/blueprintsprocessor/application/src/main/resources/application.properties
index eb15c5a7e..74549b0ae 100755
--- a/ms/blueprintsprocessor/application/src/main/resources/application.properties
+++ b/ms/blueprintsprocessor/application/src/main/resources/application.properties
@@ -63,7 +63,7 @@ security.user.name: ccsdkapps
# Error Managements
error.catalog.applicationId=cds
error.catalog.type=properties
-error.catalog.errorDefinitionDir=/opt/app/onap/config
+error.catalog.errorDefinitionDir=/opt/app/onap/config/
# Used in Health Check
#endpoints.user.name=ccsdkapps
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/ErrorCatalogTestConfiguration.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/ErrorCatalogTestConfiguration.kt
index 74a17fa1d..c9d55c18a 100644
--- a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/ErrorCatalogTestConfiguration.kt
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/ErrorCatalogTestConfiguration.kt
@@ -22,7 +22,7 @@ import org.springframework.context.annotation.Configuration
@Configuration
@ComponentScan(
- basePackages = ["org.onap.ccsdk.error.catalog"]
+ basePackages = ["org.onap.ccsdk.cds.error.catalog"]
)
@EnableAutoConfiguration
open class ErrorCatalogTestConfiguration
diff --git a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/error/ErrorCatalogServiceTest.kt b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/error/ErrorCatalogServiceTest.kt
index 8e399fd1a..4f7ef0ec2 100644
--- a/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/error/ErrorCatalogServiceTest.kt
+++ b/ms/blueprintsprocessor/application/src/test/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/uat/error/ErrorCatalogServiceTest.kt
@@ -20,11 +20,11 @@ import org.junit.runner.RunWith
import org.onap.ccsdk.cds.blueprintsprocessor.uat.ErrorCatalogTestConfiguration
import org.onap.ccsdk.cds.controllerblueprints.core.grpcProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException
-import org.onap.ccsdk.error.catalog.core.ErrorCatalog
-import org.onap.ccsdk.error.catalog.core.ErrorCatalogCodes
-import org.onap.ccsdk.error.catalog.core.ErrorMessage
-import org.onap.ccsdk.error.catalog.core.ErrorPayload
-import org.onap.ccsdk.error.catalog.services.ErrorCatalogService
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalog
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes
+import org.onap.ccsdk.cds.error.catalog.core.ErrorMessage
+import org.onap.ccsdk.cds.error.catalog.core.ErrorPayload
+import org.onap.ccsdk.cds.error.catalog.services.ErrorCatalogService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.ContextConfiguration
import org.springframework.test.context.TestPropertySource
diff --git a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintProcessorException.kt b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintProcessorException.kt
index 50b6614ad..acb158d89 100644
--- a/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintProcessorException.kt
+++ b/ms/blueprintsprocessor/modules/blueprints/blueprint-core/src/main/kotlin/org/onap/ccsdk/cds/controllerblueprints/core/BluePrintProcessorException.kt
@@ -17,9 +17,9 @@
package org.onap.ccsdk.cds.controllerblueprints.core
-import org.onap.ccsdk.error.catalog.core.ErrorCatalogException
-import org.onap.ccsdk.error.catalog.core.ErrorCatalogExceptionFluent
-import org.onap.ccsdk.error.catalog.core.ErrorMessage
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogException
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogExceptionFluent
+import org.onap.ccsdk.cds.error.catalog.core.ErrorMessage
/**
*
@@ -134,5 +134,6 @@ private fun BluePrintProcessorException.addDomainAndErrorMessage(
message: String,
cause: Throwable = Throwable()
): BluePrintProcessorException {
- return this.addSubError(ErrorMessage(domain, message, cause.message ?: "")).domain(domain)
+ return this.addSubError(ErrorMessage(domain, message, cause.message
+ ?: "")).domain(domain)
}
diff --git a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt
index 908c04607..e5daecede 100644
--- a/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt
+++ b/ms/blueprintsprocessor/modules/inbounds/selfservice-api/src/main/kotlin/org/onap/ccsdk/cds/blueprintsprocessor/selfservice/api/ExecutionServiceController.kt
@@ -29,7 +29,7 @@ import org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api.utils.determineHtt
import org.onap.ccsdk.cds.controllerblueprints.core.asJsonPrimitive
import org.onap.ccsdk.cds.controllerblueprints.core.httpProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.logger
-import org.onap.ccsdk.error.catalog.core.ErrorCatalogCodes
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogCodes
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.http.MediaType
import org.springframework.http.ResponseEntity
diff --git a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCatalogException.kt b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCatalogException.kt
index 76f9cc0f1..032feb62c 100644
--- a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCatalogException.kt
+++ b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCatalogException.kt
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.core
+package org.onap.ccsdk.cds.error.catalog.core
interface ErrorCatalogExceptionFluent<T> {
fun code(code: Int): T
diff --git a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCatalogExtensions.kt b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCatalogExtensions.kt
index 76011b27d..65c547245 100644
--- a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCatalogExtensions.kt
+++ b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCatalogExtensions.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.core
+package org.onap.ccsdk.cds.error.catalog.core
import org.slf4j.LoggerFactory
import org.slf4j.helpers.MessageFormatter
diff --git a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCodes.kt b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCodes.kt
index 241e9d238..86483e3e9 100644
--- a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorCodes.kt
+++ b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorCodes.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.core
+package org.onap.ccsdk.cds.error.catalog.core
object ErrorCatalogCodes {
const val GENERIC_FAILURE = "GENERIC_FAILURE"
diff --git a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorLibData.kt b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorLibData.kt
index b33c118de..2c0772e31 100644
--- a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorLibData.kt
+++ b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorLibData.kt
@@ -14,11 +14,11 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.core
+package org.onap.ccsdk.cds.error.catalog.core
import com.fasterxml.jackson.annotation.JsonFormat
import org.slf4j.event.Level
-import org.onap.ccsdk.error.catalog.core.ErrorMessageLibConstants.ERROR_CATALOG_DEFAULT_ERROR_CODE
+import org.onap.ccsdk.cds.error.catalog.core.ErrorMessageLibConstants.ERROR_CATALOG_DEFAULT_ERROR_CODE
import java.time.LocalDateTime
open class ErrorPayload {
diff --git a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorMessageLibConstants.kt b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorMessageLibConstants.kt
index ef56e7b79..6570e3e66 100644
--- a/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/error/catalog/core/ErrorMessageLibConstants.kt
+++ b/ms/error-catalog/core/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/core/ErrorMessageLibConstants.kt
@@ -14,16 +14,17 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.core
+package org.onap.ccsdk.cds.error.catalog.core
object ErrorMessageLibConstants {
- const val ERROR_CATALOG_DOMAIN = "org.onap.ccsdk.error.catalog"
+ const val ERROR_CATALOG_DOMAIN = "org.onap.ccsdk.cds.error.catalog"
const val ERROR_CATALOG_TYPE = "error.catalog.type"
const val ERROR_CATALOG_TYPE_PROPERTIES = "properties"
const val ERROR_CATALOG_TYPE_DB = "DB"
const val ERROR_CATALOG_PROPERTIES_FILENAME = "error-messages_en.properties"
- const val ERROR_CATALOG_MODELS = "org.onap.ccsdk.error.catalog.domain"
- const val ERROR_CATALOG_REPOSITORY = "org.onap.ccsdk.error.catalog.repository"
+ const val ERROR_CATALOG_PROPERTIES_DIRECTORY = "/opt/app/onap/config/"
+ const val ERROR_CATALOG_MODELS = "org.onap.ccsdk.cds.error.catalog.domain"
+ const val ERROR_CATALOG_REPOSITORY = "org.onap.ccsdk.cds.error.catalog.repository"
const val ERROR_CATALOG_DEFAULT_ERROR_CODE = 500
const val ERROR_CATALOG_PROTOCOL_HTTP = "http"
const val ERROR_CATALOG_PROTOCOL_GRPC = "grpc"
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogConfiguration.kt
index a73401724..f0a75e087 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogConfiguration.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogConfiguration.kt
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services
+package org.onap.ccsdk.cds.error.catalog.services
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.EnableConfigurationProperties
@@ -30,5 +30,5 @@ open class ErrorCatalogConfiguration
open class ErrorCatalogProperties {
lateinit var type: String
lateinit var applicationId: String
- var errorDefinitionDir: String = ""
+ var errorDefinitionDir: String? = null
}
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogDBService.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogDBService.kt
index 841bcf539..95b44e683 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogDBService.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogDBService.kt
@@ -15,13 +15,13 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services
+package org.onap.ccsdk.cds.error.catalog.services
-import org.onap.ccsdk.error.catalog.core.ErrorMessageLibConstants
-import org.onap.ccsdk.error.catalog.services.domain.Domain
-import org.onap.ccsdk.error.catalog.services.domain.ErrorMessageModel
-import org.onap.ccsdk.error.catalog.services.repository.DomainRepository
-import org.onap.ccsdk.error.catalog.services.repository.ErrorMessageModelRepository
+import org.onap.ccsdk.cds.error.catalog.core.ErrorMessageLibConstants
+import org.onap.ccsdk.cds.error.catalog.services.domain.Domain
+import org.onap.ccsdk.cds.error.catalog.services.domain.ErrorMessageModel
+import org.onap.ccsdk.cds.error.catalog.services.repository.DomainRepository
+import org.onap.ccsdk.cds.error.catalog.services.repository.ErrorMessageModelRepository
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.data.domain.Page
import org.springframework.data.domain.Pageable
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogExceptionHandler.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogExceptionHandler.kt
index 91fa97b77..88e2f4522 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogExceptionHandler.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogExceptionHandler.kt
@@ -14,10 +14,10 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services
+package org.onap.ccsdk.cds.error.catalog.services
-import org.onap.ccsdk.error.catalog.core.ErrorCatalogException
-import org.onap.ccsdk.error.catalog.core.ErrorPayload
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogException
+import org.onap.ccsdk.cds.error.catalog.core.ErrorPayload
import org.springframework.http.ResponseEntity
import org.springframework.web.bind.annotation.ExceptionHandler
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogLoadService.kt
index b8a649eb0..ca7d72b50 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogLoadService.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogLoadService.kt
@@ -15,14 +15,15 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services
+package org.onap.ccsdk.cds.error.catalog.services
-import org.onap.ccsdk.error.catalog.core.ErrorMessageLibConstants
-import org.onap.ccsdk.error.catalog.core.logger
-import org.onap.ccsdk.error.catalog.services.domain.ErrorMessageModel
+import org.onap.ccsdk.cds.error.catalog.core.ErrorMessageLibConstants
+import org.onap.ccsdk.cds.error.catalog.core.logger
+import org.onap.ccsdk.cds.error.catalog.services.domain.ErrorMessageModel
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.stereotype.Service
+import java.io.File
import java.io.FileNotFoundException
import java.io.IOException
import java.io.InputStream
@@ -99,11 +100,10 @@ open class ErrorCatalogLoadDBService(
havingValue = ErrorMessageLibConstants.ERROR_CATALOG_TYPE_PROPERTIES
)
open class ErrorCatalogLoadPropertyService(private var errorCatalogProperties: ErrorCatalogProperties) :
- ErrorCatalogLoadService {
+ ErrorCatalogLoadService {
private val propertyFileName = ErrorMessageLibConstants.ERROR_CATALOG_PROPERTIES_FILENAME
- private var propertyFileBaseDirectory = Paths.get(errorCatalogProperties.errorDefinitionDir)
- private var propertyFilePath = propertyFileBaseDirectory.resolve(propertyFileName)
+ private lateinit var propertyFile: File
private var log = logger(ErrorCatalogLoadPropertyService::class)
@@ -111,6 +111,8 @@ open class ErrorCatalogLoadPropertyService(private var errorCatalogProperties: E
override suspend fun loadErrorCatalog() {
log.info("Application ID: ${errorCatalogProperties.applicationId} > Initializing error catalog message from properties...")
+ val propertyDir = errorCatalogProperties.errorDefinitionDir ?: ErrorMessageLibConstants.ERROR_CATALOG_PROPERTIES_DIRECTORY
+ propertyFile = Paths.get(propertyDir, propertyFileName).toFile().normalize()
properties = parseErrorMessagesProps()
}
@@ -129,14 +131,14 @@ open class ErrorCatalogLoadPropertyService(private var errorCatalogProperties: E
var inputStream: InputStream? = null
val props = Properties()
try {
- inputStream = propertyFilePath.toFile().inputStream()
+ inputStream = propertyFile.inputStream()
props.load(inputStream)
} catch (e: FileNotFoundException) {
- log.error("Application ID: ${errorCatalogProperties.applicationId} > Property File '$propertyFileName}' " +
+ log.error("Application ID: ${errorCatalogProperties.applicationId} > Property File '$propertyFileName' " +
"not found in the application directory.")
} catch (e: IOException) {
log.error("Application ID: ${errorCatalogProperties.applicationId} > Fail to load property file " +
- "'$propertyFileName}' for message errors.")
+ "'$propertyFileName' for message errors.")
} finally {
inputStream!!.close()
}
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogService.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogService.kt
index e55e552d9..91f817133 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogService.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogService.kt
@@ -15,16 +15,16 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services
+package org.onap.ccsdk.cds.error.catalog.services
import kotlinx.coroutines.runBlocking
-import org.onap.ccsdk.error.catalog.core.ErrorCatalog
-import org.onap.ccsdk.error.catalog.core.ErrorCatalogException
-import org.onap.ccsdk.error.catalog.core.ErrorMessageLibConstants
-import org.onap.ccsdk.error.catalog.core.ErrorPayload
-import org.onap.ccsdk.error.catalog.core.GrpcErrorCodes
-import org.onap.ccsdk.error.catalog.core.HttpErrorCodes
-import org.onap.ccsdk.error.catalog.services.utils.ErrorCatalogUtils
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalog
+import org.onap.ccsdk.cds.error.catalog.core.ErrorCatalogException
+import org.onap.ccsdk.cds.error.catalog.core.ErrorMessageLibConstants
+import org.onap.ccsdk.cds.error.catalog.core.ErrorPayload
+import org.onap.ccsdk.cds.error.catalog.core.GrpcErrorCodes
+import org.onap.ccsdk.cds.error.catalog.core.HttpErrorCodes
+import org.onap.ccsdk.cds.error.catalog.services.utils.ErrorCatalogUtils
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean
import org.springframework.stereotype.Service
import javax.annotation.PostConstruct
@@ -70,11 +70,11 @@ open class ErrorCatalogService(private var errorCatalogLoadService: ErrorCatalog
}
return ErrorCatalog(
- errorCatalogException.name,
- errorCatalogException.domain,
- errorCode,
- action,
- errorCause
+ errorCatalogException.name,
+ errorCatalogException.domain,
+ errorCode,
+ action,
+ errorCause
)
}
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogServiceExtensions.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogServiceExtensions.kt
index 41481623a..bb4a8f15e 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/ErrorCatalogServiceExtensions.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/ErrorCatalogServiceExtensions.kt
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services
+package org.onap.ccsdk.cds.error.catalog.services
-import org.onap.ccsdk.error.catalog.core.ErrorPayload
+import org.onap.ccsdk.cds.error.catalog.core.ErrorPayload
import org.springframework.http.HttpStatus
import org.springframework.http.ResponseEntity
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/domain/Domain.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/domain/Domain.kt
index 50a05b231..7ade1c2a2 100755
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/domain/Domain.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/domain/Domain.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services.domain
+package org.onap.ccsdk.cds.error.catalog.services.domain
import java.io.Serializable
import javax.persistence.CascadeType
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/domain/ErrorMessageModel.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/domain/ErrorMessageModel.kt
index 73e143095..a4e92af48 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/domain/ErrorMessageModel.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/domain/ErrorMessageModel.kt
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services.domain
+package org.onap.ccsdk.cds.error.catalog.services.domain
import java.io.Serializable
import java.util.UUID
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/repository/DomainRepository.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/repository/DomainRepository.kt
index 700340b10..197e385e0 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/repository/DomainRepository.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/repository/DomainRepository.kt
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services.repository
+package org.onap.ccsdk.cds.error.catalog.services.repository
-import org.onap.ccsdk.error.catalog.services.domain.Domain
+import org.onap.ccsdk.cds.error.catalog.services.domain.Domain
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/repository/ErrorMessageModelRepository.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/repository/ErrorMessageModelRepository.kt
index 084474970..4a0f78672 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/repository/ErrorMessageModelRepository.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/repository/ErrorMessageModelRepository.kt
@@ -14,9 +14,9 @@
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services.repository
+package org.onap.ccsdk.cds.error.catalog.services.repository
-import org.onap.ccsdk.error.catalog.services.domain.ErrorMessageModel
+import org.onap.ccsdk.cds.error.catalog.services.domain.ErrorMessageModel
import org.springframework.data.jpa.repository.JpaRepository
import org.springframework.stereotype.Repository
diff --git a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/utils/ErrorCatalogUtils.kt b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/utils/ErrorCatalogUtils.kt
index 673082eed..967d3560c 100644
--- a/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/error/catalog/services/utils/ErrorCatalogUtils.kt
+++ b/ms/error-catalog/services/src/main/kotlin/org/onap/ccsdk/cds/error/catalog/services/utils/ErrorCatalogUtils.kt
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onap.ccsdk.error.catalog.services.utils
+package org.onap.ccsdk.cds.error.catalog.services.utils
object ErrorCatalogUtils {
private const val REGEX_PATTERN = "^cause=(.*),action=(.*)"