vavrtom commented on code in PR #129:
URL: https://github.com/apache/qpid-broker-j/pull/129#discussion_r917600911


##########
broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java:
##########
@@ -103,13 +106,34 @@ public String getPassword()
     @Override
     public void setPassword(final String password)
     {
-        setAttributes(Collections.<String, Object>singletonMap(User.PASSWORD, 
password));
+        setAttributes(Collections.singletonMap(User.PASSWORD, password));
     }
 
     @Override
     protected void logOperation(final String operation)
     {
-        ((Container) 
_authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(AuthenticationProviderMessages.OPERATION(operation));
+    }
+
+    @Override
+    protected void logCreated(final Map<String, Object> attributes, final 
Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.CREATE(getName(), "SUCCESS", 
String.valueOf(getActualAttributes())));

Review Comment:
   The outcome should be used instead of the "SUCCESS" string to see if 
operation was successful.



##########
broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java:
##########
@@ -103,13 +106,34 @@ public String getPassword()
     @Override
     public void setPassword(final String password)
     {
-        setAttributes(Collections.<String, Object>singletonMap(User.PASSWORD, 
password));
+        setAttributes(Collections.singletonMap(User.PASSWORD, password));
     }
 
     @Override
     protected void logOperation(final String operation)
     {
-        ((Container) 
_authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(AuthenticationProviderMessages.OPERATION(operation));
+    }
+
+    @Override
+    protected void logCreated(final Map<String, Object> attributes, final 
Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.CREATE(getName(), "SUCCESS", 
String.valueOf(getActualAttributes())));
+    }
+
+    @Override
+    protected void logDeleted(final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.DELETE(getName(), "SUCCESS"));

Review Comment:
   The outcome should be used instead of the "SUCCESS" string to see if 
operation was successful.



##########
broker-core/src/main/java/org/apache/qpid/server/security/auth/manager/ManagedUser.java:
##########
@@ -103,13 +106,34 @@ public String getPassword()
     @Override
     public void setPassword(final String password)
     {
-        setAttributes(Collections.<String, Object>singletonMap(User.PASSWORD, 
password));
+        setAttributes(Collections.singletonMap(User.PASSWORD, password));
     }
 
     @Override
     protected void logOperation(final String operation)
     {
-        ((Container) 
_authenticationManager.getParent()).getEventLogger().message(AuthenticationProviderMessages.OPERATION(operation));
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(AuthenticationProviderMessages.OPERATION(operation));
+    }
+
+    @Override
+    protected void logCreated(final Map<String, Object> attributes, final 
Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.CREATE(getName(), "SUCCESS", 
String.valueOf(getActualAttributes())));
+    }
+
+    @Override
+    protected void logDeleted(final Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.DELETE(getName(), "SUCCESS"));
     }
 
+    @Override
+    protected void logUpdated(final Map<String, Object> attributes, final 
Outcome outcome)
+    {
+        ((Container<?>) _authenticationManager.getParent()).getEventLogger()
+            .message(UserMessages.UPDATE(getName(), "SUCCESS", 
String.valueOf(getActualAttributes())));

Review Comment:
   The outcome should be used instead of the "SUCCESS" string to see if 
operation was successful.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to