2 * Copyright © 2021 Aarna Networks, Inc.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit
19 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
20 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
21 import org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit.db.BlueprintAuditStatusRepository
22 import org.onap.ccsdk.cds.blueprintsprocessor.functions.workflow.audit.db.BlueprintWorkflowAuditStatus
23 import org.slf4j.LoggerFactory
24 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
25 import org.springframework.stereotype.Service
26 import javax.annotation.PostConstruct
29 * Workflow request and response details are persisted to database
31 @ConditionalOnProperty(
32 name = ["blueprintsprocessor.workflow.self-service-api.audit.storeEnable"],
36 class NoStoreAuditService(
37 private val blueprintAuditStatusRepository: BlueprintAuditStatusRepository
38 ) : StoreAuditService {
41 LoggerFactory.getLogger(NoStoreAuditService::class.toString())
45 log.info("Workflow Audit store is disabled")
48 * store the blueprint workflow input details to database
49 * @param executionServiceInput {@link ExecutionServiceInput}
50 * @throws {@link BluePrintException}
52 override suspend fun storeExecutionInput(
53 executionServiceInput: ExecutionServiceInput
56 "storeExecutionInput called not to store the Workflow action " +
59 val resturnId: Long = -1
64 * store the blueprint workflow output to database
66 * @param correlationUUID
67 * @param executionServiceOutput {@link ExecutionServiceOutput}
68 * @throws {@link BluePrintException}
70 override suspend fun storeExecutionOutput(
72 correlationUUID: String,
73 executionServiceOutput: ExecutionServiceOutput
76 "storeExecutionOutput called not to store the Workflow action " +
77 "output details correlationUUID $correlationUUID " +
78 "auditStoreId $auditStoreId"
83 * retrive workflow records based on request ID
85 * @return list of {@link BlueprintWorkflowAuditStatus}
87 override suspend fun getWorkflowStatusByRequestId(
89 ): List<BlueprintWorkflowAuditStatus> {
91 "getWorkflowStatusByRequestId placeholer , this doesn't return " +
95 var results: List<BlueprintWorkflowAuditStatus> = ArrayList<BlueprintWorkflowAuditStatus>()
100 * Retrive workflow records based on request ID and sub request ID
102 * @param subRequestId
103 * @return list of {@link BlueprintWorkflowAuditStatus}
105 override suspend fun getWorkflowStatusByRequestIdAndSubRequestId(
108 ): List<BlueprintWorkflowAuditStatus> {
110 "getWorkflowStatusByRequestIdAndSubRequestId placeholer , this doesn't return " +
114 var results: List<BlueprintWorkflowAuditStatus> = ArrayList<BlueprintWorkflowAuditStatus>()