Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
Modified TopicParams to set "managed" to true by default.
Change-Id: Ia21caba2b882199f1a63d40b0fed1167ccb93142
Issue-ID: POLICY-1744
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
regardless of type (source or sink)
Change-Id: Idaebae611746e364364d35375519173a7461ae61
Issue-ID: POLICY-1608
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
|
|
|
|
Change-Id: I6b92dcc0f225aa712b34adb9a1f9ab47df412c81
Issue-ID: POLICY-1608
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
Added common classes needed by other gson-jackson code.
Modified some logic to make it more maintainable or perform better.
Updated comments and spacing.
Fix another comment.
Moved gson classes from utils to a separate gson project.
Added GsonXxx annotations to mirror jackson annotations.
Removed unneeded dependencies from gson pom.
Removed old GsonMessage class from policy-endpoints.
Removed trailing spaces.
Updated licenses.
Removed more trailing spaces.
Removed unneeded checkstyle suppression file from utils.
Change-Id: I1a285500faeb0a0b6a1467d09b92ecd3cded713e
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Added "provider" property to both http client and server builders.
The provider defaults to jackson, to maintain backward compatibility
until other policy code has been converted to gson.
Removed commented item from pom.
Added some comments and re-arranged a few pieces of code.
Fixed a few typos and removed spacing at the end of some lines.
Reordered imports.
Added comments about limitations when using jersey-media-json-jackson.
Address ridiculous checkstyle complaint.
Support comma-separated list of serialization providers in jersey client.
Disabled metainf discovery from jersey client and server so that the
media-json dependencies could be re-instated in the pom.
Address another ridiculous checkstyle complaint.
Change-Id: Ic5a93b475d0ee9b435352b3516de6b865b00a86a
Issue-ID: POLICY-1428
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Additional clean up for sonars have also been added for the
classes that have been modified
Issue-ID: POLICY-1367
Change-Id: Ie97d9057273e89850420a7c1b5b2d275709bdfd0
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
|
|
In addition, Noop* classes have been refactored to
increase code reuse and clean some checkstyle issues.
Additional Junits have been added for existing functionality.
Change-Id: I072f9ff2f415630ac82eca949a8360249f73da86
Issue-ID: POLICY-1397
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
|
|
Change-Id: I73c186f181960ac7ac8cd985e55db1831963910f
Issue-ID: POLICY-1392
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
The new version has changed class names.
Issue-ID: POLICY-1229
Change-Id: Id268b1a57667ffa3b5950dba7c10db2181586245
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
Change-Id: I049e88bec2c83f6224ba1d1f24b93e0fb1aa807e
Issue-ID: POLICY-1216
Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
|
|
Apparently drools-pdp code depends on Dmaap topic factories throwing
IllegalArgumentException instead of IllegalStateException (which is what
the other topic factories throw) when an unknown topic name is requested.
Therefore, the change to make them consistent has been backed out.
Change-Id: Ia3d7e26a61027977eb626c9ddad6369982eae002
Issue-ID: POLICY-1148
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Also extracted out common code from tests.
Fix checkstyle issues.
Be consistent in returning IllegalStateException when topic is not
found by any Topic Factory.
Added/updated some comments.
Use better name for "validate" argument.
Renamed test() to testDestroy().
Added NoopTopicPropertyBuilder.
Renamed BusTopicTestBase to TopicTestBase.
Change-Id: Id4c7ab9f2b5572dc5195b0da116e285c5e9b6f06
Issue-ID: POLICY-1148
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
|
|
Added license.
Fix checkstyle warnings.
Change-Id: I2279b8b80b3dc175583353ced3d71c3a5cc4f975
Issue-ID: POLICY-1148
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Fixed checkstyle error.
Change-Id: Ie6a85633bab098a30ccb2c1c309e1640aa1c8131
Issue-ID: POLICY-1148
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
Added coverage tests for policy-endpoints.
Fixed new checkstyle warnings.
Use powermock version from parent pom.
Replaced literals with constants in new tests.
Moved test superclass higher up the class hierarchy so it can be re-used.
Removed powermock version.
Change-Id: I7d3d45132cd0973f4d02d3af320a1d53a1234e4d
Issue-ID: POLICY-1148
Signed-off-by: Jim Hahn <jrh3@att.com>
|
|
The root pom.xml had a syntax error in a declaration. The suppressions
xml was not being found by the sub-modules. It was better to create a
copy in each of the sub-modules where we will not be fixing
abbreviations or the interface declarations in own java file.
Added specific checkstyle files for each submodule.
One interesting note for the InheritDoc tag. It seems that the mvn
compile has a bug that interprets these as missing a period after
the tag. Even though the parent interface has it correctly. It was
easier to just remove it than duplicate.
There are new JIRA's for that work to be done in Dublin.
Fixed some spacing in pom's.
Issue-ID: POLICY-1131
Change-Id: I5f845958ccefd50a3b7290662da43c994870f1f7
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
|
|
Change-Id: Idb1346ca645ffcc55808e25c8957e01d27a48a75
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Issue-ID: POLICY-1043
|
|
These will aid applications using there own authorization
system at their desired granularity.
Change-Id: Iba7fca8742127bcec177b93452f111d28c7f8ec7
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Issue-ID: POLICY-1043
|
|
With the latest released version of AAF, encountered
problems when testing AAF. This seems to be resolved
when migrating to the not-released yet, 2.1.2-SNAPSHOT.
Checking further into AAF jira's it seems that some
necessary fixes have gone into 2.1.2-SNAPSHOT (see for example
AAF-460).
The assumption is that 2.1.2-SNAPSHOT will be soon
released by AAF team, and then we should appropriately change
this version.
In addition, there has been enhancements to allow policy
apps to configure additional filters. These will be used
initially by specific "rest" servers to provide additional
authorization capabilities.
Change-Id: I48e279738de20bd68e3f05323ad9b6cffdafc83e
Signed-off-by: Jorge Hernandez <jh1730@att.com>
Issue-ID: POLICY-1044
Signed-off-by: Jorge Hernandez <jh1730@att.com>
|
|
Added support for http PUT for use by the policy forwarder in
policy/distribution
Issue-ID: POLICY-926
Change-Id: Ifa5c2e8be0582797936b95b772ad236f35c10f24
Signed-off-by: mmis <michael.morris@ericsson.com>
|
|
* Changing TestHealthCheckReport to use openpojo for testing the
HealthCheckReport class.
* Adding a custom Tester implementation called ToStringTester
as a utility to test toString() method of classes using openpojo.
Change-Id: I491a23c471d50454b4d5591c6c09c6758e2c0624
Issue-ID: POLICY-1035
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
|
|
* Adding HealthCheckReport class to policy/common for wider use
among all policy modules.
* Adding utility class called ParameterValidationUtils for providing
common validation methods to all policy modules. For now, it has only 3
validation methods but we all can add more in future.
Change-Id: I363fe116ba74f25299fd71211be73505b3164f72
Issue-ID: POLICY-1035
Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
|
|
Sonar issue with more than 7 params in a method. Use builder object
instead of params. Rework2 for fixing review comments.
Add modifications copyright
Issue-ID: POLICY-1017
Change-Id: Ib0fa692f8da770dcba06158d6e6cafbed2969c27
Signed-off-by: Krishnajinka <kris.jinka@samsung.com>
|