aboutsummaryrefslogtreecommitdiffstats
path: root/models-provider/src
AgeCommit message (Collapse)AuthorFilesLines
2019-09-05Repair policy types in TOSCA service templateliamfallon2-226/+223
Changed policy types from a list of maps to a map. Changed data types from a list of maps to a map. Made all knock on changes to adapters and tests. Updated Issue ID. Added onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml policy type that is required to be preloaded in policy-api. Issue-ID: POLICY-2047 Change-Id: Ic8e809eab248fd7242f0e565fa2e3da75bcfbdeb Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-06-18Change getCanonicalName to getName in modelsJim Hahn4-5/+8
Per javadocs, getName() should generally be used instead of Class.getCanonicalName(). This change only applies to classes; it does not apply to File objects. Note: this impacts the output from PfValidationMessage, as it will now list the names of embedded classes with a "$" separator instead of a ".". Change-Id: I2cd64bc0281dd324bf80eac57335a7299a516447 Issue-ID: POLICY-1646 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-18Merge "Fix simple sonar issues in models: errors to sim-pdp"Pamela Dragosh8-366/+357
2019-06-17Fix simple sonar issues in models: errors to sim-pdpJim Hahn8-366/+357
models-errors models-pdp models-provider models-sim-pdp Also had to work around this checkstyle issue: src/test/java/org/onap/policy/models/sim/pdp/comm/ TestPdpStateChangeListener.java:[77,32] (javadoc) JavadocMethod: Unable to get class information for @throws tag 'PdpSimulatorException'. The error appears to be bogus, as PdpSimulatorException is on the "throws" line thus indicating that the class IS accessible to the above java file. Change-Id: Iaca58457a32b00121000fc0bab12a8be4cb19bac Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-17Fix the bug of cannot return multiple versions of particular tosca policy ↵Chenfei Gao2-4/+18
and policy type Issue-ID: POLICY-1807 Change-Id: I831c720993930a911d301a82b59a74cda7cb0c50 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-06-14Allow multiple versions of entities to be returnedliamfallon1-13/+14
Fix .gitreviw file to point at "master" rather than "dublin" Allow return of multiple versions of policy types and data types in TOSCA service templates and multiple policies in TOSCA topology templates. Because the return type is a list of singleton maps, utility methods were added to return flat maps of poliicy types, data types, and policies keyed by a compound ToscaEntityKey name/version key. Issue-ID: POLICY-1807 Change-Id: I355038aaca26f41064d0e3cb3b45b1de2294cf5f Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-22Fix name/version regexp in model keysliamfallon3-14/+14
The regular expressions for checking names and versions in policy key names and versions were not expressive enough to restrict all error names and versions. Issue-ID: POLICY-1777 Change-Id: I037eca051f6c7a9f1e7182150d40d8b8d906a75c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-21Add version on legacy get/deleteliamfallon8-59/+116
Issue-ID: POLICY-1777 Change-Id: I5b07ad1acdb4a614a50cb15978130c19bc5786f7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-09Store legacy op policy properties as plain stringsliamfallon2-0/+4
THe properties of legacy operational policies are already encoded and should not be stored in JSON format. Issue-ID: POLICY-1759 Change-Id: I3e2a69f216348c02c2ef9c23282f87da52a7f390 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-09Store policy type version in policy before DB writeliamfallon1-0/+2
The policy type version must be updated on a policy before it is stored to the database, otherwise the database value is incorrect. Issue-ID: POLICY-1738 Change-Id: I0a7f2da3837497dd999141f40466d6507c26159b Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-07Set default and check existance of Policy Typeliamfallon5-5/+119
The TOSCA specification has a "bug" in that it does not have a field to specify the version of a policy type to use. We already had introduced the "type_version" field for this. This review introduces setting of the default version of a policy type to be be used by a policy as the latest version of the policy type in the database. As a side effect of this, we now have to check for existence of the policy type of a policy in the database. This means that creation/update of a policy with a non-existant policy type specified will now fail. Issue-ID: POLICY-1738 Change-Id: I27080cf6cd358948810dab6897c72dfe4d41fe91 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-12Remove version from PdpGroupliamfallon6-229/+101
Issue-ID: POLICY-1095 Change-Id: I91f495947fe77222804e7ab31c4dd7d7aee66b44 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-12UNit test and minor fixes for DB parsliamfallon2-12/+12
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-11Fix database propertiesliamfallon10-90/+46
Issue-ID: POLICY-1095 Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-10Finish unit test on policy-modelsliamfallon9-109/+394
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-09Add unit tests for policy type and policy filtersliamfallon2-2/+32
THis review adds unit tests for the authorative concepts in the models-tosc module and adds unit tests for the authorative and and database providers. Issue-ID: POLICY-1095 Change-Id: If98deea99658056030dd47725b0c0a4266d84106 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-09Complete unit test for models-pdpliamfallon1-1/+1
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-05Complete filters for Database Fetchesliamfallon1-0/+152
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-04Add filter obejcts for conceptsliamfallon5-160/+56
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-03Add impl of more PDP persistenceliamfallon5-5/+70
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-02Add persistence for PDP conceptsliamfallon12-69/+92
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-01Add extra methods to Provider interfaceliamfallon6-106/+445
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-01Refactor to authorative TOSCA serializtionliamfallon9-146/+175
This review refactors the TOSCA support to use authorative serialization and mapping. It removes the JPA entities from the Proider interface It brings the mapping support from and to authorative concepts out of the JSON serialization classes directly into the JPA classes It adapts the unit tests to work with the refactored structure. Apologies for the review size but it all had to be done in a single block of work. Issue-ID: POLICY-1095 Change-Id: I4827d1dc67ef7aac98cba230ffcd79c6de71e805 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-29Restructure for authorative modelsliamfallon10-67/+71
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 policiesliamfallon8-367/+394
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-27Merge "Add Legacy Op Policy Persistence"Pamela Dragosh4-13/+335
2019-03-27Merge "Fix file access issue in DummyProviderImpl"Liam Fallon2-52/+230
2019-03-26Add Legacy Op Policy Persistenceliamfallon4-13/+335
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-26Fix file access issue in DummyProviderImplChenfei Gao2-52/+230
Changed to use ResourceUtils.getResourceAsString in policy/common project to access dummy files. Issue-ID: POLICY-1441 Change-Id: I42d7cb809a0eeedfc2a8a6b82edfe38ad7138548 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-03-26Add persistence test for all policy examplesliamfallon3-120/+160
The test checks the TOSCA policy examples and ensures they can be persisted and read back from persistence. Test against the expected outcome will be added in later reviews. Tests for legacy and PDP-A policies willbe added in later reviews. Issue-ID: POLICY-1095 Change-Id: Ie06bbd477ff63618f126b01c9ab49bfc45b19ae9 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-25Add provider for Tosca Policiesliamfallon2-8/+51
Provider working from JAVA API call through to database and back for TOSCA policies with full unit test. Issue-ID: POLICY-1195 Change-Id: I82cf3b513b4921dcb2e6726856aa4fbeb7d0d816 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-22Implement Database providerliamfallon13-90/+1639
This review brings in the structure of the database provider with complete unit test coverage. The provider delegates the details of each database interactino to the appropriate package in the model. Resolved merge conflict. Issue-ID: POLICY-1195 Change-Id: I9d01146415531d18bc9648dcf232b425bc09578d Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-20Implement persistence test for policiesliamfallon2-0/+191
The unit test MonitoringPolicySerializationTest tests persistence for policies and shows how persistence works. Issue-ID: POLICY-1195 Change-Id: I933eb538238f9ccd41ce69614e0c9afcac869c29 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-17Implement Legacy to TOSCA Mappingliamfallon4-11/+11
This first patch set is a rough first draft of how translation will work. Issue-ID: POLICY-1195 Change-Id: I4a57b049f5756dc6d1e2f4d458d9dd770f928eb2 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-15Add serialization for Tosca Modelliamfallon9-13/+545
Added tests for Yaml policy monitoring Added provider interface calls in provider and structure for handling legacy APIs. Issue-ID: POLICY-1195 Change-Id: I4825272e0713b9e6a4b89753828de8905bcffbd1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-14Add DAO Enabled Tosca Modelliamfallon3-0/+292
Add DAO annotations to TOSCA model Add keying between concepts and define foreign keys in objects for translation to DB schema Added provider interface, factory, and stubbed implementation. Completed unit test for models-base Completed unit test for models-dao Completed unit test for models-tosca Issue-ID: POLICY-1195 Change-Id: I53a0ba8b7a679b6887b38bdab184b60315e0cf5b Signed-off-by: liamfallon <liam.fallon@est.tech>