summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2019-06-13More sonar fixes in policy/commonJim Hahn22-498/+467
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>
2019-06-12Apply simple sonar fixesJim Hahn59-801/+753
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>
2019-06-07Add @Max annotation to paramater validation codeJim Hahn3-0/+70
Change-Id: I928eeb6bf52cb9e825db456278ce8bff449c692c Issue-ID: POLICY-1762 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-06Remove nexus staging pluginpdragosh1-10/+0
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>
2019-05-28Change version to 1.5.0Pamela Dragosh11-13/+13
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>
2019-05-22Update INFO.yaml to add Jim and Ramliamfallon1-1/+17
Issue-ID: POLICY-1775 Change-Id: I7a1327a73617d5d7ffb07754b9b6f39abb089d99 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-05-13Merge "Upgrade policy/parent in common"Jorge Hernandez0-0/+0
2019-05-13Upgrade policy/parent in commonramverma1-1/+1
Change-Id: Ibc15649c26eaafc620cec85876790fd2d73372fe Issue-ID: POLICY-1630 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-05-01Bump common snapshotPamela Dragosh11-11/+11
In prep for next version. Issue-ID: POLICY-1700 Change-Id: I4dec2414dbd3d0d941bf24e9cd359265d7105371 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-29Fix sonar issue with double compare4.0.0-ONAP1.4.0Jim Hahn3-24/+24
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>
2019-04-29Upgrade policy/parent releasePamela Dragosh1-1/+1
Policy/parent is released. Issue-ID: POLICY-1700 Change-Id: I4a3f11bd069eefbe7205495b83fc8d8b68a221a9 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-12Merge "Set jetty.dump to trace"Liam Fallon1-11/+11
2019-04-12Set jetty.dump to tracePamela Dragosh1-11/+11
Makes Junit debugging more simple. Issue-ID: POLICY-1641 Change-Id: I5835f608e468e90e11d923973d726b0313e91189 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-11Add ValidationResult for arbitrary beansJim Hahn6-0/+701
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>
2019-04-11Don't map JSON values to DoubleJim Hahn12-16/+392
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>
2019-04-09Add more logging to message dispatcherJim Hahn1-3/+10
Change-Id: I889cb9397b4b834ab273ec8f8ddc1af2b3c3c05e Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-05Add string constructor to Version classliamfallon1-12/+30
Issue-ID: POLICY-1095 Change-Id: Ib0d2c778f3e8dc5e52369e43b98249ed426fc14a Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-04-04Add semantic version comparable classliamfallon3-1/+262
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>
2019-04-02Deleting pdp-common module from policy/commonramverma15-702/+0
Change-Id: I1b599ce62a4fab852420089b5d1d8ae8f5cfe7ca Issue-ID: POLICY-1443 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-03-26Add get() without clazzJim Hahn1-0/+17
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>
2019-03-21Add simple Registry class to manage singletonsJim Hahn2-0/+290
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>
2019-03-20Add wrapper for ServiceManagerJim Hahn2-0/+214
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>
2019-03-20Merge "Add method to support configure all topics at once"Pamela Dragosh3-0/+27
2019-03-20Merge "Revert "Upgrade jersey""Jorge Hernandez2-7/+1
2019-03-20Revert "Upgrade jersey"Pamela Dragosh2-7/+1
This reverts commit c8da79dec8d68cded0e1608c914364c2148bb6ec. Change-Id: I8d9efd3c2d886e3d86ba3fdded3b057a45ed6ed3 Signed-Off-by: Pamela Dragosh <pdragosh@research.att.com> Issue-ID: POLICY-1609
2019-03-20Merge "Upgrade jersey"Jorge Hernandez2-1/+7
2019-03-19Upgrade jerseyPamela Dragosh2-1/+7
Issue-ID: POLICY-1609 Change-Id: I462f0cce8f8b189082bc2cb4bbd23b927f2cb871 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-19Add method to support configure all topics at onceJorge Hernandez3-0/+27
regardless of type (source or sink) Change-Id: Idaebae611746e364364d35375519173a7461ae61 Issue-ID: POLICY-1608 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-03-19Add timestamp to PDP requestsJim Hahn1-0/+6
Change-Id: Ic529e166ce4cdc93830f7da06db5ae752d86260d Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-19Merge "TopicSinkClient support for unmanaged topics"Pamela Dragosh3-34/+46
2019-03-18Merge "Add Network Logging Feature"Liam Fallon16-99/+876
2019-03-18TopicSinkClient support for unmanaged topicsJorge Hernandez3-34/+46
Change-Id: I6b92dcc0f225aa712b34adb9a1f9ab47df412c81 Issue-ID: POLICY-1608 Signed-off-by: Jorge Hernandez <jorge.hernandez-herrero@att.com>
2019-03-18ONAP password encryption tool sonar fixChou, Joseph1-25/+25
Update code to fix sonar scan issues Change-Id: I5ccf3d774651bd3d8df908c1e7fe83218016a007 Issue-ID: POLICY-1561 Signed-off-by: Chou, Joseph <jc2555@att.com>
2019-03-16Make ServiceManager implement StartableJim Hahn3-36/+114
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>
2019-03-16Merge "Update INFO.yaml file"Pamela Dragosh1-3/+26
2019-03-16Add equals() to Policy classJim Hahn1-0/+2
Change-Id: I7cc9baa21654e3d416a6ca1143f365ca295bf1d6 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-15Update INFO.yaml fileJessica Wagantall1-3/+26
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>
2019-03-14Add support for TOSCA JSON Parsingliamfallon5-1/+176
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>
2019-03-13Add policyVersion to Policy modelJim Hahn1-0/+1
Change-Id: I64a997bbd1f21cb4eef134a1c474f8b5780dceb6 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-13Add Network Logging FeatureDaniel Cruz16-99/+876
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>
2019-03-12Merge "ONAP password encryption tool"Pamela Dragosh3-0/+383
2019-03-12Merge "Add ServiceManager class"Liam Fallon8-11/+601
2019-03-12ONAP password encryption toolChou, Joseph3-0/+383
Migrate ECOMP Policy password encryption tool to ONAP Issue-ID: POLICY-1561 Change-Id: I9020efb7698b95c36c4ebff842a318bf8beefc69 Signed-off-by: Joseph Chou <jc2555@att.com>
2019-03-11Add ServiceManager classJim Hahn8-11/+601
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>
2019-03-11Address sonar issues in utilsJim Hahn2-4/+7
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>
2019-03-10Merge "Create ParameterGroupImpl"Liam Fallon20-385/+226
2019-03-08Merge "Add code to allocate server ports"Jorge Hernandez3-39/+165
2019-03-08Add code to allocate server portsJim Hahn3-39/+165
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>
2019-03-08Create ParameterGroupImplJim Hahn20-385/+226
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>
2019-03-08Merge "Add NotNull and NotBlank parameter validation"Liam Fallon9-83/+487