603f1386701b16b90fcb528c8112d9b5facae610
[vid.git] / vid-app-common / src / main / java / org / onap / vid / services / AsyncInstantiationBusinessLogic.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * VID
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package org.onap.vid.services;
22
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;
31
32 import java.util.Arrays;
33 import java.util.List;
34 import java.util.Map;
35 import java.util.UUID;
36 import java.util.function.Consumer;
37
38 public interface AsyncInstantiationBusinessLogic {
39
40     List<String> PARAMS_TO_IGNORE = Arrays.asList("vnf_name", "vf_module_name");
41
42     List<ServiceInfo> getAllServicesInfo();
43
44     List<UUID> pushBulkJob(ServiceInstantiation request, String userId);
45
46     RequestDetailsWrapper<ServiceInstantiationRequestDetails> generateMacroServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String optimisticUniqueServiceInstanceName, String userId);
47
48     RequestDetailsWrapper<ServiceInstantiationRequestDetails> generateALaCarteServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String optimisticUniqueServiceInstanceName, String userId);
49
50     RequestDetailsWrapper<ServiceDeletionRequestDetails> generateALaCarteServiceDeletionRequest(UUID uuid, ServiceInstantiation details, String userId);
51
52     RequestDetailsWrapper<VnfInstantiationRequestDetails> generateVnfInstantiationRequest(Vnf vnfDetails, ModelInfo serviceModelInfo, String serviceInstanceId, String userId);
53
54     RequestDetailsWrapper<VfModuleInstantiationRequestDetails> generateVfModuleInstantiationRequest(VfModule vfModuleDetails, ModelInfo serviceModelInfo, String serviceInstanceId, ModelInfo vnfModelInfo, String vnfInstanceId, String vgInstanceId, String userId);
55
56     RequestDetailsWrapper<VolumeGroupRequestDetails> generateVolumeGroupInstantiationRequest(VfModule vfModuleDetails, ModelInfo serviceModelInfo, String serviceInstanceId, ModelInfo vnfModelInfo, String vnfInstanceId, String userId);
57
58     RequestDetailsWrapper<NetworkInstantiationRequestDetails> generateNetworkInstantiationRequest(Network networkDetails, ModelInfo serviceModelInfo, String serviceInstanceId, String userId);
59
60     RequestDetailsWrapper<InstanceGroupInstantiationRequestDetails> generateInstanceGroupInstantiationRequest(InstanceGroup request, ModelInfo serviceModelInfo, String serviceInstanceId, String userId);
61
62     List<Map<String,String>> buildVnfInstanceParams(List<Map<String, String>> currentVnfInstanceParams, List<VfModuleMacro> vfModules);
63
64     String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
65
66     String getServiceDeletionPath(String serviceInstanceId);
67
68     String getVnfInstantiationPath(String serviceInstanceId);
69
70     String getNetworkInstantiationPath(String serviceInstanceId);
71
72     String getVfmoduleInstantiationPath(String serviceInstanceId, String vnfInstanceId);
73
74     String getVolumeGroupInstantiationPath(String serviceInstanceId, String vnfInstanceId);
75
76     String getInstanceGroupInstantiationPath();
77
78     String getInstanceGroupDeletePath(String instanceGroupId);
79
80     String getOrchestrationRequestsPath();
81
82     ServiceInfo getServiceInfoByJobId(UUID jobUUID);
83
84     List<JobAuditStatus> getAuditStatuses(UUID jobUUID, JobAuditStatus.SourceStatus source);
85
86     ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
87
88     ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
89
90     void auditVidStatus(UUID jobUUID, Job.JobStatus jobStatus);
91
92     void auditMsoStatus(UUID jobUUID, AsyncRequestStatus.Request msoRequestStatus);
93
94     void auditMsoStatus(UUID jobUUID, String jobStatus, String requestId, String additionalInfo);
95
96     Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus);
97
98     void handleFailedInstantiation(UUID jobUUID);
99
100     void deleteJob(UUID jobId);
101
102     void hideServiceInfo(UUID jobUUID);
103
104     int getCounterForName(String name);
105
106     int getMaxRetriesGettingFreeNameFromAai();
107
108     void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
109
110     String getUniqueName(String name, ResourceType resourceType);
111
112
113 }