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 | 19 |
1 files changed, 17 insertions, 2 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 8fe2bfc396..4a84c83338 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 @@ -28,6 +28,8 @@ 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 final ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); /** @@ -36,14 +38,27 @@ public class VendorSoftwareProductInvalidErrorBuilder { * @param vendorSoftwareProductId the vendor software product id * @param version the version */ - public VendorSoftwareProductInvalidErrorBuilder(String vendorSoftwareProductId, Version 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.toString())); + return builder.build(); } - public ErrorCode 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(String.format(VSP_INVALID_MISSING_DEPLOYMENT_FLAVOR_MSG)); return builder.build(); } + } |