Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Foundation |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 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.onosproject.yms.app.yob; |
| 18 | |
| 19 | /** |
| 20 | * Represents common constant utility for YANG object builder. |
| 21 | */ |
| 22 | final class YobConstants { |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 23 | |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 24 | private YobConstants() { |
| 25 | } |
| 26 | |
| 27 | static final String FROM_STRING = "fromString"; |
| 28 | static final String BUILD = "build"; |
| 29 | static final String OP_PARAM = "OpParam"; |
| 30 | static final String DEFAULT = "Default"; |
| 31 | static final String ADD_TO = "addTo"; |
| 32 | static final String VALUE_OF = "valueOf"; |
Vidyashree Rama | 6160be1 | 2016-11-24 13:43:31 +0530 | [diff] [blame] | 33 | static final String OP_TYPE = "OpType"; |
| 34 | static final String ONOS_YANG_OP_TYPE = "OnosYangOpType"; |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 35 | static final String OF = "of"; |
| 36 | static final String PERIOD = "."; |
Vidyashree Rama | f463dc5 | 2016-10-06 12:46:33 +0530 | [diff] [blame] | 37 | static final String SPACE = " "; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 38 | static final String ADD_AUGMENT_METHOD = "addYangAugmentedInfo"; |
Vidyashree Rama | 6160be1 | 2016-11-24 13:43:31 +0530 | [diff] [blame] | 39 | static final String YANG = "yang"; |
| 40 | static final String JAVA_LANG = "java.lang"; |
| 41 | static final String LEAF_IDENTIFIER = "LeafIdentifier"; |
| 42 | static final String SELECT_LEAF = "selectLeaf"; |
Vidyashree Rama | fd339c4 | 2016-12-01 19:19:56 +0530 | [diff] [blame] | 43 | static final String EVENT_SUBJECT = "EventSubject"; |
| 44 | static final String EVENT = "Event"; |
| 45 | static final String TYPE = "Type"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 46 | |
| 47 | //Error strings |
| 48 | static final String E_NO_HANDLE_FOR_YDT = "No handler for YDT node"; |
| 49 | static final String E_HAS_NO_CHILD = " does not have child "; |
| 50 | static final String E_SET_OP_TYPE_FAIL = "Failed to set Operation Type"; |
| 51 | static final String E_FAIL_TO_BUILD = "Failed to build the object: "; |
| 52 | static final String L_FAIL_TO_BUILD = "Failed to build the object: {}"; |
| 53 | static final String E_FAIL_TO_GET_FIELD = "Failed to get field for class: "; |
| 54 | static final String L_FAIL_TO_GET_FIELD = |
| 55 | "Failed to get field for class: {}"; |
| 56 | static final String E_FAIL_TO_GET_METHOD = |
| 57 | "Failed to get method for class: "; |
| 58 | static final String L_FAIL_TO_GET_METHOD = |
| 59 | "Failed to get method for class: {}"; |
| 60 | static final String E_FAIL_TO_LOAD_CLASS = |
| 61 | "Failed to load class for class: "; |
| 62 | static final String L_FAIL_TO_LOAD_CLASS = |
| 63 | "Failed to load class for class: {}"; |
| 64 | static final String E_YDT_TYPE_IS_NOT_SUPPORT = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 65 | "Given YDT type is not supported."; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 66 | static final String E_FAIL_TO_CREATE_OBJ = |
| 67 | "Failed to create an object for class: "; |
| 68 | static final String L_FAIL_TO_CREATE_OBJ = |
| 69 | "Failed to create an object for class: {}"; |
| 70 | static final String E_REFLECTION_FAIL_TO_CREATE_OBJ = |
| 71 | "Reflection failed to create an object for class: "; |
| 72 | static final String L_REFLECTION_FAIL_TO_CREATE_OBJ = |
| 73 | "Reflection failed to create an object for class: {}"; |
| 74 | static final String E_FAIL_TO_LOAD_CONSTRUCTOR = |
| 75 | "Failed to load constructor for class: {}"; |
| 76 | static final String E_FAIL_TO_INVOKE_METHOD = |
| 77 | "Failed to invoke method for class: "; |
| 78 | static final String L_FAIL_TO_INVOKE_METHOD = |
| 79 | "Failed to invoke method for class: {}"; |
| 80 | static final String E_DATA_TYPE_NOT_SUPPORT = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 81 | "Given data type is not supported."; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 82 | static final String E_OBJ_IS_ALREADY_BUILT_NOT_FETCH = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 83 | "Object is already built, cannot fetch builder"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 84 | static final String E_BUILDER_IS_NOT_SET = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 85 | "Builder is not yet set, cannot fetch it"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 86 | static final String E_BUILT_OBJ_IS_NOT_SET = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 87 | "Built object is not set"; |
Vidyashree Rama | 6160be1 | 2016-11-24 13:43:31 +0530 | [diff] [blame] | 88 | static final String E_OBJ_IS_ALREADY_BUILT_NOT_SET = |
| 89 | "Object is already built, cannot set builder"; |
| 90 | static final String E_BUILDER_IS_NOT_ALREADY_SET = |
| 91 | "Builder is not already set"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 92 | static final String E_OBJ_IS_NOT_SET_NOT_FETCH = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 93 | "Builder is not yet set, cannot fetch it"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 94 | static final String E_OBJ_IS_ALREADY_BUILT_NOT_BUILD = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 95 | "Object is already built, cannot build again"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 96 | static final String E_OBJ_BUILDING_WITHOUT_BUILDER = |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 97 | "Object building without builder"; |
VinodKumarS-Huawei | 7b1733c | 2016-10-25 13:44:26 +0530 | [diff] [blame] | 98 | static final String E_MISSING_DATA_IN_NODE = |
| 99 | "YANG data tree is missing the data required for YOB"; |
| 100 | static final String E_INVALID_DATA_TREE = |
| 101 | "YANG tree does not have a application root"; |
Vidyashree Rama | 6160be1 | 2016-11-24 13:43:31 +0530 | [diff] [blame] | 102 | static final String E_INVALID_EMPTY_DATA = |
| 103 | "Value for empty data type is invalid"; |
Rama-Huawei | b711e5c | 2016-08-31 07:55:46 +0530 | [diff] [blame] | 104 | } |