[ 
https://issues.apache.org/jira/browse/QPID-7336?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15433090#comment-15433090
 ] 

Lorenz Quack commented on QPID-7336:
------------------------------------

Hi Alex,
thanks for the review.
* UserPreferencesImpl
** I renamed checkForIdUniqueness as suggested.
** I now call ensureSameTypeAndOwnerForExistingPreference from 
checkForConflictWithExisting. I think the name check is not appropriate for a 
replace operation because it will be replaced anyway (type and owner are the 
same)
** inlined principalsEqual and principalsContain as suggested
* PreferencesRecoverer
** I added a validation step to PreferebceRecoverer
* PreferenceImpl
** I don't think there was the possibility for NPE in the date code because 
PreferenceFactory returns a new Date in case the given one is null or unknown 
type.
* PreferenceFactory
** The factory only validates that fields have the correct types and otherwise 
constructs the object as requested. Any further validation is performed in the 
layer that requires the validation (which is different depending on the context 
where the preference is being created). I think this is a sensible separation 
of concerns. The problem with the previous approach was that at the time of 
calling the factory we did not know whether we want a new preference 
(creationDate set to now) or an existing preference (with a given creationDate).
** the name "create" was avoided to steer clear of possible confusion with the 
createdDate. We wanted a name that can be used to construct a Preference 
regardless of context. And IMHO factory methods in the style of fromSomething() 
are not that uncommon.
* PreferencesTest
** this is not a modified old test but rather the old test was removed and this 
is a new test. This now tests that the broker ignores the owner field provided 
by the client which is a valid test. The name of the test might not be ideal.

> [Java Broker] Add createdDate to Preference object
> --------------------------------------------------
>
>                 Key: QPID-7336
>                 URL: https://issues.apache.org/jira/browse/QPID-7336
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Broker
>            Reporter: Lorenz Quack
>            Assignee: Lorenz Quack
>             Fix For: qpid-java-6.1
>
>
> For auditing purpose we want a field createdDate on Preference objects.
> One difficulty is that we would like Preferences to be immutable.
> This might prove problematic in the case where we update a preference. 
> Special attention should be paid to this case.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to