Merge from ECOMP's repository
[vid.git] / vid-app-common / src / main / java / org / onap / vid / job / command / VfmoduleInstantiationCommand.java
1 package org.onap.vid.job.command;
2
3 import org.onap.vid.changeManagement.RequestDetailsWrapper;
4 import org.onap.vid.job.JobAdapter;
5 import org.onap.vid.job.command.CommandParentData.CommandDataKey;
6 import org.onap.vid.model.serviceInstantiation.VfModule;
7 import org.onap.vid.mso.model.VfModuleInstantiationRequestDetails;
8 import org.onap.vid.services.AsyncInstantiationBusinessLogic;
9 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
10 import org.springframework.context.annotation.Scope;
11 import org.springframework.stereotype.Component;
12
13 import javax.inject.Inject;
14
15 @Component
16 @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
17 public class VfmoduleInstantiationCommand extends ResourceInstantiationCommand {
18     @Inject
19     private AsyncInstantiationBusinessLogic asyncInstantiationBL;
20
21     @Override
22     protected String getRequestPath() {
23         return asyncInstantiationBL.getVfmoduleInstantiationPath(commandParentData.getInstanceId(CommandDataKey.SERVICE_INSTANCE_ID),commandParentData.getInstanceId(CommandDataKey.VNF_INSTANCE_ID));
24     }
25
26     @Override
27     protected RequestDetailsWrapper<VfModuleInstantiationRequestDetails> generateMSORequest(JobAdapter.AsyncJobRequest request, String userId) {
28         return asyncInstantiationBL.generateVfModuleInstantiationRequest(
29                 (VfModule) getSharedData().getRequest(),
30                 commandParentData.getModelInfo(CommandDataKey.SERVICE_MODEL_INFO),
31                 commandParentData.getInstanceId(CommandDataKey.SERVICE_INSTANCE_ID),
32                 commandParentData.getModelInfo(CommandDataKey.VNF_MODEL_INFO),
33                 commandParentData.getInstanceId(CommandDataKey.VNF_INSTANCE_ID),
34                 commandParentData.getInstanceId(CommandDataKey.VG_INSTANCE_ID),
35                  getSharedData().getUserId()
36         );
37     }
38
39     @Override
40     protected String getJobAuditMSOStatus() {
41         return "VF_MODULE_REQUESTED";
42     }
43
44 }