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 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;
35 public interface AsyncInstantiationBusinessLogic {
37 List<String> PARAMS_TO_IGNORE = Arrays.asList("vnf_name", "vf_module_name");
39 List<ServiceInfo> getAllServicesInfo();
41 List<UUID> pushBulkJob(ServiceInstantiation request, String userId);
43 boolean isPartOfBulk(UUID jobId);
45 String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
47 String getServiceDeletionPath(String serviceInstanceId);
49 String getVnfInstantiationPath(String serviceInstanceId);
51 String getVnfDeletionPath(String serviceInstanceId, String vnfInstanceId);
53 String getNetworkInstantiationPath(String serviceInstanceId);
55 String getVfmoduleInstantiationPath(String serviceInstanceId, String vnfInstanceId);
57 String getVfModuleReplacePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId);
59 String getVfModuleDeletePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId);
61 String getVolumeGroupInstantiationPath(String serviceInstanceId, String vnfInstanceId);
63 String getInstanceGroupInstantiationPath();
65 String getInstanceGroupMemberInstantiationPath(String vnfGroupInstanceId);
67 String getInstanceGroupDeletePath(String instanceGroupId);
69 String getInstanceGroupMemberDeletePath(String vnfGroupInstanceId);
71 String getNetworkDeletePath(String serviceInstanceId, String networkInstanceId);
73 String getOrchestrationRequestsPath();
75 ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
77 ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
79 Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus);
81 void handleFailedInstantiation(UUID jobUUID);
83 void deleteJob(UUID jobId);
85 void hideServiceInfo(UUID jobUUID);
87 int getCounterForName(String name);
89 int getMaxRetriesGettingFreeNameFromAai();
91 void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
93 String getUniqueName(String name, ResourceType resourceType);
95 ServiceInstantiation prepareServiceToBeUnique(ServiceInstantiation serviceInstantiation);
97 ServiceInstantiation enrichBulkForRetry(ServiceInstantiation serviceInstantiation, UUID jobId);
99 List<UUID> retryJob(UUID jobId, String userId);
101 List<UUID> retryJob(ServiceInstantiation request, UUID oldJobId, String userId);
103 void addResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, String instanceId);
105 void addFailedResourceInfo(JobSharedData sharedData, RestObject msoResponse);
107 void updateResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, AsyncRequestStatus message);
109 ServiceInstantiation getBulkForRetry(UUID jobId);
111 String getResumeRequestPath(String requestId);