From 397259ecc15404b40e5589203db2637115426170 Mon Sep 17 00:00:00 2001 From: vempo Date: Tue, 16 Jan 2018 17:37:58 +0200 Subject: Removed MDC from two modules Change-Id: Ib1d4df731fa6b6626d49042df9a7bf902940be27 Issue-ID: SDC-772 Signed-off-by: vempo --- .../sdc/vendorlicense/dao/types/ChoiceOrOther.java | 15 ++------------- .../vendorlicense/dao/types/MultiChoiceOrOther.java | 19 +++++-------------- .../SubmitUncompletedLicenseModelErrorBuilder.java | 4 ---- .../VendorLicenseModelNotFoundErrorBuilder.java | 16 +++++----------- 4 files changed, 12 insertions(+), 42 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java index ce39ac62c9..01699355f5 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java @@ -19,14 +19,7 @@ package org.openecomp.sdc.vendorlicense.dao.types; import com.datastax.driver.mapping.annotations.Transient; import com.datastax.driver.mapping.annotations.UDT; import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; @UDT(keyspace = "dox", name = "choice_or_other") public class ChoiceOrOther> { @@ -117,13 +110,9 @@ public class ChoiceOrOther> { try { choice = E.valueOf(enumClass, OTHER_ENUM_VALUE); } catch (IllegalArgumentException ex) { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.VALIDATE_CHOICE_VALUE, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE); throw new CoreException(new ErrorCode.ErrorCodeBuilder() - .withId(CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID) - .withMessage(CHOICE_OR_OTHER_INVALID_ENUM_MSG) - .withCategory(ErrorCategory.APPLICATION).build()); + .withId(CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID) + .withMessage(CHOICE_OR_OTHER_INVALID_ENUM_MSG).build()); } other = result; } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java index 8adfecf44e..01a4cac6b8 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java @@ -20,24 +20,20 @@ import com.datastax.driver.mapping.annotations.Transient; import com.datastax.driver.mapping.annotations.UDT; import org.apache.commons.collections4.CollectionUtils; import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerErrorDescription; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import java.util.HashSet; import java.util.Set; @UDT(keyspace = "dox", name = "multi_choice_or_other") public class MultiChoiceOrOther> { + private static final String MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID = "MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID"; + private static final String MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG = "Enum used as part of MultiChoiceOrOther type must contain the value 'Other'"; + public static final String OTHER_ENUM_VALUE = "Other"; @Transient @@ -137,14 +133,9 @@ public class MultiChoiceOrOther> { try { choices.add(E.valueOf(enumClass, OTHER_ENUM_VALUE)); } catch (IllegalArgumentException ex) { - - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.VALIDATE_CHOICE_VALUE, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE); throw new CoreException(new ErrorCode.ErrorCodeBuilder() - .withId(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID) - .withMessage(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG) - .withCategory(ErrorCategory.APPLICATION).build()); + .withId(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_ERR_ID) + .withMessage(MULTI_CHOICE_OR_OTHER_INVALID_ENUM_MSG).build()); } other = result; } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java index 4cf134c262..1b25421052 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/SubmitUncompletedLicenseModelErrorBuilder.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.vendorlicense.errors; -import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; public class SubmitUncompletedLicenseModelErrorBuilder { @@ -30,12 +29,9 @@ public class SubmitUncompletedLicenseModelErrorBuilder { /** * Instantiates a new Submit uncompleted license model error builder. - * - * @param error */ public SubmitUncompletedLicenseModelErrorBuilder(UncompletedVendorLicenseModelErrorType error) { builder.withId(VendorLicenseErrorCodes.SUBMIT_UNCOMPLETED_LICENSE_MODEL); - builder.withCategory(ErrorCategory.APPLICATION); builder.withMessage(error.getErrorMessage()); } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java index d2dc1d6f00..e3eb27f342 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseModelNotFoundErrorBuilder.java @@ -1,26 +1,21 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ +/* + * 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. - * ============LICENSE_END========================================================= */ package org.openecomp.sdc.vendorlicense.errors; -import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; public class VendorLicenseModelNotFoundErrorBuilder { @@ -36,7 +31,6 @@ public class VendorLicenseModelNotFoundErrorBuilder { */ public VendorLicenseModelNotFoundErrorBuilder(String vendorLicenseModelId) { builder.withId(VendorLicenseErrorCodes.VENDOR_LICENSE_MODEL_NOT_FOUND); - builder.withCategory(ErrorCategory.APPLICATION); builder.withMessage(String.format(VENDOR_LICENSE_MODEL_NOT_FOUND_MSG, vendorLicenseModelId)); } -- cgit 1.2.3-korg