diff options
-rw-r--r-- | src/main/java/org/onap/crud/event/GraphEvent.java | 23 | ||||
-rw-r--r-- | src/main/java/org/onap/crud/service/AaiResourceService.java | 6 |
2 files changed, 23 insertions, 6 deletions
diff --git a/src/main/java/org/onap/crud/event/GraphEvent.java b/src/main/java/org/onap/crud/event/GraphEvent.java index 958c227..b189373 100644 --- a/src/main/java/org/onap/crud/event/GraphEvent.java +++ b/src/main/java/org/onap/crud/event/GraphEvent.java @@ -172,11 +172,28 @@ public class GraphEvent { public String toString() { return toJson(); } - + + @Override + public boolean equals(Object o){ + if(o == this){ + return true; + } + + if( !(o instanceof GraphEvent)){ + return false; + } + + GraphEvent graphEvent = (GraphEvent) o; + return this.dbTransactionId.equals( + graphEvent.getDbTransactionId()) + && this.timestamp == graphEvent.getTimestamp() + && this.operation.equals(graphEvent.getOperation() + ); + } + @Override public int hashCode() { - return Objects.hash(this.dbTransactionId, this.timestamp, this.edge, this.vertex, this.operation, - this.result); + return Objects.hash(this.dbTransactionId, this.timestamp, this.operation); } public String getObjectKey() { diff --git a/src/main/java/org/onap/crud/service/AaiResourceService.java b/src/main/java/org/onap/crud/service/AaiResourceService.java index c0375b4..881f9fd 100644 --- a/src/main/java/org/onap/crud/service/AaiResourceService.java +++ b/src/main/java/org/onap/crud/service/AaiResourceService.java @@ -22,6 +22,7 @@ package org.onap.crud.service; import java.security.cert.X509Certificate;
import java.util.AbstractMap;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
@@ -506,7 +507,7 @@ public class AaiResourceService { authUser = subjectDn.toString();
}
- return this.auth.validateRequest(authUser.toLowerCase(), action.toString() + ":" + authPolicyFunctionName);
+ return this.auth.validateRequest(authUser!=null ? authUser.toLowerCase():"", action.toString() + ":" + authPolicyFunctionName);
} catch (Exception e) {
logResult(action, uri, e);
@@ -518,8 +519,7 @@ public class AaiResourceService { logger.error(CrudServiceMsgs.EXCEPTION_DURING_METHOD_CALL,
op.toString(),
- uri,
- e.getStackTrace().toString());
+ uri, Arrays.toString(e.getStackTrace()));
// Clear the MDC context so that no other transaction inadvertently
// uses our transaction id.
|