aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/main/java/org/onap/policy/common/utils/network/NetworkUtil.java
AgeCommit message (Collapse)AuthorFilesLines
2021-06-25Add name generator for PAP and PDPsJim Hahn1-0/+12
Added a method that PAPs and PDPs can use to generate a unique name or identifier to be used in PAP-PDP messages. Issue-ID: POLICY-3410 Change-Id: I22b075b123f79ba05e0884f743296c4bc64842b9 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-06-17Use lombok in policy-common utilsJim Hahn1-5/+4
Issue-ID: POLICY-3394 Change-Id: I42a18c115c3ca7110f37fc0ae8aeea3f2bbffb37 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-06Fix sonars in policy-commonJim Hahn1-2/+2
Fixed sonars: - use "var" instead of actual type name - re-interrupt threads - use rej2 split() instead of String split() Issue-ID: POLICY-3285 Change-Id: I82261e0b8a53ee5c5264556fbf5cec37454f014e Signed-off-by: Jim Hahn <jrh3@att.com>
2020-06-30Fix sonar about always-trust-managerJim Hahn1-25/+2
This trust manager is not secure and should be avoided. However, it is only used when the configuration explicitly says to allow self-signed certificates. Modified the code to use an apache trust manager, thus avoid the sonar complaint. Issue-ID: POLICY-2650 Change-Id: Iaf4c72689916ed5ed5e6864666f3f54b2c5e0f12 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-07Update licenses on sonar fixes in commonJim Hahn1-1/+1
Forgot to update licenses on some of the files that were modified as part of addressing sonar issues. Updated. Issue-ID: POLICY-2305 Change-Id: I9858bfb54be5b8eb42406e944361ec100ae238ff Signed-off-by: Jim Hahn <jrh3@att.com>
2020-04-06More sonar issues in commonJim Hahn1-2/+10
Fixed additional sonar issues: - infinit loop; while the issue is bogus, it was easy enough to modify the code to satisfy sonar - doesn't like "volatile"; again, the issue is bogus, but easy enough to modify the code Disabled a couple of sonars in NetworkUtil, as they are not actually an issue. Issue-ID: POLICY-2305 Change-Id: I5500183e3fe4060696994cff55bdae4ba7e138c7 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-05Fix sonar issue in common/utilsJim Hahn1-1/+1
Renamed a constant. Change-Id: I5e1f2fb6de8445a8f667ea48a595773173c6beae Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-13More sonar fixes in policy/commonJim Hahn1-3/+2
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-03-11Address sonar issues in utilsJim Hahn1-2/+6
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-08Add code to allocate server portsJim Hahn1-3/+76
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>
2018-08-13Fix checkstyle in utilsPamela Dragosh1-4/+4
Cleared all the checkstyle in these 2 submodules. Issue-ID: POLICY-881 Change-Id: I248e1894aebf549d5a4f8669a6466ec227d40b55 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-07-25Copy policy-endpoints from drools-pdp to commonmmis1-0/+113
Issue-ID: POLICY-967 Change-Id: I374c155ee102c3e157c60d0a22d7191544abb76a Signed-off-by: mmis <michael.morris@ericsson.com>