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>
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>
Jim Hahn [Thu, 11 Apr 2019 00:08:30 +0000 (20:08 -0400)]
Don't map JSON values to Double
By default, gson treats all numbers as Double when placed into a
generic Map. This is not backward compatible with existing policy
APIs. Added a type adapter that walks Map objects and converts the
Double values to Integer or Long, where possible.
Made this the default behavior in the GsonMessageBodyHandler, the
JacksonHandler, and the StandardCoder.
Also fixed a couple of checkstyle errors in the gson project.
Change-Id: I9ac0c77e6592d1c039646f0662c077b77a1e9aaf
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 9 Apr 2019 12:34:45 +0000 (08:34 -0400)]
Add more logging to message dispatcher
Change-Id: I889cb9397b4b834ab273ec8f8ddc1af2b3c3c05e
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
liamfallon [Fri, 5 Apr 2019 04:51:42 +0000 (04:51 +0000)]
Add string constructor to Version class
Issue-ID: POLICY-1095
Change-Id: Ib0d2c778f3e8dc5e52369e43b98249ed426fc14a
Signed-off-by: liamfallon <liam.fallon@est.tech>
liamfallon [Thu, 4 Apr 2019 13:26:58 +0000 (13:26 +0000)]
Add semantic version comparable class
Class written by Jim Hahn that implements Comparable for comparing
semantic versions. Lifted from policy models pap.
Issue-ID: POLICY-1095
Change-Id: Ie8c5f9066c06cb569085e1390b3de3e4aa580267
Signed-off-by: liamfallon <liam.fallon@est.tech>
ramverma [Tue, 2 Apr 2019 17:58:10 +0000 (17:58 +0000)]
Deleting pdp-common module from policy/common
Change-Id: I1b599ce62a4fab852420089b5d1d8ae8f5cfe7ca
Issue-ID: POLICY-1443
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Jim Hahn [Tue, 26 Mar 2019 23:32:56 +0000 (19:32 -0400)]
Add get() without clazz
Added Registry.get() that does not need a class argument.
Change-Id: I3e8b0e3cc14eda914e0b1b201e6ddf67a9e3462e
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 20 Mar 2019 21:58:49 +0000 (17:58 -0400)]
Add simple Registry class to manage singletons
Typically, singleton classes have lots of static methods, or use
a getInstance() method to get the singleton. This provides an alternative
mechanism, similar to the JDNI and the common-paramater property registry,
where singletons can be registered.
Clean up registry after junit test.
Modified a few comments. (I prefer 90 characters for comments.)
Added a method to register or replace an existing key without throwing
an exception.
Change-Id: I3b62719013d3b5f71adb5e9299d3c1257fb55c80
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 20 Mar 2019 20:40:02 +0000 (16:40 -0400)]
Add wrapper for ServiceManager
This makes it easier for a class to implement a Startable interface,
using a ServiceManager internally, while preventing other classes from
adding services to the manager (as would be the case if the class were
simply subclassed from the ServiceManager).
Changed the field name to be more descriptive.
Fixed a typo in a comment.
Change-Id: I1bed6291114d21c20d2324cbda81518bf9183139
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Wed, 20 Mar 2019 13:45:30 +0000 (13:45 +0000)]
Merge "Add method to support configure all topics at once"
Jorge Hernandez [Wed, 20 Mar 2019 03:12:14 +0000 (03:12 +0000)]
Merge "Revert "Upgrade jersey""
Pamela Dragosh [Wed, 20 Mar 2019 01:04:47 +0000 (01:04 +0000)]
Revert "Upgrade jersey"
This reverts commit
c8da79dec8d68cded0e1608c914364c2148bb6ec.
Change-Id: I8d9efd3c2d886e3d86ba3fdded3b057a45ed6ed3
Signed-Off-by: Pamela Dragosh <pdragosh@research.att.com>
Issue-ID: POLICY-1609
Jorge Hernandez [Wed, 20 Mar 2019 00:08:27 +0000 (00:08 +0000)]
Merge "Upgrade jersey"
Pamela Dragosh [Wed, 20 Mar 2019 00:01:06 +0000 (20:01 -0400)]
Upgrade jersey
Issue-ID: POLICY-1609
Change-Id: I462f0cce8f8b189082bc2cb4bbd23b927f2cb871
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jorge Hernandez [Tue, 19 Mar 2019 21:10:37 +0000 (16:10 -0500)]
Add method to support configure all topics at once
regardless of type (source or sink)
Change-Id: Idaebae611746e364364d35375519173a7461ae61
Issue-ID: POLICY-1608
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
Jim Hahn [Tue, 19 Mar 2019 14:32:28 +0000 (10:32 -0400)]
Add timestamp to PDP requests
Change-Id: Ic529e166ce4cdc93830f7da06db5ae752d86260d
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Tue, 19 Mar 2019 11:43:27 +0000 (11:43 +0000)]
Merge "TopicSinkClient support for unmanaged topics"
Liam Fallon [Mon, 18 Mar 2019 23:01:15 +0000 (23:01 +0000)]
Merge "Add Network Logging Feature"
Jorge Hernandez [Mon, 18 Mar 2019 20:59:04 +0000 (15:59 -0500)]
TopicSinkClient support for unmanaged topics
Change-Id: I6b92dcc0f225aa712b34adb9a1f9ab47df412c81
Issue-ID: POLICY-1608
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
Chou, Joseph [Mon, 18 Mar 2019 17:10:36 +0000 (13:10 -0400)]
ONAP password encryption tool sonar fix
Update code to fix sonar scan issues
Change-Id: I5ccf3d774651bd3d8df908c1e7fe83218016a007
Issue-ID: POLICY-1561
Signed-off-by: Chou, Joseph <jc2555@att.com>
Jim Hahn [Sat, 16 Mar 2019 17:47:21 +0000 (13:47 -0400)]
Make ServiceManager implement Startable
Also added a "name" to the manager, for logger purposes.
Change-Id: Ide57cdec1fafc36c43b7f7584c0baad6261e8412
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Sat, 16 Mar 2019 14:54:37 +0000 (14:54 +0000)]
Merge "Update INFO.yaml file"
Jim Hahn [Sat, 16 Mar 2019 13:50:59 +0000 (09:50 -0400)]
Add equals() to Policy class
Change-Id: I7cc9baa21654e3d416a6ca1143f365ca295bf1d6
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Jessica Wagantall [Fri, 15 Mar 2019 20:53:33 +0000 (13:53 -0700)]
Update INFO.yaml file
Update missing information blocks and
indentation to pass verify job.
Change-Id: I0f514e9fb4a429addf40ba1171a8b7a363a070ae
Issue-ID: CIMAN-134
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
liamfallon [Thu, 14 Mar 2019 14:24:14 +0000 (14:24 +0000)]
Add support for TOSCA JSON Parsing
Added a getter to allow the Gson object to be retrieved from a GSON
message body handler, useful for testing.
Moved the TextFileUtils utility class from APEX utilites to policy common
utils
Issue-ID: POLICY-1195
Change-Id: I7c8074e8177a90b292c6dfd6e7f0d352063818e7
Signed-off-by: liamfallon <liam.fallon@est.tech>
Jim Hahn [Wed, 13 Mar 2019 21:44:51 +0000 (17:44 -0400)]
Add policyVersion to Policy model
Change-Id: I64a997bbd1f21cb4eef134a1c474f8b5780dceb6
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Daniel Cruz [Wed, 6 Mar 2019 16:45:09 +0000 (10:45 -0600)]
Add Network Logging Feature
This is part 1 of introducing the mdc filter feature. Network
logging has to have interception points in order to pre/post
process messages coming in from a network endpoint.
The OrderedService interface and OrderedServiceImpl of the
drools-pdp project have now been migrated to common but is
also left in drools-pdp to mitigate disruption to existing
features. However for features that need to use common's
OrderedServiceImpl and drools-pdp version of OrderedServiceImpl
there will be a conflict with getSequenceNumber(). So a migration
of the other features is suggested.
Network logging is moved to its own util class so that feature
hooks can be invoked any time an event is being logged by a
network logger. This util class will also be accessible to
drools-applications in the case where drools-applications
would like to invoke network logging features for REST events.
Change-Id: I83d7c46e5abb351486f841c3be4d9009f7992476
Issue-ID: POLICY-1499
Signed-off-by: Daniel Cruz <dc443y@att.com>
Pamela Dragosh [Tue, 12 Mar 2019 14:33:23 +0000 (14:33 +0000)]
Merge "ONAP password encryption tool"
Liam Fallon [Tue, 12 Mar 2019 14:25:52 +0000 (14:25 +0000)]
Merge "Add ServiceManager class"
Chou, Joseph [Thu, 7 Mar 2019 16:49:23 +0000 (11:49 -0500)]
ONAP password encryption tool
Migrate ECOMP Policy password encryption tool to ONAP
Issue-ID: POLICY-1561
Change-Id: I9020efb7698b95c36c4ebff842a318bf8beefc69
Signed-off-by: Joseph Chou <jc2555@att.com>
Jim Hahn [Mon, 11 Mar 2019 15:37:53 +0000 (11:37 -0400)]
Add ServiceManager class
Added ServiceManager class to start a list of services, in order,
and stop them in reverse order.
Also addressed minor checkstyle issue in TopicSinkClient.
Enabled logging from tests.
Updated some comments.
Updated license date.
Added state checks and support for multi-threading.
Change-Id: Ie7f053d9884766fe199895691a57eb5a51b1d155
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Mon, 11 Mar 2019 14:15:19 +0000 (10:15 -0400)]
Address sonar issues in utils
Fixed issues in BeanConfigurator.
Fixed issues in NetworkUtil associated with newly added trust manager.
Change-Id: I0777ff85131d22c92c0ede06335a5b2839a1c482
Issue-ID: POLICY-1519
Signed-off-by: Jim Hahn <jrh3@att.com>
Liam Fallon [Sun, 10 Mar 2019 12:59:16 +0000 (12:59 +0000)]
Merge "Create ParameterGroupImpl"
Jorge Hernandez [Fri, 8 Mar 2019 15:18:42 +0000 (15:18 +0000)]
Merge "Add code to allocate server ports"
Jim Hahn [Thu, 7 Mar 2019 16:30:16 +0000 (11:30 -0500)]
Add code to allocate server ports
Added code to find available server ports.
Also added a trust manager that always trusts certificates.
Made trust manager private so we can allocate new ones in the future,
if we decide it isn't safe to re-use the same one over and over.
Modified test code to allocate a port rather than assuming 8180 was
not in use. Also modified retry parameters in other tests.
Added another allocPort() that takes an IP address and then modified
the other two to use that so the code does not have to be duplicated,
while providing more functionality.
Change-Id: I08cf18d923af46b1310d8496498bb1d4a0690b6e
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 8 Mar 2019 00:51:59 +0000 (19:51 -0500)]
Create ParameterGroupImpl
Classes that implement ParameterGroup all have to add their own
name and validate() fields and methods. Added an "impl" class that
provides the standard functionality and modified subclasses to use
it.
Change-Id: Ic6ee1607fb4fe7164a4e1eeebc480ea7d1e7e4d7
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Liam Fallon [Fri, 8 Mar 2019 13:02:28 +0000 (13:02 +0000)]
Merge "Add NotNull and NotBlank parameter validation"
Jim Hahn [Thu, 7 Mar 2019 19:53:12 +0000 (14:53 -0500)]
Add NotNull and NotBlank parameter validation
Modified the ParameterValidator to support new NotNull and NotBlank
annotations indicating that a field should not be null or blank.
These annotations can be made at class level or individual field level.
Moved annotations to their own subdirectory.
Added a comment to a method.
Extracted constant strings.
Moved one annotation to the subclass level.
Added support for "Min" annotation.
Propagate validation errors up from nested items. Apply
field-level validations, even when field is a ParameterGroup.
Change-Id: Ic90df55487dc5db7b7b0be5397624d1957904a81
Issue-ID: POLICY-1542
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Thu, 7 Mar 2019 17:58:53 +0000 (17:58 +0000)]
Merge "Remove PropertyConfiguration class"
Jim Hahn [Thu, 7 Mar 2019 15:29:46 +0000 (10:29 -0500)]
Remove PropertyConfiguration class
Removed PropertyConfiguration class, as it has been replaced by the
BeanConfigurator class.
Change-Id: If97a74fe81875d3eb85d7775ce78a7f2b1fb1f70
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
ramverma [Wed, 6 Mar 2019 15:43:11 +0000 (15:43 +0000)]
Adding client class for sending message to topic
1) Adding TopicSinkClient class for sending messages to topic. The same
class will be used for PAP->PDP & PDP->PAP communication.
2) Once this review is through, will raise another one to remove
PdpClient from policy/pap.
Change-Id: I7253683d9e88885cfbe2ac9041d01da239b9321b
Issue-ID: POLICY-1443
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Liam Fallon [Tue, 5 Mar 2019 21:03:06 +0000 (21:03 +0000)]
Merge "Add bean configurator"
Jim Hahn [Mon, 4 Mar 2019 21:03:26 +0000 (16:03 -0500)]
Add bean configurator
Refactored PropertyConfiguration, but left the original class alone
until references to it have been removed from other policy repos.
Split the Property annotation out into its own file. Cloned the
remaining code into BeanConfigurator, modifying its behavior so that,
instead of operating on its own subclass, it operates on a provided bean.
Also added an ability to copy the bean's fields to a Properties object.
Updated license dates.
Removed unneeded argument from functional interface.
Added comment about always checking default values.
Updated a few comments.
Change-Id: Iff36fd0524032d7630f9ee08f0eef7b05de100d1
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 5 Mar 2019 00:46:57 +0000 (19:46 -0500)]
Fix new sonar issue in listener
Change-Id: I0d718ace3099bfa33508b11beece58447c0943ff
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Mon, 4 Mar 2019 20:56:21 +0000 (20:56 +0000)]
Merge "Add various listener classes"
ramverma [Mon, 4 Mar 2019 13:29:54 +0000 (13:29 +0000)]
Adding pdp-common module to policy/common
1) Adding pdp-common module to policy/common. So that all common code
across various pdps will be at one place.
2) Adding java classes for PDP_STATUS, PDP_UPDATE, PDP_STATE_CHANGE &
PDP_HEALTH_CHECK messages.
3) Adding enums for PDPHeathStatus, PDPResponseStatus & PdpState.
4) Adding relevant test cases.
Change-Id: I13e62f393fbd1c261696783cfe4b7dfff72625ba
Issue-ID: POLICY-1443
Signed-off-by: ramverma <ram.krishna.verma@est.tech>
Jim Hahn [Fri, 1 Mar 2019 19:13:11 +0000 (14:13 -0500)]
Add various listener classes
Added various listener classes to support dispatch by message type
and request id. The listeners are intended to form a pipeline:
TopicSource =>
MessageTypeDispatcher =>
RequestIdDispatcher =>
TypedMessageListener
Removed "PAP" from license.
Changed "handler" to "listener" in most places.
Simplified a test case.
Verified that no error message logged on success cases.
Removed println from test.
Updated some comments.
Change-Id: Ife265d14a6c5c8531601d9ce1343b88c1f8986a8
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Fri, 1 Mar 2019 16:16:07 +0000 (16:16 +0000)]
Merge "Add StandardCoderObject to hide GSON internals"
Jim Hahn [Fri, 1 Mar 2019 02:59:33 +0000 (21:59 -0500)]
Add StandardCoderObject to hide GSON internals
Added StandardCoderObject to hide GSON's JsonElement so that classes
are not dependent on the use of JsonElement, making it easier to switch
out serialization mechanisms in the future.
Added a test for field-not-found.
Converted tabs to spaces in json test file.
Simplified StandardCoderObject and added methods to Coder for
translating to and from StandardCoderObject.
Removed a test for a method that no longer exists.
Added more tests to a test case.
Change-Id: I5123dc3f17c940ded431ef7f9ccd8c4bff6b1c5f
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Thu, 28 Feb 2019 18:00:16 +0000 (13:00 -0500)]
Get proper message in test logger appender
The logger appender that's used in junit tests was getting the
raw message, which still had "{}" place-holders in it. Fixed that.
Split a test method to avoid checkstyle error.
Change-Id: I57571d8717aaee4adb7df186fe156501e9cc669e
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Thu, 28 Feb 2019 15:15:36 +0000 (10:15 -0500)]
Update INFO.yaml Liam's email
est.tech
Issue-ID: POLICY-1556
Change-Id: If83637b547d84b4caac6ad9b2b117d0051735c8c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Jim Hahn [Wed, 27 Feb 2019 22:42:52 +0000 (17:42 -0500)]
Add additional encode and decode methods to Coder
Also:
Updated some comments and renamed a few parameters.
Removed a "throws" for a RuntimeException.
Short-circuit some calls.
Typo in comment.
Let gson create the JsonWriter.
Renamed a few more parameters.
Change-Id: I22e48c2191820c2a3d0743200edca79bd74353e7
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
Liam Fallon [Wed, 27 Feb 2019 21:47:37 +0000 (21:47 +0000)]
Merge "Add common coder classes"
Jim Hahn [Wed, 27 Feb 2019 15:08:55 +0000 (10:08 -0500)]
Add common coder classes
Added coder classes as a common utility that can be used to encode
and decode json data. Currently, it uses gson, but that can be
changed.
Separated the Coder interface from implementation.
Used assertSame to compare references.
Used numbers instead of strings so don't have to deal with escaping quotes
in the test cases.
Change-Id: Iea9001d2adc5a3150b3367619b5f43e96b5f8b41
Issue-ID: POLICY-1444
Signed-off-by: Jim Hahn <jrh3@att.com>
liamfallon [Tue, 26 Feb 2019 22:20:13 +0000 (22:20 +0000)]
Assertion class for DAO code
This class is used by the DAO model code being moved from
the APEX PDP to policy-models for generic DAO handling in the
Policy Framework
Issue-ID: POLICY-1264
Change-Id: I67cca540d9357f9ab16532090cb2edf397b332be
Signed-off-by: liamfallon <liam.fallon@est.tech>
Jim Hahn [Fri, 22 Feb 2019 21:30:07 +0000 (16:30 -0500)]
Log which gson style is being used
Different gson providers may be used for REST APIs. Updated the code
to identify which was being used.
Change-Id: I8ffbda7409142ec728e217a87c9bcba3c34b814b
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Pamela Dragosh [Fri, 22 Feb 2019 12:53:33 +0000 (12:53 +0000)]
Merge "Support for lab contextual topic names."
Jorge Hernandez [Wed, 20 Feb 2019 02:05:31 +0000 (20:05 -0600)]
Support for lab contextual topic names.
This work allows a drools application, with its drl
template to refer to the topic name by its invariable
canonical name, ie. POLICY-CL-MGT. Since the drl
is a design time artifact, it is desired to know topics
by its canonical non-changeable name.
The actual per lab environment topic name may change
on a per deployment basis, for example POLICY-CL-MGT-WINDRIVER
or POLICY-CL-MGT-TLAB. The template can still use
POLICY-CL-MGT without modification but the actual installation
configuration would use the "effectiveTopic" property to
point to the right topic on a per lab basis.
This also helps with installation (long story) since
the canonical topics will be known ahead of time.
Change-Id: I8322bf7e427569c37a76eea5ce6d5b9547cb2ff3
Issue-ID: POLICY-1534
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
Jim Hahn [Mon, 18 Feb 2019 18:30:00 +0000 (13:30 -0500)]
Remove jackson from policy-endpoints pom
Removed most jackson dependencies from the policy-endpoints pom,
leaving jackson-annotations.
Moved jersey.version to top-level pom.
Change-Id: I73c6fef79d104ef62c7632ad3e02bc52865351cd
Issue-ID: POLICY-1531
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 15 Feb 2019 22:43:45 +0000 (17:43 -0500)]
Add log message when gson used
Added code to log a message when gson is used instead of jackson.
Change-Id: I8cbb8ad8461cc364c3419aaa174cef2680c5a672
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Liam Fallon [Fri, 15 Feb 2019 19:37:49 +0000 (19:37 +0000)]
Merge "Remove erroneous comments"
Liam Fallon [Fri, 15 Feb 2019 19:36:27 +0000 (19:36 +0000)]
Merge "Remove unneeded jackson references"
Jim Hahn [Fri, 15 Feb 2019 16:33:25 +0000 (11:33 -0500)]
Remove unneeded jackson references
Removed some jackson references that are no longer needed.
Others remain; those must remain in place until they are no longer
needed by other policy repos.
Change-Id: Ica6624baf17be118714bb566c8db3ffce2c3587c
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 15 Feb 2019 15:57:14 +0000 (10:57 -0500)]
Remove erroneous comments
Some comments still said that including the maven artifact,
jersey-media-json-jackson, could override gson behavior, but
that is no longer true. The comments have been removed.
Change-Id: I9b6477b76f835b96c52ccb9777b80791fc6b1d77
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Fri, 15 Feb 2019 14:50:25 +0000 (09:50 -0500)]
Fix sonar issues with gson code
Fixed issues with GsonTestUtils:
- don't set static from within a non-static method
- don't throw generic RuntimeException
Resolved checkstyle issue.
Removed trailing spaces.
Change-Id: If0c85733f62a24b56088dc90aadd4b95b3a6c91a
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 13 Feb 2019 21:16:45 +0000 (16:16 -0500)]
Sonar fixes
Added test for Serializer to increase junit coverage.
Added tests for TestTimeMulti to increase junit coverage.
Sonar fixes for PropertyConfiguration:
- use equalsIgnoreCase
- use the exception
Updated license dates.
Some fixes for LoggerFactoryWrapper to address sonar issue - utility
classes should typically have a private constructor.
Change-Id: I8957e9673fe8371ecca7abbb7ece87b0d6f46c1a
Issue-ID: POLICY-1519
Signed-off-by: Jim Hahn <jrh3@att.com>
Jorge Hernandez [Thu, 14 Feb 2019 15:05:27 +0000 (15:05 +0000)]
Merge "Add gson handler and tests"
Jim Hahn [Wed, 13 Feb 2019 15:42:19 +0000 (10:42 -0500)]
Refactor common class from gson code
The TypeAdapters in the gson-jackson code were nearly identical,
so a common class was factored out. This also enabled junit tests
to attain 100% coverage on that code, whereas there were a couple
of branches that could not be tested previously.
Addressed new sonar issues.
Removed unused import.
Change-Id: Id8e6460c881c6ce0239768f182e4e652cd10645f
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Wed, 13 Feb 2019 15:53:12 +0000 (10:53 -0500)]
Add gson handler and tests
Added JacksonHandler which provides jackson behavior in gson.
Also added classes to facilitate testing of gson serializations.
Added compareGson(xxx, Class).
Removed trailing spaces from some files.
Updated license dates.
Replaced incorrect constant with ${xxx} in json test file.
Fixed typo in test method name.
Change-Id: If05b654d76a4ffc88646f03334be82b32506f28f
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Liam Fallon [Wed, 13 Feb 2019 13:45:20 +0000 (13:45 +0000)]
Merge "Fix sonar issues in gson superclasses"
Liam Fallon [Wed, 13 Feb 2019 13:44:37 +0000 (13:44 +0000)]
Merge "Add jackson behavior for fields"
Liam Fallon [Wed, 13 Feb 2019 13:43:21 +0000 (13:43 +0000)]
Merge "Add jackson behavior for methods"
Liam Fallon [Wed, 13 Feb 2019 13:26:34 +0000 (13:26 +0000)]
Merge "Replace PolicyAssert with assertj"
Jim Hahn [Tue, 12 Feb 2019 18:17:09 +0000 (13:17 -0500)]
Add jackson behavior for methods
Added classes to make gson treat methods as jackson does.
Remove unneeded "forGetter" parameter from constructors.
Fixed sonar issue with too long "if" test.
Corrected comment about annotation names.
Adjusted error message.
Removed unused constant.
Removed trailing spaces.
Change-Id: I3a4fc92193737a0dc89f1218e70f093aedbdb152
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 12 Feb 2019 16:20:13 +0000 (11:20 -0500)]
Add jackson behavior for fields
Added classes to make gson treat fields as jackson does.
Added check for input OR output fields.
Corrected comment about annotation names.
Removed trailing spaces.
Extracted some string constants.
Fixed checkstyle issue.
Change-Id: I665b31774086d72a5a95bee6cf3486a019b72402
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Tue, 12 Feb 2019 15:50:06 +0000 (10:50 -0500)]
Fix sonar issues in gson superclasses
Fixing some of the issues necessitated the use of generic/raw types.
Removed version from assertj in pom.
Removed trailing spaces.
Change-Id: I76e0a05ca06c103ccc876675be04a4ab5e4de5ea
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Jim Hahn [Mon, 11 Feb 2019 20:53:14 +0000 (15:53 -0500)]
Add Serializer interface
Added missing Serializer interface, needed by other gson classes.
Change-Id: I4c37dea89011a833d71c11e2d2c4d74ad768e750
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
Liam Fallon [Mon, 11 Feb 2019 18:04:51 +0000 (18:04 +0000)]
Merge "Add superclasses for gson-jackson migration"