aboutsummaryrefslogtreecommitdiffstats
path: root/feature-server-pool/src/main/java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2020-06-29 20:54:18 +0000
committerGerrit Code Review <gerrit@onap.org>2020-06-29 20:54:18 +0000
commit1793d0ca9245e2ff0253274dc2cdf35d7fdf89c2 (patch)
tree5462ff430dd35874df4191163f8a324901be1136 /feature-server-pool/src/main/java
parent9216163ead0c64653544dc674992e485ad98549b (diff)
parenta2a84654f27648091db9c49abc8f7b8afa391e73 (diff)
Merge "Clean up of Pair classes - drools-pdp"
Diffstat (limited to 'feature-server-pool/src/main/java')
-rw-r--r--feature-server-pool/src/main/java/org/onap/policy/drools/serverpool/FeatureServerPool.java9
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 cce7a09d..dd1c7c32 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;
@@ -791,7 +792,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));
}
}
@@ -813,7 +814,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) {
/*
@@ -824,7 +825,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)",