diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java | 107 |
1 files changed, 48 insertions, 59 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java index c3a2862e39..1555bd77ee 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/VendorSoftwareProductInvalidErrorBuilder.java @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - package org.openecomp.sdc.vendorsoftwareproduct.errors; import org.openecomp.sdc.common.errors.ErrorCategory; @@ -21,69 +20,59 @@ import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.versioning.dao.types.Version; public class VendorSoftwareProductInvalidErrorBuilder { - private static final String VSP_INVALID_MSG = - "Vendor software product with Id %s and version %s is invalid - does not contain " - + "service model."; - private static final String VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG = "VSP has to have a " - + "minimum of one Deployment Flavor defined for being able to be instantiated.Please add a " - + "Deployment Flavor and re-submit the VSP."; - private static final String CANDIDATE_DATA_NOT_PROCESSED_OR_ABORTED = "Uploaded network package" - + " file %s was not processed/aborted."; - private static final String INVALID_PROCESSED_CANDIDATE = "Uploaded network package file %s" - + " is invalid and need to be aborted"; - private VendorSoftwareProductInvalidErrorBuilder() { + private static final String VSP_INVALID_MSG = + "Vendor software product with Id %s and version %s is invalid - does not contain " + "service model."; + private static final String VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG = + "VSP has to have a " + "minimum of one Deployment Flavor defined for being able to be instantiated.Please add a " + + "Deployment Flavor and re-submit the VSP."; + private static final String CANDIDATE_DATA_NOT_PROCESSED_OR_ABORTED = "Uploaded network package" + " file %s was not processed/aborted."; + private static final String INVALID_PROCESSED_CANDIDATE = "Uploaded network package file %s" + " is invalid and need to be aborted"; - } + private VendorSoftwareProductInvalidErrorBuilder() { + } - /** - * Instantiates a new Vendor software product invalid error builder. - * - * @param vendorSoftwareProductId the vendor software product id - * @param version the version - */ - public static ErrorCode vendorSoftwareProductMissingServiceModelErrorBuilder(String - vendorSoftwareProductId, - Version version) { - ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - builder.withId(VendorSoftwareProductErrorCodes.VSP_INVALID); - builder.withCategory(ErrorCategory.APPLICATION); - builder - .withMessage(String.format(VSP_INVALID_MSG, vendorSoftwareProductId, version.getId())); - return builder.build(); - } + /** + * Instantiates a new Vendor software product invalid error builder. + * + * @param vendorSoftwareProductId the vendor software product id + * @param version the version + */ + public static ErrorCode vendorSoftwareProductMissingServiceModelErrorBuilder(String vendorSoftwareProductId, Version version) { + ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + builder.withId(VendorSoftwareProductErrorCodes.VSP_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(VSP_INVALID_MSG, vendorSoftwareProductId, version.getId())); + return builder.build(); + } - /** - * Instantiates a new Vendor software product invalid error builder. - */ - public static ErrorCode vspMissingDeploymentFlavorErrorBuilder() { - ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - builder.withId(VendorSoftwareProductErrorCodes.VSP_INVALID); - builder.withCategory(ErrorCategory.APPLICATION); - builder - .withMessage(VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG); - return builder.build(); - } + /** + * Instantiates a new Vendor software product invalid error builder. + */ + public static ErrorCode vspMissingDeploymentFlavorErrorBuilder() { + ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + builder.withId(VendorSoftwareProductErrorCodes.VSP_INVALID); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG); + return builder.build(); + } - public static ErrorCode candidateDataNotProcessedOrAbortedErrorBuilder(String fileName) { - ErrorCode.ErrorCodeBuilder builder = getErrorCodeBuilder(VendorSoftwareProductErrorCodes - .VSP_INVALID, ErrorCategory.APPLICATION); - builder.withMessage(String.format(CANDIDATE_DATA_NOT_PROCESSED_OR_ABORTED, fileName)); - return builder.build(); - } + public static ErrorCode candidateDataNotProcessedOrAbortedErrorBuilder(String fileName) { + ErrorCode.ErrorCodeBuilder builder = getErrorCodeBuilder(VendorSoftwareProductErrorCodes.VSP_INVALID, ErrorCategory.APPLICATION); + builder.withMessage(String.format(CANDIDATE_DATA_NOT_PROCESSED_OR_ABORTED, fileName)); + return builder.build(); + } - public static ErrorCode invalidProcessedCandidate(String fileName) { - ErrorCode.ErrorCodeBuilder builder = getErrorCodeBuilder(VendorSoftwareProductErrorCodes - .VSP_INVALID, ErrorCategory.APPLICATION); - builder.withMessage(String.format(INVALID_PROCESSED_CANDIDATE, fileName)); - return builder.build(); - } + public static ErrorCode invalidProcessedCandidate(String fileName) { + ErrorCode.ErrorCodeBuilder builder = getErrorCodeBuilder(VendorSoftwareProductErrorCodes.VSP_INVALID, ErrorCategory.APPLICATION); + builder.withMessage(String.format(INVALID_PROCESSED_CANDIDATE, fileName)); + return builder.build(); + } - public static ErrorCode.ErrorCodeBuilder getErrorCodeBuilder(String errorCode, ErrorCategory - errorCategory) { - ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); - builder.withId(errorCode); - builder.withCategory(errorCategory); - return builder; - } + public static ErrorCode.ErrorCodeBuilder getErrorCodeBuilder(String errorCode, ErrorCategory errorCategory) { + ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + builder.withId(errorCode); + builder.withCategory(errorCategory); + return builder; + } } |