From e601bbdc43bae9a08e2e10c5139a6f76b47860d7 Mon Sep 17 00:00:00 2001 From: Einat Vinouze Date: Tue, 16 Jul 2019 17:17:36 +0300 Subject: Implant vid-app-common org.onap.vid.job (main and test) Issue-ID: VID-378 Change-Id: I41b0bdc2c4e3635f3f3319b1cd63cefc61912dfc Signed-off-by: Einat Vinouze Signed-off-by: Ittay Stern --- .../services/AsyncInstantiationBusinessLogic.java | 66 +++++++++++----------- 1 file changed, 33 insertions(+), 33 deletions(-) (limited to 'vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogic.java') diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogic.java b/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogic.java index 603f13867..1202fc9e3 100644 --- a/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogic.java +++ b/vid-app-common/src/main/java/org/onap/vid/services/AsyncInstantiationBusinessLogic.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,17 +21,15 @@ package org.onap.vid.services; import org.onap.vid.aai.model.ResourceType; -import org.onap.vid.changeManagement.RequestDetailsWrapper; import org.onap.vid.job.Job; -import org.onap.vid.model.JobAuditStatus; +import org.onap.vid.job.impl.JobSharedData; import org.onap.vid.model.ServiceInfo; -import org.onap.vid.model.serviceInstantiation.*; -import org.onap.vid.mso.model.*; +import org.onap.vid.model.serviceInstantiation.ServiceInstantiation; +import org.onap.vid.mso.RestObject; import org.onap.vid.mso.rest.AsyncRequestStatus; import java.util.Arrays; import java.util.List; -import java.util.Map; import java.util.UUID; import java.util.function.Consumer; @@ -43,23 +41,7 @@ public interface AsyncInstantiationBusinessLogic { List pushBulkJob(ServiceInstantiation request, String userId); - RequestDetailsWrapper generateMacroServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String optimisticUniqueServiceInstanceName, String userId); - - RequestDetailsWrapper generateALaCarteServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String optimisticUniqueServiceInstanceName, String userId); - - RequestDetailsWrapper generateALaCarteServiceDeletionRequest(UUID uuid, ServiceInstantiation details, String userId); - - RequestDetailsWrapper generateVnfInstantiationRequest(Vnf vnfDetails, ModelInfo serviceModelInfo, String serviceInstanceId, String userId); - - RequestDetailsWrapper generateVfModuleInstantiationRequest(VfModule vfModuleDetails, ModelInfo serviceModelInfo, String serviceInstanceId, ModelInfo vnfModelInfo, String vnfInstanceId, String vgInstanceId, String userId); - - RequestDetailsWrapper generateVolumeGroupInstantiationRequest(VfModule vfModuleDetails, ModelInfo serviceModelInfo, String serviceInstanceId, ModelInfo vnfModelInfo, String vnfInstanceId, String userId); - - RequestDetailsWrapper generateNetworkInstantiationRequest(Network networkDetails, ModelInfo serviceModelInfo, String serviceInstanceId, String userId); - - RequestDetailsWrapper generateInstanceGroupInstantiationRequest(InstanceGroup request, ModelInfo serviceModelInfo, String serviceInstanceId, String userId); - - List> buildVnfInstanceParams(List> currentVnfInstanceParams, List vfModules); + boolean isPartOfBulk(UUID jobId); String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest); @@ -67,32 +49,34 @@ public interface AsyncInstantiationBusinessLogic { String getVnfInstantiationPath(String serviceInstanceId); + String getVnfDeletionPath(String serviceInstanceId, String vnfInstanceId); + String getNetworkInstantiationPath(String serviceInstanceId); String getVfmoduleInstantiationPath(String serviceInstanceId, String vnfInstanceId); + String getVfModuleReplacePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId); + + String getVfModuleDeletePath(String serviceInstanceId, String vnfInstanceId, String vfModuleInstanceId); + String getVolumeGroupInstantiationPath(String serviceInstanceId, String vnfInstanceId); String getInstanceGroupInstantiationPath(); + String getInstanceGroupMemberInstantiationPath(String vnfGroupInstanceId); + String getInstanceGroupDeletePath(String instanceGroupId); - String getOrchestrationRequestsPath(); + String getInstanceGroupMemberDeletePath(String vnfGroupInstanceId); - ServiceInfo getServiceInfoByJobId(UUID jobUUID); + String getNetworkDeletePath(String serviceInstanceId, String networkInstanceId); - List getAuditStatuses(UUID jobUUID, JobAuditStatus.SourceStatus source); + String getOrchestrationRequestsPath(); ServiceInfo updateServiceInfo(UUID jobUUID, Consumer serviceUpdater); ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus); - void auditVidStatus(UUID jobUUID, Job.JobStatus jobStatus); - - void auditMsoStatus(UUID jobUUID, AsyncRequestStatus.Request msoRequestStatus); - - void auditMsoStatus(UUID jobUUID, String jobStatus, String requestId, String additionalInfo); - Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus); void handleFailedInstantiation(UUID jobUUID); @@ -109,5 +93,21 @@ public interface AsyncInstantiationBusinessLogic { String getUniqueName(String name, ResourceType resourceType); + ServiceInstantiation prepareServiceToBeUnique(ServiceInstantiation serviceInstantiation); + + ServiceInstantiation enrichBulkForRetry(ServiceInstantiation serviceInstantiation, UUID jobId); + + List retryJob(UUID jobId, String userId); + + List retryJob(ServiceInstantiation request, UUID oldJobId, String userId); + + void addResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, String instanceId); + + void addFailedResourceInfo(JobSharedData sharedData, RestObject msoResponse); + + void updateResourceInfo(JobSharedData sharedData, Job.JobStatus jobStatus, AsyncRequestStatus message); + + ServiceInstantiation getBulkForRetry(UUID jobId); + String getResumeRequestPath(String requestId); } -- cgit 1.2.3-korg