1 package org.openecomp.sdc.vendorsoftwareproduct.errors;
3 import org.openecomp.sdc.common.errors.ErrorCategory;
4 import org.openecomp.sdc.common.errors.ErrorCode;
6 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK;
7 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_TYPE_UPDATE_NOT_ALLOWED;
9 public class NicInternalNetworkErrorBuilder {
10 private static final String NULL_NETWORKID_NOT_ALLOWED_MSG =
11 "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.";
13 private static final String NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK_MSG =
14 "Invalid request, Network Description not allowed for Internal Networks";
15 private static final String NETWORK_TYPE_UPDATE_NOT_ALLOWED_MSG =
16 "Invalid request, Network Type Update not allowed for a Nic";
19 public static ErrorCode getNicNullNetworkIdInternalNetworkIdErrorBuilder(){
20 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
21 builder.withId(VendorSoftwareProductErrorCodes.NULL_NETWORKID_NOT_ALLOWED);
22 builder.withCategory(ErrorCategory.APPLICATION);
23 builder.withMessage(String.format(NULL_NETWORKID_NOT_ALLOWED_MSG));
24 return builder.build();
28 public static ErrorCode getNetworkDescriptionInternalNetworkErrorBuilder(){
29 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
30 builder.withId(NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK);
31 builder.withCategory(ErrorCategory.APPLICATION);
32 builder.withMessage(String.format(NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK_MSG));
33 return builder.build();
37 public static ErrorCode getNetworkTypeErrorBuilder(){
38 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
39 builder.withId(NETWORK_TYPE_UPDATE_NOT_ALLOWED);
40 builder.withCategory(ErrorCategory.APPLICATION);
41 builder.withMessage(String.format(NETWORK_TYPE_UPDATE_NOT_ALLOWED_MSG));
42 return builder.build();