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
index 90eb0d2..1202fc9 100644 (file)
@@ -1,12 +1,31 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * 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.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
 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.ServiceInstantiation;
-import org.onap.vid.mso.model.ServiceInstantiationRequestDetails;
+import org.onap.vid.mso.RestObject;
 import org.onap.vid.mso.rest.AsyncRequestStatus;
 
 import java.util.Arrays;
@@ -22,25 +41,41 @@ public interface AsyncInstantiationBusinessLogic {
 
     List<UUID> pushBulkJob(ServiceInstantiation request, String userId);
 
-    RequestDetailsWrapper<ServiceInstantiationRequestDetails> generateServiceInstantiationRequest(UUID uuid, ServiceInstantiation details, String userId);
+    boolean isPartOfBulk(UUID jobId);
 
     String getServiceInstantiationPath(ServiceInstantiation serviceInstantiationRequest);
 
-    String getOrchestrationRequestsPath();
+    String getServiceDeletionPath(String serviceInstanceId);
 
-    ServiceInfo getServiceInfoByJobId(UUID jobUUID);
+    String getVnfInstantiationPath(String serviceInstanceId);
 
-    List<JobAuditStatus> getAuditStatuses(UUID jobUUID, JobAuditStatus.SourceStatus source);
+    String getVnfDeletionPath(String serviceInstanceId, String vnfInstanceId);
 
-    ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
+    String getNetworkInstantiationPath(String serviceInstanceId);
 
-    ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
+    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 getInstanceGroupMemberDeletePath(String vnfGroupInstanceId);
+
+    String getNetworkDeletePath(String serviceInstanceId, String networkInstanceId);
 
-    void auditVidStatus(UUID jobUUID, Job.JobStatus jobStatus);
+    String getOrchestrationRequestsPath();
 
-    void auditMsoStatus(UUID jobUUID, AsyncRequestStatus.Request msoRequestStatus);
+    ServiceInfo updateServiceInfo(UUID jobUUID, Consumer<ServiceInfo> serviceUpdater);
 
-    void auditMsoStatus(UUID jobUUID, String jobStatus, String requestId, String additionalInfo);
+    ServiceInfo updateServiceInfoAndAuditStatus(UUID jobUuid, Job.JobStatus jobStatus);
 
     Job.JobStatus calcStatus(AsyncRequestStatus asyncRequestStatus);
 
@@ -57,4 +92,22 @@ public interface AsyncInstantiationBusinessLogic {
     void setMaxRetriesGettingFreeNameFromAai(int maxRetriesGettingFreeNameFromAai);
 
     String getUniqueName(String name, ResourceType resourceType);
+
+    ServiceInstantiation prepareServiceToBeUnique(ServiceInstantiation serviceInstantiation);
+
+    ServiceInstantiation enrichBulkForRetry(ServiceInstantiation serviceInstantiation, UUID jobId);
+
+    List<UUID> retryJob(UUID jobId, String userId);
+
+    List<UUID> 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);
 }