-
Notifications
You must be signed in to change notification settings - Fork 2
RAD-6204 6206 Update Mango Configuration Data Source To Support New Locators and Publishers #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ew Locators and Publishers
aasbra
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added comments that should be addressed before the PR can be merged. Please let me know if you have any questions.
track-mango-details.js
Outdated
| } | ||
| } | ||
|
|
||
| function processSystemMetrisLocatorType(locatorValue){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
processSystemMetrisLocatorType should be processSystemMetricsLocatorType
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected
track-mango-details.js
Outdated
| return 'undefined'; | ||
| } | ||
| }catch(err){ | ||
| LOG.error('Publisher Locator testing' + ' ' + err.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only have "testing" in the logs during testing, that should not be in the final PR. Also, this method is a generic method for retrieving JSON values, it's not specific to Publishers. The error log entry should not reference Publisher. It should reference an error when retrieving a JSON value. It would also be good to include the jsonObject and path data to help with troubleshooting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected jsonObject and path added in log entry
track-mango-details.js
Outdated
| } | ||
| } | ||
| } else { | ||
| LOG.debug("empty object receioved."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
receioved should be received
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corrected
track-mango-details.js
Outdated
| return this.fetchedLocatorValue; | ||
| } | ||
|
|
||
| function getValueBackup(jsonObject,path){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method removed, it is only backup of existing method
track-mango-details.js
Outdated
| return this.fetchedLocatorValue; | ||
| } | ||
|
|
||
| function getTestJson(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this method? If this is from testing, it should not be included in the final PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method removed . It provides test json data for testing.
track-mango-details.js
Outdated
| continue; | ||
| } | ||
|
|
||
| if(locatorType === 'publisher') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add logging locatorParam1 inside the publisher method and remove it from this method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been fixed.
track-mango-details.js
Outdated
| } | ||
|
|
||
| function processSystemMetrisLocatorType(locatorValue){ | ||
| return monitoredValuesHashList.get(locatorValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to provide some logging if the locatorValue is not found. All the other methods include this type of logging, this one should not be different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locatorValue not found logging info added
track-mango-details.js
Outdated
| var AbstractPublisherModelObj = RestModelMapperInstance.map(PublisherVO, AbstractPublisherModel.class, Common.getUser()); | ||
| var PublisherJsonString = mapperInstance.writerWithDefaultPrettyPrinter().writeValueAsString(AbstractPublisherModelObj); | ||
|
|
||
| return getPublisherLocatorTypePropertyValue(PublisherJsonString,locatorValue); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to provide some logging if the locatorValue is not found. All the other methods include this type of logging, this one should not be different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this has been fixed
track-mango-details.js
Outdated
|
|
||
| //get the bean named restObjectMapper and make sure it is of type ObjectMapper | ||
| var mapperInstance = Common.getBean(ObjectMapper.class,"restObjectMapper"); | ||
| var PublisherVO= PublisherService.get(locatorParam1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to add a check to confirm locatorParam1 returns a Publisher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added. please check line 280-292
track-mango-details.js
Outdated
| return getPublisherLocatorTypePropertyValue(PublisherJsonString,locatorValue); | ||
|
|
||
| } catch(err){ | ||
| LOG.error('Publisher locatorParam1: ' + locatorParam1 + ' ' + err.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should include the locatorValue in this log as well to help with troubleshooting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes added
RAD-6204 Update Mango Configuration Data Source To Support New Locators
RAD-6206 Update Mango Configuration Data Source To Support Publishers