aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actor.so/src
AgeCommit message (Collapse)AuthorFilesLines
2021-06-17Use lombok annotations for actorsJim Hahn2-20/+9
This is the last one for policy-models! Issue-ID: POLICY-3396 Change-Id: I05b114a57a720a6ae8ae073b80c8bded36d0d06d Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-07Fix sonars in policy-models actorsJim Hahn3-30/+21
Fixed: - use "var" - don't throw generic Exception Issue-ID: POLICY-3094 Change-Id: I020addb9511fd665b5fed48e7d40719e27039224 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-05Give better messages than NPE for missing dataJim Hahn10-21/+126
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>
2020-12-23Add Service Template TOSCA handlingliamfallon1-12/+6
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-07Fix Modify NSSI operationkrishnaa962-15/+6
Update the operation to receive payload from the onset message Issue-ID: POLICY-2916 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: If49d41b35c1cd6562146fe4d92799a9a77a46db9
2020-12-02Address sonar issues in policy/modelsJim Hahn3-5/+5
Addressed the following issues: - unused parameter in method call - make constructor of abstract class protected instead of public Issue-ID: POLICY-2905 Change-Id: I1e846b88246796f1ad5cee4a3bd296647732fd24 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-11-20Delete preprocessed flag from actorsJim Hahn2-2/+2
Removed the "preprocessed" flag from the Actor parameter class, now that the actors no longer have a startPreprocess() method. Also removed targetEntity from Actor parameter class. Created a makeOutcome method within OperationPartial, which is used to create an initial outcome whose target field is pre-populated with the target-entity extracted from the properties. As the meaning of "target" may be specific to an operation, the makeOutcome method may be overridden by an operation subclass. Issue-ID: POLICY-2804 Change-Id: Ifb66de63301d644e69340009593513773ee5672d Signed-off-by: Jim Hahn <jrh3@att.com>
2020-10-27Make Actors event-agnosticJim Hahn12-5247/+76
Removed event and event-context code from the Actor code. Also removed the preprocessing steps from the Actor code, giving the application complete control over any preprocessing. Also fixed a bug wherein the APPC actor was treating the AAI_RESOURCE_VNF property as a String instead of as a GenericVnf. Issue-ID: POLICY-2746-actor Change-Id: Ibc05fe39ffedc0bc461abf10e6a960861ac70119 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-10-02Fix eclipse/sonar warnings in modelsJim Hahn1-0/+2
Addressed the following eclipse/sonar warnings: - unused imports - unchanged type - unreachable "catch" block - reinterrupt Issue-ID: POLICY-2714 Change-Id: I2fe6011ec74b7fab8889050e5c83647ab034ea25 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-09-01Add Modify NSSI operation in SO actorkrishnaa9612-16/+273
Issue-ID: POLICY-2586 Signed-off-by: krishnaa96 <krishna.moorthy6@wipro.com> Change-Id: I6ac184a6e731767f06401a0ac984c6b448c5d82f
2020-08-27Remove Target and TargetTypePamela Dragosh5-82/+73
The dependency should have been removed in the last review to remove SDC and policy-yaml legacy code. It was revealed that usage of TargetType and Type were spread out over the actor code. Those fields are represented differently in the new TOSCA Operational Policy Type, so fields were created to capture those values to be used by actor code. Issue-ID: POLICY-2428 Change-Id: Ib783526a518ca7942ae9e38019bd343639f4dd98 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-08-06Modify Actors to use properties when providedJim Hahn6-91/+301
Modified the Actors to use properties when the application provides them instead of going to the event context for the data. This sometimes entailed moving code out of the Operation subclass constructor that used or validated the context data. Combined some property names and renamed others. Changed VF Count from AtomicInteger to Integer. Issue-ID: POLICY-2746 Change-Id: Ib8730538309bb77d2f4f6161e9a20a49362d8972 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-08-04Skip preprocessor step in ActorsJim Hahn4-0/+26
Modified Actors to skip the preprocessor step if the "preprocessed" flag is set to true in the parameters. Did not add any error checking code to ensure the data was actually available to the operation - will add that once the properties are being set by the application code. Extracted common code in GrpcOperationTest into the setup method. Issue-ID: POLICY-2746 Change-Id: Id70c31a2c96a7aaa9d73cc70cdf4f55f8a4e087f Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-31Add property lists to ActorsJim Hahn6-9/+67
Modified the Actor code to provide a list of properties needed by the actor to perform a given operation. Added a build() method to the parameter class so invokers can build an operation and set its properties prior to starting it. Added a "preprocessed" field to the parameter class so invokers can indicate that the Actor need not perform any preprocessing steps. Will modify the actors, in a subsequent review, to observe the flag. Added "properties" to Operation so invokers can set the properties. Will modify the actors, in a subsequent review, to use the property values instead of the event context. Tweaked a few Actors to get values using the "params" object instead of reaching inside to the event object that it contains. Addressed review comment(s): - add prefix to other property names Issue-ID: POLICY-2746 Change-Id: I65996aef5cec5afe25e8287c0b2f5f322c532ca5 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-21Fix some sonars in policy-modelsJim Hahn2-3/+2
Fixed the following sonar issues in some of the project directories: - use assertNull, assertEquals, etc. - swap assertEquals arguments - extract a constant - don't invoke toString() in logger calls - TODOs - generic types Issue-ID: POLICY-2714 Change-Id: Id8803f9bf617ea9fc173a67b8606600709b55bdc Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-13Remove legacy actor code from modelsJim Hahn2-623/+0
Deleted legacy actor code. That includes deleting most of the XxxManager classes. Issue-ID: POLICY-2559 Change-Id: I1ef1b900ca1d23e88da64b2c95a18986feb1b765 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-07-02Rename XxxActorServiceProvider to XxxActorJim Hahn3-28/+27
Renamed the actors and their test classes. Addressed review comments: - some license dates Issue-ID: POLICY-2684 Change-Id: Ic9d83e146ef36bb305496d541166cb9f80544025 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-12Moving common polling code into HttpOperationJim Hahn17-855/+93
SO and VFC have duplicate code for polling. Moved it into the common superclass. Issue-ID: POLICY-2632 Change-Id: I27128bfb2d54ef522b6b44ff569819a8463f3454 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-11Default ActorImpl should have an "operations" propertyJim Hahn1-3/+3
Added "operations" level to actor properties. Also renamed CommonActorParams to ActorParams, in the process. Note: This impacts the properties specified in drools-apps. Issue-ID: POLICY-2629 Change-Id: I155bcb6ced73cb54e656d34e0b184fb2ed6250d1 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-02Change Actor makeCoder() to getCoder()Jim Hahn3-4/+4
Issue-ID: POLICY-2603 Change-Id: I29d5c73f4b8b129bfdd6d0c9fb6d766b260e27c4 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-01Merge "Use "coder" to serialize Actor requests"Pamela Dragosh3-61/+15
2020-05-29Use "coder" to serialize Actor requestsJim Hahn3-61/+15
Modified the Actors to use the "coder" to serialize requests instead of defaulting to the HttpClient serialization provider. Decided to just pretty-print the requests since that can be used for both logging and transmission, which avoids serializing the request twice. Issue-ID: POLICY-2601 Change-Id: I190ed19dd852a1aa66156b358cbc97c3b121af1f Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-29Use default serialization providerJim Hahn1-2/+1
The default provider has been changed to gson, so the provider property no longer has to be set. Issue-ID: POLICY-1527 Change-Id: I3c829e2070617f85d998a56c0f58127d7f22b467 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-27Include response in OperationOutcomeJim Hahn4-0/+17
Added the response field and modified the actors to populate it. Issue-ID: POLICY-2592 Change-Id: I24487b6fbc23b69bde4a95acd470864d8231c49d Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-15Cannot parse finishTime in legacy SO responsesJim Hahn1-46/+1
Adding the actual sample responses to the SO simulator broke the drools-apps junit for usecases. Fixed (in theory) by updating the legacy SO actor to properly decode the finishTime. Refactored the new SO actor, extracting the type adapter into its own class file so it could be shared between the new and legacy actors. Issue-ID: POLICY-2570 Change-Id: I061b603172440b1a91da16d09b4f2a0d289dfc41 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-15Cannot parse finishTime in SO responsesJim Hahn3-3/+103
The timestamp in SO responses appears to follow RFC-1123/RFC-822 format instead of ISO format. Added a type adapter for SO. In Guilin, we may want to consider combining the two type adapters for LocalDateTime so that either format is accepted. Also modified the SO simulator to return responses that are actual samples from SO. As part of that work, discovered that the legacy SO actor is not able to parse these timestamps either. However, as that code is now deprecated, left it as is. Issue-ID: POLICY-2570 Change-Id: I322318d1007e36eef47bb8867fd8ed01cb60223a Signed-off-by: Jim Hahn <jrh3@att.com>
2020-05-14SO poll should not require request IDJim Hahn6-12/+20
When SO is polled for the result of a previous request, it does not necessarily include the originally returned request ID in the response. This causes the SO actor to generate a "missing request ID in response" exception. Modified the actor to only extract the request ID from the first response and cache it for subsequeent responses. Testing this required the SO simulator to be modified so that it would return an INCOMPLETE on the initial request, forcing the actor to poll until it returns a COMPLETE. Made this a settable flag so that it could be enabled just to test the SO actor without impacting other components (e.g., drools-apps, CSITs). Also fixed a couple of checkstyle issues in the simulators. Issue-ID: POLICY-2568 Change-Id: Ifad8b3c0c2c0b03cb82da693c2cf5ced44ede105 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-01Set sub request ID before start callbackJim Hahn2-9/+16
Modified new actor code to generate the sub request ID before invoking the start callback. Issue-ID: POLICY-2461 Change-Id: I4adabd6efda2c30c0e2da31f95f01dd5fe546c0a Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-30Test new actors against simulatorsJim Hahn3-0/+76
Also modified HttpParams to allow "path" to be blank to support any cases that really have no "path" to append to the context URI base path. Issue-ID: POLICY-2405 Change-Id: I49eebde6759659d2804b5a11c1504c37674bd0c4 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-23New Guard actor request structure is incorrectJim Hahn2-18/+2
Missing various fields within the request structure (e.g., ONAPName). Fixed. In the process, also modified makeGuardPayload() so that it only constructs the inner "guard" JSON object, making it easier for invoking code to modify it. Issue-ID: POLICY-2434 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I7d34a279845bb98425caf66565eab7513d310815
2020-03-10Fix field names in SO Actor messagesJim Hahn2-6/+6
Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I42b6980460c2075544eb7698479b386eff8ef7b5
2020-03-06Add subrequest ID to OperationOutcomeJim Hahn2-2/+17
Rule notifications need the subrequest ID to be populated in the OperationOutcome object, where possible. Issue-ID: POLICY-2385 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ic44320f67ad8df7bcb3000cfa667f95427818e71
2020-03-05Add SO VF Module Delete OperationJim Hahn12-27/+1102
Redesigned the SO Operation classes; moved some code from the subclass to the superclass so it could be reused by the VF Module Delete Operation. JerseyClient does not support DELETE with a request body, so had to implement a delete() method using java11 HttpClient. Fix some issues found while testing with drools-apps. Added "delete" operation to SO simulator. Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I269fe13cf90c295ec2bbac92bc5a59b3820ea265
2020-03-03Fix path issuesJim Hahn3-8/+6
A&AI tenant query is prepending the target entity with "/", but it should not. Fixed it. Modified A&AI and SO actors to get path prefixes from parameters. Fixed a bug in an A&AI simulator response (extra "}" at the end. Issue-ID: POLICY-2349 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I71f8b1e5fb8a4bd29b4f616a7757d366c7d58127
2020-02-25Support separate VF Counts for different TargetsJim Hahn5-67/+132
Changed the key by which the VF Count is stored within the context so that each Target can have its own VF Count. Also moved VF Count code from VfModuleCreate to SoOperation, to hide the determination of the VF Count "key". Fixed sonar issue about return "null" instead of returning an empty list - modified the code to use Optional. Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ia23eabea0edf6857372e269a2db1a21e741824c6
2020-02-24Move CQ operation name from actor.aai to aaiJim Hahn1-2/+1
Issue-ID: POLICY-2385 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I12a7d55b118baa5f0f849855fbcf0602a1208b52
2020-02-21Change payload to Map<String,Object> so it's more versatileJim Hahn11-41/+303
This was supposed to be two separate commits, but I goofed something. Added guard query to Operation superclass. Modified VfModuleCreate to store the VF count, pass it to the guard, and bump it once the create completes successfully. Added code to check Actors for proper plug-in to ActorService. Renamed "operation" property to "operations", to be more consistent with other parameters (e.g., TopicParameterGroup). The META-INF/services files for the actors had mixed case, which did not match the package name of the Actor class, preventing the ServiceLoader from recognizing them. Also modified the ActorService to skip any that cannot actually be loaded, for whatever reason (e.g., not in the classpath). Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ifa97744543f2866cc553138ec5ec644b033de780
2020-02-20More actor clean-upJim Hahn10-138/+212
Currently, Operator classes refer to Operation classes, and vice versa, creating a dependency cycle. In addition, there is a slight problem in that if an operator is reconfigured, any running operation may get inconsistent configuration data. Modified the code to create Config objects that are passed to the operation, instead of passing the Operator to the operations. This solved both issues. Replaceed makeOperator() with constructors. Added parameter type to HttpActors. Modified guard to get "ONAP" properties from its configuration, as a default. Changed setUp() to setUpBasic(), so "throws Exception" could be removed, thus resolving a sonar issue. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I21eb8798acfbc636ff1bd8741b21c7278365b6e4
2020-02-19Add SO actorJim Hahn17-0/+1845
Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I3faf0276e8039dc43a976d18ff8e704fdbec3d49
2020-02-18Actor updates to support SOJim Hahn1-6/+13
Used SuperBuilder in operation Params classes. Added rawResponse to http setOutcome(). Made HttpOperation.operator private. Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Ie894f2e6ae4a31b69a700e425f9e94c5e8a15daa
2020-02-03Actor redesign.Jim Hahn1-3/+7
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
2019-11-13Removing Named Query.pramod.jamkhedkar2-362/+0
Removing all the related files and necessary modifications for removing named query. The code now only supports Custom Query Issue-ID: POLICY-2125 Change-Id: Ifa5ccb74142aa424359c0dea85b90bbcf70147cb Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-10-09Added ModelType to SO Req.pramod.jamkhedkar1-0/+1
Added ModelType to SO Request and set it to vfModule Issue-ID: POLICY-2156 Change-Id: Icfd824ff1f521ec32a711506d01283566d2a7ed9 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-08-30Added VFModule countpramod.jamkhedkar1-673/+0
Added the function VFModuleCount to AaiCqResponse class. It counts the number of vf modules. Also changed the same custom query response in AaiSimulator. Issue-ID: POLICY-1858 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com> Change-Id: If08de84f74d2bd9501b501b881cdd761089614dc
2019-06-17Fix simple sonar issues in modelsJim Hahn2-41/+39
Added @FunctionalInterface where needed. Replaced anonymous classes with lambda expressions. Replaced duplicate strings with a constant. Removed unused BeforeClass & AfterClass test methods. Removed some trailing spaces. Fixed: aai actor.appc actor.appclcm actor.sdnc actor.sdnr actor.so actor.vfc actorServiceProvider appc appclcm cds events Change-Id: I0e21cbb10db6d1217bbd0e00e6dd4fac3eb84e31 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-13Fixed SO request creationpramod.jamkhedkar2-5/+4
Fixed the SO creation from aai custom query. Issue-ID: POLICY-1856 Change-Id: I5842a4dccbd61c774d84c8e897a876eae76d3a79 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-05-06Supports new aai changes.pramod.jamkhedkar3-26/+3922
Made changes to support model and model version additions to Aai custom query response. Issue-ID: POLICY-1729 Change-Id: I84a202105d477548e9e8e060d983bf9cd47d3885 Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-04-10Custom Query Codepramod.jamkhedkar4-62/+1040
Changes to aai, so, vfc and restmanager to support aai custom queries. updated to latest version of aai schema. Made changes according to latest updates. Issue-ID: POLICY-1278 Change-Id: I255cef17fff4fe7d4ea21344c0e5ccaac52cbe9a Signed-off-by: pramod.jamkhedkar <pramod@research.att.com>
2019-04-09Parse new model ids from operational policyPamela Dragosh2-35/+53
Companion review to https://gerrit.onap.org/r/#/c/84235/ Copies the required changes into policy/models. Issue-ID: POLICY-1545 Change-Id: I43fec36f60b5409d9e3df9d925de06209c81fd01 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-08Remove drools PDP dependencyPamela Dragosh2-8/+11
Removing working memory and use of PolicyEngine from drools in these classes. Cleaned up some unused imports and checkstyle. Issue-ID: POLICY-1264 Change-Id: Id059da9689a721b0eafc6b310adcbdad43574ce7 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>