2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.onap.vid.services;
23 import org.onap.vid.aai.model.ResourceType;
24 import org.onap.vid.changeManagement.RequestDetailsWrapper;
25 import org.onap.vid.job.Job;
26 import org.onap.vid.model.JobAuditStatus;
27 import org.onap.vid.model.ServiceInfo;
28 import org.onap.vid.model.serviceInstantiation.*;
29 import org.onap.vid.mso.model.*;
30 import org.onap.vid.mso.rest.AsyncRequestStatus;
32 import java.util.Arrays;
33 import java.util.List;
35 import java.util.UUID;
36 import java.util.function.Consumer;
38 public interface AsyncInstantiationBusinessLogic {
40 List<String> PARAMS_TO_IGNORE = Arrays.asList("vnf_name", "vf_module_name");
42 List<ServiceInfo> getAllServicesInfo();
44 List<UUID> pushBulkJob(ServiceInstantiation request, String userId);
46 RequestDetailsWrapper<ServiceInstantiationRequestDetails> generateMacroServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String optimisticUniqueServiceInstanceName, String userId);
48 RequestDetailsWrapper<ServiceInstantiationRequestDetails> generateALaCarteServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String optimisticUniqueServiceInstanceName, String userId);
50 RequestDetailsWrapper<ServiceDeletionRequestDetails> generateALaCarteServiceDeletionRequest(UUID uuid, ServiceInstantiation details, String userId);
52 RequestDetailsWrapper<VnfInstantiationRequestDetails> generateVnfInstantiationRequest(Vnf vnfDetails, ModelInfo serviceModelInfo, String serviceInstanceId, String userId);
54 RequestDetailsWrapper<VfModuleInstantiationRequestDetails> generateVfModuleInstantiationRequest(VfModule vfModuleDetails, ModelInfo serviceModelInfo, String serviceInstanceId, ModelInfo vnfModelInfo, String vnfInstanceId, String vgInstanceId, String userId);
56 RequestDetailsWrapper<VolumeGroupRequestDetails> generateVolumeGroupInstantiationRequest(VfModule vfModuleDetails, ModelInfo serviceModelInfo, String serviceInstanceId, ModelInfo vnfModelInfo, String vnfInstanceId, String userId);
58 RequestDetailsWrapper<NetworkInstantiationRequestDetails> generateNetworkInstantiationRequest(Network networkDetails, ModelInfo serviceModelInfo, String serviceInstanceId, String userId);
60 RequestDetailsWrapper<InstanceGroupInstantiationRequestDetails> generateInstanceGroupInstantiationRequest(InstanceGroup request, ModelInfo serviceModelInfo, String serviceInstanceId, String userId);
62 List<Map<String,String>> buildVnfInstanceParams(List<Map<String, String>> currentVnfInstanceParams, List<VfModuleMacro> vfModules);
64 String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
66 String getServiceDeletionPath(String serviceInstanceId);
68 String getVnfInstantiationPath(String serviceInstanceId);
70 String getNetworkInstantiationPath(String serviceInstanceId);
72 String getVfmoduleInstantiationPath(String serviceInstanceId, String vnfInstanceId);
74 String getVolumeGroupInstantiationPath(String serviceInstanceId, String vnfInstanceId);
76 String getInstanceGroupInstantiationPath();
78 String getInstanceGroupDeletePath(String instanceGroupId);
80 String getOrchestrationRequestsPath();
82 ServiceInfo getServiceInfoByJobId(UUID jobUUID);
84 List<JobAuditStatus> getAuditStatuses(UUID jobUUID, JobAuditStatus.SourceStatus source);
86 ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
88 ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
90 void auditVidStatus(UUID jobUUID, Job.JobStatus jobStatus);
92 void auditMsoStatus(UUID jobUUID, AsyncRequestStatus.Request msoRequestStatus);
94 void auditMsoStatus(UUID jobUUID, String jobStatus, String requestId, String additionalInfo);
96 Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus);
98 void handleFailedInstantiation(UUID jobUUID);
100 void deleteJob(UUID jobId);
102 void hideServiceInfo(UUID jobUUID);
104 int getCounterForName(String name);
106 int getMaxRetriesGettingFreeNameFromAai();
108 void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
110 String getUniqueName(String name, ResourceType resourceType);