Search in sources :

Example 6 with GlusterService

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterService in project ovirt-engine by oVirt.

the class ManageGlusterServiceCommand method getServiceList.

private List<String> getServiceList() {
    List<GlusterService> serviceList = glusterServiceDao.getByServiceType(getParameters().getServiceType());
    List<String> serviceListStr = new ArrayList<>();
    for (GlusterService srvc : serviceList) {
        serviceListStr.add(srvc.getServiceName());
    }
    return serviceListStr;
}
Also used : GlusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterService) ArrayList(java.util.ArrayList)

Example 7 with GlusterService

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterService in project ovirt-engine by oVirt.

the class ManageGlusterServiceCommandTest method getGlusterServiceListByServiceType.

private List<GlusterService> getGlusterServiceListByServiceType(ServiceType serviceType, GlusterServiceStatus status) {
    List<GlusterService> serviceList = new ArrayList<>();
    GlusterService srvc1 = new GlusterService();
    srvc1.setId((status == GlusterServiceStatus.RUNNING) ? startedServiceId1 : stoppedServiceId1);
    srvc1.setServiceName("srvc1");
    srvc1.setServiceType(serviceType);
    serviceList.add(srvc1);
    GlusterService srvc2 = new GlusterService();
    srvc2.setId((status == GlusterServiceStatus.RUNNING) ? startedServiceId2 : stoppedServiceId2);
    srvc2.setServiceName("srvc2");
    srvc2.setServiceType(serviceType);
    serviceList.add(srvc2);
    return serviceList;
}
Also used : GlusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterService) ArrayList(java.util.ArrayList)

Example 8 with GlusterService

use of org.ovirt.engine.core.common.businessentities.gluster.GlusterService in project ovirt-engine by oVirt.

the class GlusterServiceDaoTest method testGetByServiceTypeAndName.

@Test
public void testGetByServiceTypeAndName() {
    GlusterService service = dao.getByServiceTypeAndName(ServiceType.GLUSTER, GLUSTER_SERVICE);
    assertNotNull(service);
    assertEquals(GLUSTER_SERVICE_ID, service.getId());
}
Also used : GlusterService(org.ovirt.engine.core.common.businessentities.gluster.GlusterService) Test(org.junit.Test)

Aggregations

GlusterService (org.ovirt.engine.core.common.businessentities.gluster.GlusterService)8 ArrayList (java.util.ArrayList)3 Test (org.junit.Test)2 GlusterServerService (org.ovirt.engine.core.common.businessentities.gluster.GlusterServerService)2 HashMap (java.util.HashMap)1 Guid (org.ovirt.engine.core.compat.Guid)1