summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2020-02-17More changes to actor codeJim Hahn22-57/+451
Use Coder.convert() from policy-common. Passed response to setOutcome(). Changed class names from XxxOperator to XxxOperation. Modified SDNC junits to invoke start() instead of startOperationAsync(). Changed context obtain() to re-run if the future was canceled. Added junit support class, BasicBidirectionalTopicOperation. Modified HttpOperation to allow subsequent requests to be issued. Some actors, like SO, send an initial HTTP request and then follow it with HTTP "are you done?" requests. Issue-ID: POLICY-2363-prop Change-Id: I12b5c2d4f07254e0cb79fabfe1ccf844b70a0654 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-17Merge "Use BidirectionalTopicClient from policy-common"Jim Hahn47-1765/+1887
2020-02-17Merge "Add/Update test cases for PdpStatistics entity"Pamela Dragosh5-42/+204
2020-02-17Use BidirectionalTopicClient from policy-commonJim Hahn47-1765/+1887
Also modified "target" to sink in various places, and renamed various uses of "pair" to "bidirectional" (e.g., TopicPairParams => BidirectionalTopicParams). Also replaced MyExec with PseudoExecutor, from policy-common. As part of this, extracted the logRequest and logResponse methods from the Http and Topic classes, moving them into the common OperationPartial class. Modified A&AI, SDNC junit tests to use PseudoExecutor. Added support for incomplete responses on Topics, where multiple responses may be received for one request Fixed a duplicate entry in actor.aai pom. As the changes were already big enough, went ahead and also did the following to support the APPC Actor: - Reorganized parameter classes and content. - Modified anyOf, allOf to take functions instead of futures and handle exceptions thrown by any of the functions. Also added sequence() method. - Deleted doTask. - Modified ActorService.config to take a map of maps, not just a map. - Decided NOT to move anyOf, allOf, and sequence from OperationPartial to a utility class, because they depend on "params". Issue-ID: POLICY-2363 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I5a8bae05dfef22fe71c57c58f265b9dac20df5c5
2020-02-17Add missing entry_schema for operational policy typePamela Dragosh18-75/+71
Also ensure the json for vFirewall matches the yaml. We will need to clean up some of the other legacy operational policies. Or at least rename them. Renamed legacy Operational policies to avoid confusion. Fixed wrong derived_from policy types. Operational Policy Types are now solely for new TOSCA compliant operational policy types. Issue-ID: POLICY-2146 Change-Id: Ia0bcabe6cca8e197f1bec8157a3004a420033969 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-02-17Add/Update test cases for PdpStatistics entityhuaxing5-42/+204
Add test cases for PdpStatistics / PdpEngineWorkerStatistics / JpaPdpStatistics. Add lombok.Data annotation to PdpStatistics and PdpEngineWorkerStatistics to facilitate testing. Issue-ID: POLICY-1628 Signed-off-by: huaxing <huaxing.jin@est.tech> Change-Id: I4269678641716a56db260ad67a30c97b904123cd
2020-02-17Fix return building on policy getliamfallon1-4/+11
The service template that is being returned for the "get" has to be built up in the correct order. A policy and the policy types and data types it is referencing must be added together. Before, all the policies were added at once and then the policy types and data types for the policies were added afterwards. This means that if the service template is validated during the service template build, validation may fail, depending on the order of building of the template. Issue-ID: POLICY-1402 Change-Id: Ia4fb9ee3819dccfc8c346c682545b2d27ebc4058 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-14Merge "Fix return codes and policy get"Pamela Dragosh4-36/+45
2020-02-14Fix return codes and policy getliamfallon4-36/+45
Change the return codes for validation to return more helpful and correct codes. Fix the policy "get" request to get policy types and data types for a policy get. Issue-ID: POLICY-1402 Change-Id: I89d67f830e9a75bdeef39c4142523c718879f19c Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-13Add Topic Actor superclassesJim Hahn23-56/+2617
Issue-ID: POLICY-2363 Change-Id: I5d29d85f6c5f40fb6c8f1bf678d9c718760a7558 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-13Merge "Add A&AI actor and some operators"Jim Hahn16-3/+947
2020-02-13Update models-tosca for hetter handlingliamfallon14-33/+64
More additions, updates, and fixes for TOSCA service template handling. Better handling of 404 not found on list requests. Issue-ID: POLICY-1402 Change-Id: Id73b9a3cebb5445d4f05ae83e301330ee38a6598 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-12Add A&AI actor and some operatorsJim Hahn16-3/+947
Added A&AI Actor, as well as operators for the "custom query" and the "tenant" query (on which the custom query depends). Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ic9dadc07a6057cb1abb9698da86eb9431fc9ed3e
2020-02-12Merge "Implement validation and hierarchical get"Pamela Dragosh34-906/+1022
2020-02-12Implement validation and hierarchical getliamfallon34-906/+1022
NOTE: This review will require changes to the persistence.xml file in other policy framework components. This change brings in two changes: 1) Validation of the references betwen policies, policy types, and data types This change mans that additions to and changes to policies, policy types, and data types must be structurally correct in the change coming in and with whatever is already in the database 2) Hierarchical return of referenced entitites on policy types, policies and data types. When a policy, policy type, or data type is read from the database, the entities referenced byt the returned policy, policy type, or data type are returned as well. Tests are amended for the stricter validation and structure. Examples are corrected where they are incorrect. Issue-ID: POLICY-1402 Change-Id: Ie6a4cb7ed336562338924079114df405f0ab889f Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-11Add more code to facilitate actor implementationJim Hahn49-3092/+4334
Added obtain() to Context Added startGuardAsync(), in anticipation of adding guards. Moved logRestXxx() from Util to HttpOperation. Added actor.test to facilitate testing of actors. Changed timeoutSec from long to int in various places. Made a couple of methods public to support junit testing. Most of the methods required Params to be passed, which indicated a design issue. Split Operator and Operation so that the Params could be kept in a field and thus need not be passed to every method. Basically, renamed OperatorPartial.java to OperationPartial.java and created a new OperatorPartial.java. Of course, this makes it look to gerrit like it's all new code, when in fact, most of it is unchanged, other than removing the Params argument to the method calls. That accounts for about half of the "lines changed" count. Issue-ID: POLICY-1625 Change-Id: I9e98c9dadcbed145bf84deb06c9db1c864a3c24a Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-10Get the tree of parent entities for an entity in a containerliamfallon6-48/+191
Utilityu method to filter out all bit an entity and its parents from a service template entity container. Issue-ID: POLICY-1402 Change-Id: I8c3b4c21b27fd8787cdfde0e1b726646f52c437b Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-10Merge "Add data type and policy type reference checking"Jim Hahn18-125/+317
2020-02-07Clean up and enhancement of Actor re-designJim Hahn39-829/+3457
Added junits for the remaining code. Enhancements to facilitate implementation of Operators: - Added allOf(), anyOf() facilities - Added AsyncResponseHandler for handling asynchronous I/O via the HttpClient - Added logRestRequest() and logRestResponse() for logging REST requests and responses - Added HttpActor and HttpOperator, which can be used as superclasses - Added doTask() - Lifted data from the event into ControlLoopEventContext Updates per previous review comments: - Changed logException() to runFunction(). - Removed the aaiCqResponse field. - Lifted fields from Policy into ControlLoopOperationParams, eliminating the need to include Policy in the class. OperatorPartial depends on the string values in the ControlLoopOperation being set to one of the string values of PolicyResult. Instead of passing ControlLoopOperation around, the operators should pass around an object that uses PolicyResult directly, rather than depending on the string values being set correctly. Created OperationOutcome for this purpose. Stop pipeline when the controller completes. Use whenComplete() where appropriate. startOperationAsync() should not block. Modified it to launch the task in the background via its own thread. Extracted CallbackManager into its own file. Replaced actor setOperators() with addOperator() Renamed add() to wrap(), and modified it to remove the future when it completes. Fixed the signature on delayedRemove() and delayedComplete(). Replaced xxxAsync() calls with just xxx() calls, where appropriate to avoid the extra overhead of submitting it to a work queue. Renamed handleFailure() to handlePreprocessorFailure(). Updates per WIP review comments Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Id4c4c7ade979bdb76cc54266837609cc69a22c58
2020-02-07Merge "Change recipe to operation to match type"Ram Krishna Verma2-2/+2
2020-02-07Add data type and policy type reference checkingliamfallon18-125/+317
Full validation including references to policy types and data types added. Unit tests fixed to cope with new stricter validation. Issue-ID: POLICY-1402 Change-Id: I59f37640a99494a53960a54d2fc82cc96861d43b Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-06Change recipe to operation to match typejhh2-2/+2
Issue-ID: POLICY-2345 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I4a79459cf7dfdccd7d9d88ec983afb6bce746493 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-02-06Merge "Actor redesign."Jim Hahn48-84/+6518
2020-02-05Add vaidation for entity hierarchiesliamfallon27-149/+498
This change brings in proper hierarchical checks for service templates, making sure that all parents of data types, policy types, and policies must be in place. Issue-ID: POLICY-1402 Change-Id: I61b1b556403f74aeaa092f0d4d6ed19bf6a0b715 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-04Merge "Add merge utility for service templates"Ram Krishna Verma7-44/+424
2020-02-04Add merge utility for service templatesliamfallon7-44/+424
This utility function allows a TOSCA service template fragment to be merged with an exsiting service template and will be tbe backbone of "create" methods on the API from now on. Issue-ID: POLICY-1402 Change-Id: I3381cb2a1bd30621a639dedc213c546eeb2bf9aa Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-03Actor redesign.Jim Hahn48-84/+6518
Left original code intact so that it can continue to be used until everything has been converted to use the new approach. Simply added new methods and classes. (A few minor edits were required to the old code, e.g., added constructors to the Actor implementations). Code to be removed is annotated with "TODO". This only contains one revised actor, SDNC. This actor combines code from actor.sdnc, sdnc, and drools-applications. Coverage tests are incomplete, but I anticipate some simplification to this design in a couple of days; coverage will be added at that time. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I4b75730e3621a9ee026ad10e557abe92df10dcf4
2020-02-03Merge "name + consistent case in drools policies"Pamela Dragosh3-8/+8
2020-02-03Design Operational Policy Type for Apexa.sreekumar3-10/+26
Design the TOSCA Policy Type for operational policy supported by Apex so that CLAMP can select this policy type for control loops that are designed to use Apex. Change-Id: I50099a47d5314fa42e353856715adaaa20352a96 Issue-ID: POLICY-2147 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-01-31name + consistent case in drools policiesjhh3-8/+8
Issue-ID: POLICY-2345 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Ibf54e6bac3d53daf0e23256ff0c2e8108b82cd9f Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-01-28Merge "Add service template persistence provider"Jorge Hernandez6-26/+342
2020-01-28Add service template persistence providerliamfallon6-26/+342
Persistence needs to be carried out at service template level in order to guarantee consistency of the service template in the database as much as possible. Therefire, service template lelve reading, writing, and delting is required. Issue-ID: POLICY-1402 Change-Id: I5be57c29381bf6ddc87afdbb64ddae66a5ea5e5f Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-23Handling supported policy type during PdpGroup Updatea.sreekumar1-3/+8
Change-Id: I62fbfeb80b81f4cc6dc0049bbd4ab9dcc5065773 Issue-ID: POLICY-2023 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-01-22Handling supported policy type during PdpGroup Updatea.sreekumar5-25/+109
Change-Id: I469125c232af9d78a55c3dfa71cb701cb3864015 Issue-ID: POLICY-2023 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2020-01-20vcpe operational policy tosca compliant jsonjhh3-3/+49
Issue-ID: POLICY-2148 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: Id8ac0279184e5d063cbff197e47f14745a9ef353 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-01-17Update Dockerfiles for java11 in policy-modelsJim Hahn6-42/+8
Also modified docker build scripts so they work with SNAPSHOT or release versions of the tarballs. Issue-ID: POLICY-1586 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ib5b8c0b83d7736180ab213b0b67d457eab7ee48e
2020-01-16Merge "Ensure one jacoco output file"Jorge Hernandez4-0/+18
2020-01-16Ensure one jacoco output filePamela Dragosh4-0/+18
Sub-modules under sub-modules need to set the path to ensure a single jacoco-ut.exec file is produced and appended to. I think this only gives us .1% - but that's ok. Its a step towards consolidation. Issue-ID: POLICY-2321 Change-Id: I31023843f55200096a905482ee55ad19bf681494 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-16Merge "Added Time agnostic Onset and Abated classes"Jorge Hernandez10-18/+493
2020-01-16Added Time agnostic Onset and Abated classesjhh10-18/+493
These classes can be used for comparison of alarm skeletons independently of the time at which they were produced. Issue-ID: POLICY-2323 Signed-off-by: jhh <jorge.hernandez-herrero@att.com> Change-Id: I85b9d6a429de56f056eb0a6caa9e4f90fbd68918 Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
2020-01-16Merge "Clean up TOSCA provider unit tests"Pamela Dragosh5-36/+85
2020-01-16Clean up TOSCA provider unit testsliamfallon5-36/+85
SOme outstanding comment on TOSCA provider unit tests cleaned up. Issue-ID: POLICY-2315 Change-Id: I235a5fc9996c81f421f17236afb413df7435de19 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-14Update sonar configPamela Dragosh2-71/+5
Skip module that doesn't have code. parent now defines the plugins, no need to duplicate that. Issue-ID: POLICY-2321 Change-Id: I84a161781cc0b44ba8d328ff5fb269855fcc4b36 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-13Read resource dirs in models prvider unit testsliamfallon8-467/+347
Update the unit tests in models-provider so that we can check that the TOSCA artifact that is read from the database is the same as the TOSCA artifact that is stored. This review does some groundwork for that check. Issue-ID: POLICY-2315 Change-Id: Iabc7b247736b862713585a493752bc254cfe1c3d Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-01-10Remove deprecated methods from modelsJim Hahn6-12/+24
Addressed the following issues related to the java 11 upgrade: - forClass().newInstance() - java.xml.bind no longer included in jdk - new mockito doesn't clear captured lists Issue-ID: POLICY-1406 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ia254c1ed21f847d1824e7abc22528975372ee2b6
2020-01-10policy/models jdk 11 upgradesHOCKLA17-28/+98
Issue-ID: POLICY-1592 Change-Id: Iaa6b61c5f1c76f3e7c2043691f4d29dbc43d144e Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-10Bumped patch version for policy/modelsHOCKLA38-64/+75
Issue-ID: POLICY-1592 Change-Id: Iafc35fe53e28c815a79041f289cb17b6354ceccd Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-10Release policy/models 2.2.0HOCKLA1-0/+4
Issue-ID: POLICY-1592 Change-Id: I751dbafc67d5f232e930b56f8399ea326c6efdb1 Signed-off-by: HOCKLA <ah999m@att.com>
2020-01-10Merge "Added new policy examples to support integration of new version ↵Liam Fallon7-12/+6
validation feature"
2020-01-10Merge "Remove supportedPolicyTypes from PdpStatus"Liam Fallon3-17/+13