Search in sources :

Example 6 with GlusterClusterService

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;
}
Also used : GlusterClusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService)

Example 7 with GlusterClusterService

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);
}
Also used : GlusterClusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService)

Example 8 with GlusterClusterService

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());
}
Also used : GlusterClusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService) Test(org.junit.Test)

Example 9 with GlusterClusterService

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;
}
Also used : GlusterClusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService) HashMap(java.util.HashMap) ServiceType(org.ovirt.engine.core.common.businessentities.gluster.ServiceType)

Aggregations

GlusterClusterService (org.ovirt.engine.core.common.businessentities.gluster.GlusterClusterService)9 Test (org.junit.Test)4 HashMap (java.util.HashMap)2 ServiceType (org.ovirt.engine.core.common.businessentities.gluster.ServiceType)2 GlusterServiceStatus (org.ovirt.engine.core.common.businessentities.gluster.GlusterServiceStatus)1