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