summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src
AgeCommit message (Collapse)AuthorFilesLines
2019-06-20Set timeout to CL timeout if zeroJim Hahn4-1/+129
Modified the rules to set the operational timeout to the overall CL timeout if the operational timeout is zero. Added code to check for zero timeout for the overall CL, too. Change-Id: I28d41632f59e9bc2fce953267883d567abc92a49 Issue-ID: POLICY-1859 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-17Change getCanonicalName() to getName() in drools-appsJim Hahn3-4/+6
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Change-Id: Ie402ab9239b2d5149c420d495f16bb82417d2d25 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-05-21Check for null vserver.pramod.jamkhedkar2-0/+21
Handles the case where vserver name is not present in onset mesage. Issue-ID: POLICY-1778 Change-Id: Ie7a1b9d207860a70b49309049b512fc8ce05a984 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-04-29Fix sonar bug and upgrade parentPamela Dragosh1-0/+4
* Fix simple sonar bug for logging errors * Private constructors to hide implicit. * Not enough arguments for debug statement * Upgrade to policy/parent released version Issue-ID: POLICY-1700 Change-Id: Id8040c2aa0abdbe4946db60f97cb279974817447 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-26New BUILD_VERSION needed as fixed in parent imagejhh1-1/+1
BUILD_VERSION could not be used in ENV variable as it is cooked in the base image itself. Need to create a new one to reflect the drools build to get by. Some minor additional changes as to exit shell when a docker command fails for clarity when executing these operations is added as well. Change-Id: Ic8dfc03bc0563c088d55b1991a0f8c431ab0fab2 Issue-ID: INT-998 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-04-25Match up ControlLoopParams against ToscaPolicyjhh3-0/+145
Change-Id: Ia23a5b90b452bcafe2a8aa660598697ebfb07431 Issue-ID: POLICY-1691 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2019-04-11Merge "Drools-App changes to support CQ"Jorge Hernandez5-80/+845
2019-04-11Drools-App changes to support CQpramod.jamkhedkar5-80/+845
Changes in event manager to support Aai custom query Issue-ID: POLICY-1278 Change-Id: I693dd6b94f1fa6f24b08a389db099914636cf2ba Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-04-11Cleanup PIP/Database-related code.Joshua Reich6-274/+57
Ensure database schema/naming consistent across repos. Ensure PIP implementation consistent across repos. Cleanup unused imports and made sure licenses are ok. Issue-ID: POLICY-1471 Change-Id: I20a325fe3e66e6ae400e603ec366315aea716993 Signed-off-by: Joshua Reich <jreich@research.att.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-10Parse new model ids from operation policyvamshi.nemalikonda1-1/+27
Takes VFModule info from policy yaml,instead AAI. Change-Id: If745b3ba32562cbc37571cea29ec7797ee697e88 Issue-ID: POLICY-1545 Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
2019-04-08Code changes done for OOF SON use caseSaravanan A1-1/+22
Added a new control loop for SON ANR changes Introducing control loop response flow using DCAE_CL_RSP topic Change-Id: I81d0e92ce2f5c489596ad70d7b523cab0d8436ce Issue-ID: POLICY-1463 Signed-off-by: Saravanan A <saravanan.a75@wipro.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-08update dependency to policy/modelsshaoqiu1-23/+26
Update the dependency of model-impl from drools-applications to policy/models. Issue-ID: POLICY-1264 Change-Id: I07fcb29501499a97689d2d27c845bf8e411e7825 Signed-off-by: shaoqiu <tim.huang@est.tech> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-05Add CCVPN Bandwidth on demand policyVidyashree Rama1-2/+4
CCVPN Bandwidth on demand policy Issue-ID: POLICY-1405 Change-Id: I67bceb35e5a849933b3e46772c9cbbbaab1e9a75 Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
2019-01-14Remove eventmanager checkstyle suppressionsJim Hahn3-60/+62
Renamed enum class name and various method names in ControlLoopEventManager. Change-Id: I18b4a7d30a24dfcf3b155fd662433590b9d4c769 Issue-ID: POLICY-1138 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-14Remove model-imp/rest checkstyle suppressionsJim Hahn1-6/+6
Renamed "RESTManager" class to "RestManager". This did not require any changes to rules. Updated license data in pom. Change-Id: Ide59b99b8c5d939804b7540c71a686404195173c Issue-ID: POLICY-1141 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-11Remove model-impl/so checkstyle suppressionsJim Hahn2-12/+12
Renamed classes from "SOxxx" to "SoXxx". Also renamed a few method names to make them camelcase, too. Updated drl files with above changes. Change-Id: I06aa303a20911733f870947c55e01f3a2dc66fa3 Issue-ID: POLICY-1143 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-10Remove model-impl/vfc checkstyle suppressionsJim Hahn2-10/+10
Entails renaming VFCxxx classes and updated drl files, as well. Change-Id: Ib31c61a35536df22772de6090761b22beb1b561b Issue-ID: POLICY-1145 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-11-26Rename test classes in drools-applicationsParshad Patel3-8/+8
Make test classes name consitence by adding 'Support' or 'Dummy' at start of util or dummy type of test classes Issue-ID: POLICY-1258 Change-Id: Idea946375ee46f14512d4c4bc29e65adaa4d2b37 Signed-off-by: Parshad Patel <pars.patel@samsung.com>
2018-10-23Add CCVPN policyVidyashree Rama1-0/+35
CCVPN policy Issue-ID: POLICY-1209 Change-Id: I8adea233f8672c9ff43b4a169b50336d9e43c91d Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
2018-10-05Add new actor SDNC to support CCVPN Closed LoopXin Miao1-0/+12
Issue-ID: POLICY-1183 Change-Id: I1b77b5b9cefca104382d9d84dd00bbd63b20e0f2 Signed-off-by: Xin Miao <xin.miao@huawei.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-10-02Fixing sonar issuesPamela Dragosh1-0/+1
Some trivial functional interface and ordering. Added some missing JUnit tests. Issue-ID: POLICY-1129 Change-Id: Iad6fe757a40819ca39e007b41dae1bf4b3f6cc0c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-10-02Merge "Fix remaining sonar"Pamela Dragosh1-0/+1
2018-10-01Fix remaining sonarPamela Dragosh1-0/+1
Mostly moving variables to their right spot. Issue-ID: POLICY-1129 Change-Id: Iccc084bbb404ffd51bdd0b26b5f8c373c6142fb1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-28Merge "Yet more sonar issues in drools-applications"Pamela Dragosh1-3/+1
2018-09-27Fix more sonar issuesPamela Dragosh1-59/+56
Most of these are minor issues along with a few others. They have been bugging me so I thought I would get them done. Some also do not show up on sonarlint. Issue-ID: POLICY-1129 Change-Id: I31f2765f6babdfa80b23f0589daacc98da8d2002 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-27Yet more sonar issues in drools-applicationsJoshua Reich1-3/+1
removed unused imports and variable definitions moved variable declarations above methods refactored deeply nested if/while removed code smell due to unecessary use of static keyword moved string literals to left side of comparator fixed logging of exceptions immediately return expression instead of assigning it to the temporary variable Change-Id: Idfd2a2bdf3c2f3bbfcb54a06b713d57bc867b3ab Issue-ID: POLICY-1129 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-09-25Fix sonar criticalPamela Dragosh1-8/+8
Sonar complains that the password is an actual password when in fact we are doing exactly the fix they suggest. I seem to not have access to resolve it as a false positive. So it seems the better way to do this is rename this to reflect that it is actually a property value. Had to also address 120> due to new variable name size. Issue-ID: POLICY-1135 Change-Id: I2e2a36ed8d7f5c95e912df4f6ed74983cee8a3dd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-24Fix checkstyle declarationsPamela Dragosh2-15/+16
I fixed what I thought would be tolerable for this release. Same issue as policy/common I had to defined the checkstyle in each repo where the suppressions were needed. Issue-ID: POLICY-1135 Change-Id: I8f30bee7e9cddc692ddad3cf88acedb2e6b4781b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-21new sonar issues in drools-applicationsJim Hahn1-10/+13
Don't return null lists from AAI. Transient TargetLock. Extract aai.url, et. al., constants. Don't allocate extra unneeded variable. Re-order fields in xacml attributes. Extract "vserver" constant from simulator. Replace thread sleep with join. Change-Id: Iee1bd182862632af1f131cca5db5b526f5865b9f Issue-ID: POLICY-1129 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-14Option to disable target locking. Needed by CLC.Joshua Reich1-3/+26
When used, the ControlLoopEventManager will set useTargetLock to false converting TargetLock lock/unlock operations to no-ops. Allows CLC-specified logic to coordinate closed loops instead of hard-coded mutual-exclusion enforced by target locking. Change-Id: Ic067c1e1ce47b12d12742ed4bc04d59aa42751d6 Issue-ID: POLICY-953 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-09-12implement Serializable in additional classesJim Hahn5-11/+82
Change-Id: I5d5acb9d71dc49eaa9fb397da5988ba3d8bd5f1d Issue-ID: POLICY-1106 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-12Add implementation for OOF PCI use caseSaravanan A1-1/+58
Receive DMaaP message from PCI-Handler MS with PCI Config change recommendations through DCAE_CL_OUTPUT topic. Trigger SDN-R (if allowed by policy) by sending DMaaP request through SDNR-CL topic. When the response is received from SDNR through SDNR-CL-RSP topic, just parse and print. Code review comments addressed Change-Id: If340a23ae18367b7f98e31fe79c09a09e645b2ad Issue-ID: POLICY-1089 Signed-off-by: Saravanan A<saravanan.a75@wipro.com>
2018-09-04Added junit test for commitAbatement.Joshua Reich2-13/+104
Change-Id: Iee71481e357861618bed068f8b8ef37ec0ea2ab8 Issue-ID: POLICY-975 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-08-31Add code to store abatement events.Joshua Reich2-1/+55
Stores abatement events in history DB. Change-Id: Ifca6acd42cd9eea85e27765bd268a491028e305a Issue-ID: POLICY-975 Signed-off-by: Joshua Reich <jreich@research.att.com>
2018-08-29Fix remaining checkstylePamela Dragosh3-17/+21
Lots of formatting, missing javadoc, distance from use, imports must be explicit, ordering of methods. Fixed some abbreviation problems in classes and renamed JUnit tests to fix this. Issue-ID: POLICY-883 Change-Id: I8494f63d88d63c0232aca97f7bcc848816228fb1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-08-21move AAI named queryJim Hahn3-54/+182
The AAI vserver named-query was being done as a preliminary step for the SO request. However, it will now be needed during the guard query, which happens much earlier. Thus it has been moved from the SO classes into the event manager class, where it is retrieved in a lazy fashion and cached. Also removed some trailing white space. Update licenses. Make test method private. Change-Id: Id7353a2e0f2d42601d5142cb92961528fa21aa94 Issue-ID: POLICY-1011 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-17fix new sonar issues with prov-status checkJim Hahn1-36/+37
Changes made while adding the prov-status check triggered some sonar thresholds in ControlLoopEventManager. Updated the code to resolve them. One of the changes that had been introduced was to check for the existence of both the is-closed-loop-disabled AND the prov-status fields. However, if one is there then the other should be there, thus the second check is redundant and was removed, which should reduce the cyclomatic complexity back under the threshold. Re-ordered the code a little, to make it less ambiguous. Removed trailing white space. Change-Id: If0ce74cedbf947c32cae3df3374cda6ba1305cd2 Issue-ID: POLICY-964 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-15add prov-status check to AAI queriesJim Hahn2-183/+428
Also had to add prov-status field to AaiGetVnfResponse class. Removed bogus comment from test. Verify response is not null in test. Verify no requery by vnf name in test. Add prov-status to template.demo tests. Add prov-status to sample json for archetype-cl's. Change-Id: I3f36a2bb6de8265ce5b10103690d6d8813c15b1a Issue-ID: POLICY-964 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-15Merge "Fix checkstyle issues"Jorge Hernandez1-2/+2
2018-08-15Merge "update AAI response classes per API"Pamela Dragosh2-62/+51
2018-08-14Fix checkstyle issuesPamela Dragosh1-2/+2
Spacing, missing javadoc Issue-ID: POLICY-883 Change-Id: Ice65c6c1baf0bb7c6273411f078bacfe3496b89b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-08-14update AAI response classes per APIJim Hahn2-62/+51
Several of the AAI response classes did not match the new AAI interface. Updated AaiGetVnfResponse and AaiGetVserverResponse and the classes they use to reflect the new API; other top-level classes were left untouched. Fix checkstyle errors. Change-Id: Ife5830c45ba8aece8d676a10f0fd8a9c9fe6cb66 Issue-ID: POLICY-964 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-13Resolve checkstyle formattingPamela Dragosh1-13/+13
This submission is mostly focused on 120 spacing, missing spaces, rearranged imports, newlines before package and a few other items. Will have to submit further reviews to finish this. Issue-ID: POLICY-883 Change-Id: I772a2077ac97a0cb929810d8afadd2f415fae17b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis2-5/+5
Replaced references to classes deleted from drools-pdp with references to the corresponding in policy-common Issue-ID: POLICY-967 Change-Id: Ia9d2ac704e6b7c434e5a9e7aee6d7dcf9198e4f2 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-05Clean up objects for deleted rulesJim Hahn2-1/+13
When rules for a closed loop are deleted, associated working memory elements may be left around. Modified the code to retract the various elements. Re-added code to unlock when retracting TargetLock. Add junit tests for new methods. Forgot the junit test for request id. Change-Id: Iec2805adbdb147a643f6163badee05ea353ada88 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-05unlock should always return TargetLockJim Hahn2-7/+9
ControlLoopEventManager.unlock only returns the TargetLock if the PolicyGuard.unlock operation is successful. However, if the lock has already expired, then PolicyGuard.unlock will return false, and ControlLoopEventManager.unlock will then return null. As a result, the rules do not retract the TargetLock. (The rules do, however, retract any left-over TargetLock objects during the clean-up phase. Nevertheless, the earlier rules should not have to depend on the clean-up rules to do that.) Modified the code to address this issue. Change-Id: I2e6099a4e3511053d2e6e1373cae4b480798d1b6 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-29Add time limit to local guard locking facilityJim Hahn2-2/+13
Modified the local policy guard locking facility to add a time parameter. Modified the control loop event manager to extend the lock when lockCurrentOperation() is re-invoked. Modified the rules to retract the lock if the lock request was denied. Reorder assertions in junit test. Change-Id: Ic9b77acbb4881a5a516f30eb56664bad1a5c4d7e Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-27Modify PolicyGuard to use new locking APIJim Hahn1-1/+1
Modified PolicyGuard to use the locking API from policy-core instead of its own internal map. Initialized PolicyGuard.factory. Fixed bug in eventmanager junit test uncovered due to changes to PolicyGuard. Change-Id: I853ee5f146f3bde16b3f6e65bc188ca7c0cc4f73 Issue-ID: POLICY-577 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-25Prevent AAI re-queryJim Hahn2-51/+61
Modified event manager code to not query AAI if there's already a response from a previous query. Modified code to store AAI properties in local variables instead of static to prevent any chance of a race condition in a multi-threaded situation. Updated junit tests to use a new manager for each subsequent query. Update license. Change variable name, in junit test, from onsetEvent to event, because it can be any type of event. Included fix to prevent initial AAI query if AAI data was already available in the initial onset event. Change-Id: Idf3e15ea8c5e297f22f23570c22fd837b72ba200 Issue-ID: POLICY-754 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-16Add missing license headersPamela Dragosh8-0/+104
I removed a couple of empty README and added licenses. Issue-ID: POLICY-741 Change-Id: I10aad3536d02b738a1dc606f7311de6b3a2777cd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>