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.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;
31 import java.util.Arrays;
32 import java.util.List;
33 import java.util.UUID;
34 import java.util.function.Consumer;
36 public interface AsyncInstantiationBusinessLogic {
38 List<String> PARAMS_TO_IGNORE = Arrays.asList("vnf_name", "vf_module_name");
40 List<ServiceInfo> getAllServicesInfo();
42 List<UUID> pushBulkJob(ServiceInstantiation request, String userId);
44 boolean isPartOfBulk(UUID jobId);
46 String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
48 String getServiceDeletionPath(String serviceInstanceId);
50 String getVnfInstantiationPath(String serviceInstanceId);
52 String getVnfDeletionPath(String serviceInstanceId, String vnfInstanceId);
54 String getNetworkInstantiationPath(String serviceInstanceId);
56 String getVfmoduleInstantiationPath(String serviceInstanceId, String vnfInstanceId);
58 String getVfModuleReplacePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId);
60 String getVfModuleDeletePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId);
62 String getVolumeGroupInstantiationPath(String serviceInstanceId, String vnfInstanceId);
64 String getInstanceGroupInstantiationPath();
66 String getInstanceGroupMemberInstantiationPath(String vnfGroupInstanceId);
68 String getInstanceGroupDeletePath(String instanceGroupId);
70 String getInstanceGroupMemberDeletePath(String vnfGroupInstanceId);
72 String getNetworkDeletePath(String serviceInstanceId, String networkInstanceId);
74 String getOrchestrationRequestsPath();
76 ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
78 ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
80 Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus);
82 void handleFailedInstantiation(UUID jobUUID);
84 void deleteJob(UUID jobId);
86 void hideServiceInfo(UUID jobUUID);
88 int getCounterForName(String name);
90 int getMaxRetriesGettingFreeNameFromAai();
92 void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
94 String getUniqueName(String name, ResourceType resourceType);
96 ServiceInstantiation prepareServiceToBeUnique(ServiceInstantiation serviceInstantiation);
98 ServiceInstantiation enrichBulkForRetry(ServiceInstantiation serviceInstantiation, UUID jobId);
100 List<UUID> retryJob(UUID jobId, String userId);
102 List<UUID> retryJob(ServiceInstantiation request, UUID oldJobId, String userId);
104 void addResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, String instanceId);
106 void addFailedResourceInfo(JobSharedData sharedData, RestObject msoResponse);
108 void updateResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, AsyncRequestStatus message);
110 ServiceInstantiation getBulkForRetry(UUID jobId);
112 String getResumeRequestPath(String requestId);