Jim Hahn [Mon, 20 Jan 2020 22:39:32 +0000 (17:39 -0500)]
Replace deprecated Nashorn javascript engine
Some test drivers use javascript to evaluate expected results.
In java 8, the standard javascript engine was Nashorn, but that has
been deprecated. As the test scripts use a simple xxx.yyy.zzz notation,
decided to go with a small expression language, Apache JEXL, instead.
Issue-ID: POLICY-2324
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Iffff468a880c612bdb31da84964dfa4132fa15e3
Pamela Dragosh [Tue, 14 Jan 2020 18:51:12 +0000 (13:51 -0500)]
Sonar cleanup overrides and fixes
Removal of UTF-8 because its already set
capabilities doesn't generate any code, no need to include
override false positives for passwords etc.
override for logging and exception throw that we want
add synchronized to overrides that are synchronized
ignore checking of some conditions
adding synchronized to match set* methods
Issue-ID: POLICY-2321
Change-Id: I26d9ca22a0cdd67fdaae9c44b718b8dc103f190e
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Pamela Dragosh [Tue, 14 Jan 2020 12:35:41 +0000 (12:35 +0000)]
Merge "Changed Matchers to ArgumentMatchers"
liamfallon [Fri, 10 Jan 2020 20:27:22 +0000 (20:27 +0000)]
Add method to return resource directory contents
In order to avoid hard coding the policy types and policies that are in
the example directories into unit test cases, and in order to
automatically pick up added and removed policy types and policies, it
would be good to read the contents of resource directories at run time
in unit tests. This change brings in that functionality into
ResourceUtils.
Issue-ID: POLICY-2315
Change-Id: I601718828aad0f065dbbaa1f5af8d0a0f133f44d
Signed-off-by: liamfallon <liam.fallon@est.tech>
Jim Hahn [Fri, 10 Jan 2020 22:20:07 +0000 (17:20 -0500)]
Changed Matchers to ArgumentMatchers
Issue-ID: POLICY-1406
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I6d85bb10c15f9d82fa55d9328d18640098050dd9
Ram Krishna Verma [Mon, 13 Jan 2020 12:56:55 +0000 (12:56 +0000)]
Merge "Update sonar configuration"
Ram Krishna Verma [Mon, 13 Jan 2020 12:55:56 +0000 (12:55 +0000)]
Merge "Address items deprecated by move to java 11"
Jim Hahn [Fri, 10 Jan 2020 21:59:48 +0000 (16:59 -0500)]
Fix mockito import in common
ONAP-Logging was failing when using powermock-mockito2.
This change also requires a property (version.javax.bind) to be
added to the parent/integration pom.
Issue-ID: POLICY-1406
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: If8813edaf86d84cff72c0e476ebf2a36bf5dcf18
Pamela Dragosh [Fri, 10 Jan 2020 01:26:46 +0000 (20:26 -0500)]
Update sonar configuration
Sonarcloud upgrade resulted in new configuration property
Removed deprecated properties
No need for plugin configuration override of oparent
Issue-ID: POLICY-2321
Change-Id: Ia294575d2ea0a589eab6797b48b8c1924f9f1b36
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jim Hahn [Fri, 10 Jan 2020 16:30:21 +0000 (11:30 -0500)]
Address items deprecated by move to java 11
Addressed the following deprecated items:
- "new Integer(xxx)"
- Observable/Observer
- Mockito.anyObject()
Added assertion to a junit test to address a sonar issue.
Did not address deprecated Nashorn javascript interpreter; that will be
done in a separate review.
Updated licenses.
Issue-ID: POLICY-1406
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: I81fd158f831e01d5410d79898ced658285787d47
HOCKLA [Thu, 9 Jan 2020 17:48:49 +0000 (11:48 -0600)]
policy/common jdk11 upgrades
Issue-ID: POLICY-1583
Change-Id: I6bcd320a6cdedd84dad9b54fdb4fec0cb8443b44
Signed-off-by: HOCKLA <ah999m@att.com>
liamfallon [Thu, 12 Dec 2019 14:11:28 +0000 (14:11 +0000)]
Update policy common for checkstyle 8
Minor changes to clear down checkstyle warnings in policy common.
Issue-ID: POLICY-206
Change-Id: Ifa6753bafdc4b2a9ee0725c4f3751c6eac03e096
Signed-off-by: liamfallon <liam.fallon@est.tech>
HOCKLA [Wed, 11 Dec 2019 16:24:44 +0000 (10:24 -0600)]
Added JDK 11 upgrades and point to parent java 11 branch
Issue-ID: POLICY-1583
Change-Id: Ic46ffcb6eb5b0d18f9cb0a6a2ec46374e523f54a
Signed-off-by: HOCKLA <ah999m@att.com>
Pamela Dragosh [Fri, 6 Dec 2019 21:47:40 +0000 (21:47 +0000)]
Merge "Minor changes for new Eclipse checkstyle checks"
HOCKLA [Fri, 6 Dec 2019 20:29:46 +0000 (14:29 -0600)]
Bumped policy/common patch version to 1.6.2-SNAPSHOT
Issue-ID: POLICY-1583
Change-Id: I4a1c5848f158d10b4b6f21f048f92d69ccc90a83
Signed-off-by: HOCKLA <ah999m@att.com>
HOCKLA [Fri, 6 Dec 2019 17:16:11 +0000 (11:16 -0600)]
Release 1.6.1 policy/common
This is a re-release, previous release wasn't pointing to
an already installed release
Issue-ID: POLICY-1583
Change-Id: I613dd5a78b439b60455be58b476204e422ebbf02
Signed-off-by: HOCKLA <ah999m@att.com>
HOCKLA [Fri, 6 Dec 2019 15:56:15 +0000 (09:56 -0600)]
Point to 3.1.0 policy/parent to prep for re-release
Issue-ID: POLICY-1583
Change-Id: I1c65a4478d1121b863d29388bd3a7047d92ff5ea
Signed-off-by: HOCKLA <ah999m@att.com>
liamfallon [Wed, 4 Dec 2019 10:24:58 +0000 (10:24 +0000)]
Minor changes for new Eclipse checkstyle checks
The laest Eclipse checkstyle version 8.26.0 does more thorough checking
and identified a number of small issues in the apex-pdp codebase. This
review fixes those issues.
logging pattern in logback.xml files amended to be less than 120
characters. Test case added for checking parameter is valid.
Issue-ID: POLICY-2204
Change-Id: Id7293e44b56c225afc6290e1c599603e9ebedb19
Signed-off-by: liamfallon <liam.fallon@est.tech>
HOCKLA [Thu, 5 Dec 2019 13:25:42 +0000 (07:25 -0600)]
Changed project version to 1.6.1-SNAPSHOT to isolate for java 11 upgrades
Issue-ID: POLICY-1583
Change-Id: I805ebed75e7e0cb5109946328958341018421aad
Signed-off-by: HOCKLA <ah999m@att.com>
HOCKLA [Wed, 4 Dec 2019 14:53:28 +0000 (08:53 -0600)]
Added a yaml file to release 1.6.0 policy/common
Issue-ID: POLICY-1583
Change-Id: I20b608a6674a4496e5aa20fa3c26da2a275a289d
Signed-off-by: HOCKLA <ah999m@att.com>
liamfallon [Mon, 4 Nov 2019 14:30:14 +0000 (14:30 +0000)]
Make jersey-hk2 dependency non-test
THis change will amke this dependency available to all components when
using policy-endopints.
Issue-ID: POLICY-2209
Change-Id: Ie3c6ca9d21327bdc54b5f14d64c41eed329941ad
Signed-off-by: liamfallon <liam.fallon@est.tech>
liamfallon [Fri, 1 Nov 2019 11:21:54 +0000 (11:21 +0000)]
Add common Jersey version
Add a common version of Jersey for all Policy Framework components.
Issue-ID: POLICY-2209
Change-Id: I8554a97e9f13887418118966bfe1043b65d9a179
Signed-off-by: liamfallon <liam.fallon@est.tech>
Jim Hahn [Tue, 29 Oct 2019 19:02:25 +0000 (15:02 -0400)]
Fix new sonar issues in common
Issue-ID: POLICY-2204
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: If0a11913f614e038ecd3e8c3f0b56d3ac78b03ec
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Tue, 29 Oct 2019 17:45:34 +0000 (17:45 +0000)]
Merge "Cleanup eclipse warnings in common"
Jim Hahn [Tue, 29 Oct 2019 16:44:35 +0000 (12:44 -0400)]
Cleanup eclipse warnings in common
Issue-ID: POLICY-2204
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: If55ea1a804997ab751f15813e6b643572d4f189f
Jim Hahn [Tue, 29 Oct 2019 13:47:44 +0000 (09:47 -0400)]
Disable HTML escaping in gson coders
Issue-ID: POLICY-1869
Signed-off-by: Jim Hahn <jrh3@att.com>
Change-Id: Ic757d3a8e7e0e3537ecba979a919b9ea3c1aa797
Signed-off-by: Jim Hahn <jrh3@att.com>
Chou, Joseph (jc2555) [Tue, 22 Oct 2019 13:47:21 +0000 (09:47 -0400)]
Integrate CryptoUtils into ONAP common
Update junit to add test cases
Change-Id: If3236853138a05faac5f51a859b935265c14f0d6
Issue-ID: POLICY-1945
Signed-off-by: Chou, Joseph (jc2555) <jc2555@att.com>
jhh [Mon, 21 Oct 2019 14:08:11 +0000 (09:08 -0500)]
Add CryptoCoder interface
This is to allow multiple supporting implementations.
Issue-ID: POLICY-1945
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I42491e5671f561fe320f034bf8ffe03848dff43f
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
jhh [Thu, 17 Oct 2019 02:25:57 +0000 (21:25 -0500)]
Removed unthrown checked exceptions from CryptoUtils.
additional minor javadoc clean up
Issue-ID: POLICY-1945
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I23927b8c4dd63ed658e8062c87b4884ea1d31825
Jim Hahn [Mon, 16 Sep 2019 15:38:20 +0000 (11:38 -0400)]
Eliminate constructors with side-effects
Several of the Gson and Jackson handlers take a GsonBuilder, which
they then configure with additional adapters prior to create a Gson
object that they subsequently use. The code has been modified so
that the constructors no longer take a GsonBuilder, thus eliminating
the side-effects that they had on the builders. Instead, a
configBuilder() method has been added to the handler classes that
makes it clear tht they modify the GsonBuilder.
This also has the advantage that classes that want a Gson object
configured per a given handler need only call that handler's
configBuilder() method; previously, they had to constructor the
handler and then retrieve its gson object.
Also updated a few tests to specify the HTTP "Accept" header to ensure
that return results are in yaml format.
Change-Id: I2ef98198041ff9f73913d01ee6ee14ecf20ba617
Issue-ID: POLICY-2081
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 13 Sep 2019 16:14:25 +0000 (12:14 -0400)]
Extract YamlJsonTranslator from StandardYamlCoder
Refactored StandardYamlCoder, extracting a new class, YamlJsonTranslator,
from it. This facilitates performing yaml translation when not using a
standard "gson" coder.
Added YamlJacksonHandler which supports YAML translation layered on
top of a JacksonHandler instead of a GsonMessageBodyHandler.
Also added junit tests to complete coverage of StandardCoder.
Also added public APPLICATION_YAML to YamlMessageBodyHandler.
Change-Id: Ia470fa194661fbf1aebeaf0f18b57f2a984cb64b
Issue-ID: POLICY-2081
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Fri, 13 Sep 2019 19:07:53 +0000 (19:07 +0000)]
Merge "Changes to accomodate to version of jetty"
Jim Hahn [Fri, 13 Sep 2019 15:36:48 +0000 (15:36 +0000)]
Merge "Remove YamlException class"
Jim Hahn [Tue, 10 Sep 2019 17:48:31 +0000 (13:48 -0400)]
Changes to accomodate to version of jetty
With a newer version of jetty being used, a couple of methods have
been deprecated. Modified the code to use the facilities appropriate
to the new jetty version.
Change-Id: Idcaef11836841480c24b1721c06ed642d3d4394a
Issue-ID: POLICY-2100
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 12 Sep 2019 21:29:49 +0000 (17:29 -0400)]
Report bad-request for invalid YAML
Added classes and modified code to report bad-request when a servlet
attempts to read invalid YAML.
Change-Id: Iacddee92a448fb69d5c778a3c3f3f2b5528983f7
Issue-ID: POLICY-2085
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 12 Sep 2019 18:25:45 +0000 (14:25 -0400)]
Remove YamlException class
After the implementation was finalized, it turned out that YamlException
was no longer needed, so it has been deleted.
Change-Id: Ie895fc096787f05eff36a6127b08247a7664ff8d
Issue-ID: POLICY-2065
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Mon, 9 Sep 2019 20:51:32 +0000 (16:51 -0400)]
Create StandardYamlCoder
Created StandardYamlCoder which is like a StandardCoder, except that
the original converts to/from JSON, while the new class converts to/from
YAML. Also added YamlMessageBodyHandler and incorporated it into the
http server so that it supports a media type of */yaml.
Change-Id: Ibd83a9f6d355a330f63e435f2bb41affcf1947c2
Issue-ID: POLICY-2065
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 10 Sep 2019 14:43:11 +0000 (10:43 -0400)]
Update default branch in common for master
Change-Id: I7ddce7f583575adc11db4f9cc102d474a827d488
Issue-ID: POLICY-2045
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 5 Sep 2019 18:23:30 +0000 (14:23 -0400)]
Bump version in policy/common master
Change-Id: If86cac60ee143b1d8ae92fd3893ea33a0d3e1b81
Issue-ID: POLICY-2045
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Thu, 5 Sep 2019 12:57:24 +0000 (08:57 -0400)]
Upgrade to released parent 3.0.1
Released
Issue-ID: POLICY-2045
Change-Id: I82bf30780064ddaf26fdc6ed96a78653b1af1797
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jim Hahn [Tue, 27 Aug 2019 18:13:25 +0000 (14:13 -0400)]
Remove AlertSeverity from logback in policy/common
Replaced AlertSeverity with severity in logback xml files, because
the MDC only has severity.
Change-Id: I118b195b65555c915c723faf117c4f4854e990f3
Issue-ID: POLICY-1989
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 23 Aug 2019 22:35:40 +0000 (18:35 -0400)]
Rest servers should return 400 for bad syntax JSON
Modified common RestServer to inject an exception handler
into the list of providers so that it returns 400 instead
of 500 for JSON parsing errors.
Change-Id: I7c77625e3531e26413d72cc386296a709946cda2
Issue-ID: POLICY-1725
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Mon, 19 Aug 2019 21:32:09 +0000 (17:32 -0400)]
Enhance TestTimeMulti
Enhance TestTimeMulti to support execution of tasks, whether
submitted via Timers or via Executors.
Change-Id: Ib5f216730b3b69028e9581052645370b827cd446
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 6 Aug 2019 16:17:29 +0000 (12:17 -0400)]
Add ApiUtils to facilitate looping over features
A number of places in the code (common & drools-pdp) loop over
features, giving each provider a chance to act on something.
Created a common method in a new ApiUtils class to faciliate
it.
Renamed to FeatureApiUtils per review comment.
Change-Id: I0c2cf0f33854cb5b6921b394f64de498a6234909
Issue-ID: POLICY-1968
Signed-off-by: Jim Hahn <jrh3@att.com>
Bruno Sakoto [Thu, 8 Aug 2019 14:40:11 +0000 (10:40 -0400)]
Review maven dependency for snakeyaml
Remove explicit version for snakeyaml maven dependency and inherit it
from integration parent artifact.
Upgrade snakeyaml to latest 1.24 version.
Issue-ID: POLICY-1603
Signed-off-by: Bruno Sakoto <bruno.sakoto@bell.ca>
Change-Id: Id44753332f39409205d2a64f6bc5563a5869bf91
Jim Hahn [Fri, 2 Aug 2019 22:10:29 +0000 (18:10 -0400)]
Bump version in policy/common
Change-Id: I7efbdf7c36907eb10ae5ce4c9d7d4988d7e2d68a
Issue-ID: POLICY-1965
Signed-off-by: Jim Hahn <jrh3@att.com>
Ram Krishna Verma [Thu, 1 Aug 2019 10:29:17 +0000 (10:29 +0000)]
Merge "Change to fix issues in overridden validations of ParameterGroups"
Jim Hahn [Wed, 31 Jul 2019 15:16:39 +0000 (11:16 -0400)]
Remove ParameterUtils
Removed ParameterUtils.
Also made RestServer.getServerProperties() protected so it can be
overridden.
Also fixed issue in TopicParameterGroupTest to prevent it from validating
static fields.
Change-Id: Icb4580f5802b9edca489a38896d61ad24aece449
Issue-ID: POLICY-1953
Signed-off-by: Jim Hahn <jrh3@att.com>
a.sreekumar [Wed, 31 Jul 2019 13:25:29 +0000 (13:25 +0000)]
Change to fix issues in overridden validations of ParameterGroups
Currently, for validation of nested ParameterGroup classes, a new
GroupValidationResult is directly created instead of calling the
validate method of nested classes. Thus any overridden validate methods
won't work. This is fixed.
Change-Id: I8ee9265b295cb68d67926128b5b68c217f341034
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Jim Hahn [Tue, 30 Jul 2019 13:53:19 +0000 (09:53 -0400)]
Fix managed noop topic source
NOOP topic sources configured via TopicParameterGroup are left
unmanaged. Removed a new override method, as it did not pass
the "managed" flag down, while the method that already existed
in the superclass already works correctly.
Also restored "null" lists to TopicParameterGroup so-as not
to break the behavior of its validate() method.
Change-Id: Id392a3263c3bd1c8f278461715b441719817c47c
Issue-ID: POLICY-1953
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Tue, 30 Jul 2019 13:57:35 +0000 (13:57 +0000)]
Merge "Passing the updated topic parameters to policy-endpoints"
a.sreekumar [Tue, 30 Jul 2019 11:17:55 +0000 (11:17 +0000)]
Passing the updated topic parameters to policy-endpoints
Changes to pass the updated parameters from BusTopicParams to
PolicyEndpoints.
Change-Id: I49d3b9d30a2a4c6b2337d0ab76a61583eb9ef04a
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Jim Hahn [Sat, 27 Jul 2019 12:20:17 +0000 (08:20 -0400)]
Add addTopic(List<TopicParams>)
New services are typically configured using TopicParameters. These
are converted into Properties before being passed to
TopicEndpoint.addTopic(), which then converts them into BusTopicParams
before configuring a given topic. Added
TopicEndpoint.addTopic(List<TopicParams>), which makes it possible
to configure the topics without going into the intermediate Properties.
Furthermore, because TopicParams is a subclass of BusTopicParams, no
conversion is needed for that either, so the TopicParams can be passed
directly into the configuration classes.
Incorporated changes from review.
Change-Id: Id87e2c6812e36ae1a3ac680e6b35208667971782
Issue-ID: POLICY-1953
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Sat, 27 Jul 2019 11:53:24 +0000 (07:53 -0400)]
Default TopicParams.isManaged to true
Modified TopicParams to set "managed" to true by default.
Change-Id: Ia21caba2b882199f1a63d40b0fed1167ccb93142
Issue-ID: POLICY-1744
Signed-off-by: Jim Hahn <jrh3@att.com>
a.sreekumar [Thu, 25 Jul 2019 15:58:58 +0000 (15:58 +0000)]
Changes to add missing topic parameters
Changes to support parameters which would be critical to run in a
secure environment.
Change-Id: Ia7df174261041b35e57b9f1f2be7552e5dcd2cec
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Ram Krishna Verma [Thu, 18 Jul 2019 11:14:22 +0000 (11:14 +0000)]
Merge "Convert double to int when decoding via gson"
Jim Hahn [Wed, 17 Jul 2019 16:05:34 +0000 (12:05 -0400)]
Convert double to int when decoding via gson
Refactored MapDoubleAdapterFactory, extracting DoubleConverter to be
used by code needing to convert Double to Integer/Long after being
decoded by GSON.
Enhanced StandardCoder to automatically use the above converter if
the desired class is a generic Object.
Change-Id: I1d4e83910de41ceda383f257bfea706db2b8fbbe
Issue-ID: POLICY-1919
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 16 Jul 2019 20:10:25 +0000 (16:10 -0400)]
Copy PapRestServer to policy/common
Copied and renamed the class to RestServer. Also modified it to
derive from ServiceManagerContainer.
Added getName() method to HttpServletServer, which facilitated
the refactoring.
Renamed "controllers" to "providers".
Change-Id: I905166e41063e3fe84e356fd6c4a91ca9d4cb8a6
Issue-ID: POLICY-1652
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 11 Jul 2019 22:05:01 +0000 (18:05 -0400)]
Combine lines in IM state transition table
Rewrote the code to generate the Integrity Monitor state transition
table, eliminating duplicate lines. Output the table, before and
after the change, and verified that they were identical, with one
exception: there were two places where the original code had
"StandbyStateException", while all of the others had
"StandbyStatusException". Guessing that the original code was
incorrect in these two cases, I changed the new code to always use
"StandbyStatusException" instead.
Change-Id: Ibe3044eb1ac398a0bc8f328f4e14305d4bdeb380
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 11 Jul 2019 14:10:17 +0000 (10:10 -0400)]
Fix checkstyle issues in common/gson
Also deleted the checkstyle suppression file.
Change-Id: I6d310af32d6d4be9633a8f88745447f40a566af7
Issue-ID: POLICY-1074
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Mon, 8 Jul 2019 16:17:17 +0000 (16:17 +0000)]
Merge "Fix sonar issues in Integrity Monitor"
Jim Hahn [Mon, 8 Jul 2019 15:54:31 +0000 (15:54 +0000)]
Merge "Replace ONAP-logging getters/setters with lombok"
Jim Hahn [Mon, 8 Jul 2019 15:12:11 +0000 (15:12 +0000)]
Merge "Fix sonar issues in policy/endpoints"
Jim Hahn [Mon, 8 Jul 2019 13:32:51 +0000 (09:32 -0400)]
Replace ONAP-logging getters/setters with lombok
Added lombok annotations to EvenData, but forgot to remove
the get/set methods.
Change-Id: I4dc21fdf1e57e2d326a122ddebe10ef99a9b2638
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Mon, 8 Jul 2019 13:20:38 +0000 (13:20 +0000)]
Merge "Fix sonar issues in policy ONAP logging"
Jim Hahn [Fri, 5 Jul 2019 17:03:06 +0000 (13:03 -0400)]
Fix sonar issues in policy ONAP logging
Sonar fixes, other than code coverage. These changes are disruptive
and will likely cause breakage in a number of policy repos.
Renamed constants.
Moved constants/factories from interfaces to classes.
Also fixed remaining checkstyle issues, which was equally disruptive,
as it required renaming of methods and classes.
Split out Onap config properties from EELF config properties, in
case changes are made in the future such that Onap properties can
no longer subclass from EELF properties (e.g., if EELF properties are
converted from a interface to a utility class with a private constructor).
Attempted to eliminate some duplicate blocks of code by refactoring
out common methods.
Change-Id: Ie038d2d4ed553037a9af3f0ddf31baf2b3628fa3
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 5 Jul 2019 14:52:20 +0000 (10:52 -0400)]
Fix sonar issues in policy/endpoints
Sonar fixes, other than code coverage. These changes are disruptive
and will likely cause breakage in a number of policy repos.
Renamed constants.
Moved constants/factories from interfaces to classes.
Change-Id: I182d50320aa6b53e383081af806c60dd2f806cbe
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 5 Jul 2019 14:04:55 +0000 (10:04 -0400)]
Fix sonar issue in common/utils
Renamed a constant.
Change-Id: I5e1f2fb6de8445a8f667ea48a595773173c6beae
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 5 Jul 2019 13:58:14 +0000 (09:58 -0400)]
Fix sonar issues in Integrity Monitor
Fixed most sonar issues, except for code coverage.
Change-Id: I473635d896797b2290920da86c6770848bc2e883
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 3 Jul 2019 18:04:48 +0000 (14:04 -0400)]
Fix remaining sonar issues in Integrity Audit
Renamed enums to upper case - this might disrupt other repos, though
it should be minimal.
Renamed constants in a junit test.
Change-Id: Ifd864bb61eec3d9b3c7a0321fe3841696046f6f6
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
ramverma [Wed, 3 Jul 2019 13:33:08 +0000 (13:33 +0000)]
Remove ToStringTester from utils
Finally, removing the ToStringTester from utils module.
All repos are moved to use it from utils-test.
Change-Id: I79c7db0b39b5d300a850279c46858c719aa1faab
Issue-ID: POLICY-1746
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Jim Hahn [Thu, 27 Jun 2019 22:15:45 +0000 (18:15 -0400)]
Allow empty DB password in IntegrityAudit
With the sonar fixes, IntegrityAudit is no longer allowing an empty
DB password. This breaks some junits in other policy repos.
Corrected the issue.
Change-Id: I291d1592ffd80ee76dd9758b3b7156436c579dab
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
a.sreekumar [Thu, 27 Jun 2019 10:26:04 +0000 (10:26 +0000)]
Making the topic property utility method more generic - addressing Jorge's review comment
Making the method to update topic properties object more generic so that
it can be used by other components such as drools if needed.
Change-Id: I29c0f8fde5f4e1dd464072a9b06f2d93cc15b137
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Jim Hahn [Wed, 26 Jun 2019 15:13:19 +0000 (15:13 +0000)]
Merge "Speed up CryptoUtilsTest"
Pamela Dragosh [Wed, 26 Jun 2019 15:11:58 +0000 (15:11 +0000)]
Merge "Adding Topic and REST parameters to policy-endpoints"
Jim Hahn [Wed, 26 Jun 2019 13:27:51 +0000 (09:27 -0400)]
Speed up CryptoUtilsTest
CryptoUtilsTest runs slowly because the SecureRandom that CryptoUtils
uses to generate an "iv" takes a while to create enough randomness.
However, as the "iv" is only used as a "salt", it is not necessary
to use SecureRandom; the values generated by Random are sufficient.
Change-Id: I1f3b03b85d28852a7969d3a83802a2691308caa5
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Mon, 24 Jun 2019 19:46:36 +0000 (15:46 -0400)]
Fix some sonar issues in policy-endpoints
Refactored various classes to reduce cyclomatic complexity.
Introduced some endpoint utility classes to facilitate extraction
and conversion of property values, and populating of common
"builder" values.
Change-Id: Ie1c91cd94cb54700dc9127f72780b4d94b82ec39
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
a.sreekumar [Wed, 26 Jun 2019 10:52:28 +0000 (10:52 +0000)]
Adding Topic and REST parameters to policy-endpoints
1) Adding Topic parameters and REST parameters into policy-endpoints module as these
are used by other modules such as PAP, APEX and XACML PDPs.
2) ParameterUtils class is also added which can contain related utility methods
Change-Id: I5421fbf2234259305e3626ec0859aee0f36ed9b1
Issue-ID: POLICY-1744
Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
Ram Krishna Verma [Tue, 25 Jun 2019 15:28:53 +0000 (15:28 +0000)]
Merge "Moving ToStringTester to utils-test module"
ramverma [Tue, 25 Jun 2019 13:46:47 +0000 (13:46 +0000)]
Moving ToStringTester to utils-test module
Moving ToStringTester to utils-test as thos module holds all test
related utilities. Keeping the original one for now as it will break
build for all the repos.
Will delete the original one after pointing all the dependent repos to
the new one.
Change-Id: I5f90b722452178e1e1a30d759679b8738dadfb65
Issue-ID: POLICY-1746
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Jim Hahn [Mon, 24 Jun 2019 12:41:18 +0000 (08:41 -0400)]
Fix more sonar issues in Integrity Audit & Monitor
Removed duplicate code in DbDao by refactoring common code
into a new updateIae() method.
Removed duplicate code in IntegrityMonitor by refactoring common code
into a new withinTransaction() method.
Removed duplicate code in StateManagementEntity, StateElement by
replacing with lombok Getter & Setter annotations.
Removed duplicate code in StateManagement by refactoring common code
into new setState() and getState() methods. Also removed
logger.isDebugEnabled() tests.
Added coverage for StateChangeNotifier.
Change-Id: I2e29b836dafc5de569a2267206a6a34105e44021
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 21 Jun 2019 17:19:31 +0000 (13:19 -0400)]
Fix sonar issues in integrity monitor
Used Eclipse Refactor->Extract Method to reduce cyclomatic
complexity.
Flattened nested FpManager class into IntegrityMonitor class.
Changed some strings to StringBuilder, where lots of concatenation
was being done.
Simplified some things by eliminating some try/catch blocks where
an exception can't actually (except may an out-of-memory exception).
Also addressed some sonar issues in the tests (e.g., use "<>" where
appropriate).
Eliminated some assertException methods, replacing them with assertj
methods.
Did not attempt to increase junit coverage.
Change-Id: I311acaffcd87f0cbbf382c06c7fa26177007abd5
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 19 Jun 2019 21:31:24 +0000 (17:31 -0400)]
Fix sonar issues in integrity audit
Mostly used Eclipse Refactor->Extract Method to reduce cyclomatic
complexity. Also combined a few "if" statements to reduce nesting
levels.
Also addressed some sonar issues in the tests (e.g., use "<>" where
appropriate).
Did not attempt to increase junit coverage.
Change-Id: I9d6c1305ce455f0d64249b548d123bb9bf37292a
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Fri, 21 Jun 2019 13:08:00 +0000 (09:08 -0400)]
Bump common to 1.5.1 SNAPSHOT
Released 1.5.0
Issue-ID: POLICY-1737
Change-Id: I51b1c264d52cab2b2501dce7c5b0e7805d39ad5c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Pamela Dragosh [Thu, 20 Jun 2019 20:07:38 +0000 (16:07 -0400)]
Upgrade to release 3.0.0 parent
Policy/parent released
Issue-ID: POLICY-1737
Change-Id: I0fe368d5a4771813b1afb5fec5f9d48f7df39c87
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jim Hahn [Fri, 14 Jun 2019 14:58:51 +0000 (10:58 -0400)]
Change getCanonicalName() to getName() in common
Per javadocs, getName() should generally be used instead of
Class.getCanonicalName().
This change only applies to classes; it does not apply to File
objects.
Change-Id: Iea0995d1167f4837607f194d35f0193eeedeacd7
Issue-ID: POLICY-1646
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 13 Jun 2019 16:34:17 +0000 (12:34 -0400)]
More sonar fixes in policy/common
Note: this does not increase code coverage, but should fix other
code issues.
Resolved cyclomatic complexity issue in ParameterValidationResult.
Refactored duplicate code in GroupValidationResult.
Removed IOException from NetworkUtil "throws".
Replaced null/empty string tests with StringUtils.isBlank().
Added @FunctionalInterface where needed.
Replaced anonymous classes with lambda expressions.
Replaced duplicate strings with a constant.
Added private constructors for utility classes.
Removed sleep() from tests.
Removed unused parameter from method call.
Made some protected methods private.
Compute integrity monitor's state-transition table once.
Use for-loop instead of iterator.
Moved constructors.
Fixed some checkstyle issues (tabs => spaces, trailing spaces).
Change-Id: I9a962ca45c4ff3f212c6014da799d06f07b232ef
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 12 Jun 2019 18:32:25 +0000 (14:32 -0400)]
Apply simple sonar fixes
Note: A number of these were identified, by SonarLint, in the Test
classes, which are not typically scanned by Sonar.
Removed unnecessary imports.
Removed unneeded "throws Xxx".
Replaced lambda with method references.
Replaced duplicate strings with constants.
Replaced try-fail-catch with assert-j methods to eliminate sonar
complaints about duplicate failure messages.
Added missing @Override annotations.
Use map.computeIfAbsent() where appropriate.
Also fixed some minor checkstyle issues.
Removed unneeded "volatile" declarations.
Replaced some if-else constructs with "?:" construct, per sonar.
Replaced Object.wait() with CountDownLatch.await(); according to sonar
(and javadocs), Object.wait() can return due to "spurious wakeups".
Fixed issue whereby CryptoUtilsTest wouldn't run in my Eclipse.
Change-Id: Ib6b71ed65662cfd6209400dac57ed69279bf29ec
Issue-ID: POLICY-1791
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 7 Jun 2019 14:20:20 +0000 (10:20 -0400)]
Add @Max annotation to paramater validation code
Change-Id: I928eeb6bf52cb9e825db456278ce8bff449c692c
Issue-ID: POLICY-1762
Signed-off-by: Jim Hahn <jrh3@att.com>
pdragosh [Thu, 6 Jun 2019 17:48:25 +0000 (13:48 -0400)]
Remove nexus staging plugin
No longer used.
Issue-ID: POLICY-1737
Signed-off-by: pdragosh <pdragosh@research.att.com>
Change-Id: Ia85139cbb200d3ca71bcdedd43e2ae838eeb79bb
Signed-off-by: pdragosh <pdragosh@research.att.com>
Pamela Dragosh [Tue, 28 May 2019 17:54:17 +0000 (13:54 -0400)]
Change version to 1.5.0
Upgrade minor review for El Alto.
Update to policy/parent
Issue-ID: POLICY-1747
Change-Id: I5c54479d7b1e1951e52580c40127177e5f6d389d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
liamfallon [Wed, 22 May 2019 14:30:48 +0000 (14:30 +0000)]
Update INFO.yaml to add Jim and Ram
Issue-ID: POLICY-1775
Change-Id: I7a1327a73617d5d7ffb07754b9b6f39abb089d99
Signed-off-by: liamfallon <liam.fallon@est.tech>
Jorge Hernandez [Mon, 13 May 2019 13:37:21 +0000 (13:37 +0000)]
Merge "Upgrade policy/parent in common"
ramverma [Mon, 13 May 2019 11:14:02 +0000 (11:14 +0000)]
Upgrade policy/parent in common
Change-Id: Ibc15649c26eaafc620cec85876790fd2d73372fe
Issue-ID: POLICY-1630
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Pamela Dragosh [Wed, 1 May 2019 15:13:34 +0000 (11:13 -0400)]
Bump common snapshot
In prep for next version.
Issue-ID: POLICY-1700
Change-Id: I4dec2414dbd3d0d941bf24e9cd359265d7105371
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jim Hahn [Mon, 29 Apr 2019 15:43:05 +0000 (11:43 -0400)]
Fix sonar issue with double compare
The gson code to convert Double to Long/Integer use a direct comparison
of the original double with a long. However, sonar does not like that
so changed the code to use the Double.compare() method instead.
Also fixed sonar issue with diamond operator.
Addressed some sonar issues in ServiceManager.
Addressed some sonar issues in Version.
Change-Id: I0959603918d251db671e87e12c295c6ec911f427
Issue-ID: POLICY-1707
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Mon, 29 Apr 2019 13:41:07 +0000 (09:41 -0400)]
Upgrade policy/parent release
Policy/parent is released.
Issue-ID: POLICY-1700
Change-Id: I4a3f11bd069eefbe7205495b83fc8d8b68a221a9
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Liam Fallon [Fri, 12 Apr 2019 19:00:22 +0000 (19:00 +0000)]
Merge "Set jetty.dump to trace"
Pamela Dragosh [Fri, 12 Apr 2019 17:10:35 +0000 (13:10 -0400)]
Set jetty.dump to trace
Makes Junit debugging more simple.
Issue-ID: POLICY-1641
Change-Id: I5835f608e468e90e11d923973d726b0313e91189
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jim Hahn [Thu, 11 Apr 2019 20:44:16 +0000 (16:44 -0400)]
Add ValidationResult for arbitrary beans
Added implementations of ValidationResult for arbitrary objects and
for beans (i.e., containers of arbitrary objects).
Change-Id: I4c6f35bd19f1386062ce19125cbc648c399cc331
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>