1 package org.onap.vid.job.command;
3 import org.onap.vid.changeManagement.RequestDetailsWrapper;
4 import org.onap.vid.job.Job;
5 import org.onap.vid.job.JobAdapter;
6 import org.onap.vid.job.NextCommand;
7 import org.onap.vid.job.command.CommandParentData.CommandDataKey;
8 import org.onap.vid.model.serviceInstantiation.Vnf;
9 import org.onap.vid.mso.model.VnfInstantiationRequestDetails;
10 import org.onap.vid.services.AsyncInstantiationBusinessLogic;
11 import org.springframework.beans.factory.config.ConfigurableBeanFactory;
12 import org.springframework.context.annotation.Scope;
13 import org.springframework.stereotype.Component;
15 import javax.inject.Inject;
18 @Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
19 public class VnfInstantiationCommand extends ResourceInstantiationCommand {
22 private AsyncInstantiationBusinessLogic asyncInstantiationBL;
25 protected String getRequestPath() {
26 return asyncInstantiationBL.getVnfInstantiationPath( commandParentData.getInstanceId(CommandDataKey.SERVICE_INSTANCE_ID));
30 protected RequestDetailsWrapper<VnfInstantiationRequestDetails> generateMSORequest(JobAdapter.AsyncJobRequest request, String userId) {
31 return asyncInstantiationBL.generateVnfInstantiationRequest(
32 (Vnf) getSharedData().getRequest(),
33 commandParentData.getModelInfo(CommandDataKey.SERVICE_MODEL_INFO),
34 commandParentData.getInstanceId(CommandDataKey.SERVICE_INSTANCE_ID),
35 getSharedData().getUserId()
40 protected String getJobAuditMSOStatus() {
41 return "VNF_REQUESTED";
45 protected NextCommand getNextCommand(String requestId, String instanceId) {
46 return new NextCommand(Job.JobStatus.RESOURCE_IN_PROGRESS,
47 new VnfInProgressStatusCommand(getSharedData(), requestId, instanceId, commandParentData));