Add collaboration feature
[sdc.git] / openecomp-be / lib / openecomp-common-lib / src / main / java / org / openecomp / sdc / common / errors / Messages.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.sdc.common.errors;
22
23
24 public enum Messages {
25   CANT_LOAD_HEALING_CLASS("Can't load healing class %s."),
26
27   VERSION_UPGRADE("Item %s is of old version. A check out was made in order to get new " +
28       "functionalities"),
29
30   INVALID_ZIP_FILE("Invalid zip file"),
31   INVALID_CSAR_FILE("Invalid csar file"),
32   CSAR_FILE_NOT_FOUND("Each CSAR file must contain %s file."),
33   CSAR_DIRECTORIES_NOT_ALLOWED("Directory : %s , is not allowed."),
34   CSAR_FILES_NOT_ALLOWED("File : %s , are not allowed."),
35   MANIFEST_INVALID_LINE("Manifest contains invalid line : %s"),
36   MANIFEST_NO_METADATA("Manifest must contain metadata"),
37   MANIFEST_NO_SOURCES("Manifest must contain source"),
38   MANIFEST_PARSER_INTERNAL("Invalid manifest file"),
39   FAILED_TO_TRANSLATE_ZIP_FILE("Failed to translate zip file"),
40   ZIP_NOT_EXIST("Zip file doesn't exist"),
41
42   PERMISSIONS_ERROR("Permissions Error. The user does not have permission to perform this action."),
43
44   ZIP_SHOULD_NOT_CONTAIN_FOLDERS("Zip file should not contain folders"),
45   VES_ZIP_SHOULD_CONTAIN_YML_ONLY(
46       "Wrong VES EVENT Artifact was uploaded - all files contained in Artifact must be YAML files" +
47           " (using .yaml/.yml extensions)"),
48   MANIFEST_NOT_EXIST("Manifest doesn't exist"),
49   FILE_TYPE_NOT_LEGAL("File type not legal as data for other file"),
50   MODULE_IN_MANIFEST_NO_YAML("Module '%s', has no yaml file reference"),
51   NO_MODULES_IN_MANIFEST("At least one Base/Module must be defined \n"),
52   MODULE_IN_MANIFEST_VOL_ENV_NO_VOL("Module '%s', has volume Env. reference with no Volume " +
53       "reference"),
54   ILLEGAL_MANIFEST("Illegal Manifest"),
55   NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST("no zip file was uploaded or zip file doesn't exist"),
56   MAPPING_OBJECTS_FAILURE("Failed to map object %s to %s. Exception message: %s"),
57   MORE_THEN_ONE_VOL_FOR_HEAT("heat contains more then one vol. selecting only first vol"),
58   FILE_CONTENT_MAP("failed to load %s content"),
59   CREATE_MANIFEST_FROM_ZIP("cannot create manifest from the attached zip file"),
60   CANDIDATE_PROCESS_FAILED("Candidate zip file process failed"),
61   FOUND_UNASSIGNED_FILES("cannot process zip since it has unassigned files"),
62
63   /* Monitor uploads related errors*/
64   ILLEGAL_MONITORING_ARTIFACT_TYPE("Illegal monitoring artifact type for component id %s, vsp id " +
65       "%s"),
66
67
68   /* manifest errors*/
69   MISSING_FILE_IN_ZIP("Missing file in zip"),
70   MISSING_FILE_IN_MANIFEST("Missing file in manifest"),
71   MISSING_FILE_NAME_IN_MANIFEST("Missing file name in manifest"),
72   MISSING_NESTED_FILE("Missing nested file - %s"),
73   MISSING_ARTIFACT("Missing artifact - %s"),
74   WRONG_HEAT_FILE_EXTENSION("Wrong HEAT file extension - %s"),
75   WRONG_ENV_FILE_EXTENSION("Wrong ENV file extension - %s"),
76   INVALID_MANIFEST_FILE("invalid manifest file"),
77   INVALID_FILE_TYPE("Missing or Unknown file type in Manifest"),
78   ENV_NOT_ASSOCIATED_TO_HEAT("ENV file must be associated to a HEAT file"),
79   CSAR_MANIFEST_FILE_NOT_EXIST("CSAR manifest file does not exist"),
80   CSAR_FAILED_TO_READ("CSAR file is not readable"),
81   TOSCA_PARSING_FAILURE("Invalid tosca file. Error code : %s, Error message : %s/"),
82   /* content errors*/
83   INVALID_YAML_FORMAT("Invalid YAML format - %s"),
84   INVALID_YAML_FORMAT_REASON("Invalid YAML format Problem - [%s]"),
85   EMPTY_YAML_FILE("empty yaml"),
86   GENERAL_YAML_PARSER_ERROR("general parser error"),
87   GENERAL_HEAT_PARSER_ERROR("general parser error"),
88   INVALID_HEAT_FORMAT_REASON("Invalid HEAT format problem - [%s]"),
89   MISSING_RESOURCE_IN_DEPENDS_ON("a Missing resource in depend On, Missing Resource ID [%s]"),
90   REFERENCED_PARAMETER_NOT_FOUND("Referenced parameter - %s - not found, used in resource [%s]"),
91   GET_ATTR_NOT_FOUND("get_attr attribute not found, Attribute name [%s], Resource ID [%s]"),
92   MISSING_PARAMETER_IN_NESTED(
93       "Referenced parameter not found in nested file - %s, parameter name [%s], Resource ID [%s]"),
94   NESTED_LOOP("Nested files loop - %s"),
95   MORE_THAN_ONE_BIND_FROM_NOVA_TO_PORT("Resource Port %s exceed allowed relations from NovaServer"),
96   SERVER_NOT_DEFINED_FROM_NOVA("Missing server group definition - %s, %s"),
97   WRONG_POLICY_IN_SERVER_GROUP("Wrong policy in server group - %s"),
98   MISSING_IMAGE_AND_FLAVOR("Missing both Image and Flavor in NOVA Server, Resource ID [%s]"),
99   ENV_INCLUDES_PARAMETER_NOT_IN_HEAT("Env file %s includes a parameter not in HEAT - %s"),
100   PARAMETER_ENV_VALUE_NOT_ALIGN_WITH_TYPE("Parameter env value %s not align with type"),
101   PARAMETER_DEFAULT_VALUE_NOT_ALIGN_WITH_TYPE(
102       "Parameter - %s default value not align with type %s"),
103   INVALID_RESOURCE_TYPE("A resource has an invalid or unsupported type - %s, Resource ID [%s]"),
104   ARTIFACT_FILE_NOT_REFERENCED("Artifact file is not referenced."),
105   RESOURCE_NOT_IN_USE("%s not in use, Resource Id [%s]"),
106   PORT_NO_BIND_TO_ANY_NOVA_SERVER("Port not bind to any NOVA Server, Resource Id [%s]"),
107   INVALID_GET_RESOURCE_SYNTAX(
108       "invalid get_resource syntax is in use - %s , get_resource"
109           + " function should get the resource id of the referenced resource"),
110   INVALID_RESOURCE_GROUP_TYPE(
111       "OS::Heat::ResourceGroup resource with resource_def which is not pointing to "
112           + "nested heat file is not supported, Resource ID [%s], resource_def type [%s]"),
113   WRONG_VALUE_TYPE_ASSIGNED_NESTED_INPUT(
114       "Wrong value type assigned to a nested input parameter, nested resource [%s],"
115           + " property name [%s], nested file [%s]"),
116   NOVA_NAME_IMAGE_FLAVOR_NOT_CONSISTENT(
117       "Nova Server naming convention in image, flavor and name properties is not "
118           + "consistent, Resource ID [%s]"),
119   RESOURCE_GROUP_INVALID_INDEX_VAR(
120       "Wrong value assigned to a ResourceGroup index_var property (functions are not allowed"
121           + " but only strings), Resource ID [%s]"),
122   CONTRAIL_2_IN_USE("Contrail 2.x deprecated resource is in use, Resource ID [%s]"),
123
124   /* warnings */
125   REFERENCED_RESOURCE_NOT_FOUND("Referenced resource - %s not found"),
126   MISSING_GET_PARAM("Missing get_param in %s, Resource Id [%s]"),
127
128   /*OPENECOMP Guide lines*/
129   MISSING_NOVA_SERVER_METADATA("Missing Nova Server Metadata property, Resource ID [%s]"),
130   MISSING_NOVA_SERVER_VNF_ID("Missing VNF_ID in Metadata property, Resource ID [%s]"),
131   MISSING_NOVA_SERVER_VF_MODULE_ID("Missing VF_MODULE_ID in Metadata property, Resource id [%s]"),
132   NETWORK_PARAM_NOT_ALIGNED_WITH_GUIDE_LINE(
133       "Network Parameter Name not aligned with Guidelines, Parameter Name [%s] Resource ID [%s]"),
134   MISSIN_BASE_HEAT_FILE(
135       "Missing Base HEAT. Pay attention that without Base HEAT, there will be no shared resources"),
136   MULTI_BASE_HEAT_FILE("Multi Base HEAT. Expected only one. Files %s."),
137   RESOURCE_NOT_DEFINED_IN_OUTPUT(
138       "Resource is not defined as output and thus cannot be Shared, Resource ID [%s]"),
139   RESOURCE_CONNECTED_TO_TWO_EXTERNAL_NETWORKS_WITH_SAME_ROLE(
140       "A resource is connected twice to the same network role, Network Role [%s],"
141           + " Resource ID [%s]"),
142   VOLUME_HEAT_NOT_EXPOSED("Volume is not defined as output and thus cannot be attached %s"),
143   FORBIDDEN_RESOURCE_IN_USE("%s is in use, Resource ID [%s]"),
144   PARAMETER_NAME_NOT_ALIGNED_WITH_GUIDELINES(
145       "%s '%s' Parameter Name not aligned with Guidelines, Parameter Name [%s], Resource ID [%s]."
146           + " As a result, VF/VFC Profile may miss this information"),
147   /* Contrail validator messages*/
148   MERGE_OF_CONTRAIL2_AND_CONTRAIL3_RESOURCES(
149       "HEAT Package includes both Contrail 2 and Contrail 3 resources. "
150           + "Contrail 2 resources can be found in %s. Contrail 3 resources can be found in %s"),
151   CONTRAIL_VM_TYPE_NAME_NOT_ALIGNED_WITH_NAMING_CONVENSION(
152       "Service Template naming convention in Image and Flavor "
153           + "properties is not consistent in Resource, Resource ID %s"),
154
155   /* Notifications */
156   FAILED_TO_MARK_NOTIFICATION_AS_READ("Failed to mark notifications as read"),
157   FAILED_TO_UPDATE_LAST_SEEN_NOTIFICATION("Failed to update last seen notification for user %s");
158
159   private String errorMessage;
160
161   Messages(String errorMessage) {
162     this.errorMessage = errorMessage;
163   }
164
165   public String getErrorMessage() {
166     return errorMessage;
167   }
168
169 }