summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2021-02-17Use new version of A&AI APIsJim Hahn4-195/+11
Just changed the version numbers; the APIs appear to be the same otherwise. Also removed unused APIs from the A&AI simulator. Issue-ID: POLICY-2788 Change-Id: I8c0ae11c1e42f487b34286d5dfd4ca536bb2c07b Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-17PAP Deployment API changes - change url to uria.sreekumar2-10/+17
Change-Id: I6fa4b001a0c4573a34e1cefe0d32ca969ca5096e Issue-ID: POLICY-2526 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-02-16Merge "Fix duplicate code in Jpa classes"Pamela Dragosh25-766/+870
2021-02-16Add PfReference Timestamp key in policy-models-base to support timestamprameshiyer272-0/+375
property Issue-ID: POLICY-3011 Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech> Change-Id: I7a9db3a4fb0345e0979952e5c086523cc1d960f9
2021-02-16Merge "Updating PAP deployment API to reflect actual status"Liam Fallon2-0/+70
2021-02-16Fix duplicate code in Jpa classesJim Hahn25-766/+870
Addressed the following issues: - remove duplicate code; extracted a common class containing properties Issue-ID: POLICY-2905 Change-Id: I80c423ab45c0c6823d338a034762d222ec334288 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-16Fix the Naming policy examplesebdet1-2/+2
Change the attribute derived_from of the policy.data.increment-sequence attribute in the Naming policy example. It should inherit from tosca.datatypes.Root Issue-ID: POLICY-3067 Signed-off-by: sebdet <sebastien.determe@intl.att.com> Change-Id: I7a62b8c662b90a8481bb609d6a39e33ab9e7dada
2021-02-15Updating PAP deployment API to reflect actual statusa.sreekumar2-0/+70
Change-Id: I1fb0232d2f5fe37e95e87babb233a824212439ff Issue-ID: POLICY-2526 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
2021-02-15Merge "Use type adapters from common"Ram Krishna Verma5-168/+34
2021-02-12Merge "More sonars in models"Jim Hahn2-6/+9
2021-02-12Use type adapters from commonJim Hahn5-168/+34
Addressed the following sonar issue: - remove duplicate code by using gson type adapters from common Issue-ID: POLICY-2905 Change-Id: I7a832ce3e15387ed25061caec3e057f150828dad Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-12More sonars in modelsJim Hahn2-6/+9
Addressed the following issues: - change visibility of constructor - assert exception type Issue-ID: POLICY-2905 Change-Id: Iaededb32802e4facbbc776ae51d05d2ef5c60b93 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-12Merge "Alter PDP_UPDATE message to store lists of delpoyed/undeployed policies"Ram Krishna Verma1-0/+12
2021-02-12Alter PDP_UPDATE message to store lists of delpoyed/undeployed policieswaynedunican1-0/+12
Update the PdpUpdate class to store lists of deployed and undeployed policies while maintaining it's current original full list of policies. This will ensure that the changes to send policy updates only in the PDP_UPDATE message will not effect the PDPs they can support updated policies. Issue-ID: POLICY-2112 Change-Id: I1a6e9d426ed3a8a3b4469a8b72ef57441e50545e Signed-off-by: waynedunican <wayne.dunican@est.tech>
2021-02-11Fix sonars from depeendency upgradeJim Hahn30-140/+116
The dependency upgrades in policy-parent caused some new sonars. In particular, initMocks() has been deprecated - replaced with calls to the Mockito Runner, in most cases. Changed to openMocks() in one case and removed unnecessary stubbings. Issue-ID: POLICY-2905 Change-Id: I9aa098aa7aaebba09f6dcea4cac69ac1e5fbd4d6 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-10More sonars in modelsJim Hahn38-533/+254
Addressed the following: - make constructors protected - check exception type - too many assertions - remove annotation lists - use "<>" - reduce cognitive complexity - extract constant - multiple method calls in one assert - don't use eq() in verify() - indentation Issue-ID: POLICY-2905 Change-Id: I25bb3951f781250e9cdfe8f5f3b80cb63e129184 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-08Set target-database propertyJim Hahn2-1/+5
The new version of eclipselink doesn't recognize mariaDB by default. Added an optional property, databaseType, to the DB parameter class, which defaults to "MySQL" if not set. ("MySQL" is what web discussions indicated should be used for mariaDB.) Issue-ID: POLICY-3005 Change-Id: I7af9b65a53e0090944af6ce40d5cffa13a4123d7 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-08Merge "Make filters on TOSCA entities generic"Jim Hahn24-493/+287
2021-02-07Make filters on TOSCA entities genericliamfallon24-493/+287
The classes PolicyTypeFilter and PolicyFilter only work on Policy types and policies. However they just filter on name/version/type/typeversion so there is no reason that the filters could not be applied to other entities. This commit adapts the PolicyTypeFilter to EntityFilter and PolicyFilter to TypedEntityFilter, so the filters can be applied to collections of any ToscaEntity class. Issue-ID: POLICY-2995 Change-Id: I8fcf76ee8c8497836b3286b35f928b0c341dac34 Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-02-05Give better messages than NPE for missing dataJim Hahn20-40/+255
When data is not available to actor operations, an NPE is generally thrown. Modified the code to provide more info about what is missing than simply NPE. Issue-ID: POLICY-2913 Change-Id: I37b6eadd966e0693508a6d552b7db4edf5410018 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-29Merge "Upgrade io.grpc library in CDS actor"Ajith Sreekumar3-14/+6
2021-01-28Upgrade io.grpc library in CDS actorRam Krishna Verma3-14/+6
Upgrading to latest version of io.grpc 1.35.0 to fix security issues. The methods named loadBalancerFactory and nameResolverFactory have been removed in the latest version. After going through the grpc-java codebase found that the one's we were using to initialize those factories are made default. Confirmed my understanding by posting a query on grpc-java github repo. Issue-ID: POLICY-2936 Change-Id: I238700ac3f384ff8e5fdef6c3f2ccfb54bff7005 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-01-28Add copy constructors to conceptsliamfallon4-2/+167
Copy constructors for ToscaServiceTemplate and ToscaTopologyTemplate. Issue-ID: POLICY-2971 Change-Id: Idb4abf8bce40593e0bf18614b8c647688dd5748d Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-20Merge "Remove "Jpa" from table name"Ram Krishna Verma1-1/+1
2021-01-19Remove "Jpa" from table nameJim Hahn1-1/+1
The DB table names of the various JpaXxx classes do not include the "Jpa" prefix. Removed it from the new Jpa class. Issue-ID: POLICY-2648 Change-Id: I7f56502d75db05631749780138e989009eb93c83 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-19Merge "Convert Model Exception to Runtime Exception"Ram Krishna Verma3-9/+38
2021-01-19Merge "Allow providers other than PolicyModelsProvider"Ram Krishna Verma2-107/+153
2021-01-19Allow providers other than PolicyModelsProviderliamfallon2-107/+153
This change separates the database initiation and close functions of the DatabasePolicyModelsProviderImpl class into an abstract class that does the database DAO initiation and closing, and a domain specific part, that does the manipulation of the policy models in the database. This means that other providers, that wish to manipulate other objects in the database, can specialize the AbstractModelsProvider class and use its common DAO initiation and clsoing functionality, but can have their own domain specific code. The abstract class also now supports the Closeable interface. Note that the exiting JUnit tests provide 100% coverage on AbstractModelsProvider. Issue-ID: POLICY-2971 Change-Id: Ibe59c02ab127ddbd9355d892b94a5d315507a8e6 Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-19Convert Model Exception to Runtime Exceptionliamfallon3-9/+38
Sometimes the exception thrown by the database providers has to be converted to a runtime exception, especiall if the database provider is running in a thread (called by the rum() method that does not return exceptions). It is convenient to have a constructor on the PfModelRuntimeException class that takes a PfModelException class as its argument, thus creating the runtime exception. Also the mapMap method in pfUtils is updated to allow the key of the map to be templated. By doing this, the utility can be used for maps that are keyed with types other than String (such as UUID). Issue-ID: POLICY-2971 Change-Id: Ib0b3678de531fd383753a1cd0ce47a06f4079ec0 Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-19Merge "Add PfKey translation to ToscaConceptIdentifier"Pamela Dragosh3-4/+36
2021-01-18Create ToscaConceptIdentifier from ToscaEntityKeyliamfallon2-1/+6
THis change adds a method to create a ToscaConceptIdentifer from a ToscaEntityKey class. This method reduces the code vloume when translating between these identifiers. Issue-ID: POLICY-2971 Change-Id: Idd62339935d2ba78e6c60b40ee95fedac0642bef Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-16Add PfKey translation to ToscaConceptIdentifierliamfallon3-4/+36
Concenience constructor to create a TosaConceptIdentifier from a PfKey and a method to create a PfConceptKey from a ToscaConceptIdentifier. Issue-ID: POLICY-2971 Change-Id: I402b2e12cc11976cd7e98436eb46486c35fdaa31 Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-15Merge "Do not log filter to error log"Liam Fallon1-1/+1
2021-01-15Merge "Add copy constructor to ToscaNodeTemplate"Jim Hahn2-1/+69
2021-01-15Merge "Rename keywords used as column names in API and PAP JPA"Jim Hahn2-5/+5
2021-01-15Do not log filter to error logJim Hahn1-1/+1
The DAO code was logging the query filter to the error log. Modified to log it to the debug log. Issue-ID: POLICY-2648 Change-Id: I372c77cb4fa1e5c4cb645d82b26ab0bba4a00826 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-14Add copy constructor to ToscaNodeTemplateliamfallon2-1/+69
In order to support serialization and deserialization of ToscaNodeTemplate objects onto DMaaP, we need a copy constructor on the ToscaNodeTemplate object. Issue-ID: POLICY-2971 Change-Id: If6dc6c54d5673cef46734a88d0a91ae868c11dcb Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-01-14Rename keywords used as column names in API and PAP JPAgregory.hayes2-5/+5
Using keywords as column names in JPA models is causing syntax errors during auto generation of DDL The errors are visible in the policy api and pap docker logs on startup This review renames the relevant columns Issue-ID: POLICY-2670 Signed-off-by: gregory.hayes <gregory.hayes@est.tech> Change-Id: I52a3156461940465c3945841c69a04fcb2f90117
2021-01-13Remove extra logging from cds actorRam Krishna Verma1-7/+1
Issue-ID: POLICY-2885 Change-Id: I5b7cb219f55a25153d50260d62292b92cfe39323 Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-01-12Add more methods to query deployment statusJim Hahn10-4/+191
Issue-ID: POLICY-2648 Change-Id: I398fa1332eb5a862dabd97ed409ef6413bb0c202 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-08Add PDP-Policy deployment table to DBJim Hahn13-7/+780
Added a table to record the PDP policy deployment status, which is required for making PAP stateless. Issue-ID: POLICY-2648 Change-Id: Ibe40ce00aca7a600051edcac49e55651c1c0164f Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-06Use annotations on parameterized typesJim Hahn25-827/+336
Updated the code to place validation annotations directly on the annotated types instead of using the @Items and @Entries annotations. Also added/updated junits for validation code. Issue-ID: POLICY-2648 Change-Id: Ia535da07a38cec77a74c5c3215b5ae784d7a4e1a Signed-off-by: Jim Hahn <jrh3@att.com>
2021-01-06Changed identifiers to concept identifiersliamfallon33-365/+543
The policy models tosca classes ToscaPolicyIdentifier and ToscaPolicyIdentifierOptVersion can be used to identify any TOSCA concept, not just TOSCA policies so they are renamed to ToscaConceptIdentifier and ToscaCinceptIdentifierOptVersion respectively. The class ToscaPolicyTypeIdentifier is redundant and is replaced by ToscaConceptIdentifier. Issue-ID: POLICY-2900 Change-Id: Id0a37c42ea4e74f07b47e1694c4f8291c35879c9 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-12-23Merge "Add Service Template TOSCA handling"Liam Fallon18-112/+793
2020-12-23Add Service Template TOSCA handlingliamfallon18-112/+793
Today we can only handle a single service template in the database. We should be able to handle multiple service templates and assign arbitrary policy types and policies to maned and versioned service templates. This review brings in the Java API in models provider for handling service templates in this way and uses a simplistic single-teplate implementation in models-tosca, that will work but still only handles a single service template under the hood. Issue-ID: POLICY-2900 Change-Id: Ia02dea8abe44b7f407e685090a4b8e0360889653 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-12-22Allow wild-card in supportedPolicyTypesJim Hahn2-1/+3
Changes to the validation code broke the validation check for the supportedPolicyTypes field in PdpSubGroup - it no longer supports wild- cards in the name. Modified the validation annotation in PfSearchableKey to allow wild-card names. Issue-ID: POLICY-2648 Change-Id: Ibd2853025ce72ed88697dd9a7d6d5eed2b28475e Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-21Use annotations to do validationJim Hahn43-326/+660
Modified models to use annotations instead of function calls for most field validations. Created a few new validation annotations for use within models. Per review comments: - renamed Key to VerifyKey - enhanced VerifyKey to imply "@Valid", unless disabled Issue-ID: POLICY-2648 Change-Id: I2b53f218b0a2ab1ed1f5e278816a3509f1408972 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-17Use ValidationResult for models v2.0Jim Hahn87-2539/+1444
Policy models uses PfValidationXxx classes which are totally unrelated to ValidationResult in policy common. This precludes the use of various utility methods and annotations for doing validation. Modified policy models to use ValidationResult instead. This approach uses function calls, though a future approach could make use of annotations instead. Issue-ID: POLICY-2648 Change-Id: I9760f1dc46902ab6bef7f440f3caf5e951660a5d Signed-off-by: Jim Hahn <jrh3@att.com>
2020-12-14JPA concepts for TOSCAliamfallon41-382/+3376
Implement the Database persistence parts for the new TOSCA concepts so that those concepts can be written to and read from the database. First batch of comment fixes Issue-ID: POLICY-2900 Change-Id: I45191c1ff57cf1ea8563399db6cc8e51b2724813 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-12-09Add functional method for mapping maps to PfUtilsliamfallon2-34/+30
Add a functional interface to PfUtils for mapping maps so that more complex conversions can be handled. List mapping functional methods added as well. Issue-ID: POLICY-2900 Change-Id: I4189e09d6d8621638960b5d9f0d19792a7faceb8 Signed-off-by: liamfallon <liam.fallon@est.tech>