summaryrefslogtreecommitdiffstats
path: root/models-pdp
AgeCommit message (Collapse)AuthorFilesLines
2019-04-29Address sonar issue in policy-models/pdpJim Hahn1-3/+5
Extracted a common constant. Change-Id: I24504109e9c7bbed352fa3e845d7d3f7b07db970 Issue-ID: POLICY-1708 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-25Add copy constructor for PdpStatus3.0.2-ONAPJim Hahn6-0/+227
Change-Id: Id818d3b16355ad3f3a96ff4456ec8e8062055f98 Issue-ID: POLICY-1645 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-25Populate policies, even if emptyJim Hahn2-1/+3
Modified PdpUpdate to create an empty policy list, by default, rather than leaving it null. Change-Id: I81906410bcc7da21d6471d496713ec9b375632a2 Issue-ID: POLICY-1692 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-16Don't include "nullVersion" in swagger APIJim Hahn1-0/+3
Swagger sitll uses jackson, thus it is including ToscaPolicyIdentifierOptVersion.isNullVersion() in the API that it generates. Added @JsonIgnore annotation to prevent it from being included. Similar issue with get/setVersion() in PdpGroup. Created POLICY-1653 to remove the isNullVersion() method altogether in El Alto. Change-Id: I6cb7b7d1d75258eeb9d6f9b6c7a48eeb32174307 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-16Fix null not accepted on PDP messageliamfallon2-1/+3
Issue-ID: POLICY-1648 Change-Id: I580d1c433cd3a5730b115ef6353770f17939cf3a Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-15Fix sonar issue in PdpGroupsJim Hahn1-3/+5
Extracted common string constant. Change-Id: I5721641d8a45e7dce317cb6a1b75570a715779ea Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-15Use keys to speed DB queriesJim Hahn1-3/+3
When a filter specifies a name (and possibly version), those can be used to speed DB searches. Modified the code to use the keys rather than always retrieving every record before applying the filter. Change-Id: I6b48d9e6880ab7e8132d5d8f770394720031b9b5 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-13Disallow empty subgroup list in group requestJim Hahn3-8/+26
Change-Id: I8a00caf1b22363fe3ab90bdf57244af687a2cb6d Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12Check for duplicates in listsJim Hahn4-18/+36
Modified duplicate subgroup check to eliminate sonar issue. Added duplicate group check. Modified ModelsTest to exclude PdpMessage, which seemed to cause intermittent junit failures. Change-Id: Id281874506d3a39610739e24cee49360b345724f Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12Remove version from PdpGroupliamfallon10-423/+134
Issue-ID: POLICY-1095 Change-Id: I91f495947fe77222804e7ab31c4dd7d7aee66b44 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-12Add validation methods for PAP REST APIJim Hahn9-22/+404
Also made the identifier classes comparable. Stupid tabs. Change-Id: I54c0595c6a2c61a1b72b58fe1d667657f9d5d71e Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12UNit test and minor fixes for DB parsliamfallon1-9/+6
Add unit test for the new database provider driver parameter. Address the comments raised in the last review. Issue-ID: POLICY-1095 Change-Id: I9f629d9f4446d12bfb492e00e49e07b97ef5a490 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-11Merge "Fix database properties"Pamela Dragosh2-46/+15
2019-04-11Fix database propertiesliamfallon2-46/+15
Issue-ID: POLICY-1095 Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-11Add constant PdpGroup.VERSIONJim Hahn1-0/+6
At some point, the "version" field will be removed from PdpGroup. Until then, all groups should have the same version, thus added a constant for that value. Change-Id: Ib81e2760d04bea0abf83c42bf95fe861a7471176 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-10Finish unit test on policy-modelsliamfallon3-15/+26
Unit test coverage well over 90% in policy-models-base policy-models-dao policy-models-pdp policy-models-tosca policy-models-provider Issue-ID: POLICY-1095 Change-Id: I7703e2ae8a93575ca478c3d809ff8c1fb9f0f334 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-09Complete unit test for models-pdpliamfallon4-169/+668
This review completes the unit test for the models-pdp module, for persistence of PDP groups and for PDP group filtering. Added unit test of filters for TOSCA policy types and policies. Added fix to allow filters to pass when the value being checked is null. Issue-ID: POLICY-1095 Change-Id: I982400ef39f0282d813d49e484a58207e03b8a63 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-08Add lists and tests for PDP filtersliamfallon10-80/+553
The policy type and policy filters for PDP groups are added in this review. Also filter tests for PDP group filter is completed. Issue-ID: POLICY-1095 Change-Id: Ia28776c809f2ab879af4007b3480621637a83f69 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-08Merge "Add bug fixes and tests for filters"Jorge Hernandez11-112/+531
2019-04-08Merge "Add PdpMessage.appliesTo()"Pamela Dragosh3-16/+168
2019-04-08Add bug fixes and tests for filtersliamfallon11-112/+531
Fixed bugs on filtering where lack of null checks was blocking all results. Added unit test for PDP related JPA objects. Fixed cascading and orphan control on JPA objects. Added partial testing of PdpProvider. Added partial testing of filters. Changed tag for content of operational policies from "Content" to "content". Issue-ID: POLICY-1095 Change-Id: Ieb22e06955a8434b490bae7d0f6b77d4479515e8 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-08Add unit test for PDP groupsliamfallon10-70/+909
Unit test for the JPA concepts in models-pdp. Issue-ID: POLICY-1095 Change-Id: Id33626f3789da45e36935edf564003651e9ce7c4 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-07Add PdpMessage.appliesTo()Jim Hahn3-16/+168
Added a method to determine if a message is applicable to a particular PDP. This is a common function that should have been added previously, as each PDP type has had to create an implementation of it. Nevertheless, this provides a "reference" implementation. Change-Id: I54073c77a9d2b4c1f902c5ac0bce9fa5fa485503 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-06Fix bugs on filtersliamfallon2-2/+26
Filters were not being invoked from providers. Filter for getting latest version was filtering out everything Filter on PDP state was not implemented. Issue-ID: POLICY-1095 Change-Id: If43ce48a57b010e05f75db8cfa80e63f2719ace1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-05Complete filters for Database Fetchesliamfallon3-11/+96
This review completes the implementaiton of the filters for fetching policy types, policies, and PDP groups from the database. It also fixes bugs in Policy type creation. Yaml in some of the policy type examples modified so that it is syntatically correct. Proeprties now stored as a blob in DB as they can be big. Issue-ID: POLICY-1095 Change-Id: I6aef88ee2905afa58d778d82832f2b55d794fe9c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-04Updates to models from scrum on 4/4Jim Hahn19-428/+91
Moved ToscaPolicyIdentXxx classes from models-pdp to models-tosca, and added methods to retrieve them from a ToscaPolicy. Removed version and instance fields from PdpStatus. Chose to leave "description" field in the PAP/PDP messages. The PDPs can ignore them or leave them null. In a PdpUpdate message, the description will be the description associated with the PdpGroup. In a PdpStatus message, the PDP could choose to provide a description of the PDP, itself (or the type of PDP). Added comments to that effect. Moved name, group, and subgroup fields into PdpMessage. Fixed typos in comments. Updated licenses. Change "long" to "Long" in PdpUpdate. Use lombok @ToString instead of override. Fixed merge conflict. Change-Id: Icd928f9a7630b838ad4b0b5556e899dc21b7872b Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-04Add filters on policy objectsliamfallon1-1/+43
I just raised this review to shwo where I'm going with the filters. They are not complete yet. Issue-ID: POLICY-1095 Change-Id: I7b602a32bb67159b893f3b3cefea5d88038c4e5f Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-04Merge "Add filter obejcts for concepts"Pamela Dragosh3-31/+46
2019-04-04Add filter obejcts for conceptsliamfallon3-31/+46
This review: - Fixes the bug in getting policies where the key fields were null - Removes complex version checks from DAO interface - Simplifies provider API by introducing filter objects for searches Issue-ID: POLICY-1095 Change-Id: I5ab7471c03e8b61849e7882ed18541acd627dc39 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-03Updating PdpStatistics modelramverma1-3/+4
Change-Id: Ic3ae28997dd1db14c16bdfd24a5d936393fa8da4 Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-03Merge "Add impl of more PDP persistence"Liam Fallon1-15/+127
2019-04-03Add impl of more PDP persistenceliamfallon1-15/+127
Add the implementation of more metods in the PDP provider. Issue-ID: POLICY-1095 Change-Id: Ie02189cad7a262a453e1f731190525f838648401 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-03Changing PAP model as per discussionramverma13-128/+83
1) Changing PAP models to use ToscaPolicyIdentifier instead of actual ToscaPolicy itself. 2) Deleting unused PdpHealthCheck message. As we decided to return heath check based on DB state. 3) Updating PdpStatus message to use ToscaPolicyIdentifier instead of actual ToscaPolicy itself. Pdp don't need to send the whole ToscaPolicy everytime in heartbeat to PAP. Instead the identifier is sufficient. Change-Id: I50ead8d8b6af118fd1da08071a2b0fc50584d4aa Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-02Add persistence for PDP conceptsliamfallon10-18/+1404
This review adds the JPA annotations to PDP group/subgroup and PDP for persisting to the database. It also updates the Provider API as requested by other team members. Issue-ID: POLICY-1095 Change-Id: I8188afb763849ede9680f3751b464d9d76c27196 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-02Adding pdpHeartbeatIntervalMs to PdpUpdate messageramverma2-3/+6
Adding pdpHeartbeatIntervalMs to PdpUpdate message. The value of which can be used by Pdp to override its own interval for sending PdpStatus message as heartbeat to PAP. Change-Id: I720713b9b569cf09bf393ac797da29e7f330f8bf Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-02Merge "Remove pdpType from PdpUpdate"Liam Fallon2-5/+2
2019-04-02Merge "Add extra methods to Provider interface"Pamela Dragosh1-7/+103
2019-04-01Remove PfConceptKey from models-pdp classesJim Hahn6-141/+65
PfConceptKey has different notions of "null", thus removing it from models-pdp. Change-Id: I3b0fc818a8283dcca0fb67ec6c3b6e2302d26196 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-01Remove pdpType from PdpUpdateJim Hahn2-5/+2
The pdpType field is redundant; it has the same value as the pdpSubgroup field. Change-Id: Id5cd0c726ffcf73aa82d35eb8cdbf1d7e3c2abc8 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-01Add extra methods to Provider interfaceliamfallon1-7/+103
This review provides the full specification of the Provider interfce and stups the new implemented methods into the relevant delegated providers. Issue-ID: POLICY-1095 Change-Id: I5f297f8dbbe4131ce910fce95459425ac8b7c3f9 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-01Fix breakage from ToscaPolicy refactoringJim Hahn1-8/+11
A few tests in models-pdp broken when ToscaPolicy was moved and refactored. Change-Id: If8e17a140ebc4f8f83b1f5c7cb32a542dd6e5390 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-01Merge "Add copy constructors to more models-pdp classes"Liam Fallon4-2/+165
2019-03-31Add copy constructors to more models-pdp classesJim Hahn4-2/+165
Change-Id: I9c6dc85b13e3e114f380dd9581f3f4c055889260 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-29Restructure for authorative modelsliamfallon11-33/+37
Use authorative models instead of the JPA stored models as the venacular models in the Policy Framework. The next step is to pass the authorative objects over the provider interface rather than the JPA obejcts. This change will be made in the next review. Minor changes to pdp objects to remove JPA things from them. These object will be the authorative in-memory obejcts on the PDP side and new JPA entity object will be introduced in a future review to persist them. Issue-ID: POLICY-1095 Change-Id: I40e7b713903980cb41bb315417111b67a9b17307 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-27Add support for legacy guard policiesliamfallon1-0/+86
Support for legacy guard policies added. Support for translation of all legacy policies to TOSCA format now complete. Fix merge problems with dummy provider implementation. Issue-ID: POLICY-1095 Change-Id: I3dd1775b78d39078a884e1834502b832ff40be18 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-26Add Legacy Op Policy Persistenceliamfallon3-5/+15
Legacy operational policies now fully supported for serialization and persistence from provider through to database and back. Unit test coverage completed also Issue-ID: POLICY-1095 Change-Id: I65755859c94b50edee537d2685f51a7838c6541f Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-25Add internal classes to models-pdpJim Hahn7-0/+449
Added PdpGroup and other classes. These are the objects that will will actually be stored in the DB. The DB Provider classes should be updated to use these instead of the external classes found in models-pap. Note: These were copied from policy/pap. Change-Id: I2e5518d28e79c26038d0a1600553ab058bcdda1a Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-25Add PolicyIdentOptVersionJim Hahn8-1/+510
Added additional PolicyIdentXxx classes. Added PdpDeployPolicies, which makes use of it, thus eliminating the need for PdpPolicies, which will be deleted once the PAP has been modified to use the new code. Added Validated class to facilitate field validation. Added utility methods to Validated class. Use new validator methods in PolicyIdentXxx classes. Use addError() method in validator class. Use parameter types instead of "?". Use static Validator instead of local. Get "result" from each call to a validateXxx() method. Derived PolicyIdentOptVersion from PfConceptKey. Moved PolicyIdent classes to models-pdp. Added PolicyIdent classes to models-pap. Also removed copy constructors from classes in models-pap, as those are plain POJOs that will not be copied. Copy constructors will be added to new classes that will be added to models-pdp in a separate review. Forgot to include the new Ident classes in models-pap. Change-Id: I923132c464c7802ee3e9225685cde44f36c64620 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-22Add models-pdp to models repoJim Hahn13-0/+662
Also changed supportedPolicyTypes to PfConceptKey. Updated licenses. Removed trailing whitespace from pom. Provide default request id. Rebased to fix merge conflict. Added SupportedPolicyType class. Renamed SupportedPolicyType to PolicyTypeIdent, and moved it to models-base. Also updated models-pap to use it. Deleted models-pdp Policy and replaced it with ToscaPolicy. Updated test method name. Change-Id: Id65f769c2f308c6b56e79978bd50b84f2e0b3d02 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>