summaryrefslogtreecommitdiffstats
path: root/auth/auth-locate/src/main
diff options
context:
space:
mode:
authorInstrumental <jcgmisc@stl.gathman.org>2018-03-29 19:02:24 -0500
committerInstrumental <jcgmisc@stl.gathman.org>2018-03-29 19:02:44 -0500
commitd86dd644e1543743cfcbc83b230bd4f2cb2e5d4e (patch)
tree698e12f7c0142441cd494cd68da03437e510d0b0 /auth/auth-locate/src/main
parent17ca744723bd652f15d59d6c8555824f6e49018d (diff)
Clean up Sonar results 1
Issue-ID: AAF-206 Change-Id: If1fced5b528490a52691508fb1e30962dbe28856 Signed-off-by: Instrumental <jcgmisc@stl.gathman.org>
Diffstat (limited to 'auth/auth-locate/src/main')
-rw-r--r--auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java
index 1ce9821f..fdb02c70 100644
--- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java
+++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java
@@ -275,6 +275,7 @@ public abstract class LocateFacadeImpl<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,ERROR> ex
}
public final static String GET_ENDPOINTS = "getEndpoints";
+ private final static Object LOCK = new Object();
/* (non-Javadoc)
* @see org.onap.aaf.auth.locate.facade.GwFacade#getEndpoints(org.onap.aaf.auth.env.test.AuthzTrans, javax.servlet.http.HttpServletResponse, java.lang.String, java.lang.String, java.lang.String)
*/
@@ -284,7 +285,7 @@ public abstract class LocateFacadeImpl<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,ERROR> ex
try {
String output=null;
long temp=System.currentTimeMillis();
- synchronized(GET_ENDPOINTS) {
+ synchronized(LOCK) {
if(cacheClear<temp) {
epsCache.clear();
cacheClear = temp+1000*60*2; // 2 mins standard cache clear
@@ -302,7 +303,7 @@ public abstract class LocateFacadeImpl<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,ERROR> ex
return Result.err(reps);
} else {
output = epDF.newData(trans).load(reps.value).asString();
- synchronized(GET_ENDPOINTS) {
+ synchronized(LOCK) {
epsCache.put(key, output);
}
}
@@ -338,7 +339,7 @@ public abstract class LocateFacadeImpl<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,ERROR> ex
Result<Void> rp = service.putMgmtEndPoints(trans, rreq);
switch(rp.status) {
case OK:
- synchronized(GET_ENDPOINTS) {
+ synchronized(LOCK) {
cacheClear = 0L;
}
setContentType(resp,mepDF.getOutType());
@@ -374,7 +375,7 @@ public abstract class LocateFacadeImpl<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,ERROR> ex
Result<Void> rp = service.removeMgmtEndPoints(trans, rreq);
switch(rp.status) {
case OK:
- synchronized(GET_ENDPOINTS) {
+ synchronized(LOCK) {
cacheClear = 0L;
}
setContentType(resp,mepDF.getOutType());