diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java new file mode 100644 index 0000000000..0850d2e704 --- /dev/null +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/NicInternalNetworkErrorBuilder.java @@ -0,0 +1,46 @@ +package org.openecomp.sdc.vendorsoftwareproduct.errors; + +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK; +import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_TYPE_UPDATE_NOT_ALLOWED; + +import org.openecomp.sdc.common.errors.ErrorCategory; +import org.openecomp.sdc.common.errors.ErrorCode; + +public class NicInternalNetworkErrorBuilder { + private static final String NULL_NETWORKID_NOT_ALLOWED_MSG = + "Internal Networks are currently not supported for VSP created Manually, so please fix all the NIC to be of Type External and re-submit the VSP."; + + private static final String NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK_MSG = + "Invalid request, Network Description not allowed for Internal Networks"; + private static final String NETWORK_TYPE_UPDATE_NOT_ALLOWED_MSG = + "Invalid request, Network Type Update not allowed for a Nic"; + + + public static ErrorCode getNicNullNetworkIdInternalNetworkIdErrorBuilder(){ + ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + builder.withId(VendorSoftwareProductErrorCodes.NULL_NETWORKID_NOT_ALLOWED); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(NULL_NETWORKID_NOT_ALLOWED_MSG)); + return builder.build(); + } + + + public static ErrorCode getNetworkDescriptionInternalNetworkErrorBuilder(){ + ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + builder.withId(NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK_MSG)); + return builder.build(); + } + + + public static ErrorCode getNetworkTypeErrorBuilder(){ + ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder(); + builder.withId(NETWORK_TYPE_UPDATE_NOT_ALLOWED); + builder.withCategory(ErrorCategory.APPLICATION); + builder.withMessage(String.format(NETWORK_TYPE_UPDATE_NOT_ALLOWED_MSG)); + return builder.build(); + } + + +} |