mooli tayer has posted comments on this change. Change subject: tools: notifier - simple first match include/exclude. ......................................................................
Patch Set 3: (3 comments) I've moved FilterEntry and Subscriber inside firstMatchSimpleFilter. They both have only one constructor and all other parsing is done in parse. I am awaiting your response on notificationProperties. I would think that we should at least check that for each filter Element it matches PARSE_PATTERN (as appose to ignoring what doesn't match) and also that we do not have exclude:kuku(*) we can check that in parse but it's up to you. http://gerrit.ovirt.org/#/c/24018/3/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FirstMatchSimpleFilter.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FirstMatchSimpleFilter.java: Line 76: } Line 77: } Line 78: } Line 79: Line 80: public static List<FilterEntry> parse(String filters) { > it is not better practive for something that should not be modified, as in So What should be done is return a Collections.unmodifiableList(ret) Line 81: List<FilterEntry> ret = new LinkedList<>(); Line 82: Matcher m = PARSE_PATTERN.matcher(filters); Line 83: while (m.find()) { Line 84: log.debug(String.format("parse: handling '%s'", m.group(0))); http://gerrit.ovirt.org/#/c/24018/3/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/Recipient.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/Recipient.java: Line 45: } Line 46: Recipient recipient = (Recipient) o; Line 47: return (name != null ? name.equals(recipient.name) : recipient.name == null) && Line 48: (transport != null ? transport.equals(recipient.transport) : Line 49: recipient.transport == null); > no need for check null if you use stringutils. Yes I know, but there where no null checks and no stringUtils... Line 50: Line 51: } Line 52: Line 53: @Override http://gerrit.ovirt.org/#/c/24018/3/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java File backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/utils/NotificationProperties.java: Line 237: String.format("%s Illegal value for %s , (%s)", Line 238: GENERIC_MESSAGE, Line 239: FILTER, Line 240: filterElement)); Line 241: } > non existing transports should not be validated in my opinion, if you want I DO NOT WANT TO VALIDATE NON EXISTING TRANSPORTS, I keep saying it every time. Anyway currently no validation is done inside parse. do you want it to remain that way? If so I will remove validateFilter() entirely. Line 242: } Line 243: } Line 244: } Line 245: } -- To view, visit http://gerrit.ovirt.org/24018 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0b94ee8665ff8030b36b463207e50beea44b47d Gerrit-PatchSet: 3 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com> Gerrit-Reviewer: Barak Azulay <bazu...@redhat.com> Gerrit-Reviewer: Martin Peřina <mper...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: mooli tayer <mta...@redhat.com> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches