mooli tayer has posted comments on this change.

Change subject: tools: notifier - simple first match include/exclude.
......................................................................


Patch Set 2:

(8 comments)

http://gerrit.ovirt.org/#/c/24018/2/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java
File 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java:

Line 85:             deleteObsoleteHistoryData();
Line 86:             log.debug("Finished event notification service iteration");
Line 87:         } catch (Throwable t) {
Line 88:             log.error("Exception while querying for notifications.", 
t);
Line 89:             if (t instanceof SQLException) {
> try {
Done
Line 90:                 distributeDbDownEvent();
Line 91:             }
Line 92:             if (!Thread.interrupted()) {
Line 93:                 log.error(String.format("Failed to run the service."), 
t);


http://gerrit.ovirt.org/#/c/24018/2/backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FilterEntry.java
File 
backend/manager/tools/src/main/java/org/ovirt/engine/core/notifier/filter/FilterEntry.java:

Line 12: 
Line 13:     private FilterEntry(String eventName, boolean exclude, String 
transportCandidate, String address) {
Line 14:         this.eventName = eventName;
Line 15:         this.exclude = exclude;
Line 16:         this.transportCandidate = transportCandidate;
> please don't.
OK
Line 17:         this.address = address;
Line 18:     }
Line 19: 
Line 20:     public static FilterEntry createEntryFromRecipient(


Line 13:     private FilterEntry(String eventName, boolean exclude, String 
transportCandidate, String address) {
Line 14:         this.eventName = eventName;
Line 15:         this.exclude = exclude;
Line 16:         this.transportCandidate = transportCandidate;
Line 17:         this.address = address;
> transport + name only consistent, please.
Yes
Line 18:     }
Line 19: 
Line 20:     public static FilterEntry createEntryFromRecipient(
Line 21:             String eventName,


Line 64:     }
Line 65: 
Line 66:     public String getAddress() {
Line 67:         return address;
Line 68:     }
> only constructor should be public, all the other should be package protecte
Please see next revision.
Line 69: 
Line 70:     @Override
Line 71:     public String toString() {
Line 72:         return "FilterEntry{" +


http://gerrit.ovirt.org/#/c/24018/2/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:

> not sure I understand this comment.
Holding recipient as an object with Transport+adress/name/profile/whatever + 
equals.
Line 1: package org.ovirt.engine.core.notifier.filter;
Line 2: 
Line 3: import java.util.HashMap;
Line 4: import java.util.HashSet;


Line 84:             log.debug(String.format("parse: handling '%s'", 
m.group(0)));
Line 85:             boolean exclude = "exclude".equals(m.group("exclude"));
Line 86:             String event = m.group("event");
Line 87:             String recipient = m.group("recipient");
Line 88:             ret.add(FilterEntry.createEntryFromRecipient(event, 
exclude, recipient));
> createFromConfigrationString is plain simple parse of string, why do you ne
Please see next revision.
Line 89:         }
Line 90:         return ret;
Line 91:     }


http://gerrit.ovirt.org/#/c/24018/2/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 224:         if (!StringUtils.isEmpty(filter)) {
Line 225:             String[] filterElements = filter.split("\\s+");
Line 226:             for (String filterElement : filterElements) {
Line 227:                 if (!StringUtils.isEmpty(filterElement)) {
Line 228:                     if 
(!FILTER_ELEMENT_PATTERN.matcher(filterElement).matches()) {
> you do not check if transports are wrong, only that the configuration can b
Done
Line 229:                         throw new IllegalArgumentException(
Line 230:                                 String.format("%s Illegal value for 
%s , (%s)",
Line 231:                                         GENERIC_MESSAGE,
Line 232:                                         FILTER,


http://gerrit.ovirt.org/#/c/24018/2/packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in
File packaging/services/ovirt-engine-notifier/ovirt-engine-notifier.conf.in:

Line 60: 
Line 61: # Comma separated list of email recipients to be informed in case
Line 62: # the notification service cannot connect to the DB. can be empty.
Line 63: # Deprecated, use FILTER with DATABASE_UNREACHABLE instead.
Line 64: FAILED_QUERIES_NOTIFICATION_RECIPIENTS=
> reorder is a different patch.
OK
Line 65: 
Line 66: #--------------#
Line 67: # Event Filter #
Line 68: #--------------#


-- 
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: 2
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

Reply via email to