diff options
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors')
7 files changed, 81 insertions, 109 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/InvalidDateErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/InvalidDateErrorBuilder.java index e1857532a8..9aeef8b470 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/InvalidDateErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/InvalidDateErrorBuilder.java @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorlicense.errors; import org.openecomp.sdc.common.errors.ErrorCategory; @@ -25,19 +24,16 @@ import org.openecomp.sdc.common.errors.ErrorCode; public class InvalidDateErrorBuilder { - private static final String DATE_RANGE_INVALID = "Vendor license model with id %s has invalid " + - "date range."; - - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - - public InvalidDateErrorBuilder(String vendorLicenseModelId){ - builder.withId(VendorLicenseErrorCodes.DATE_RANGE_INVALID); - builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage(String.format(DATE_RANGE_INVALID, vendorLicenseModelId)); - } + private static final String DATE_RANGE_INVALID = "Vendor license model with id %s has invalid " + "date range."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - public ErrorCode build() { - return builder.build(); - } + public InvalidDateErrorBuilder(String vendorLicenseModelId) { + builder.withId(VendorLicenseErrorCodes.DATE_RANGE_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(DATE_RANGE_INVALID, vendorLicenseModelId)); + } + public ErrorCode build() { + return builder.build(); + } } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java index a11092bbe3..6164d5eb5a 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/JsonErrorBuilder.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. @@ -17,7 +17,6 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorlicense.errors; import org.openecomp.sdc.common.errors.ErrorCategory; @@ -25,27 +24,22 @@ import org.openecomp.sdc.common.errors.ErrorCode; public class JsonErrorBuilder { - private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID = - "JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID"; - private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG = - "Json error occured during artifact generation:%s."; - - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - - /** - * Instantiates a new Json error builder. - * - * @param exceptionMessage the exception message - */ - public JsonErrorBuilder(String exceptionMessage) { - builder.withId(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID); - builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage( - String.format(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG, exceptionMessage)); - } - - public ErrorCode build() { - return builder.build(); - } - + private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID = "JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID"; + private static final String JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG = "Json error occured during artifact generation:%s."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Json error builder. + * + * @param exceptionMessage the exception message + */ + public JsonErrorBuilder(String exceptionMessage) { + builder.withId(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(JSON_ERROR_OCCURED_DURING_ARTIFACT_GENERATION_ERR_ID_MSG, exceptionMessage)); + } + + public ErrorCode build() { + return builder.build(); + } } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java index dfc9a93751..0a9839a0e4 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/LicensingDataInvalidErrorBuilder.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. @@ -17,33 +17,30 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorlicense.errors; +import java.util.List; import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; -import java.util.List; - public class LicensingDataInvalidErrorBuilder { - private static final String LICENSING_DATA_INVALID_MSG = "Invalid licensing data: %s"; - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - /** - * Instantiates a new Licensing data invalid error builder. - * - * @param licensingDataErrors the licensing data errors - */ - public LicensingDataInvalidErrorBuilder(List<String> licensingDataErrors) { - builder.withId(VendorLicenseErrorCodes.LICENSING_DATA_INVALID); - builder.withCategory(ErrorCategory.APPLICATION); - builder.withMessage(String.format(LICENSING_DATA_INVALID_MSG, - CommonMethods.listToSeparatedString(licensingDataErrors, ','))); - } + private static final String LICENSING_DATA_INVALID_MSG = "Invalid licensing data: %s"; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - public ErrorCode build() { - return builder.build(); - } + /** + * Instantiates a new Licensing data invalid error builder. + * + * @param licensingDataErrors the licensing data errors + */ + public LicensingDataInvalidErrorBuilder(List<String> licensingDataErrors) { + builder.withId(VendorLicenseErrorCodes.LICENSING_DATA_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(LICENSING_DATA_INVALID_MSG, CommonMethods.listToSeparatedString(licensingDataErrors, ','))); + } + public ErrorCode build() { + return builder.build(); + } } 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 1b25421052..1686078911 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 @@ -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. @@ -17,14 +17,12 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorlicense.errors; import org.openecomp.sdc.common.errors.ErrorCode; public class SubmitUncompletedLicenseModelErrorBuilder { - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); /** @@ -38,6 +36,4 @@ public class SubmitUncompletedLicenseModelErrorBuilder { public ErrorCode build() { return builder.build(); } - - } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/UncompletedVendorLicenseModelErrorType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/UncompletedVendorLicenseModelErrorType.java index fa35553ecc..cfc1997413 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/UncompletedVendorLicenseModelErrorType.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/UncompletedVendorLicenseModelErrorType.java @@ -23,16 +23,14 @@ package org.openecomp.sdc.vendorlicense.errors; * Created by ayalaben on 5/8/2017 */ public enum UncompletedVendorLicenseModelErrorType { - + // @formatter:off SUBMIT_UNCOMPLETED_VLM_MSG_MISSING_LA("Uncompleted vendor license model - cannot be submitted. \n" - + "It must contain a license agreement(s)."), - + + "It must contain a license agreement(s)."), SUBMIT_UNCOMPLETED_VLM_MSG_LA_MISSING_FG("Uncompleted vendor license model - cannot be submitted. \n" - + "The license agreement(s) must contain at least one feature group."), - + + "The license agreement(s) must contain at least one feature group."), SUBMIT_UNCOMPLETED_VLM_MSG_FG_MISSING_EP("Uncompleted vendor license model - cannot be submitted. \n" + "The feature group(s) must contain at least one entitlement pool."); - + // @formatter:on private String errorMessage; @@ -44,4 +42,3 @@ public enum UncompletedVendorLicenseModelErrorType { return errorMessage; } } - diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java index e8c252f7be..62ea84b48b 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/errors/VendorLicenseErrorCodes.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. @@ -17,21 +17,17 @@ * limitations under the License. * ============LICENSE_END========================================================= */ - package org.openecomp.sdc.vendorlicense.errors; - public class VendorLicenseErrorCodes { - public static final String VENDOR_LICENSE_MODEL_NOT_FOUND = "VENDOR_LICENSE_MODEL_NOT_FOUND"; - public static final String SUBMIT_UNCOMPLETED_LICENSE_MODEL = "SUBMIT_UNCOMPLETED_LICENSE_MODEL"; - public static final String LICENSING_DATA_INVALID = "LICENSING_DATA_INVALID"; - - public static final String LIMIT_INVALID_TYPE = "LIMIT_INVALID_TYPE"; - public static final String LIMIT_INVALID_METRIC = "LIMIT_INVALID_METRIC"; - public static final String LIMIT_INVALID_AGGREGATIONFUNCTION = "LIMIT_INVALID_AGGREGATIONFUNCTION"; - public static final String LIMIT_INVALID_TIME = "LIMIT_INVALID_TIME"; - public static final String DUPLICATE_LIMIT_NAME_NOT_ALLOWED = - "DUPLICATE_LIMIT_NAME_NOT_ALLOWED"; - public static final String DATE_RANGE_INVALID = "DATE_RANGE_INVALID"; + public static final String VENDOR_LICENSE_MODEL_NOT_FOUND = "VENDOR_LICENSE_MODEL_NOT_FOUND"; + public static final String SUBMIT_UNCOMPLETED_LICENSE_MODEL = "SUBMIT_UNCOMPLETED_LICENSE_MODEL"; + public static final String LICENSING_DATA_INVALID = "LICENSING_DATA_INVALID"; + public static final String LIMIT_INVALID_TYPE = "LIMIT_INVALID_TYPE"; + public static final String LIMIT_INVALID_METRIC = "LIMIT_INVALID_METRIC"; + public static final String LIMIT_INVALID_AGGREGATIONFUNCTION = "LIMIT_INVALID_AGGREGATIONFUNCTION"; + public static final String LIMIT_INVALID_TIME = "LIMIT_INVALID_TIME"; + public static final String DUPLICATE_LIMIT_NAME_NOT_ALLOWED = "DUPLICATE_LIMIT_NAME_NOT_ALLOWED"; + public static final String DATE_RANGE_INVALID = "DATE_RANGE_INVALID"; } 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 e3eb27f342..da95e437c6 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 @@ -13,30 +13,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.vendorlicense.errors; import org.openecomp.sdc.common.errors.ErrorCode; public class VendorLicenseModelNotFoundErrorBuilder { - private static final String VENDOR_LICENSE_MODEL_NOT_FOUND_MSG = - "Vendor license model with id %s not found."; - private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - - /** - * Instantiates a new Vendor license model not found error builder. - * - * @param vendorLicenseModelId the vendor license model id - */ - public VendorLicenseModelNotFoundErrorBuilder(String vendorLicenseModelId) { - builder.withId(VendorLicenseErrorCodes.VENDOR_LICENSE_MODEL_NOT_FOUND); - builder.withMessage(String.format(VENDOR_LICENSE_MODEL_NOT_FOUND_MSG, vendorLicenseModelId)); - } - - public ErrorCode build() { - return builder.build(); - } - - + private static final String VENDOR_LICENSE_MODEL_NOT_FOUND_MSG = "Vendor license model with id %s not found."; + private final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + + /** + * Instantiates a new Vendor license model not found error builder. + * + * @param vendorLicenseModelId the vendor license model id + */ + public VendorLicenseModelNotFoundErrorBuilder(String vendorLicenseModelId) { + builder.withId(VendorLicenseErrorCodes.VENDOR_LICENSE_MODEL_NOT_FOUND); + builder.withMessage(String.format(VENDOR_LICENSE_MODEL_NOT_FOUND_MSG, vendorLicenseModelId)); + } + + public ErrorCode build() { + return builder.build(); + } } |