@Override public Snapshot mapRow(ResultSet rs, int rowNum) throws SQLException { Snapshot snapshot = createInitialSnapshotEntity(rs); snapshot.setId(getGuidDefaultEmpty(rs, "snapshot_id")); snapshot.setVmId(getGuidDefaultEmpty(rs, "vm_id")); snapshot.setType(SnapshotType.valueOf(rs.getString("snapshot_type"))); snapshot.setStatus(SnapshotStatus.valueOf(rs.getString("status"))); snapshot.setDescription(rs.getString("description")); snapshot.setCreationDate(new Date(rs.getTimestamp("creation_date").getTime())); snapshot.setAppList(rs.getString("app_list")); snapshot.setVmConfiguration(rs.getString("vm_configuration")); snapshot.setMemoryDiskId(getGuid(rs, "memory_dump_disk_id")); snapshot.setMetadataDiskId(getGuid(rs, "memory_metadata_disk_id")); snapshot.setVmConfigurationBroken(rs.getBoolean("vm_configuration_broken")); return snapshot; }
private org.ovirt.engine.core.common.businessentities.Snapshot createSnapshot(int index) { org.ovirt.engine.core.common.businessentities.Snapshot result = new org.ovirt.engine.core.common.businessentities.Snapshot(); result.setId(GUIDS[index]); result.setDescription("snap1"); return result; }
@Override protected void updateExistingEntity() { existingEntity.setDescription(RandomUtils.instance().nextString(1000)); }
snapshot.setType(SnapshotType.valueOf(selectSingleNode(node, "Type", _xmlNS).innerText)); snapshot.setStatus(SnapshotStatus.OK); snapshot.setDescription(selectSingleNode(node, "Description", _xmlNS).innerText); XmlNode memory = selectSingleNode(node, "Memory", _xmlNS); if (memory != null) {
@Override protected org.ovirt.engine.core.common.businessentities.Snapshot getEntity(int index) { org.ovirt.engine.core.common.businessentities.Snapshot entity = new org.ovirt.engine.core.common.businessentities.Snapshot(); entity.setId(SNAPSHOT_IDS[index]); entity.setCreationDate(SNAPSHOT_DATES[index]); entity.setDescription(DESCRIPTIONS[index]); entity.setType(SnapshotType.REGULAR); entity.setVmId(VM_ID); return entity; }