use of org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService in project ovirt-engine by oVirt.
the class GlusterServiceSyncJobTest method createClusterService.
private GlusterClusterService createClusterService(Guid clusterId, ServiceType serviceType, GlusterServiceStatus status) {
GlusterClusterService service = new GlusterClusterService();
service.setClusterId(clusterId);
service.setServiceType(serviceType);
service.setStatus(status);
return service;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService in project ovirt-engine by oVirt.
the class GlusterClusterServiceDaoTest method insertTestService.
private void insertTestService(Guid clusterId, ServiceType serviceType, GlusterServiceStatus status) {
GlusterClusterService service = new GlusterClusterService();
service.setClusterId(clusterId);
service.setServiceType(serviceType);
service.setStatus(status);
dao.save(service);
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService in project ovirt-engine by oVirt.
the class GlusterClusterServiceDaoTest method testGetByClusterIdAndServiceType.
@Test
public void testGetByClusterIdAndServiceType() {
GlusterClusterService service = dao.getByClusterIdAndServiceType(CLUSTER_ID, ServiceType.GLUSTER);
assertNotNull(service);
assertEquals(GlusterServiceStatus.RUNNING, service.getStatus());
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService in project ovirt-engine by oVirt.
the class GlusterServiceSyncJob method getClusterServiceMap.
private Map<ServiceType, GlusterClusterService> getClusterServiceMap(Cluster cluster) {
List<GlusterClusterService> clusterServices = clusterServiceDao.getByClusterId(cluster.getId());
if (clusterServices == null) {
clusterServices = new ArrayList<>();
}
Map<ServiceType, GlusterClusterService> clusterServiceMap = new HashMap<>();
for (GlusterClusterService clusterService : clusterServices) {
clusterServiceMap.put(clusterService.getServiceType(), clusterService);
}
return clusterServiceMap;
}
Aggregations