Skip to content

Commit 541678a

Browse files
Added LogFilter alias definition and continue fix on alias definitions
1 parent 6ecdbdb commit 541678a

File tree

20 files changed

+226
-99
lines changed

20 files changed

+226
-99
lines changed

core/src/main/python/wlsdeploy/aliases/alias_entries.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class AliasEntries(object):
8686
'JTA': 'JTA',
8787
'Library': 'Library',
8888
'Log': 'Log',
89+
'LogFilter': 'LogFilter',
8990
'Machine': 'Machine',
9091
'MailSession': 'MailSession',
9192
'MessagingBridge': 'MessagingBridge',
@@ -118,6 +119,7 @@ class AliasEntries(object):
118119
'JMX',
119120
'JTA',
120121
'Log',
122+
'LogFilter',
121123
'Machine',
122124
'MigratableTarget',
123125
'NMProperties',

core/src/main/python/wlsdeploy/aliases/model_constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
LIBRARY = 'Library'
133133
LOAD_BALANCING_PARAMS = 'LoadBalancingParams'
134134
LOG = 'Log'
135+
LOG_FILTER = 'LogFilter'
135136
LOG_ACTION = 'LogAction'
136137
MACHINE = 'Machine'
137138
MAIL_SESSION = 'MailSession'

core/src/main/python/wlsdeploy/tool/create/creator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,6 @@ def _set_attribute(self, location, model_name, model_value, uses_path_tokens_nam
346346
logged_value = wlst_value
347347
if masked:
348348
logged_value = '<masked>'
349-
print 'wlst_name ', wlst_name, ' type is ', type(wlst_value)
350349
self.logger.finest('WLSDPLY-12115', wlst_name, logged_value,
351350
class_name=self.__class_name, method_name=_method_name)
352351
self.wlst_helper.set(wlst_name, wlst_value, masked=masked)

core/src/main/python/wlsdeploy/tool/create/domain_creator.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from wlsdeploy.aliases.model_constants import JDBC_DRIVER_PARAMS_PROPERTIES
2222
from wlsdeploy.aliases.model_constants import JDBC_RESOURCE
2323
from wlsdeploy.aliases.model_constants import JDBC_SYSTEM_RESOURCE
24+
from wlsdeploy.aliases.model_constants import LOG_FILTER
2425
from wlsdeploy.aliases.model_constants import MACHINE
2526
from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET
2627
from wlsdeploy.aliases.model_constants import NAME
@@ -382,6 +383,9 @@ def __apply_base_domain_config(self, topology_folder_list):
382383
self.security_provider_creator.create_security_configuration(security_config_location)
383384
topology_folder_list.remove(SECURITY_CONFIGURATION)
384385

386+
self.__create_log_filters(location)
387+
topology_folder_list.remove(LOG_FILTER)
388+
385389
self.__create_machines(location)
386390
topology_folder_list.remove(MACHINE)
387391
topology_folder_list.remove(UNIX_MACHINE)
@@ -438,6 +442,22 @@ def __create_security_folder(self, location):
438442
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
439443
return
440444

445+
def __create_log_filters(self, location):
446+
"""
447+
Create the /LogFilter objects if any for use in the logs of the base components like domain and server
448+
:param location: the location to use
449+
:raises: CreateException: if an error occurs
450+
"""
451+
_method_name = '__create_log_filters'
452+
453+
self.logger.entering(str(location), class_name=self.__class_name, method_name=_method_name)
454+
log_filter_nodes = dictionary_utils.get_dictionary_element(self._topology, LOG_FILTER)
455+
456+
if len(log_filter_nodes) > 0:
457+
self._create_named_mbeans(LOG_FILTER, log_filter_nodes, location, log_created=True)
458+
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)
459+
return
460+
441461
def __create_machines(self, location):
442462
"""
443463
Create the /Machine and /UnixMachine folder objects, if any.

core/src/main/python/wlsdeploy/tool/discover/topology_discoverer.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ def discover_domain_parameters(self):
259259
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
260260
model_folder_name, folder_result = self._get_restful_management_services()
261261
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
262+
model_folder_name, folder_result = self._get_log_filters()
263+
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
262264
model_folder_name, folder_result = self._get_domain_log()
263265
discoverer.add_to_model_if_not_empty(self._dictionary, model_folder_name, folder_result)
264266
model_folder_name, folder_result = self._get_nm_properties()
@@ -343,6 +345,31 @@ def _get_domain_log(self):
343345

344346
return model_top_folder_name, result
345347

348+
def _get_log_filters(self):
349+
"""
350+
Discover the log filters that are used in the different types of Logs in the domain.
351+
:return: model name for the folder: dictionary containing the discovered log filters
352+
"""
353+
_method_name = '_get_log_filters'
354+
_logger.entering(class_name=_class_name, method_name=_method_name)
355+
model_top_folder_name = model_constants.LOG_FILTER
356+
result = OrderedDict()
357+
location = LocationContext(self._base_location)
358+
location.append_location(model_top_folder_name)
359+
filters = self._find_names_in_folder(location)
360+
if filters is not None:
361+
_logger.info('WLSDPLY-06628', len(filters), class_name=_class_name, method_name=_method_name)
362+
name_token = self._alias_helper.get_name_token(location)
363+
for logfilter in filters:
364+
_logger.info('WLSDPLY-06629', logfilter, class_name=_class_name, method_name=_method_name)
365+
location.add_name_token(name_token, logfilter)
366+
result[logfilter] = OrderedDict()
367+
self._populate_model_parameters(result[logfilter], location)
368+
location.remove_name_token(name_token)
369+
370+
_logger.exiting(class_name=_class_name, method_name=_method_name, result=model_top_folder_name)
371+
return model_top_folder_name, result
372+
346373
def _get_nm_properties(self):
347374
"""
348375
Discover the NMProperties attributes.

