diff options
author | waynedunican <wayne.dunican@est.tech> | 2020-06-19 15:23:27 +0100 |
---|---|---|
committer | waynedunican <wayne.dunican@est.tech> | 2020-06-29 17:18:11 +0100 |
commit | a2a84654f27648091db9c49abc8f7b8afa391e73 (patch) | |
tree | d5ad1853c70d81d2d47ee9720b7b3b5d46ac9742 /feature-server-pool/src | |
parent | 119a9c73934c57046ed1e591a7e26dd67c715aa9 (diff) |
Clean up of Pair classes - drools-pdp
Removed Pair class from drools-pdp and replaced with Apache Common Pair
class
Issue-ID: POLICY-2202
Change-Id: Ica2a5b734fb6eebfc0713027c1c4dc3b8d3882c8
Signed-off-by: waynedunican <wayne.dunican@est.tech>
Diffstat (limited to 'feature-server-pool/src')
-rw-r--r-- | feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java index 23da0712..762af962 100644 --- a/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java +++ b/feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java @@ -3,6 +3,7 @@ * feature-server-pool * ================================================================================ * Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2020 Nordix Foundation * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,6 +47,7 @@ import javax.ws.rs.client.WebTarget; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import lombok.AllArgsConstructor; +import org.apache.commons.lang3.tuple.Pair; import org.kie.api.runtime.KieSession; import org.kie.api.runtime.rule.FactHandle; import org.onap.policy.common.endpoints.event.comm.Topic.CommInfrastructure; @@ -65,7 +67,6 @@ import org.onap.policy.drools.system.PolicyController; import org.onap.policy.drools.system.PolicyControllerConstants; import org.onap.policy.drools.system.PolicyEngine; import org.onap.policy.drools.system.PolicyEngineConstants; -import org.onap.policy.drools.utils.Pair; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -796,7 +797,7 @@ public class FeatureServerPool kieSession.insert(backupAndRemove); // add pending operation to the list - pendingData.add(new Pair<>(droolsObjectsWrapper, session)); + pendingData.add(Pair.of(droolsObjectsWrapper, session)); } } @@ -818,7 +819,7 @@ public class FeatureServerPool for (Pair<CompletableFuture<List<Object>>, PolicySession> pair : pendingData) { - PolicySession session = pair.second(); + PolicySession session = pair.getRight(); long delay = endTime - System.currentTimeMillis(); if (delay < 0) { /* @@ -829,7 +830,7 @@ public class FeatureServerPool } try { List<Object> droolsObjects = - pair.first().get(delay, TimeUnit.MILLISECONDS); + pair.getLeft().get(delay, TimeUnit.MILLISECONDS); // if we reach this point, session data read has completed logger.info("{}: session={}, got {} object(s)", |