Introduce FeatureManager to ResourceCommand
[vid.git] / vid-app-common / src / main / java / org / onap / vid / job / command / RootServiceCommand.kt
index 875de66..d13ecd7 100644 (file)
@@ -13,6 +13,7 @@ import org.onap.vid.services.AsyncInstantiationBusinessLogic
 import org.onap.vid.services.AuditService
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.http.HttpMethod
+import org.togglz.core.manager.FeatureManager
 import java.util.*
 
 abstract class RootServiceCommand @Autowired constructor(
@@ -24,9 +25,10 @@ abstract class RootServiceCommand @Autowired constructor(
         jobAdapter: JobAdapter,
         private val asyncInstantiationBL: AsyncInstantiationBusinessLogic,
         private val auditService: AuditService,
-        private val msoRequestBuilder: MsoRequestBuilder
+        private val msoRequestBuilder: MsoRequestBuilder,
+        featureManager: FeatureManager
 ) : ResourceCommand(restMso, inProgressStatusService, msoResultHandlerService,
-        watchChildrenJobsBL, jobsBrokerService, jobAdapter), JobCommand {
+        watchChildrenJobsBL, jobsBrokerService, jobAdapter, featureManager), JobCommand {
 
     lateinit var optimisticUniqueServiceInstanceName: String
 
@@ -71,13 +73,13 @@ abstract class RootServiceCommand @Autowired constructor(
         try {
             val requests = auditService.retrieveRequestsFromMsoByServiceIdAndRequestTypeAndScope(serviceInstanceId, requestType, scope)
             if (requests.isEmpty() || requests[0].requestId == null) {
-                LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to retrieve requestId with type: $type, scope: $scope for service instanceId $serviceInstanceId ")
+                LOGGER.error("Failed to retrieve requestId with type: $type, scope: $scope for service instanceId $serviceInstanceId ")
                 return Job.JobStatus.FAILED
             }
             val createMyselfCommand = planResumeMyselfRestCall(requests[0].requestId, sharedData.userId)
             return executeAndHandleMsoInstanceRequest(createMyselfCommand)
         } catch (exception: Exception) {
-            LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to resume instanceId $serviceInstanceId ", exception)
+            LOGGER.error("Failed to resume instanceId $serviceInstanceId ", exception)
             return Job.JobStatus.FAILED
         }
     }