X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fakraino%2Fvalidation%2Fui%2Fservice%2FDbAdapter.java;h=65154e0a9df0174a7ca6089faa1a545cc5932b4c;hb=c4f35d65a835e53a7847524eea61cb172a2433f5;hp=56eada68c10388216ae67a48743e380b625e14c7;hpb=3ff5d7028b19a649f6b80c476ff45ced1fdd67dc;p=validation.git diff --git a/ui/src/main/java/org/akraino/validation/ui/service/DbAdapter.java b/ui/src/main/java/org/akraino/validation/ui/service/DbAdapter.java index 56eada6..65154e0 100644 --- a/ui/src/main/java/org/akraino/validation/ui/service/DbAdapter.java +++ b/ui/src/main/java/org/akraino/validation/ui/service/DbAdapter.java @@ -1,3 +1,19 @@ +/* + * Copyright (c) 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. + */ + package org.akraino.validation.ui.service; import java.io.IOException; @@ -204,7 +220,7 @@ public class DbAdapter { public List readResultFromDb(String blueprintName, String version, String lab, List layers, Boolean allLayers, Boolean optional, Boolean outcome) - throws JsonParseException, JsonMappingException, IOException { + throws JsonParseException, JsonMappingException, IOException { synchronized (LOCK) { LabInfo actualLabInfo = null; if (lab != null) { @@ -609,8 +625,8 @@ public class DbAdapter { .equals(vNexusResult.getBlueprintInstance().getBlueprint().getBlueprintName())) { LOGGER.error(EELFLoggerDelegate.errorLogger, "Nexus has different data for blueprint : " + blueprint.getBlueprintName() - + ". Name inconsistency : " + blueprint.getBlueprintName() + " " - + vNexusResult.getBlueprintInstance().getBlueprint().getBlueprintName()); + + ". Name inconsistency : " + blueprint.getBlueprintName() + " " + + vNexusResult.getBlueprintInstance().getBlueprint().getBlueprintName()); return false; } } @@ -618,8 +634,8 @@ public class DbAdapter { if (!bluInst.getVersion().equals(vNexusResult.getBlueprintInstance().getVersion())) { LOGGER.error(EELFLoggerDelegate.errorLogger, "Nexus has different data for blueprint : " + bluInst.getBlueprint().getBlueprintName() - + ", version: " + bluInst.getVersion() + ". Version inconsistency : " - + bluInst.getVersion() + " " + vNexusResult.getBlueprintInstance().getVersion()); + + ", version: " + bluInst.getVersion() + ". Version inconsistency : " + + bluInst.getVersion() + " " + vNexusResult.getBlueprintInstance().getVersion()); return false; } } @@ -663,7 +679,7 @@ public class DbAdapter { if (vDbTimestamp.equals(vDbSubmission) || (vDbTimestamp.getSubmission() != null && !jnksJobNotify.getSubmissionId().equals(vDbTimestamp.getSubmission().getSubmissionId()))) { LOGGER.error(EELFLoggerDelegate.errorLogger, "Received same timestamp: " + jnksJobNotify.getTimestamp() - + " from nexus for submission id: " + jnksJobNotify.getSubmissionId()); + + " from nexus for submission id: " + jnksJobNotify.getSubmissionId()); return false; } if (!vDbSubmission.getAllLayers()) { @@ -691,7 +707,7 @@ public class DbAdapter { if (!vDbSubmission.getBlueprintInstance().getBlueprint().getBlueprintName() .equals(vDbTimestamp.getBlueprintInstance().getBlueprint().getBlueprintName()) || !vDbSubmission.getBlueprintInstance().getVersion() - .equals(vDbTimestamp.getBlueprintInstance().getVersion()) + .equals(vDbTimestamp.getBlueprintInstance().getVersion()) || !compareLabInfos(vDbSubmission.getLab(), vDbTimestamp.getLab())) { LOGGER.error(EELFLoggerDelegate.errorLogger, "No consistency exists in database records."); return false;