use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GlusterVolumeGeoRepStatusDetail method getSessionDetails.
@Override
protected GlusterGeoRepSessionDetails getSessionDetails(Map<String, Object> innerMap) {
GlusterGeoRepSessionDetails details = super.getSessionDetails(innerMap);
if (details != null) {
Long dataOpsPending = parseSafeLong(innerMap, DATA);
Long metaOpsPending = parseSafeLong(innerMap, META);
Long entryOpsPending = parseSafeLong(innerMap, ENTRY);
Long failures = parseSafeLong(innerMap, FAILURES);
details.setDataOpsPending(dataOpsPending);
details.setMetaOpsPending(metaOpsPending);
details.setEntryOpsPending(entryOpsPending);
details.setFailures(failures);
if (innerMap.containsKey(CHECK_POINT_COMPLETED)) {
if ("YES".equalsIgnoreCase(innerMap.get(CHECK_POINT_COMPLETED).toString())) {
details.setCheckpointCompleted(true);
} else {
details.setCheckpointCompleted(false);
}
}
String timezone = innerMap.containsKey(TIMEZONE) ? innerMap.get(TIMEZONE).toString() : null;
Long lastSynced = parseSafeLong(innerMap, LAST_SYNCED);
Long checkPointTime = parseSafeLong(innerMap, CHECK_POINT_TIME);
Long checkPointCompletionTime = parseSafeLong(innerMap, CHECK_POINT_COMPLETION_TIME);
details.setLastSyncedAt(lastSynced != null ? new Date(lastSynced * 1000L) : null);
details.setCheckPointCompletedAt(checkPointCompletionTime != null ? new Date(checkPointCompletionTime * 1000L) : null);
details.setCheckPointTime(checkPointTime != null ? new Date(checkPointTime * 1000L) : null);
}
geoRepDetails.add(details);
return details;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method testSaveDetails.
@Test
public void testSaveDetails() {
GlusterGeoRepSessionDetails sessionDetails = getGlusterGeoRepSessionDetails();
dao.saveDetails(sessionDetails);
List<GlusterGeoRepSessionDetails> fetchedSessionDetails = dao.getGeoRepSessionDetails(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
assertEquals(sessionDetails, fetchedSessionDetails.get(0));
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class GlusterGeoRepDaoTest method getGlusterGeoRepSessionDetails.
private GlusterGeoRepSessionDetails getGlusterGeoRepSessionDetails() {
GlusterGeoRepSessionDetails sessionDetails = new GlusterGeoRepSessionDetails();
sessionDetails.setSessionId(FixturesTool.GLUSTER_GEOREP_SESSION_ID);
sessionDetails.setMasterBrickId(FixturesTool.GLUSTER_BRICK_UUID1);
sessionDetails.setSlaveHostName("remoteHost");
sessionDetails.setSlaveNodeUuid(FixturesTool.GLUSTER_SERVER_UUID1);
sessionDetails.setStatus(GeoRepSessionStatus.ACTIVE);
sessionDetails.setCheckPointStatus("NA");
sessionDetails.setCrawlStatus(GeoRepCrawlStatus.CHANGELOG_CRAWL);
sessionDetails.setDataOpsPending(100L);
sessionDetails.setMetaOpsPending(40L);
sessionDetails.setEntryOpsPending(10L);
sessionDetails.setFailures(0L);
sessionDetails.setCheckpointCompleted(false);
sessionDetails.setCheckPointTime(new Date());
sessionDetails.setLastSyncedAt(new Date());
return sessionDetails;
}
use of org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSessionDetails in project ovirt-engine by oVirt.
the class VolumeGeoRepListModel method populateStatus.
private void populateStatus(final List<GlusterGeoRepSessionDetails> details) {
final VolumeGeoRepSessionDetailsModel windowModel = new VolumeGeoRepSessionDetailsModel();
windowModel.setHelpTag(HelpTag.geo_replication_status_detail);
// $NON-NLS-1$
windowModel.setHashName("geo_replication_status_detail");
final UIConstants constants = ConstantsManager.getInstance().getConstants();
windowModel.setTitle(constants.geoReplicationSessionDetailsTitle());
// $NON-NLS-1$
UICommand okCommand = new UICommand("closeWindow", this);
okCommand.setIsCancel(true);
okCommand.setTitle(constants.ok());
windowModel.getCommands().add(okCommand);
setWindow(windowModel);
final List<EntityModel<GlusterGeoRepSessionDetails>> detailRows = new ArrayList<>();
for (GlusterGeoRepSessionDetails detail : details) {
detailRows.add(new EntityModel<>(detail));
}
windowModel.getGeoRepSessionSummary().setItems(detailRows, detailRows.get(0));
}
Aggregations