aboutsummaryrefslogtreecommitdiffstats
path: root/models-interactions/model-actors/actorServiceProvider/src/main
AgeCommit message (Collapse)AuthorFilesLines
2020-02-20More actor clean-upJim Hahn12-162/+402
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 Hahn2-1/+10
Issue-ID: POLICY-2371 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I3faf0276e8039dc43a976d18ff8e704fdbec3d49
2020-02-18Actor updates to support SOJim Hahn3-9/+12
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-17More changes to actor codeJim Hahn6-29/+63
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-17Use BidirectionalTopicClient from policy-commonJim Hahn17-710/+692
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-13Add Topic Actor superclassesJim Hahn11-14/+1152
Issue-ID: POLICY-2363 Change-Id: I5d29d85f6c5f40fb6c8f1bf678d9c718760a7558 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-12Add A&AI actor and some operatorsJim Hahn1-1/+1
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-11Add more code to facilitate actor implementationJim Hahn14-973/+1274
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-07Clean up and enhancement of Actor re-designJim Hahn14-394/+1100
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-03Actor redesign.Jim Hahn17-26/+2546
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-04-01move actors code in drools-applications to policy/modelsning.xi2-0/+109
remove white-space in policy/models Issue-ID: POLICY-1264 Change-Id: I8856fc7cd2c2a57af0031637870ca33c684bacf5 Signed-off-by: ning.xi <ning.xi@est.tech>