summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Hassan <sean.hassan@att.com>2020-09-29 13:14:27 -0500
committerSean Hassan <sean.hassan@att.com>2020-09-29 13:36:41 -0500
commitcee64537a7e4b8579996a4e3e1b0f98b7fe646cb (patch)
tree09abb05b158360f495787eda738301e2c1d3bc71
parent95a6e66b8cb44eba7052518be1f62db25a7ed22a (diff)
Correct ClassCastException on locator object
Issue-ID: AAF-1204 Change-Id: I03dbe7cf109ac8a0ff3a5b02338043ab5ced6323 Signed-off-by: Sean Hassan <sean.hassan@att.com>
-rw-r--r--cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFAuthn.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFAuthn.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFAuthn.java
index f74306fb..d1a3b19b 100644
--- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFAuthn.java
+++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFAuthn.java
@@ -34,6 +34,7 @@ import org.onap.aaf.cadi.User;
import org.onap.aaf.cadi.aaf.AAFPermission;
import org.onap.aaf.cadi.client.Future;
import org.onap.aaf.cadi.client.Rcli;
+import org.onap.aaf.cadi.locator.SingleEndpointLocator;
import org.onap.aaf.cadi.lur.ConfigPrincipal;
import aaf.v2_0.CredRequest;
@@ -143,10 +144,14 @@ public class AAFAuthn<CLIENT> extends AbsUserCache<AAFPermission> {
public Resp revalidate(Object state) {
int maxRetries = 15;
- try { // these SHOULD be AAFConHttp and AAFLocator objects, but put in a try anyway to be safe
+ try { // these SHOULD be an AAFConHttp and a AAFLocator or SingleEndpointLocator objects, but put in a try to be safe
AAFConHttp forceCastCon = (AAFConHttp) con;
- AAFLocator forceCastLoc = (AAFLocator) forceCastCon.hman().loc;
- maxRetries = forceCastLoc.maxIters();
+ if (forceCastCon.hman().loc instanceof SingleEndpointLocator) {
+ maxRetries = 1; // we cannot retry the single LGW gateway!
+ } else {
+ AAFLocator forceCastLoc = (AAFLocator) forceCastCon.hman().loc;
+ maxRetries = forceCastLoc.maxIters();
+ }
} catch (Exception e) {
access.log(Access.Level.DEBUG, e);
}