14
14
from wlsdeploy .aliases import password_utils
15
15
from wlsdeploy .aliases .alias_constants import ChildFoldersTypes
16
16
from wlsdeploy .aliases .location_context import LocationContext
17
+ from wlsdeploy .aliases .model_constants import APPLICATION
18
+ from wlsdeploy .aliases .model_constants import ODL_CONFIGURATION
19
+ from wlsdeploy .aliases .model_constants import RESOURCE_MANAGER
17
20
from wlsdeploy .aliases .validation_codes import ValidationCodes
18
21
from wlsdeploy .aliases .wlst_modes import WlstModes
19
22
from wlsdeploy .exception import exception_helper
@@ -72,57 +75,6 @@ class AliasEntries(object):
72
75
__category_modules_dir_name = 'oracle/weblogic/deploy/aliases/category_modules/'
73
76
__domain_category = 'Domain'
74
77
75
- __model_categories_map = {
76
- 'AdminConsole' : 'AdminConsole' ,
77
- 'Application' : 'AppDeployment' ,
78
- 'Cluster' : 'Cluster' ,
79
- 'CoherenceClusterSystemResource' : 'CoherenceClusterSystemResource' ,
80
- 'Domain' : 'Domain' ,
81
- 'EmbeddedLDAP' : 'EmbeddedLDAP' ,
82
- 'FileStore' : 'FileStore' ,
83
- 'ForeignJNDIProvider' : 'ForeignJNDIProvider' ,
84
- 'JDBCStore' : 'JDBCStore' ,
85
- 'JDBCSystemResource' : 'JDBCSystemResource' ,
86
- 'JMSBridgeDestination' : 'JMSBridgeDestination' ,
87
- 'JMSServer' : 'JMSServer' ,
88
- 'JMSSystemResource' : 'JMSSystemResource' ,
89
- 'JMX' : 'JMX' ,
90
- 'JTA' : 'JTA' ,
91
- 'Library' : 'Library' ,
92
- 'Log' : 'Log' ,
93
- 'LogFilter' : 'LogFilter' ,
94
- 'Machine' : 'Machine' ,
95
- 'MailSession' : 'MailSession' ,
96
- 'MessagingBridge' : 'MessagingBridge' ,
97
- 'MigratableTarget' : 'MigratableTarget' ,
98
- 'NMProperties' : 'NMProperties' ,
99
- 'Partition' : 'Partition' ,
100
- 'PartitionWorkManager' : 'PartitionWorkManager' ,
101
- 'PathService' : 'PathService' ,
102
- 'ResourceGroup' : 'ResourceGroup' ,
103
- 'ResourceGroupTemplate' : 'ResourceGroupTemplate' ,
104
- 'ResourceManagement' : 'ResourceManagement' ,
105
- 'ResourceManager' : 'ResourceManager' ,
106
- 'RestfulManagementServices' : 'RestfulManagementServices' ,
107
- 'SAFAgent' : 'SAFAgent' ,
108
- 'Security' : 'Security' ,
109
- 'SecurityConfiguration' : 'SecurityConfiguration' ,
110
- 'SelfTuning' : 'SelfTuning' ,
111
- 'Server' : 'Server' ,
112
- 'ServerTemplate' : 'ServerTemplate' ,
113
- 'ShutdownClass' : 'ShutdownClass' ,
114
- 'SingletonService' : 'SingletonService' ,
115
- 'StartupClass' : 'StartupClass' ,
116
- 'UnixMachine' : 'UnixMachine' ,
117
- 'VirtualHost' : 'VirtualHost' ,
118
- 'VirtualTarget' : 'VirtualTarget' ,
119
- 'WebAppContainer' : 'WebAppContainer' ,
120
- 'WLDFSystemResource' : 'WLDFSystemResource' ,
121
- 'WSReliableDeliveryPolicy' : 'WSReliableDeliveryPolicy' ,
122
- 'XMLEntityCache' : 'XMLEntityCache' ,
123
- 'XMLRegistry' : 'XMLRegistry'
124
- }
125
-
126
78
__topology_top_level_folders = [
127
79
'AdminConsole' ,
128
80
'Cluster' ,
@@ -158,6 +110,7 @@ class AliasEntries(object):
158
110
'JMSSystemResource' ,
159
111
'MailSession' ,
160
112
'MessagingBridge' ,
113
+ ODL_CONFIGURATION ,
161
114
'Partition' ,
162
115
'PartitionWorkManager' ,
163
116
'PathService' ,
@@ -178,6 +131,8 @@ class AliasEntries(object):
178
131
'Library'
179
132
]
180
133
134
+ __all_model_categories = []
135
+
181
136
__domain_info_attributes_and_types = {
182
137
'AdminUserName' : 'string' ,
183
138
'AdminPassword' : 'password' ,
@@ -211,6 +166,11 @@ def __init__(self, wlst_mode=WlstModes.OFFLINE, wls_version=None):
211
166
self ._wls_helper = WebLogicHelper (_logger , wls_version )
212
167
self ._wls_version = wls_version
213
168
169
+ self .__all_model_categories .extend (self .__topology_top_level_folders )
170
+ self .__all_model_categories .extend (self .__resources_top_level_folders )
171
+ self .__all_model_categories .extend (self .__app_deployments_top_level_folders )
172
+ self .__all_model_categories .append (RESOURCE_MANAGER )
173
+
214
174
return
215
175
216
176
def get_dictionary_for_location (self , location , resolve = True ):
@@ -241,7 +201,7 @@ def get_model_domain_subfolder_names(self):
241
201
_method_name = 'get_model_domain_subfolder_names'
242
202
243
203
_logger .entering (class_name = _class_name , method_name = _method_name )
244
- folder_list = list (self .__model_categories_map . keys () )
204
+ folder_list = list (self .__all_model_categories )
245
205
#
246
206
# Remove all folders that do not appear at the WLST root level
247
207
#
@@ -914,12 +874,24 @@ def _unit_test_only_get_category_map_files(self):
914
874
:return: blob of stuff
915
875
"""
916
876
result = {}
917
- for key , value in self .__model_categories_map . iteritems () :
918
- category_file_name = '%s.json' % value
877
+ for key in self .__all_model_categories :
878
+ category_file_name = '%s.json' % self . _get_category_file_prefix ( key )
919
879
category_file_path = '%s%s' % (self .__category_modules_dir_name , category_file_name )
920
880
result [key ] = category_file_path
921
881
return result
922
882
883
+ def _get_category_file_prefix (self , category_name ):
884
+ """
885
+ Return the file prefix for the specified top-level category.
886
+ The file prefix should match the category name exactly.
887
+ File name for Application is different for some reason
888
+ :param category_name: the name to be checked
889
+ :return: the corressponding file name prefix
890
+ """
891
+ if category_name == APPLICATION :
892
+ return 'AppDeployment'
893
+ return category_name
894
+
923
895
def __get_dictionary_for_location (self , location , resolve_path_tokens = True ):
924
896
"""
925
897
Get the dictionary for a location with or without path tokens resolved
@@ -941,7 +913,7 @@ def __get_dictionary_for_location(self, location, resolve_path_tokens=True):
941
913
model_category_name = self .__domain_category
942
914
else :
943
915
model_category_name = location_folders [0 ]
944
- if model_category_name not in self .__model_categories_map :
916
+ if model_category_name not in self .__all_model_categories :
945
917
ex = exception_helper .create_alias_exception ('WLSDPLY-08116' , model_category_name )
946
918
_logger .throwing (ex , class_name = _class_name , method_name = _method_name )
947
919
raise ex
@@ -993,7 +965,7 @@ def __load_category(self, model_category_name):
993
965
_method_name = '__load_category'
994
966
995
967
_logger .entering (model_category_name , class_name = _class_name , method_name = _method_name )
996
- model_category_file = self .__model_categories_map [ model_category_name ]
968
+ model_category_file = self ._get_category_file_prefix ( model_category_name )
997
969
raw_category_dict = self .__load_category_file (model_category_file )
998
970
_logger .fine ('WLSDPLY-08118' , model_category_name , class_name = _class_name , method_name = _method_name )
999
971
@@ -1083,8 +1055,8 @@ def __load_contains_categories(self, model_category_name, raw_model_dict, base_p
1083
1055
1084
1056
contained_folders = raw_model_dict [CONTAINS ]
1085
1057
for contained_folder in contained_folders :
1086
- if contained_folder in self .__model_categories_map :
1087
- folder_file = self .__model_categories_map [ contained_folder ]
1058
+ if contained_folder in self .__all_model_categories :
1059
+ folder_file = self ._get_category_file_prefix ( contained_folder )
1088
1060
else :
1089
1061
ex = exception_helper .create_alias_exception ('WLSDPLY-08122' , contained_folder , model_category_name )
1090
1062
_logger .throwing (ex , class_name = _class_name , method_name = _method_name )
0 commit comments