6ad73d88a5b9226db5d5a81543a4311aee6809ab
[ccsdk/cds.git] / ms / blueprintsprocessor / modules / inbounds / selfservice-api / src / main / kotlin / org / onap / ccsdk / cds / blueprintsprocessor / selfservice / api / NoPublishAuditService.kt
1 /*
2  * Copyright © 2020 Bell Canada
3  *
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
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16 package org.onap.ccsdk.cds.blueprintsprocessor.selfservice.api
17
18 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceInput
19 import org.onap.ccsdk.cds.blueprintsprocessor.core.api.data.ExecutionServiceOutput
20 import org.onap.ccsdk.cds.controllerblueprints.core.logger
21 import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
22 import org.springframework.stereotype.Service
23 import javax.annotation.PostConstruct
24
25 /**
26  * Default audit service when no audit publisher is defined, message aren't sent
27  */
28 @ConditionalOnProperty(
29         name = ["blueprintsprocessor.messageproducer.self-service-api.audit.kafkaEnable"],
30         havingValue = "false"
31 )
32 @Service
33 class NoPublishAuditService : PublishAuditService {
34
35     val log = logger(NoPublishAuditService::class)
36
37     @PostConstruct
38     fun init() {
39         log.info("Audit service is disabled")
40     }
41
42     override suspend fun publishExecutionInput(executionServiceInput: ExecutionServiceInput) {
43     }
44
45     override suspend fun publishExecutionOutput(correlationUUID: String, executionServiceOutput: ExecutionServiceOutput) {
46     }
47 }