Implant vid-app-common org.onap.vid.job (main and test)
[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.job.Job;
25 import org.onap.vid.job.impl.JobSharedData;
26 import org.onap.vid.model.ServiceInfo;
27 import org.onap.vid.model.serviceInstantiation.ServiceInstantiation;
28 import org.onap.vid.mso.RestObject;
29 import org.onap.vid.mso.rest.AsyncRequestStatus;
30
31 import java.util.Arrays;
32 import java.util.List;
33 import java.util.UUID;
34 import java.util.function.Consumer;
35
36 public interface AsyncInstantiationBusinessLogic {
37
38     List<String> PARAMS_TO_IGNORE = Arrays.asList("vnf_name", "vf_module_name");
39
40     List<ServiceInfo> getAllServicesInfo();
41
42     List<UUID> pushBulkJob(ServiceInstantiation request, String userId);
43
44     boolean isPartOfBulk(UUID jobId);
45
46     String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
47
48     String getServiceDeletionPath(String serviceInstanceId);
49
50     String getVnfInstantiationPath(String serviceInstanceId);
51
52     String getVnfDeletionPath(String serviceInstanceId, String vnfInstanceId);
53
54     String getNetworkInstantiationPath(String serviceInstanceId);
55
56     String getVfmoduleInstantiationPath(String serviceInstanceId, String vnfInstanceId);
57
58     String getVfModuleReplacePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId);
59
60     String getVfModuleDeletePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId);
61
62     String getVolumeGroupInstantiationPath(String serviceInstanceId, String vnfInstanceId);
63
64     String getInstanceGroupInstantiationPath();
65
66     String getInstanceGroupMemberInstantiationPath(String vnfGroupInstanceId);
67
68     String getInstanceGroupDeletePath(String instanceGroupId);
69
70     String getInstanceGroupMemberDeletePath(String vnfGroupInstanceId);
71
72     String getNetworkDeletePath(String serviceInstanceId, String networkInstanceId);
73
74     String getOrchestrationRequestsPath();
75
76     ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
77
78     ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
79
80     Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus);
81
82     void handleFailedInstantiation(UUID jobUUID);
83
84     void deleteJob(UUID jobId);
85
86     void hideServiceInfo(UUID jobUUID);
87
88     int getCounterForName(String name);
89
90     int getMaxRetriesGettingFreeNameFromAai();
91
92     void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
93
94     String getUniqueName(String name, ResourceType resourceType);
95
96     ServiceInstantiation prepareServiceToBeUnique(ServiceInstantiation serviceInstantiation);
97
98     ServiceInstantiation enrichBulkForRetry(ServiceInstantiation serviceInstantiation, UUID jobId);
99
100     List<UUID> retryJob(UUID jobId, String userId);
101
102     List<UUID> retryJob(ServiceInstantiation request, UUID oldJobId, String userId);
103
104     void addResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, String instanceId);
105
106     void addFailedResourceInfo(JobSharedData sharedData, RestObject msoResponse);
107
108     void updateResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, AsyncRequestStatus message);
109
110     ServiceInstantiation getBulkForRetry(UUID jobId);
111
112     String getResumeRequestPath(String requestId);
113 }