re base code
[sdc.git] / openecomp-be / backend / openecomp-sdc-vendor-software-product-manager / src / main / java / org / openecomp / sdc / vendorsoftwareproduct / errors / NotSupportedHeatOnboardMethodErrorBuilder.java
1 /*
2  * Copyright © 2016-2017 European Support Limited
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.openecomp.sdc.vendorsoftwareproduct.errors;
18
19 import org.openecomp.sdc.common.errors.ErrorCategory;
20 import org.openecomp.sdc.common.errors.ErrorCode;
21
22 import static org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes.*;
23
24 public class NotSupportedHeatOnboardMethodErrorBuilder {
25   private static final String ADD_NIC_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG =
26       "NIC cannot be added for VSPs onboarded with HEAT.";
27   private static final String ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG =
28       "Compute flavor cannot be added for VSPs onboarded with HEAT.";
29   private static final String IMAGE_ADD_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG =
30       "Image cannot be added for VSPs onboarded with HEAT.";
31   private static final String DELETE_IMAGE_NOT_ALLOWED_MSG =
32       "Image cannot be deleted for VSPs onboarded with HEAT.";
33   private static final String DELETE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_MSG =
34           "Deployment Flavor cannot be deleted for VSPs onboarded with HEAT.";
35   private static final String EDIT_DEPLOYMENT_FLAVOR_NOT_ALLOWED_MSG =
36       "Deployment Flavor cannot be edited for VSPs onboarded with HEAT.";
37
38   private NotSupportedHeatOnboardMethodErrorBuilder() {
39     
40   }
41
42
43   public static ErrorCode getAddNicNotSupportedHeatOnboardMethodErrorBuilder() {
44     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
45     builder.withId(ADD_NIC_NOT_ALLOWED_IN_HEAT_ONBOARDING);
46     builder.withCategory(ErrorCategory.APPLICATION);
47     builder.withMessage(ADD_NIC_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG);
48     return builder.build();
49   }
50
51   public static ErrorCode getAddComputeNotSupportedHeatOnboardMethodErrorBuilder() {
52     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
53     builder.withId(ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
54     builder.withCategory(ErrorCategory.APPLICATION);
55     builder.withMessage(ADD_COMPUTE_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG);
56     return builder.build();
57   }
58
59   public static ErrorCode getAddImageNotSupportedHeatOnboardMethodErrorBuilder() {
60     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
61     builder.withId(ADD_IMAGE_NOT_ALLOWED_IN_HEAT_ONBOARDING);
62     builder.withCategory(ErrorCategory.APPLICATION);
63     builder.withMessage(IMAGE_ADD_NOT_ALLOWED_IN_HEAT_ONBOARDING_MSG);
64     return builder.build();
65   }
66
67   public static ErrorCode getDelImageNotSupportedHeatOnboardMethodErrorBuilder() {
68     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
69     builder.withId(DELETE_IMAGE_NOT_ALLOWED);
70     builder.withCategory(ErrorCategory.APPLICATION);
71     builder.withMessage(DELETE_IMAGE_NOT_ALLOWED_MSG);
72     return builder.build();
73   }
74
75   public static ErrorCode getDelDeploymentFlavorNotSupportedHeatOnboardMethodErrorBuilder() {
76     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
77     builder.withId(DELETE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
78     builder.withCategory(ErrorCategory.APPLICATION);
79     builder.withMessage(DELETE_DEPLOYMENT_FLAVOR_NOT_ALLOWED_MSG);
80     return builder.build();
81   }
82
83   public static ErrorCode getUpdateDfNotSupportedHeatOnboardMethodErrorBuilder() {
84     ErrorCode.ErrorCodeBuilder builder = new ErrorCode.ErrorCodeBuilder();
85     builder.withId(EDIT_DEPLOYMENT_FLAVOR_NOT_ALLOWED_IN_HEAT_ONBOARDING);
86     builder.withCategory(ErrorCategory.APPLICATION);
87     builder.withMessage(EDIT_DEPLOYMENT_FLAVOR_NOT_ALLOWED_MSG);
88     return builder.build();
89   }
90
91 }