aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl
diff options
context:
space:
mode:
authormojahidi <mojahidul.islam@amdocs.com>2017-12-22 10:54:34 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2017-12-24 14:42:13 +0000
commitbc7d6b9adf24397f459e4090ac55d7de1b4f1eb5 (patch)
treee8407ccfd68330d413d7ad7921e3ab307af2ad98 /openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl
parentcf88f63a15e4cd7a66431b360269daa09c05ce9b (diff)
Fixed sonar issues - NeutronPortResourceValidator
Fixed all sonar issues Change-Id: I15953126b263c5746551f024f5ff34ae5848eba8 Issue-ID: SDC-343 Signed-off-by: mojahidi <mojahidul.islam@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl')
-rw-r--r--openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java39
1 files changed, 26 insertions, 13 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java
index f0e7ceccd3..befbe3bb97 100644
--- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java
+++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NeutronPortResourceValidator.java
@@ -1,3 +1,19 @@
+/*
+ * Copyright © 2016-2017 European Support Limited
+ *
+ * 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.openecomp.sdc.validation.impl.validators.heatresource;
import org.apache.commons.collections4.CollectionUtils;
@@ -25,21 +41,18 @@ import java.util.Map;
import java.util.Objects;
import java.util.Set;
-/**
- * Created by TALIO on 2/22/2017.
- */
public class NeutronPortResourceValidator implements ResourceValidator {
- private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage();
- private static ErrorMessageCode ERROR_HPRODE_HPR1 = new ErrorMessageCode("HPR1");
- private static ErrorMessageCode ERROR_HPRODE_HPR2 = new ErrorMessageCode("HPR2");
- private static ErrorMessageCode ERROR_HPRODE_HPR3 = new ErrorMessageCode("HPR3");
+ private static final MdcDataDebugMessage MDC_DATA_DEBUG_MESSAGE = new MdcDataDebugMessage();
+ private static final ErrorMessageCode ERROR_HPRODE_HPR1 = new ErrorMessageCode("HPR1");
+ private static final ErrorMessageCode ERROR_HPRODE_HPR2 = new ErrorMessageCode("HPR2");
+ private static final ErrorMessageCode ERROR_HPRODE_HPR3 = new ErrorMessageCode("HPR3");
@Override
public void validate(String fileName, Map.Entry<String, Resource> resourceEntry,
GlobalValidationContext globalContext, ValidationContext validationContext) {
- validateNovaServerPortBinding
- (fileName, resourceEntry, (HeatResourceValidationContext) validationContext, globalContext);
+ validateNovaServerPortBinding(fileName,
+ resourceEntry, (HeatResourceValidationContext) validationContext, globalContext);
}
@@ -49,7 +62,7 @@ public class NeutronPortResourceValidator implements ResourceValidator {
HeatResourceValidationContext heatResourceValidationContext,
GlobalValidationContext globalContext) {
- mdcDataDebugMessage.debugEntryMessage("file", fileName);
+ MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", fileName);
Map<String, Map<String, List<String>>> portIdToPointingResources =
heatResourceValidationContext.getFileLevelResourceDependencies()
@@ -73,7 +86,7 @@ public class NeutronPortResourceValidator implements ResourceValidator {
checkPortBindingFromMap(
fileName, portResourceId, pointingResourcesToCurrPort, globalContext);
- mdcDataDebugMessage.debugExitMessage("file", fileName);
+ MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", fileName);
}
private static void checkPortBindingFromMap(String fileName,
@@ -131,7 +144,7 @@ public class NeutronPortResourceValidator implements ResourceValidator {
List<String> securityGroupResourceNameList,
GlobalValidationContext globalContext) {
- mdcDataDebugMessage.debugEntryMessage("file", filename);
+ MDC_DATA_DEBUG_MESSAGE.debugEntryMessage("file", filename);
Map<String, Object> propertiesMap = resourceEntry.getValue().getProperties();
@@ -155,7 +168,7 @@ public class NeutronPortResourceValidator implements ResourceValidator {
}
}
- mdcDataDebugMessage.debugExitMessage("file", filename);
+ MDC_DATA_DEBUG_MESSAGE.debugExitMessage("file", filename);
}
private static void removeSecurityGroupNamesFromListByGivenFunction(String filename,