use of org.ovirt.engine.core.common.businessentities.StorageDomainDR in project ovirt-engine by oVirt.
the class StorageDRListModel method syncSearch.
@Override
protected void syncSearch() {
if (getEntity() == null) {
return;
}
super.syncSearch();
IdQueryParameters parameters = new IdQueryParameters(getEntity().getId());
parameters.setRefresh(getIsQueryFirstTime());
Frontend.getInstance().runQuery(QueryType.GetStorageDomainDR, parameters, new AsyncQuery<QueryReturnValue>(returnValue -> {
List<StorageDomainDR> resultList = returnValue.getReturnValue();
setItems(resultList);
populateSessionsMap(resultList);
}));
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainDR in project ovirt-engine by oVirt.
the class StorageDRListModel method editDR.
private void editDR() {
if (getWindow() != null) {
return;
}
final StorageDomain storageDomain = getEntity();
if (storageDomain == null) {
return;
}
final StorageDomainDR selectedDR = getSelectedItem();
StorageSyncSchedule schedule = new StorageSyncSchedule(selectedDR.getScheduleCronExpression());
final StorageDRModel model = new StorageDRModel();
model.setHelpTag(HelpTag.new_storage_dr);
model.setTitle(ConstantsManager.getInstance().getConstants().edit());
// $NON-NLS-1$
model.setHashName("edit_dr");
model.getStorageDomain().setEntity(storageDomain);
setWindow(model);
model.startProgress();
model.getFrequency().setSelectedItem(schedule.getFrequency());
model.getHour().setSelectedItem(schedule.getHour());
model.getMins().setSelectedItem(schedule.getMins());
AsyncDataProvider.getInstance().getGlusterGeoRepSessionsForStorageDomain(new AsyncQuery<>(geoRepSessions -> {
model.getGeoRepSession().setItems(geoRepSessions);
model.getGeoRepSession().setSelectedItem(Linq.firstOrNull(geoRepSessions, new Linq.IdPredicate<>(selectedDR.getGeoRepSessionId())));
model.stopProgress();
}), storageDomain.getId());
// $NON-NLS-1$
UICommand okCommand = UICommand.createDefaultOkUiCommand("OnSave", this);
model.getCommands().add(okCommand);
// $NON-NLS-1$
UICommand cancelCommand = UICommand.createCancelUiCommand("Cancel", this);
model.getCommands().add(cancelCommand);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainDR in project ovirt-engine by oVirt.
the class StorageDomainDRDaoTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
dao = dbFacade.getStorageDomainDRDao();
storageDomainDR = new StorageDomainDR();
storageDomainDR.setStorageDomainId(FixturesTool.POSIX_STORAGE_DOMAIN_ID);
storageDomainDR.setGeoRepSessionId(FixturesTool.GLUSTER_GEOREP_SESSION_ID2);
storageDomainDR.setScheduleCronExpression("0 30 22 * * ? *");
storageDomainDR.setJobId("qrtzjob1");
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainDR in project ovirt-engine by oVirt.
the class StorageDomainDRDaoTest method testGetStorageDomainDR.
@Test
public void testGetStorageDomainDR() {
StorageDomainDR result = dao.get(FixturesTool.POSIX_STORAGE_DOMAIN_ID, FixturesTool.GLUSTER_GEOREP_SESSION_ID2);
assertEquals(storageDomainDR, result);
}
use of org.ovirt.engine.core.common.businessentities.StorageDomainDR in project ovirt-engine by oVirt.
the class StorageDomainDRDaoTest method testSaveorUpdate.
@Test
public void testSaveorUpdate() {
storageDomainDR.setScheduleCronExpression(null);
dao.saveOrUpdate(storageDomainDR);
StorageDomainDR result = dao.get(FixturesTool.POSIX_STORAGE_DOMAIN_ID, FixturesTool.GLUSTER_GEOREP_SESSION_ID2);
assertEquals(storageDomainDR, result);
}
Aggregations