Allon Mureinik has uploaded a new change for review. Change subject: core: Remove GetEventNotificationMethodByType ......................................................................
core: Remove GetEventNotificationMethodByType GetEventNotificationMethodByTypeQuery is not used anywhere in the code, and hence should be removed. This patch removes the following: 1. The GetEventNotificationMethodByTypeQuery class. 2. The GetEventNotificationMethodByType constant representing it in VdcQueryType. 3. The GetEventNotificationMethodByTypeParameters class only used by the aforementioned query. 3. The getAllEventNotificationMethodByTppe() method in EvetDAO, its implementation, test and underlying stored procedure, as this method was only used by the aforementioned query. Change-Id: Ib347d2f60c84924f2b3e3904066c3e9582e8f736 Signed-off-by: Allon Mureinik <[email protected]> --- M backend/manager/dbscripts/event_sp.sql D backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodByTypeQuery.java D backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetEventNotificationMethodByTypeParameters.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 7 files changed, 0 insertions(+), 80 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/02/13602/1 diff --git a/backend/manager/dbscripts/event_sp.sql b/backend/manager/dbscripts/event_sp.sql index 6691c66..bd8f0f1 100644 --- a/backend/manager/dbscripts/event_sp.sql +++ b/backend/manager/dbscripts/event_sp.sql @@ -203,16 +203,6 @@ -Create or replace FUNCTION GetEventNotificationMethodByType(v_method_type CHAR(10)) -RETURNS SETOF event_notification_methods - AS $procedure$ -BEGIN - RETURN QUERY SELECT * - from event_notification_methods - where method_type = v_method_type; -END; $procedure$ -LANGUAGE plpgsql; - ------------------------------------------------------------------------------------- --- GetAllFromevent_audit_log_subscriber used to get un notified events ------------------------------------------------------------------------------------- diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodByTypeQuery.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodByTypeQuery.java deleted file mode 100644 index 4c3bb4a..0000000 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/GetEventNotificationMethodByTypeQuery.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.ovirt.engine.core.bll; - -import org.ovirt.engine.core.common.queries.GetEventNotificationMethodByTypeParameters; -import org.ovirt.engine.core.dal.dbbroker.DbFacade; - -public class GetEventNotificationMethodByTypeQuery<P extends GetEventNotificationMethodByTypeParameters> - extends QueriesCommandBase<P> { - public GetEventNotificationMethodByTypeQuery(P parameters) { - super(parameters); - } - - @Override - protected void executeQueryCommand() { - String method_typeField = getParameters().getMethodType().name(); - - getQueryReturnValue() - .setReturnValue(DbFacade.getInstance().getEventDao().getEventNotificationMethodsByType(method_typeField)); - } -} diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetEventNotificationMethodByTypeParameters.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetEventNotificationMethodByTypeParameters.java deleted file mode 100644 index 6620729..0000000 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/GetEventNotificationMethodByTypeParameters.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.ovirt.engine.core.common.queries; - -import org.ovirt.engine.core.common.*; - -public class GetEventNotificationMethodByTypeParameters extends VdcQueryParametersBase { - private static final long serialVersionUID = -6576190126259512799L; - - public GetEventNotificationMethodByTypeParameters(EventNotificationMethods mathodType) { - setMethodType(mathodType); - } - - private EventNotificationMethods privateMethodType = EventNotificationMethods.forValue(0); - - public EventNotificationMethods getMethodType() { - return privateMethodType; - } - - private void setMethodType(EventNotificationMethods value) { - privateMethodType = value; - } - - public GetEventNotificationMethodByTypeParameters() { - } -} 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 5896d8d..227976b 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 - GetEventNotificationMethodByType, GetNotificationEventMap, GetAllEventSubscribers, GetEventSubscribersBySubscriberId, 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 a9b8f7a..c292cea 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 @@ -31,8 +31,6 @@ List<EventNotificationMethod> getEventNotificationMethodsById(int method_id); - List<EventNotificationMethod> getEventNotificationMethodsByType(String method_type); - /** * Saves the provided subscriber. * 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 1242839..4663fa5 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 @@ -87,15 +87,6 @@ parameterSource); } - @SuppressWarnings("unchecked") - @Override - public List<EventNotificationMethod> getEventNotificationMethodsByType(String method_type) { - MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource().addValue("method_type", method_type); - return getCallsHandler().executeReadList("GetEventNotificationMethodByType", - EventNotificationMethodRowMapper.instance, - parameterSource); - } - @Override public void subscribe(event_subscriber subscriber) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() 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 ee97017..b4dac59 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 @@ -9,7 +9,6 @@ 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.EventNotificationMethod; import org.ovirt.engine.core.common.businessentities.event_notification_hist; @@ -93,20 +92,6 @@ assertNotNull(result); assertFalse(result.isEmpty()); assertEquals(1, result.size()); - } - - @Test - public void testGetEventNotificationMethodsByType() { - String target = "Email"; - - List<EventNotificationMethod> result = - dao.getEventNotificationMethodsByType(target); - - assertNotNull(result); - assertFalse(result.isEmpty()); - for (EventNotificationMethod method : result) { - assertEquals(EventNotificationMethods.EMAIL, method.getmethod_type()); - } } /** -- To view, visit http://gerrit.ovirt.org/13602 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib347d2f60c84924f2b3e3904066c3e9582e8f736 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
