Shubhendu Tripathi has uploaded a new change for review. Change subject: gluster: Added query for gluster cluster service ......................................................................
gluster: Added query for gluster cluster service Added the query GetGlusterClusterServiceByClusterIdAndServiceType for getting gluster cluster service based on cluster id and service type. Change-Id: I123e39fde8317a9227a1bd008c5afbc5dcb7691d Signed-off-by: Shubhendu Tripathi <[email protected]> --- A backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterClusterServiceByClusterIdAndServiceTypeQuery.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterQueriesCommandBase.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/VdcQueryType.java A backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/gluster/GlusterClusterServiceQueryParameters.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 6 files changed, 52 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/41/15241/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterClusterServiceByClusterIdAndServiceTypeQuery.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterClusterServiceByClusterIdAndServiceTypeQuery.java new file mode 100644 index 0000000..2e24715 --- /dev/null +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GetGlusterClusterServiceByClusterIdAndServiceTypeQuery.java @@ -0,0 +1,19 @@ +package org.ovirt.engine.core.bll.gluster; + +import org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService; +import org.ovirt.engine.core.common.queries.gluster.GlusterClusterServiceQueryParameters; + +public class GetGlusterClusterServiceByClusterIdAndServiceTypeQuery<P extends GlusterClusterServiceQueryParameters> extends GlusterQueriesCommandBase<P> { + + protected GetGlusterClusterServiceByClusterIdAndServiceTypeQuery(P parameters) { + super(parameters); + } + + @Override + protected void executeQueryCommand() { + GlusterClusterService service = + getGlusterClusterServiceDao().getByClusterIdAndServiceType(getParameters().getGroupId(), + getParameters().getServiceType()); + getQueryReturnValue().setReturnValue(service); + } +} diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterQueriesCommandBase.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterQueriesCommandBase.java index 955a6ba..3360e48 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterQueriesCommandBase.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterQueriesCommandBase.java @@ -13,6 +13,7 @@ import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.dbbroker.DbFacade; import org.ovirt.engine.core.dao.gluster.GlusterBrickDao; +import org.ovirt.engine.core.dao.gluster.GlusterClusterServiceDao; import org.ovirt.engine.core.dao.gluster.GlusterHooksDao; import org.ovirt.engine.core.dao.gluster.GlusterServerServiceDao; import org.ovirt.engine.core.dao.gluster.GlusterVolumeDao; @@ -39,6 +40,10 @@ return DbFacade.getInstance().getGlusterServerServiceDao(); } + protected GlusterClusterServiceDao getGlusterClusterServiceDao() { + return DbFacade.getInstance().getGlusterClusterServiceDao(); + } + protected String getGlusterVolumeName(Guid volumeId) { return getGlusterVolumeDao().getById(volumeId).getName(); } 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 3cc2308..b08faeb 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 @@ -236,6 +236,7 @@ GetGlusterHookById, GetGlusterServerServicesByClusterId, GetGlusterServerServicesByServerId, + GetGlusterClusterServiceByClusterIdAndServiceType, GetDefaultConfigurationVersion(VdcQueryAuthType.User), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/gluster/GlusterClusterServiceQueryParameters.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/gluster/GlusterClusterServiceQueryParameters.java new file mode 100644 index 0000000..7d95236 --- /dev/null +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/gluster/GlusterClusterServiceQueryParameters.java @@ -0,0 +1,25 @@ +package org.ovirt.engine.core.common.queries.gluster; + +import javax.validation.constraints.NotNull; + +import org.ovirt.engine.core.common.businessentities.gluster.ServiceType; +import org.ovirt.engine.core.compat.Guid; + +public class GlusterClusterServiceQueryParameters extends GlusterServiceQueryParameters { + private static final long serialVersionUID = -7687304241216035729L; + + @NotNull(message = "VALIDATION.GLUSTER.SERVICE_TYPE.NOT_NULL") + private ServiceType serviceType; + + public GlusterClusterServiceQueryParameters(Guid groupId) { + super(groupId); + } + + public ServiceType getServiceType() { + return serviceType; + } + + public void setServiceType(ServiceType serviceType) { + this.serviceType = serviceType; + } +} diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index 74c039b..43f9b47 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -807,6 +807,7 @@ VALIDATION.GLUSTER.VOLUME.BRICK.BRICK_DIR.NOT_NULL=Brick Directory is required. VALIDATION.GLUSTER.GLUSTER_HOOK_ID.NOT_NULL=Gluster Hook ID is required. VALIDATION.GLUSTER.GLUSTER_SERVICE_GROUP_ID.NOT_NULL=Cluster Id / Server Id is required. +VALIDATION.GLUSTER.SERVICE_TYPE.NOT_NULL=Service Type is required. ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID=Cannot ${action} ${type}. Cluster ID is not valid. ACTION_TYPE_FAILED_CLUSTER_DOES_NOT_SUPPORT_GLUSTER=Cannot ${action} ${type}. Cluster does not support Gluster service. ACTION_TYPE_FAILED_GLUSTER_VOLUME_NAME_ALREADY_EXISTS=Cannot ${action} ${type}. Volume name ${volumeName} already exists. diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 66ca9e4..859edcd 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -234,6 +234,7 @@ VAR__TYPE__GLUSTER_SERVER=$type Gluster Server VAR__TYPE__GLUSTER_HOOK=$type Gluster Hook VALIDATION.GLUSTER.GLUSTER_SERVICE_GROUP_ID.NOT_NULL=Cluster Id / Server Id is required. +VALIDATION.GLUSTER.SERVICE_TYPE.NOT_NULL=Service Type is required. VAR__ACTION__RUN=$action run VAR__ACTION__REMOVE=$action remove VAR__ACTION__ADD=$action add -- To view, visit http://gerrit.ovirt.org/15241 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I123e39fde8317a9227a1bd008c5afbc5dcb7691d Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Shubhendu Tripathi <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
