summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-04-09Refactor request mapJim Hahn23-1834/+2894
Refactored to facilitate the addition of broadcast requests in the future. Added disable-PDP capability. Updated some comments. Add junit tests. Only treat null group as broadcast - empty strings are not broadcasts. Added more logging. Change-Id: I6f62b8755d20769c333f06752e9d63ac9ed83b57 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-09Fix review comments & add updateLockramverma3-39/+74
1) Fixing review comments from previous review. 2) Adding updateLock to registration handler & state change provider. Change-Id: I9f6e0de1f58190e490b28965c84a3a0c7aa90486 Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-09Adding PdpGroup query & statechange providersramverma9-72/+306
1) Adding implementation of PdpGroup Query & State change providers for PAP REST API. 2) Adding support for unregistering Pdp after recieving TERMINATED state in PdpStatus message. 3) Updating PdpStatusMessageHandler with new filter changes in models. 4) Removing updatePdpStatistics method as we will implement db provider and REST provider in next release. 5) Fixing few bugs found during Pdp registration testing. 6) Updating the existing test cases to work. 7) Will be adding more exhaustive test cases in another review. Change-Id: I7aa20bf422671fdc1e06dab5e90aef4ee19a6a02 Issue-ID: POLICY-1541 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-08Adds basic performance tests for Policy PAPBilal A5-0/+368
Includes 1) Basic health and stats tests 2) Log analysis script Change-Id: I6d8f7a0203251d9b685b89c4d0c8e19cd74c24c6 Issue-ID: POLICY-1460 Signed-off-by: Bilal A <bilal@research.att.com>
2019-04-08Merge "Wrong models-pdp in pap"Pamela Dragosh1-1/+1
2019-04-08Merge "Add latest-version check to status msg handler"Liam Fallon1-2/+2
2019-04-07Wrong models-pdp in papJim Hahn1-1/+1
Policy/pap was still referring to models-pdp instead of policy-models-pdp. Change-Id: Ia39647a7fe3d29fe5d67ee6f8f57a296f4cc4347 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-05Add latest-version check to status msg handlerJim Hahn1-2/+2
PdpGroupFilter now supports filtering by latest version. Removed a TODO from PdpStatusMessageHandler and added the filter parameter. Change-Id: I67983397b616d8e289c4dc79d912bb4cf26e97ae Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-05Delay DB updates until all policies processedJim Hahn9-172/+515
If an exception is thrown in the middle of processing policies, it's possible for the DB to reflect a partial deployment. This change queues the DB changes so that they're all made at once, after all policies have been processed. Extracted sort() into a common place. Corrected some comments. Simplified the list retrieval in the junits since all DB creates and updates are now batched together into one operation each. Change-Id: I835175fc16d4042c741d36ec69caa8f603d46d5a Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-05Merge "Fix csit of policy/pap"Pamela Dragosh1-0/+8
2019-04-05Fix csit of policy/papramverma1-0/+8
Change-Id: I1158a6a7f0582dabafb22961d073db6d14cf2793 Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-05Flesh out policy deployment REST APIJim Hahn34-222/+2295
Also moved the controller, the provider, and supporting classes to their own dep_undep package. Change-Id: Ifea1c4dd2ecbf93a8f4d45e130830cf9271103d3 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-05Fixes per latest models updatesJim Hahn5-26/+24
Changes made per the scrum call on 4/4 moved things around. In addition, filter classes were added to the tosca provider. Both of these necessitated changes to policy/pap so that things compile. Change-Id: Iba4c52b650dab0f8d242b06be3fede42dd5b7264 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-04Adding more code to pdp registration handlerramverma4-30/+67
1) Adding more code to pdp registration handler. 2) Fixing few broken files. Change-Id: Ic8b68f95f7022ce0572345ea358ff380ec8a3e61 Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-03Fix classes in pap to align with change in modelsramverma13-759/+71
Change-Id: I0ecef8f004967e2fffa33eff2ee7e6f035d3d94c Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-03Changes in pdp registration handlerramverma1-21/+20
1) Fix left over comments from previous review. 2) Change from PdpGroups to List<PdpGroup> Change-Id: I833d4cf2837babf0947c9999220a651f9a69bf7e Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-02Adding PdpStatus listener & handler to policy/papramverma3-0/+290
1) Adding PdpHeartbeatListener to keep listening for PdpStatus messages coming from Pdp's over DMaaP either for registration or just heartbeat. 2) Adding PdpStatusMessageHandler to handle new Pdp registration and also heartbeat coming from Pdp's. Registration Flow - 1. Find the PdpSubgroup based on PdpType & SupportedPolicyTypes coming in PdpStatus message. 2. If not found, don't register pdp and log the error message. 3. If found, check if PdpInstance is already added. 4. If not added, add PdpInstance to the subgroup and increment the currentInstanceCount. 5. Create and send PdpUpdate & PdpStateChange message to the Pdp. 6. Update the changes in DB. Heatbeat Flow - 1. Find the PdpInstance based on details in PdpStatus message. 2. Validate the details from message to what in DB. 3. If correct, persist the health & statistics information in DB. 4. If not correct, send a PdpUpdate & PdpStateChange message to the Pdp. 3) Unit tests will come as seperate review. Change-Id: If705193259999e2ab077b78961282c998b949f57 Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-04-02Remove pdpType from testsJim Hahn2-2/+0
Somehow, pdpType is was still referenced by junit tests. Thought I had fixed that, but guess not. Change-Id: I8060208129cb2c6ba1ecb21d65efb778a2778aa5 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-01Add mapper classJim Hahn8-14/+829
Added class to map between classes in models-pap and models-pdp. Used constants in appropriate places. Re-use maker functions. Added some comment. Corrected a comment. Added mapping method for PdpDeployPolicies. Added PdpDeployPolicies to "internal" package. Updated to reflect refactoring of ToscaPolicy. Fixed bug/typo in assertEquals test. Updated tests to work with models-pdp not based on PfConceptKey. Change-Id: I31cd4aaf58fa7dc39cea76349cc1337637a1b786 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-29Fix issues with timer manager junitsJim Hahn2-82/+94
Attempt to fix intermittent issues with junit tests for timer manager. Eliminated duplicate method in junit test and renamed another method. Always release a semaphore, just to be sure. Logged different message depending whether timer is cancelled or expired. Locked access to the current time to prevent the timer thread from accessing it while registering a new timer. Change-Id: Icb499acb18197fd8042eb186f88b61d5c30daeb0 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-27Adding db provider parameters to pap config fileramverma6-45/+91
Change-Id: I573a345bcf69eb40782277f211fff2b7c69c4f55 Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-03-27Add and register DAO provider wrapperJim Hahn3-0/+85
Added a DAO provider wrapper supporting a single create() method to create a DAO provider. PapActivator registers it at start-up. Commented out some junit timer tests that seem to fail intermittently - doesn't impact code coverage. Removed TODO from close() method. Change-Id: Ie3abd7c7a4f9ffa7aa086609515a0bb3891585d9 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-26Add components for PDP communicationJim Hahn23-12/+4167
Added PAP DAO interfaces. Added Publisher. Added TimerManager. Added RequestDataParams. Added PdpModifyRequestMapParams. Added RequestData. Added PdpModifyRequestMapTest. Updated timer test. Extracted nested MessageData classes into their own files. Addressed merge conflict. Removed unneeded methods from PapActivator. Fixed mismatchint action name. Change-Id: I3aebef68a62b48d9154dd7a4c4ff366f9914717c Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-25Changes to PAP infrastructure to support PDPJim Hahn31-194/+794
Modified PapActivator to implement the Startable interface and used that to manage it instead of the original method names. Replaced pdp-common enums with models-pdp enums. Added the use of the Registry. Added parameters to be used for PDP interaction. Added DAO interface classes. Modified HTTP client, in junit tests, to use GSON instead of Jackson. Removed DAO code, as the interfaces are not merged into policy/common yet. Added pdpParameters to default json config file. Changed tabs to spaces in json files. Removed "internal" classes that were moved to models-pdp. Change-Id: I969a7747e926680ad403557b44a0a52d289fb6d9 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-20Adding query & state change PAP REST API'sramverma8-12/+446
Change-Id: I861ace4811032314c3ce2c3f227f17354e127e5e Issue-ID: POLICY-1541 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-03-17Add NSS libraries to imagesJorge Hernandez1-1/+2
Alpine OpenJDK was updated 2 days ago (3/14), this upgrade seems to break java applications that depend on libnss*.so OS libraries, which seem are no longer installed with the jdk. Added some other libraries to aid when debugging Change-Id: I0f5cbe5792038cf569940a1b32c109c9dd1e66cc Issue-ID: POLICY-1604 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-03-16Merge "Update INFO.yaml file"Pamela Dragosh1-2/+25
2019-03-16Merge "Add additional constructors to Exception classes"Jorge Hernandez3-12/+29
2019-03-15Update INFO.yaml fileJessica Wagantall1-2/+25
Update missing information blocks and indentation to pass verify job. Change-Id: I03eecae246a9da24c82d60aae19cce12b1f62d0b Issue-ID: CIMAN-134 Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
2019-03-15Updates to PDP deploy/undeploy per Ram's commentsJim Hahn5-16/+16
Change-Id: Ic038ec8571cb50918c5f0d63602112ca05233629 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-15Add additional constructors to Exception classesJim Hahn3-12/+29
Modified test class to use auto-tester. Updated comments. Updated licenses. Change-Id: I993d0b78f31d15e6e6c35b701ed801616708628a Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-13Add simple deploy/undeploy REST APIJim Hahn6-18/+277
Change-Id: I4b789bfe4f92dae930f3675c6648b90f3c9fc9e4 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-13Add PDP Group Deploy and Delete REST API stubsJim Hahn32-634/+989
Note: this will not build until the models-pap code has been added. Added PDP group Delete methods, with and without version. Added checks for OK status codes. Added topic configuration. Still does not have the "simplified" PDP Group deploy/undeploy. Still won't build without "Move PDP Group classes to concepts subdirectory". Will add junit tests for code changes in another review. Updated comments about unlocking after updates. Made ServiceManager final. Included topic start/stop actions. Fixed parameter comment. Removed unneeded parameters from json files. Fixed argument test in shell script. Updated licenses. Change-Id: I6176d51918ae758e04fb68562dc9ca70534137d4 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-07Merge "Refactor REST server tests"Jorge Hernandez11-342/+531
2019-03-07Merge "Use Alpine as base docker image in /policy/pap"Jorge Hernandez2-20/+10
2019-03-07Refactor REST server testsJim Hahn11-342/+531
Refactored the REST server tests so that each controller has its own test class. Also ensure things are shutdown by various tests. Added comments. Removed unneeded constant. Updated license. Modified code that restarts the REST server during tests. Modified code to just change the activator's "alive" state to false, leaving the REST server running. Fixed comment. Allocated server port. Removed file that should not have been included. Changed code to throw exceptions if activator methods are called while in the wrong state. Change-Id: I04a3a6654150797c23b3c86a6a39ecf8bb7f5a78 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-06Merge "Use request id instead of PDP name in listener"Pamela Dragosh2-50/+127
2019-03-06Use request id instead of PDP name in listenerJim Hahn2-50/+127
Modified the listener that receives messages from the PDPs to use the request id instead of the PDP name for tracking purposes. Modified the listener to make it more generic so any arbitrary ID can be used, depending on the context. Combined extractId into handleEvent. Corrected a comment. Change-Id: I6b7097c67d73f51b78ae4063341bcb118eb14bbc Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-06Use Alpine as base docker image in /policy/papning.xi2-20/+10
Issue-ID: POLICY-1553 Change-Id: Ie69d32c0d8c23ff2fadeb074e654f20c1acbdf76 Signed-off-by: ning.xi <ning.xi@est.tech>
2019-03-05Refactor PAP REST controllerJim Hahn5-87/+170
Split health check and statistics REST controllers out of the PAP REST controller and made PAP REST controller into a superclass. Change-Id: I6f492c9fd5d058d81143ed34d70760dbd05a5770 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-04Receive PDP status messagesJim Hahn5-1/+292
Added infrastructure code to facilitate receipt and tracking of PDP status messages. Removed temporary PdpStatus class. Use variable for pdp-common version. Change-Id: Id76c45f26b6d9f5eb9395332b637a0b1e90bc496 Issue-ID: POLICY-1444 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-04Merge "Update INFO.yaml Liam's email"Liam Fallon1-1/+1
2019-02-28Merge "Use Coder class"Jorge Hernandez3-17/+19
2019-02-28Update INFO.yaml Liam's emailPamela Dragosh1-1/+1
est.tech Issue-ID: POLICY-1556 Change-Id: I978b0df092c5bc2020ef16862d8653c230e3936b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-02-28Reference lombok from parentPamela Dragosh1-1/+0
Policy/parent now declares lombok dependency - remove the version so that we are consistent. Also must change this repo to point to correct policy/parent. Issue-ID: POLICY-1547 Change-Id: I6530b7d34ba4f4bd826e07e9d27ec83d6be94b0d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-02-28Merge "Add code to publish to PDP"Jorge Hernandez6-1/+342
2019-02-27Use Coder classJim Hahn3-17/+19
Modified existing PAP code to use the Coder class instead of Gson. Change-Id: I770d0adf201d7c1118085f85c36582e1143deb08 Issue-ID: POLICY-1444 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-27Add code to publish to PDPJim Hahn6-1/+342
Added code to take an arbitrary object and send it to PDPs using a topic sink. Does not include the code or properties needed to configure the topic. Fixed method name - test case does not cover what the method name implied. Fixed some comments. Add test to verify that the PdpClient works with a real TopicSink. Moved coder classes to policy/common. Change-Id: I4dec746b07d384c5d9d1449ca91fa39a4f680260 Issue-ID: POLICY-1444 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-25Replace static methods with single getInstanceJim Hahn8-112/+247
Some of the PAP classes use a number of static methods. These have been modified to use regular, non-static methods, a single static method, getInstance. Also modified PapStatisticsManager so its methods are thread safe. Changed "instance" to "current" for the activator, as it may be changed. Fix new checkstyle issues. Updated copyrights. Renamed test class to be consistent. Added test for getCurrent/setCurrent and isAlive. Change-Id: Id6df55fa4c116852032ad61f80f899fcd292f864 Issue-ID: POLICY-1444 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-22Use constants for http property namesjh73584-24/+40
Modified the PAP REST server to use constants from policy-endpoints instead of hard-coding property names. Also made "alive" volatile. Also modified to use standard gson as the serialization provider to ensure that it will always work with gson. Removed unneeded constant. Removed trailing whitespace. Replaced another literal with a constant name. Updated licenses. Change-Id: Ibfc6d19ad4dae62ebd610d6127d1d253175ae71e Issue-ID: POLICY-1444 Signed-off-by: Jim Hahn <jrh3@att.com>