mooli tayer has posted comments on this change.
Change subject: tools: Refactor model and DB mapping of
eventNotificationMethods.
......................................................................
Patch Set 16:
(6 comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/AddEventSubscriptionCommand.java
Line 91: boolean retval = false;
Line 92: for (event_subscriber eventSubscriber : subscriptions) {
Line 93: if (subscriberId.equals(eventSubscriber.getsubscriber_id())
Line 94: &&
StringUtils.equals(eventSubscriber.getevent_up_name(), eventName)
Line 95: &&
eventSubscriber.getevent_notification_method().equals(eventNotificationMethod))
{
Done
Line 96: retval = true;
Line 97: break;
Line 98: }
Line 99: }
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/EventNotificationMethods.java
Line 1: package org.ovirt.engine.core.common;
Line 2:
Line 3: public enum EventNotificationMethods {
Agreed. Already done in a different patch
Line 4: EMAIL
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/event_subscriber.java
Line 24: result = prime * result + ((id.eventUpName == null) ? 0 :
id.eventUpName.hashCode());
Line 25: result = prime * result + ((methodAddress == null) ? 0 :
methodAddress.hashCode());
Line 26: result = prime * result + ((id.eventNotificationMethod ==
null) ? 0 : id.eventNotificationMethod.hashCode());
Line 27: result = prime * result + ((id.subscriberId == null) ? 0 :
id.subscriberId.hashCode());
Line 28: result = prime * result + ((id.tagName == null) ? 0 :
id.tagName.hashCode());
Makes sense but not part of this change. I will push it into a dependent patch
Line 29: return result;
Line 30: }
Line 31:
Line 32: @Override
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/event_subscriber_id.java
Line 38: }
Line 39: event_subscriber_id other = (event_subscriber_id) obj;
Line 40: return (ObjectUtils.objectsEqual(subscriberId,
other.subscriberId)
Line 41: && ObjectUtils.objectsEqual(eventUpName,
other.eventUpName)
Line 42: && ObjectUtils.objectsEqual(eventNotificationMethod,
other.eventNotificationMethod)
Done.
Line 43: && ObjectUtils.objectsEqual(tagName, other.tagName));
Line 44: }
....................................................
File packaging/dbscripts/upgrade/03_04_0340_event_notification_methods.sql
Line 1: -- DROP event_notification_methods
Noted, Thanks.
Line 2: ALTER TABLE event_subscriber DROP CONSTRAINT
fk_event_subscriber_event_notification_methods;
Line 3: DROP TABLE event_notification_methods ;
Line 4:
Line 5: -- save EventNotificationMethod as enum.
Line 6: CREATE TYPE event_notification_method AS ENUM ('EMAIL');
Line 7: ALTER TABLE event_subscriber ADD COLUMN notification_method
event_notification_method;
Line 8: ALTER TABLE event_subscriber DROP CONSTRAINT pk_event_subscriber;
Line 9: ALTER TABLE event_subscriber
Line 10: ADD CONSTRAINT pk_event_subscriber PRIMARY KEY (subscriber_id,
event_up_name, notification_method, tag_name);
I would think we need subscriber_id, event_up_name and notification_method.
(Moses wants to be alerted on cluster creation event by email and sms).
also I think tag_name should be dropped since I haven't seen it used anywhere.
However it is not a part of this patch - I'm putting efforts into dividing my
work into monolithic working patches.
I just restored the previews p_key with the new column name.
Line 11: ALTER TABLE event_subscriber DROP COLUMN method_id;
Line 12:
--
To view, visit http://gerrit.ovirt.org/22135
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I8b71c4e78bbdca3d02d2ac4ef419b9d3d7d58761
Gerrit-PatchSet: 16
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: mooli tayer <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Barak Azulay <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Juan Hernandez <[email protected]>
Gerrit-Reviewer: Martin Peřina <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
Gerrit-Reviewer: mooli tayer <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches