aboutsummaryrefslogtreecommitdiffstats
path: root/feature-server-pool
diff options
context:
space:
mode:
Diffstat (limited to 'feature-server-pool')
-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 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)",