2 * Copyright © 2016-2017 European Support Limited
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.openecomp.sdc.vendorsoftwareproduct.errors;
19 import org.openecomp.sdc.common.errors.ErrorCategory;
20 import org.openecomp.sdc.common.errors.ErrorCode;
22 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK;
23 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.NETWORK_TYPE_UPDATE_NOT_ALLOWED;
25 public class NicInternalNetworkErrorBuilder {
26 private static final String NULL_NETWORKID_NOT_ALLOWED_MSG =
27 "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.";
29 private static final String NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK_MSG =
30 "Invalid request, Network Description not allowed for Internal Networks";
31 private static final String NETWORK_TYPE_UPDATE_NOT_ALLOWED_MSG =
32 "Invalid request, Network Type Update not allowed for a Nic";
34 private NicInternalNetworkErrorBuilder() {
39 public static ErrorCode getNicNullNetworkIdInternalNetworkIdErrorBuilder(){
40 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
41 builder.withId(VendorSoftwareProductErrorCodes.NULL_NETWORKID_NOT_ALLOWED);
42 builder.withCategory(ErrorCategory.APPLICATION);
43 builder.withMessage(NULL_NETWORKID_NOT_ALLOWED_MSG);
44 return builder.build();
48 public static ErrorCode getNetworkDescriptionInternalNetworkErrorBuilder(){
49 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
50 builder.withId(NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK);
51 builder.withCategory(ErrorCategory.APPLICATION);
52 builder.withMessage(NETWORK_DESCRIPTION_NOT_ALLOWED_FOR_INTERNAL_NETWORK_MSG);
53 return builder.build();
57 public static ErrorCode getNetworkTypeErrorBuilder(){
58 ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
59 builder.withId(NETWORK_TYPE_UPDATE_NOT_ALLOWED);
60 builder.withCategory(ErrorCategory.APPLICATION);
61 builder.withMessage(NETWORK_TYPE_UPDATE_NOT_ALLOWED_MSG);
62 return builder.build();