core/src/main/python/wlsdeploy/tool/util/attribute_setter.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
from wlsdeploy.aliases.model_constants import JMS_SERVER
3636
from wlsdeploy.aliases.model_constants import JMX_NOTIFICATION
3737
from wlsdeploy.aliases.model_constants import LOG_ACTION
38+
from wlsdeploy.aliases.model_constants import LOG_FILTER
3839
from wlsdeploy.aliases.model_constants import MACHINE
3940
from wlsdeploy.aliases.model_constants import MAX_THREADS_CONSTRAINT
4041
from wlsdeploy.aliases.model_constants import MIGRATABLE_TARGET
@@ -357,6 +358,19 @@ def set_wldf_action_mbeans(self, location, key, value, wlst_value):
357358
self.set_attribute(location, key, action_mbeans, wlst_merge_value=wlst_value, use_raw_value=True)
358359
return
359360

361+
def set_log_filter_mbean(self, location, key, value, wlst_value):
362+
"""
363+
Set the Log Filter MBean.
364+
:param location: the location
365+
:param key: the attribute name
366+
:param value: the string value
367+
:param wlst_value: the existing value of the attribute from WLST
368+
:raises BundleAwareException of the specified type: if store is not found
369+
"""
370+
mbean = self.__find_log_filter_mbean(location, value)
371+
self.set_attribute(location, key, mbean, wlst_merge_value=wlst_value, use_raw_value=True)
372+
return
373+
360374
def set_mt_target_mbeans(self, location, key, value, wlst_value):
361375
"""
362376
Set the virtual target MBeans.
@@ -626,6 +640,25 @@ def __find_persistent_store(self, location, store_name):
626640
self.__logger.throwing(class_name=self._class_name, method_name=method_name, error=ex)
627641
raise ex
628642

643+
def __find_log_filter_mbean(self, location, filter_name):
644+
"""
645+
Find the domain level log filter with the specified name and return its WLST mbean.
646+
:param location: the WLST location of the attribute
647+
:param filter_name: the name of the log filter to find
648+
:return: the mbean for the store
649+
:raises BundleAwareException of the specified type: if store is not found
650+
"""
651+
method_name = '__find_log_filter_mbean'
652+
domain_location = self.__get_domain_location(location)
653+
mbean = self.__find_in_location(domain_location, LOG_FILTER, filter_name)
654+
if mbean is not None:
655+
return mbean
656+
657+
ex = exception_helper.create_exception(self.__exception_type, 'WLSDPLY-19208', filter_name,
658+
location.get_folder_path())
659+
self.__logger.throwing(class_name=self._class_name, method_name=method_name, error=ex)
660+
raise ex
661+
629662
def __find_saf_destination_mbean(self, location, destination_name):
630663
"""
631664
Find the SAF destination with the specified name and return its WLST mbean.

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/AppDeployment.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,41 @@
99
"AbsolutePlanDir": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "AbsolutePlanDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO", "uses_path_tokens": "true" } ],
1010
"AbsolutePlanPath": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "AbsolutePlanPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO", "uses_path_tokens": "true" } ],
1111
"AbsoluteSourcePath": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "AbsoluteSourcePath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO", "uses_path_tokens": "true" } ],
12-
"AltDescriptorDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "AltDescriptorDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
12+
"AltDescriptorDir": [ {"version": "[12.2.1,)", "wlst_mode": "both", "wlst_name": "AltDescriptorDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
1313
"AltDescriptorPath": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "AltDescriptorPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
1414
"AltWLSDescriptorPath": [ {"version": "[10,10.3.6)", "wlst_mode": "offline", "wlst_name": "AltWlsDescriptorPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" },
1515
{"version": "[10.3.6,)", "wlst_mode": "offline", "wlst_name": "AltWLSDescriptorPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "uses_path_tokens": "true" } ],
1616
"ApplicationIdentifier": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ApplicationIdentifier", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO" } ],
1717
"ApplicationName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ApplicationName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO" } ],
18+
"AutoDeployedApp": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "AutoDeployedApp", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
19+
"BackgroundDeployment": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "BackgroundDeployment", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
1820
"CacheInAppDirectory": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "CacheInAppDirectory", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean" } ],
1921
"CompatibilityName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "CompatibilityName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
2022
"DeploymentOrder": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DeploymentOrder", "wlst_path": "WP001", "value": {"default": 100 }, "wlst_type": "integer" } ],
2123
"DeploymentPlan": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "DeploymentPlan", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO" } ],
2224
"DeploymentPlanExternalDescriptors": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "DeploymentPlanExternalDescriptors", "wlst_path": "WP001", "value": {"default": "None"},"wlst_type": "string", "access": "RO" } ],
2325
"DeploymentPrincipalName": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "DeploymentPrincipalName", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
2426
"InstallDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "InstallDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "${:RO}", "uses_path_tokens": "true" } ],
27+
"InternalApp": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "InternalApp", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
28+
"LocalInstallDir": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "LocalInstallDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "GET", "uses_path_tokens": "true", "access": "RO" } ],
29+
"LocalPlanDir": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "LocalPlanDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "GET", "uses_path_tokens": "true", "access": "RO" } ],
30+
"LocalPlanPath": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "LocalPlanPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "GET", "uses_path_tokens": "true", "access": "RO" } ],
31+
"LocalSourcePath": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "LocalSourcePath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "GET", "uses_path_tokens": "true", "access": "RO" } ],
2532
"ModuleType": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "ModuleType", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
2633
"Notes": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Notes", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
34+
"OnDemandContextPaths": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandContextPaths", "wlst_path": "WP001", "value": {"default": "[]" }, "wlst_type": "jarray", "get_method": "GET", "access": "RO" } ],
35+
"OnDemandDisplayRefresh": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "OnDemandDisplayRefresh", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean", "get_method": "GET", "access": "RO" } ],
2736
"ParallelDeployModules": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ParallelDeployModules", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean" } ],
2837
"PlanDir": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "${:RO}", "uses_path_tokens": "true" } ],
2938
"PlanPath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "PlanPath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "${:RO}", "uses_path_tokens": "true" } ],
3039
"PlanStagingMode": [ {"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "PlanStagingMode", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string" } ],
40+
"RootStagingDir": [ {"version": "[10,)", "wlst_mode": "online", "wlst_name": "RootStagingDir", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "get_method": "GET", "uses_path_tokens": "true", "access": "RO" } ],
3141
"SecurityDDModel": [ {"version": "[10,12.1.2)", "wlst_mode": "both", "wlst_name": "Security${Dd:DD}Model", "wlst_path": "WP001", "value": {"default": "DDOnly"}, "wlst_type": "string", "access": "${:RO}" },
3242
{"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "SecurityDDModel", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "${:RO}" }],
3343
"SourcePath": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "SourcePath", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "${:RO}", "uses_path_tokens": "true" } ],
3444
"StagingMode": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "StagingMode", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "${:RO}" }],
3545
"Target": [ {"version": "[10,)", "wlst_mode": "offline", "wlst_name": "Target", "wlst_path": "WP001", "value": {"default": "None"}, "wlst_type": "delimited_string" },
3646
{"version": "[10,)", "wlst_mode": "online", "wlst_name": "Targets", "wlst_path": "WP002", "value": {"default": "None"}, "wlst_type": "jarray", "get_method": "GET", "preferred_model_type": "delimited_string", "set_method": "MBEAN.set_target_mbeans", "set_mbean_type": "weblogic.management.configuration.TargetMBean"} ],
37-
"Untargeted": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "Untargeted", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean" } ],
3847
"ValidateDDSecurityData": [ {"version": "[10,12.1.2)", "wlst_mode": "both", "wlst_name": "Validate${Dd:DD}SecurityData", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean", "get_method": "${LSA:GET}"},
3948
{"version": "[12.1.2,)", "wlst_mode": "both", "wlst_name": "ValidateDDSecurityData", "wlst_path": "WP001", "value": {"default": "false"}, "wlst_type": "boolean" } ],
4049
"VersionIdentifier": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "VersionIdentifier", "wlst_path": "WP001", "value": {"default": "None" }, "wlst_type": "string", "access": "RO" } ]

0 commit comments

Comments
 (0)