Juan Hernandez has uploaded a new change for review. Change subject: [WIP] Replace GetAdGroupByGroupId with generic interface ......................................................................
[WIP] Replace GetAdGroupByGroupId with generic interface This change replaces the use of the LDAP specific GetAdGroupByGroupId command with calls to the corresponding methods of the generic interfaces. Change-Id: Ibf82cac2d465de0d9ba46589009d52700a1381c9 Signed-off-by: Juan Hernandez <[email protected]> --- M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAO.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/69/15769/1 diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAO.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAO.java index 738f0aa..851d8e7 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAO.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAO.java @@ -3,6 +3,7 @@ import java.util.List; import org.ovirt.engine.core.common.businessentities.LdapGroup; +import org.ovirt.engine.core.common.users.DirectoryGroup; import org.ovirt.engine.core.compat.Guid; /** @@ -53,6 +54,14 @@ void update(LdapGroup group); /** + * Updates the supplied group. + * + * @param group + * the group + */ + void update(DirectoryGroup group); + + /** * Removes the group with the specified id. * * @param id diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java index c5c5c30..d0f793e 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/AdGroupDAODbFacadeImpl.java @@ -6,6 +6,7 @@ import org.ovirt.engine.core.common.businessentities.LdapGroup; import org.ovirt.engine.core.common.businessentities.LdapRefStatus; +import org.ovirt.engine.core.common.users.DirectoryGroup; import org.ovirt.engine.core.compat.Guid; import org.springframework.jdbc.core.RowMapper; import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; @@ -51,6 +52,11 @@ insertOrUpdate(group, "Updatead_groups"); } + @Override + public void update(DirectoryGroup group) { + insertOrUpdate(group, "Updatead_groups"); + } + private void insertOrUpdate(final LdapGroup group, final String storedProcName) { getCallsHandler().executeModification(storedProcName, getCustomMapSqlParameterSource() .addValue("id", group.getid()) @@ -60,6 +66,15 @@ .addValue("distinguishedname", group.getDistinguishedName())); } + private void insertOrUpdate(final DirectoryGroup group, final String storedProcName) { + getCallsHandler().executeModification(storedProcName, getCustomMapSqlParameterSource() + .addValue("id", group.getId()) + .addValue("name", group.getName()) + .addValue("status", group.getStatus()) + .addValue("domain", group.getDirectory().getName()) + .addValue("distinguishedname", "")); + } + @Override public void remove(Guid id) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() -- To view, visit http://gerrit.ovirt.org/15769 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf82cac2d465de0d9ba46589009d52700a1381c9 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Juan Hernandez <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
