aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/templates/archetype-cl-amsterdam/src
AgeCommit message (Collapse)AuthorFilesLines
2018-02-08JUint/Technical Debt for eventmanagerliamfallon1-1/+1
Unit test expanded for SO POJOs, technical debt removed in eventmanager. Change-Id: I7045f5af88fd2c15019befe29a0b4fcd69801c49 Signed-off-by: liamfallon <liam.fallon@ericsson.com> Issue-ID: POLICY-455 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-02-06Add JUnit and Remove Technical Debt in Guardliamfallon1-5/+5
Unit test for guard added and technical debt removed. Issue-ID: POLICY-455 Change-Id: I440766660ddae078013e21b1991ee49c8e488bb3 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-01-18Fix Tech Debt/JUnit on control loop event POJOsLiam Fallon1-160/+160
Mainly making fields private, fixing field and methods to follow Java guidelines, and adding getter and setter methods. Unit test added for all classes in org.onap.policy.controlloop Issue-ID: POLICY-455 Change-Id: I445b7cfaf9eb921a230bbb72b06ff4455fe003ce Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
2017-12-08remove synchronized calls to avoid race conditionsJorge Hernandez1-26/+0
This is to prevent potential problems where multiple jar versions are updated one after the other. Change-Id: I78835b485e57125efb213cfdefba60351d815916 Issue-ID: POLICY-487 Signed-off-by: Jorge Hernandez <jh1730@att.com> (cherry picked from commit f2715bc0f272e5e657ed8a82c0f4e520a7c7706d)
2017-11-13default archetype tooling to 1.1.1Jorge Hernandez1-4/+4
Change-Id: I84cf9fe9e954a9ee9bac8eaff56169e44154e9c5 Issue-ID: POLICY-446 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-11-08Fix SO Request bodyHockla, Ali (ah999m)1-3/+4
- Renamed modelNameVersionId to modelVersionId in SOModelInfo - Removed requestID from SO Request body - As a result of this, an SOResponseWrapper was needed in order to attach the control loop event requestId to use in the SOResponse rule in drl (the requestID that is returned in the SO response is a newly generated requestId with no relation to the Policy control loop event requestId as per Arthur) - Updated drl to reflect the above mentioned change - Updated simulator and junits to reflect changes - Added an additional null httpResponse check/logger statement in SOManager and RestManager Issue-ID: POLICY-438 Change-Id: I5f414ba69b60b5565cca9073b47f4c4835e5abbf Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-11-02Write to DB on guard denyTemoc Rodriguez1-0/+1
When an operations was denied by guard, it was not writing to the DB at all. Only in the deny case we start the operation, then setOperationHasGuardDeny, then finish the operation. Had to add start operation just before finishing it. This allows the write to occur at setOperationHasGuardDeny. Issue-ID: POLICY-345 Change-Id: I665b9cfaa684493e39e731102d4d43ecb39fad7c Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-10-31Fix Abatement Processingdaniel1-1/+3
The drools engine will now only fire the event rule if the event is an onset. This prevents abatements from being processed as onsets. Issue-Id: POLICY-407 Change-Id: Ic74efa74fbb1dc0e01d7c36a06fdaf48fc8a3238 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-30Merge "Fix Final Failure on AAI Queries"Pamela Dragosh1-41/+42
2017-10-30Fix Final Failure on AAI Queriesdaniel1-41/+42
The drools engine will now send final failure notifications if there is an error returned from A&AI queries instead of rejected notifications. Issue-Id: POLICY-364 Change-Id: Ie9c22686d859c633bad47d223726957cc9599f7c Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-27Send final failure on null vfc requestCharles Cole1-0/+5
Made sure a final failure is sent and the memroy is cleaned up if we cannot contruct a vfc request. Issue-Id: POLICY-350 Change-Id: Ia9bc827572042ae6ff2d2d2851d33034ee86fc49 Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-25Fix Source/Target Lockdaniel1-6/+15
The locking of the target is now taken care of when the operation manager is initialized. This allows us to keep the template flow the same and to ensure that for vFW we will not lock the source if it is not intended to be the target. NOTE: This will have to be revised in the future if policy chaining will support having different targets specified for each policy in the chain. Additional work was done for hardening the APPC model code to make sure exceptions are caught and we gracefully end processing the event with memory clean up and a final failure notification sent. Issue-Id: POLICY-367 Change-Id: Ic796d95eb5400067744492f810dd8069ba6241b3 Signed-off-by: Daniel Cruz <dc443y@att.com> Signed-off-by: daniel <dc443y@att.com>
2017-10-24change drl line to avoid velocity bugJorge Hernandez1-3/+7
generating a control loop project from archetype (but not from junits) runs into velocity parse failures as specified in ticket. The existing .drl code for the line that fails the parsing has been slightly modified to bypass this problem. In addition a logging statement has been added to the catch. Change-Id: I3eec82c9b710cc9d2a13dc68032a8a6074016b40 Issue-ID: POLICY-376 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-23Fix handling of aai 'get' errorsCharles Cole1-0/+1
Now reject an event if the AAI get query for the event fails. Added test cases for this behavior. Fixed some issues from my previous pull request. Issue-Id: POLICY-314 Change-Id: I674e95302a271423c307a88d061064e12e491a7a Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-18Add support for AAI Named Query error handlingCharles Cole1-3/+19
Errors from AAI after a Named query now throw an AAIEXception. This is caught in the template to allow the resources to be removed from memory and a final failure to be thrown. Issue-ID: POLICY-314 Change-Id: I319d29ef537b2d01ca288622aac1d9dbbe05f5eb Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-17Fix Target Entity Lockdaniel1-59/+37
This fix enables the pdp to stop events with different requestId's/controlLoopNames from being processed if the target entity specified is already being processed by another event/controlloop. The lock timeout rule is removed to stop the event from waiting to obtain a lock if it was not already required. Handling of the lock denied case is taken care of in the event manager rule instead of in a seperate rule to avoid further unneccessary computation. A new control loop test case was created that is for testing general control loop errors. The test case included is for testing that the lock will deny a request with a duplicate target entity. Issue-ID: POLICY-341 Change-Id: Ib62286eff74ec22b2c645f32f385cb331fb1dff3 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-17Merge "Update SO Interface AAI NQ response from v8 to v11"Jorge Hernandez1-1/+6
2017-10-17Update SO Interface AAI NQ response from v8 to v11Hockla, Ali (ah999m)1-1/+6
- Removed nonBaseIndex since there is only base vf Module in v11 response - Reverted to checkExtractedFields() - Modified the AAI Simulator to return the v11 response - If AAI NQ fails then the SO Request will not be constructed. In this case, we are retracting objects from the transaction and inserting policyResult.FAILURE into current operation to prevent null values in finishOperation Issue-ID: POLICY-339 Change-Id: I1c48fac4f9a51467ad54b0706543f5d1baa70389 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-10-16Update abatement=false and add Abated eventPamela Dragosh5-12/+22
Missing abatement=false for Use Cases other than vCPE. Added DCAE Control Loop Event message for ABATED. Issue-ID: POLICY-346 Change-Id: Ic8890dd81607ff8657a6f9e49cd9be51cb410fe1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-10-10add structure only for PAP rule managementJorge Hernandez1-0/+21
PAP currently generates a set up rule that inserts a Params object when the session is loaded. Since the official template also has an equivalent rule that is used by the drools applications team to perform initializations tasks, at runtime we end up with 2 Params objects with the same control loop data. This has sideeffects where the same rule becomes true for 2 Params objects therefore performing duplicated actions which introduces somewhat anomalous behavior. The PapParams is introduced to satisfy current PAP needs for management of rules. The structure is included here only for those purposes but it carries no significance at runtime during drools executions since the rules go by Params instead of PapParams. In the near future, the plan is to have the PAP not generating SET UP rules. There is a companion review on the PAP side to refer to PapParams instead of Params to fulfill the resolution of POLICY-302. Change-Id: I2f9ed3cee3d5d5209eecd43823cfc44a4b937600 Issue-ID: POLICY-302 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-10-09strengthen APPC Response Cleanup RulesJorge Hernandez1-2/+2
The existing APPC Response Cleanup Rules will drop responses that are not specific for that control loop. For example vDNS control loop will drop LCM Response for vCPE control loops preventing progress of the use cases. This only happens when the control loops coexist with the current set of rules. Change-Id: I5a9ae26e39ecce8dd7f1098d02b6c6b97650b67a Issue-ID: POLICY-298 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-28missing $ in guard expansion variablesJorge Hernandez1-4/+3
Change-Id: I05c577e8760f5b4b8e6375f50a327c9dde575e06 Issue-ID: POLICY-260 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-28Make Guard Configurabledaniel1-2/+5
This allows the user to disable or enable guard through the .properties.environment file. Verified and tested in a pdp. Properties were added to the simulators properties file for the simulators to work out of the box. Issue-ID: POLICY-259 Change-Id: I0027a5d28f1b30e81bdbe42fa17621b36a61c850 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-28Fix Retries for Policiesdaniel1-10/+5
This applies changes to make retries work properly for all control loops. The current design was ignoring the upper bound of the retries and retrying until either a success or control loop timeout occured. This is now fixed to only do retries until the limit is reached that is specified from the policy. The operation is now started in the GUARD.PERMITTED rule. I think this is better because it stops Policy from doing extra processing if there is a guard deny. This is also needed so that we can properly do retries for all cases. The notifications sent in GUARD_NOT_YET_QUERIED and GUARD.RESPONSE are now more informative with the message specifying the actor and recipe. The not queried rule has a message stating that we are sending a query to guard and the guard response message in the guard response rule specifices the result from guard. During a retest of vDNS it appeared that the archetype template was no longer working, this was because there were changes in the JUnit template that were not reflected in the archetype template. These were added to archetype and vDNS is verified to work again. Another small fix needed was making sure the action for vCPE is "Restart" instead of "restart". APPC will reject our request if "Restart" is not sent as the action. Issue-ID: POLICY-259 Change-Id: I28dd3c9a629d297b408775a01afadd5c19351e37 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-28Add missing auth headers to guard requestTemoc Rodriguez1-2/+1
Added guard authentication, client authentication, and environment http headers to the pdp-x guard restful request. Properties are set to PolicyEngine.manager. Property getter, setter, and properties in guard/.../Util.java. Test properties defined in junits themselves. Added code from GuardContext.java to grab the properties and make restful request. PolicyGuardXacmlHelper now closely resembles GuardContext in order to mimic functionality. Guard url no longer is passed into CallGuardTask, it is now a property. Issue-ID: POLICY-260 Change-Id: I5b144764828b6da0e7b738a578e4f6596a0f4f36 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-09-27Fix Use Case Templatedaniel1-3/+3
This is a WIP for getting guard to work. Currently the A&AI GET and named queries are connecting to the simulator and working in the labs. Guard is not connecting to simulator and needs further analysis. Issue-ID: POLICY-259 Change-Id: If9875bfd83cbd82dcae04a876b3818ec9c07b1f7 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-25Fix Usecase Template for VoLTEdaniel3-7/+115
This includes VoLTE support for the amsterdam template. As of right now all use cases are able to get a final success with guard disabled and no A&AI GET queries. Currently, the GET query is not working in the lab. I will address this in another pull request. Issue-ID: POLICY-259 Change-Id: I216aa84daaa1e93ab12c56ee53283b4cb413a7c3 Signed-off-by: Daniel Cruz<dc443y@att.com>
2017-09-22Fix Use Case Testingdaniel11-22/+178
These changes are necessary to get the use cases working on an actual PDP. So far vCPE, vFW, and vDNS have been tested successfully on a pdp. These are priliminary tests to just test a FINAL SUCCESS without A&AI GET queries being used. A&AI named queries for vFW and vDNS have been verified to work. Changes in the template were made for SO as there were changes in the JUnit template that did not get reflected in the archetype template. Changes in the code were made in various places to use the environment properties for REST urls, usernames, and passwords. Due to VoLTE not being tested yet, the url for VFC is still hard coded and will be changed later. It has been confirmed with APPC that LCM will have two topics: APPC-LCM-READ and APPC-LCM-WRITE. Policy needs to sink to APPC-LCM-READ and pull from source APPC-LCM-WRITE. This has been reflected in the controller properties file. Issue-ID: POLICY-259 Change-Id: Ib9a8df07ae5ad9d3052c88907c1e522952af474d Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-09-21Merge "Implement restful call to xacml pdp guard"Jorge Hernandez1-3/+2
2017-09-21Implement restful call to xacml pdp guardTemoc Rodriguez1-3/+2
Removed the embedded guard decision and replace with restful call to xacml pdp to restore guard functionality. Set guard URL with PolicyEngine env properties. Modified templates accordingly. Issue-Id: POLICY-260 Change-Id: Ic1558a6ebdd5f6d1b74a748f69433f6213dbf984 Signed-off-by: Temoc Rodriguez <cr056n@att.com> Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-09-19test tooling to generate vcpe use case in labJorge Hernandez1-0/+22
run successully vcpe case in lab in 2 steps: 1. docker-install load 2. run create-cl-amsterdam (with defaults) 3. injecting dcae.onset and appc.success packaged with archetypes Change-Id: Idb20c0078228da962510dbf36dae96aceb43546c Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-19enhancements to archetype and apps packagingJorge Hernandez4-21/+51
Change-Id: I3e659d35d3cb397c011657f39ef12b10b0564fc9 Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-15Master lab template changes for MSO rename to SOHockla, Ali (ah999m)3-18/+18
Issue-ID: POLICY-162 Change-Id: Ieb0952379cd854e0ed8e4a3b068b7e29f3b93770 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-09-14master lab template maintained under archetypeJorge Hernandez9-0/+1545
This is work in progress, the official pom.xml with dependencies, drl template, and support files for controller deployment are maintained here. In the near future the junit template should be consolidated with this one. Added controlloop.properties.environment, this environment file will be populated at installation time with the lab's aai url, etc .. and will be accessible by any drools application such as control loops through the PolicyEngine interface. Note that PDP-D server already supports these environment files, so it is just natural. Therefore, this is the default mechanism to provide to applications, the url, username, and passwords to use at runtime by the control loops for the time being. In the future MSB could set them globally here through existing APIs, or it can be queried by any drools application using MSB library, doesn't matter. There's been some trouble playing nicely with the dependencies used by a control loop application classsloader, and the pdp-d middleware one, causing issues between dependencies version of libraries. Specifically, the snakeyaml library does not play well across classloader when using constructor functionality, note that the snakeyaml libraries are pulled also from jackson parsers used in the pdp-d. I made a change in ControlLoopProcessor to specifically tell the "Yaml" object which classloader to use in order to find the class with the constructor that is intended to be built, otherwise, yaml libraries use a different classloader that does not have visibility into the ControlLoopPolicy that is trying to construct, and fails. This also should respect junits that use the same classloader I pressume and does not give issues. Change-Id: I36271d29cdbf8ff861f9c03ff91cf7116927906a Issue-ID: POLICY-162 Signed-off-by: Jorge Hernandez <jh1730@att.com>