summaryrefslogtreecommitdiffstats
path: root/models-tosca
AgeCommit message (Collapse)AuthorFilesLines
2019-06-18Change getCanonicalName to getName in modelsJim Hahn6-6/+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. 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 the bug of cannot return multiple versions of particular tosca ↵Pamela Dragosh2-5/+7
policy and policy type"
2019-06-17Fix the bug of cannot return multiple versions of particular tosca policy ↵Chenfei Gao2-5/+7
and policy type Issue-ID: POLICY-1807 Change-Id: I831c720993930a911d301a82b59a74cda7cb0c50 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-06-17Fix simple sonar issues in models-toscaJim Hahn33-1088/+787
Change-Id: I36a91fbbd95df7aff2656a97dd09b778cdbb798f Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-17Merge "Allow multiple versions of entities to be returned"Jorge Hernandez8-9/+146
2019-06-14Allow multiple versions of entities to be returnedliamfallon8-9/+146
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-06-13Remove isNullVersion from identifier classJim Hahn2-15/+0
ToscaPolicyIdentifierOptVersion had an isNullVersion() method which is not being used. Removed this version, thus eliminating the need to include a jackson @JsonIgnore annotation. Change-Id: I03309099a1173591736f69b82b549ebce7994169 Issue-ID: POLICY-1653 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-07Fix version field to represent policy version instead of type versionChenfei Gao2-11/+16
Added changes to make version field in return of GET guard policy call represent the version of guard policy instead of its type version. Issue-ID: POLICY-1809 Change-Id: Ie8db6e89d8439576ee5f6ee99c3222386775b195 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-05-29Change version to 2.1.0Pamela Dragosh1-1/+1
Bump for El Alto Issue-ID: POLICY-1747 Change-Id: I72ec2583715744e9e6debe84b75d0c1d3ffab997 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-23Bump to 2.0.2-SNAPSHOTPamela Dragosh1-1/+1
Released 2.0.1 Issue-ID: POLICY-1700 Change-Id: I0f40470e9a8bfb7f8136d34b65977b1b4c54e10e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-23Add logging to model providersliamfallon3-27/+166
Issue-ID: POLICY-1777 Change-Id: I67bf56a7848bbb0495d9e8c215b665fde5c67f1d Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-22Fix name/version regexp in model keysliamfallon2-4/+4
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/deleteliamfallon4-147/+190
Issue-ID: POLICY-1777 Change-Id: I5b07ad1acdb4a614a50cb15978130c19bc5786f7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-16Allow policy type prefix on policy guard policy idliamfallon2-5/+49
In order to identify the policy type of a guard policy, we need to have the first part of the policy id as the policy type identifier prefix. Issue-ID: POLICY-1776 Change-Id: I1d6a3c4b122d978ff7ef40ce76ced7f160ebd4fa Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-15Step snapshot version of policy modelsliamfallon1-1/+1
Issue-ID: POLICY-1630 Change-Id: I163b4566030f9beebdbb546814b1a7a777ce1205 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-14Remove sonar issue in simple providerliamfallon1-6/+7
Issue-ID: POLICY-1738 Change-Id: Id85d710154727c7c535db7cc50af88f52114a358 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-09Store legacy op policy properties as plain stringsliamfallon1-18/+2
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-1/+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-08Add JSON encoding to legacy policy propertiesliamfallon4-21/+61
Now that all properties on policies are stored as JSON, the properties on legacy policies must also be stored as JSON in the database. Issue-ID: POLICY-1753 Change-Id: Ia75a02c8d6f595ce0fb68ac1fa2f2399fbc08f6e Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-07Set default and check existance of Policy Typeliamfallon12-19/+187
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-05-05Serializaiton of properties to DB as JSONliamfallon5-9/+28
Properties should be serialized to JSON prior to writing to database and deserialized from JSON when read from database. Issue-ID: POLICY-1736 Change-Id: I5ad3fd4a87079f4557f5fcb825395f0b4bec3318 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-02Fix bug in guard policy metadata creationliamfallon2-3/+32
Issue-ID: POLICY-1728 Change-Id: Ie33a30a811fcd8c128dfac87c17dcb37da6d42b4 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-20Merge "Fix a bug in adding one-digit policy-version in metadata"Jorge Hernandez2-6/+6
2019-04-19Fix a bug in adding one-digit policy-version in metadataChenfei Gao2-6/+6
Original change of adding single digit policy-version in tosca policy metadata does not take effect actually. It is added into metadata of authorative tosca policy but not jpa tosca policy. Identify the issue at the last minute and fix it. Issue-ID: POLICY-1442 Change-Id: I8aefa546f757f7841554e3caf00ccc476d23ebf5 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-19Exclude jackson-databindPamela Dragosh1-2/+6
Jackson databind has security issues, sometimes its easier to just exclude it if possible. This repo doesn't use it directly, the swagger dependency pulls it in. It doesn't look like our usage of swagger dependency would require the jackson-databind as we only use the annotation: @ApiModelProperty NOTE: Swagger also pulls in jackson-annotations, which seems to be used by a few modules for JSON annotations. eg. those modules are using jackson-annotations indirectly via the swagger dependency pulling in that dependency. Not a big deal. Compilation of policy/api repo works with this exclusion. Issue-ID: POLICY-1507 Change-Id: Ic8501df5ad4f4fc8f6cd93e739d7ff2e52d98785 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-16Don't include "nullVersion" in swagger APIJim Hahn1-0/+2
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-15Add serialized name for typeVersionChenfei Gao1-0/+4
Add serialied name and swagger ui rendering name for attribute typeVersion in ToscaPolicy. Issue-ID: POLICY-1515 Change-Id: I42e85117c5f47901bf8c16d3cc6f162a8b6db5e1 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-15Merge "Use keys to speed DB queries"Pamela Dragosh1-2/+7
2019-04-15Use keys to speed DB queriesJim Hahn1-2/+7
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-15Add conversion from plain Ident to IdentOptVersionJim Hahn2-2/+28
Added a "copy constructor" that copies an Ident to an Ident with an optional version. The reverse does not make sense, so did not add that (e.g., version may be null or may just be a prefix, while the version in Ident is major.minor.patch). Change-Id: Ifd3935a998cd4c1cb5113a59c5f36a7d9baf79ff Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-14Add prefix matching for policy versionJim Hahn2-9/+30
Re-introduced regular expressions to match policy version so that the policy version found in the metadata, which is just the major number, can be matched with a policy's version, which is of the form, major.minor.patch. Simplified equals() test, as we already know "text!=null". Added filterPrefixPred() and modified policy filter to use it when matching versions, as it is simpler to use when matching a version prefix. Also added tests to PfObjectFilterTest to test each of the XxxPred() methods. Change-Id: I0734873f701a539e883fe25b8eecfdde60cc8b6d Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12Add validation methods for PAP REST APIJim Hahn8-18/+212
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 parsliamfallon5-47/+31
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 Dragosh6-76/+77
2019-04-11Fix database propertiesliamfallon6-76/+77
Issue-ID: POLICY-1095 Change-Id: I3edd70898836d3bd978643857d1ba29599b1cf6c Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-11Use policy-id instead of nameJim Hahn1-0/+3
When CLAMP deploys a policy to the PDPs, it uses field names found in the meta-data, which are "policy-id" and "policy-version". Modified the class used by that particular to use those field names when encoded/decoded via gson. Change-Id: Ib67bd2cd05a906cc809dc6078efdabbd7aa1fa37 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-10Add policy ID and version to metadataliamfallon1-0/+13
Adds the policy-id and policy-version of the policy to the policy metadata, duplicating the policy key in therre. Issue-ID: POLICY-1095 Change-Id: I49603766141f5dee47573edc9f05d2ee2cf9da52 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-10Finish unit test on policy-modelsliamfallon30-414/+748
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 filtersliamfallon8-6/+800
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-pdpliamfallon10-13/+501
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 filtersliamfallon2-6/+4
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-08Add bug fixes and tests for filtersliamfallon3-8/+14
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-06Fix bugs on filtersliamfallon5-58/+46
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 Fetchesliamfallon11-31/+49
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 Hahn10-1/+505
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 objectsliamfallon3-6/+86
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 Dragosh5-91/+207
2019-04-04Add filter obejcts for conceptsliamfallon5-91/+207
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 ApiModelProperty annotation to authorative modelsChenfei Gao8-6/+27
Add @ApiModelProperty to authorative models for the fields that have different serialized names from their property names. Issue-ID: POLICY-1515 Change-Id: Id6509afe5cc741a6253fc0d1f98ae6b22d31f0d9 Signed-off-by: Chenfei Gao <cgao@research.att.com>
2019-04-03Add impl of more PDP persistenceliamfallon1-0/+15
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>