Allon Mureinik has uploaded a new change for review.

Change subject: core: Remove GetEventNotificationMethods
......................................................................

core: Remove GetEventNotificationMethods

GetEventNotificationMethodsQuery is not used anywhere in
the code, and hence should be removed.

This patch removes the following:
1. The GetEventNotificationMethodsQuery class.
2. The GetEventNotificationMethods constant representing
   it in VdcQueryType.
3. The getAllEventNotificationMethods() method in EvetDAO, its
   implementation, test and underlying stored procedure, as this
   method was only used by the aforementioned query.

Signed-off-by: Allon Mureinik <[email protected]>
Change-Id: I9ab37e8fb5a1602b0d8d0d9b1107c596dd33093b
---
M backend/manager/dbscripts/event_sp.sql
D 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodsQuery.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAO.java
M 
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAODbFacadeImpl.java
M 
backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/EventDAOTest.java
6 files changed, 5 insertions(+), 63 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/01/13601/1

diff --git a/backend/manager/dbscripts/event_sp.sql 
b/backend/manager/dbscripts/event_sp.sql
index db77aa8..6691c66 100644
--- a/backend/manager/dbscripts/event_sp.sql
+++ b/backend/manager/dbscripts/event_sp.sql
@@ -58,24 +58,6 @@
 
 
 ----------------------------------------------------------------
--- [event_notification_methods] Table
---
-
-
-Create or replace FUNCTION GetAllFromevent_notification_methods()
-RETURNS SETOF event_notification_methods
-   AS $procedure$
-BEGIN
-   RETURN QUERY SELECT *
-   FROM event_notification_methods;
-
-END; $procedure$
-LANGUAGE plpgsql;
-
-
-
-
-----------------------------------------------------------------
 -- [event_subscriber] Table
 --
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodsQuery.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodsQuery.java
deleted file mode 100644
index a9381fd..0000000
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodsQuery.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.ovirt.engine.core.bll;
-
-import org.ovirt.engine.core.common.queries.VdcQueryParametersBase;
-import org.ovirt.engine.core.dal.dbbroker.DbFacade;
-
-public class GetEventNotificationMethodsQuery<P extends 
VdcQueryParametersBase> extends QueriesCommandBase<P> {
-    public GetEventNotificationMethodsQuery(P parameters) {
-        super(parameters);
-    }
-
-    @Override
-    protected void executeQueryCommand() {
-        
getQueryReturnValue().setReturnValue(DbFacade.getInstance().getEventDao().getAllEventNotificationMethods());
-    }
-}
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
index 901dec5..5896d8d 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java
@@ -197,7 +197,6 @@
     GetPermittedStorageDomainsByStoragePoolId(VdcQueryAuthType.User),
 
     // Event Notification
-    GetEventNotificationMethods,
     GetEventNotificationMethodByType,
     GetNotificationEventMap,
     GetAllEventSubscribers,
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAO.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAO.java
index 5f65023..a9b8f7a 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAO.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAO.java
@@ -29,13 +29,6 @@
      */
     List<event_subscriber> getAllForSubscriber(Guid id);
 
-    /**
-     * Retrieves the list of all event notification methods.
-     *
-     * @return the event notificationet methods
-     */
-    List<EventNotificationMethod> getAllEventNotificationMethods();
-
     List<EventNotificationMethod> getEventNotificationMethodsById(int 
method_id);
 
     List<EventNotificationMethod> getEventNotificationMethodsByType(String 
method_type);
diff --git 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAODbFacadeImpl.java
 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAODbFacadeImpl.java
index 85ce5e9..1242839 100644
--- 
a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAODbFacadeImpl.java
+++ 
b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/EventDAODbFacadeImpl.java
@@ -80,15 +80,6 @@
 
     @SuppressWarnings("unchecked")
     @Override
-    public List<EventNotificationMethod> getAllEventNotificationMethods() {
-        MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource();
-        return 
getCallsHandler().executeReadList("GetAllFromevent_notification_methods",
-                EventNotificationMethodRowMapper.instance,
-                parameterSource);
-    }
-
-    @SuppressWarnings("unchecked")
-    @Override
     public List<EventNotificationMethod> getEventNotificationMethodsById(int 
method_id) {
         MapSqlParameterSource parameterSource = 
getCustomMapSqlParameterSource().addValue("method_id", method_id);
         return 
getCallsHandler().executeReadList("GetEventNotificationMethodById",
diff --git 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/EventDAOTest.java
 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/EventDAOTest.java
index 58cc1cb..ee97017 100644
--- 
a/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/EventDAOTest.java
+++ 
b/backend/manager/modules/dal/src/test/java/org/ovirt/engine/core/dao/EventDAOTest.java
@@ -1,23 +1,24 @@
 package org.ovirt.engine.core.dao;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 
 import java.util.Date;
 import java.util.List;
 
 import org.junit.Test;
-
 import org.ovirt.engine.core.common.EventNotificationMethods;
 import org.ovirt.engine.core.common.businessentities.EventMap;
-import org.ovirt.engine.core.common.businessentities.event_notification_hist;
 import org.ovirt.engine.core.common.businessentities.EventNotificationMethod;
+import org.ovirt.engine.core.common.businessentities.event_notification_hist;
 import org.ovirt.engine.core.common.businessentities.event_subscriber;
 import org.ovirt.engine.core.compat.Guid;
 
 public class EventDAOTest extends BaseDAOTestCase {
     private static final int FREE_AUDIT_LOG_ID = 44295;
     private static final int EVENT_MAP_COUNT = 1;
-    private static final int NOTIFICATION_METHOD_COUNT = 3;
     private EventDAO dao;
     private Guid existingSubscriber;
     private Guid newSubscriber;
@@ -83,15 +84,6 @@
             assertEquals(existingSubscriber,
                     subscription.getsubscriber_id());
         }
-    }
-
-    @Test
-    public void testGetAllEventNotificationMethods() {
-        List<EventNotificationMethod> result = 
dao.getAllEventNotificationMethods();
-
-        assertNotNull(result);
-        assertFalse(result.isEmpty());
-        assertEquals(NOTIFICATION_METHOD_COUNT, result.size());
     }
 
     @Test


--
To view, visit http://gerrit.ovirt.org/13601
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9ab37e8fb5a1602b0d8d0d9b1107c596dd33093b
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to