use of org.ovirt.engine.api.model.CustomProperties in project ovirt-engine by oVirt.
the class V3VnicProfileInAdapter method adapt.
@Override
public VnicProfile adapt(V3VnicProfile from) {
VnicProfile to = new VnicProfile();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetCustomProperties()) {
to.setCustomProperties(new CustomProperties());
to.getCustomProperties().getCustomProperties().addAll(adaptIn(from.getCustomProperties().getCustomProperty()));
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetNetwork()) {
to.setNetwork(adaptIn(from.getNetwork()));
}
if (from.isSetPassThrough()) {
to.setPassThrough(adaptIn(from.getPassThrough()));
}
if (from.isSetPortMirroring()) {
to.setPortMirroring(from.isPortMirroring());
}
if (from.isSetQos()) {
to.setQos(adaptIn(from.getQos()));
}
return to;
}
use of org.ovirt.engine.api.model.CustomProperties in project ovirt-engine by oVirt.
the class V3InstanceTypeInAdapter method adapt.
@Override
public InstanceType adapt(V3InstanceType from) {
InstanceType to = new InstanceType();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBios()) {
to.setBios(adaptIn(from.getBios()));
}
if (from.isSetCluster()) {
to.setCluster(adaptIn(from.getCluster()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetConsole()) {
to.setConsole(adaptIn(from.getConsole()));
}
if (from.isSetCpu()) {
to.setCpu(adaptIn(from.getCpu()));
}
if (from.isSetCpuProfile()) {
to.setCpuProfile(adaptIn(from.getCpuProfile()));
}
if (from.isSetCpuShares()) {
to.setCpuShares(from.getCpuShares());
}
if (from.isSetCreationTime()) {
to.setCreationTime(from.getCreationTime());
}
if (from.isSetCustomCpuModel()) {
to.setCustomCpuModel(from.getCustomCpuModel());
}
if (from.isSetCustomEmulatedMachine()) {
to.setCustomEmulatedMachine(from.getCustomEmulatedMachine());
}
if (from.isSetCustomProperties()) {
to.setCustomProperties(new CustomProperties());
to.getCustomProperties().getCustomProperties().addAll(adaptIn(from.getCustomProperties().getCustomProperty()));
}
if (from.isSetDeleteProtected()) {
to.setDeleteProtected(from.isDeleteProtected());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDisplay()) {
to.setDisplay(adaptIn(from.getDisplay()));
}
if (from.isSetDomain()) {
to.setDomain(adaptIn(from.getDomain()));
}
if (from.isSetHighAvailability()) {
to.setHighAvailability(adaptIn(from.getHighAvailability()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetIo()) {
to.setIo(adaptIn(from.getIo()));
}
if (from.isSetLargeIcon()) {
to.setLargeIcon(adaptIn(from.getLargeIcon()));
}
if (from.isSetMemory()) {
to.setMemory(from.getMemory());
}
if (from.isSetMemoryPolicy()) {
to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
}
if (from.isSetMigration()) {
to.setMigration(adaptIn(from.getMigration()));
}
if (from.isSetMigrationDowntime()) {
to.setMigrationDowntime(from.getMigrationDowntime());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetOrigin()) {
to.setOrigin(from.getOrigin());
}
if (from.isSetOs()) {
to.setOs(adaptIn(from.getOs()));
}
if (from.isSetRngDevice()) {
to.setRngDevice(adaptIn(from.getRngDevice()));
}
if (from.isSetSerialNumber()) {
to.setSerialNumber(adaptIn(from.getSerialNumber()));
}
if (from.isSetSmallIcon()) {
to.setSmallIcon(adaptIn(from.getSmallIcon()));
}
if (from.isSetSoundcardEnabled()) {
to.setSoundcardEnabled(from.isSoundcardEnabled());
}
if (from.isSetSso()) {
to.setSso(adaptIn(from.getSso()));
}
if (from.isSetStartPaused()) {
to.setStartPaused(from.isStartPaused());
}
if (from.isSetStateless()) {
to.setStateless(from.isStateless());
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(TemplateStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetStorageDomain()) {
to.setStorageDomain(adaptIn(from.getStorageDomain()));
}
if (from.isSetTimeZone()) {
to.setTimeZone(adaptIn(from.getTimeZone()));
}
if (from.isSetTunnelMigration()) {
to.setTunnelMigration(from.isTunnelMigration());
}
if (from.isSetType()) {
to.setType(VmType.fromValue(from.getType()));
}
if (from.isSetUsb()) {
to.setUsb(adaptIn(from.getUsb()));
}
if (from.isSetVersion()) {
to.setVersion(adaptIn(from.getVersion()));
}
if (from.isSetVm()) {
to.setVm(adaptIn(from.getVm()));
}
// new structured "time_zone" element containing the name of the time zone and the UTC offset:
if (from.isSetTimezone() && !to.isSetTimeZone()) {
TimeZone timeZone = new TimeZone();
timeZone.setName(from.getTimezone());
to.setTimeZone(timeZone);
}
return to;
}
use of org.ovirt.engine.api.model.CustomProperties in project ovirt-engine by oVirt.
the class V3SnapshotInAdapter method adapt.
@Override
public Snapshot adapt(V3Snapshot from) {
Snapshot to = new Snapshot();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBios()) {
to.setBios(adaptIn(from.getBios()));
}
if (from.isSetCdroms()) {
to.setCdroms(new Cdroms());
to.getCdroms().getCdroms().addAll(adaptIn(from.getCdroms().getCdRoms()));
}
if (from.isSetCluster()) {
to.setCluster(adaptIn(from.getCluster()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetConsole()) {
to.setConsole(adaptIn(from.getConsole()));
}
if (from.isSetCpu()) {
to.setCpu(adaptIn(from.getCpu()));
}
if (from.isSetCpuProfile()) {
to.setCpuProfile(adaptIn(from.getCpuProfile()));
}
if (from.isSetCpuShares()) {
to.setCpuShares(from.getCpuShares());
}
if (from.isSetCreationTime()) {
to.setCreationTime(from.getCreationTime());
}
if (from.isSetCustomCpuModel()) {
to.setCustomCpuModel(from.getCustomCpuModel());
}
if (from.isSetCustomEmulatedMachine()) {
to.setCustomEmulatedMachine(from.getCustomEmulatedMachine());
}
if (from.isSetCustomProperties()) {
to.setCustomProperties(new CustomProperties());
to.getCustomProperties().getCustomProperties().addAll(adaptIn(from.getCustomProperties().getCustomProperty()));
}
if (from.isSetDate()) {
to.setDate(from.getDate());
}
if (from.isSetDeleteProtected()) {
to.setDeleteProtected(from.isDeleteProtected());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDisks()) {
DiskAttachments toAttachments = new DiskAttachments();
for (V3Disk fromDisk : from.getDisks().getDisks()) {
DiskAttachment toAttachment = new DiskAttachment();
toAttachment.setDisk(adaptIn(fromDisk));
toAttachments.getDiskAttachments().add(toAttachment);
}
to.setDiskAttachments(toAttachments);
}
if (from.isSetDisplay()) {
to.setDisplay(adaptIn(from.getDisplay()));
}
if (from.isSetDomain()) {
to.setDomain(adaptIn(from.getDomain()));
}
if (from.isSetExternalHostProvider()) {
to.setExternalHostProvider(adaptIn(from.getExternalHostProvider()));
}
if (from.isSetFloppies()) {
to.setFloppies(new Floppies());
to.getFloppies().getFloppies().addAll(adaptIn(from.getFloppies().getFloppies()));
}
if (from.isSetGuestOperatingSystem()) {
to.setGuestOperatingSystem(adaptIn(from.getGuestOperatingSystem()));
}
if (from.isSetGuestTimeZone()) {
to.setGuestTimeZone(adaptIn(from.getGuestTimeZone()));
}
if (from.isSetHighAvailability()) {
to.setHighAvailability(adaptIn(from.getHighAvailability()));
}
if (from.isSetHost()) {
to.setHost(adaptIn(from.getHost()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetInitialization()) {
to.setInitialization(adaptIn(from.getInitialization()));
}
if (from.isSetInstanceType()) {
to.setInstanceType(adaptIn(from.getInstanceType()));
}
if (from.isSetIo()) {
to.setIo(adaptIn(from.getIo()));
}
if (from.isSetKatelloErrata()) {
to.setKatelloErrata(new KatelloErrata());
to.getKatelloErrata().getKatelloErrata().addAll(adaptIn(from.getKatelloErrata().getKatelloErrata()));
}
if (from.isSetLargeIcon()) {
to.setLargeIcon(adaptIn(from.getLargeIcon()));
}
if (from.isSetMemory()) {
to.setMemory(from.getMemory());
}
if (from.isSetMemoryPolicy()) {
to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
}
if (from.isSetMigration()) {
to.setMigration(adaptIn(from.getMigration()));
}
if (from.isSetMigrationDowntime()) {
to.setMigrationDowntime(from.getMigrationDowntime());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetNextRunConfigurationExists()) {
to.setNextRunConfigurationExists(from.isNextRunConfigurationExists());
}
if (from.isSetNics()) {
to.setNics(new Nics());
to.getNics().getNics().addAll(adaptIn(from.getNics().getNics()));
}
if (from.isSetNumaTuneMode()) {
to.setNumaTuneMode(NumaTuneMode.fromValue(from.getNumaTuneMode()));
}
if (from.isSetOrigin()) {
to.setOrigin(from.getOrigin());
}
if (from.isSetOs()) {
to.setOs(adaptIn(from.getOs()));
}
if (from.isSetPayloads()) {
to.setPayloads(new Payloads());
to.getPayloads().getPayloads().addAll(adaptIn(from.getPayloads().getPayload()));
}
if (from.isSetPermissions()) {
to.setPermissions(new Permissions());
to.getPermissions().getPermissions().addAll(adaptIn(from.getPermissions().getPermissions()));
}
if (from.isSetPersistMemorystate()) {
to.setPersistMemorystate(from.isPersistMemorystate());
}
if (from.isSetPlacementPolicy()) {
to.setPlacementPolicy(adaptIn(from.getPlacementPolicy()));
}
if (from.isSetQuota()) {
to.setQuota(adaptIn(from.getQuota()));
}
if (from.isSetReportedDevices()) {
to.setReportedDevices(new ReportedDevices());
to.getReportedDevices().getReportedDevices().addAll(adaptIn(from.getReportedDevices().getReportedDevices()));
}
if (from.isSetRngDevice()) {
to.setRngDevice(adaptIn(from.getRngDevice()));
}
if (from.isSetRunOnce()) {
to.setRunOnce(from.isRunOnce());
}
if (from.isSetSerialNumber()) {
to.setSerialNumber(adaptIn(from.getSerialNumber()));
}
if (from.isSetSmallIcon()) {
to.setSmallIcon(adaptIn(from.getSmallIcon()));
}
if (from.isSetSnapshotStatus()) {
to.setSnapshotStatus(SnapshotStatus.fromValue(from.getSnapshotStatus()));
}
if (from.isSetSnapshots()) {
to.setSnapshots(new Snapshots());
to.getSnapshots().getSnapshots().addAll(adaptIn(from.getSnapshots().getSnapshots()));
}
if (from.isSetSoundcardEnabled()) {
to.setSoundcardEnabled(from.isSoundcardEnabled());
}
if (from.isSetSso()) {
to.setSso(adaptIn(from.getSso()));
}
if (from.isSetStartPaused()) {
to.setStartPaused(from.isStartPaused());
}
if (from.isSetStartTime()) {
to.setStartTime(from.getStartTime());
}
if (from.isSetStateless()) {
to.setStateless(from.isStateless());
}
if (from.isSetStatistics()) {
to.setStatistics(new Statistics());
to.getStatistics().getStatistics().addAll(adaptIn(from.getStatistics().getStatistics()));
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(VmStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetStopReason()) {
to.setStopReason(from.getStopReason());
}
if (from.isSetStopTime()) {
to.setStopTime(from.getStopTime());
}
if (from.isSetStorageDomain()) {
to.setStorageDomain(adaptIn(from.getStorageDomain()));
}
if (from.isSetTags()) {
to.setTags(new Tags());
to.getTags().getTags().addAll(adaptIn(from.getTags().getTags()));
}
if (from.isSetTemplate()) {
to.setTemplate(adaptIn(from.getTemplate()));
}
if (from.isSetTimeZone()) {
to.setTimeZone(adaptIn(from.getTimeZone()));
}
if (from.isSetTunnelMigration()) {
to.setTunnelMigration(from.isTunnelMigration());
}
if (from.isSetType()) {
to.setSnapshotType(SnapshotType.fromValue(from.getType()));
}
if (from.isSetUsb()) {
to.setUsb(adaptIn(from.getUsb()));
}
if (from.isSetUseLatestTemplateVersion()) {
to.setUseLatestTemplateVersion(from.isUseLatestTemplateVersion());
}
if (from.isSetVirtioScsi()) {
to.setVirtioScsi(adaptIn(from.getVirtioScsi()));
}
if (from.isSetVm()) {
to.setVm(adaptIn(from.getVm()));
}
if (from.isSetVmPool()) {
to.setVmPool(adaptIn(from.getVmPool()));
}
if (from.isSetWatchdogs()) {
to.setWatchdogs(new Watchdogs());
to.getWatchdogs().getWatchdogs().addAll(adaptIn(from.getWatchdogs().getWatchDogs()));
}
return to;
}
use of org.ovirt.engine.api.model.CustomProperties in project ovirt-engine by oVirt.
the class V3TemplateInAdapter method adapt.
@Override
public Template adapt(V3Template from) {
Template to = new Template();
if (from.isSetLinks()) {
to.getLinks().addAll(adaptIn(from.getLinks()));
}
if (from.isSetActions()) {
to.setActions(adaptIn(from.getActions()));
}
if (from.isSetBios()) {
to.setBios(adaptIn(from.getBios()));
}
if (from.isSetCluster()) {
to.setCluster(adaptIn(from.getCluster()));
}
if (from.isSetComment()) {
to.setComment(from.getComment());
}
if (from.isSetConsole()) {
to.setConsole(adaptIn(from.getConsole()));
}
if (from.isSetCpu()) {
to.setCpu(adaptIn(from.getCpu()));
}
if (from.isSetCpuProfile()) {
to.setCpuProfile(adaptIn(from.getCpuProfile()));
}
if (from.isSetCpuShares()) {
to.setCpuShares(from.getCpuShares());
}
if (from.isSetCreationTime()) {
to.setCreationTime(from.getCreationTime());
}
if (from.isSetCustomCpuModel()) {
to.setCustomCpuModel(from.getCustomCpuModel());
}
if (from.isSetCustomEmulatedMachine()) {
to.setCustomEmulatedMachine(from.getCustomEmulatedMachine());
}
if (from.isSetCustomProperties()) {
to.setCustomProperties(new CustomProperties());
to.getCustomProperties().getCustomProperties().addAll(adaptIn(from.getCustomProperties().getCustomProperty()));
}
if (from.isSetDeleteProtected()) {
to.setDeleteProtected(from.isDeleteProtected());
}
if (from.isSetDescription()) {
to.setDescription(from.getDescription());
}
if (from.isSetDisplay()) {
to.setDisplay(adaptIn(from.getDisplay()));
}
if (from.isSetDomain()) {
to.setDomain(adaptIn(from.getDomain()));
}
if (from.isSetHighAvailability()) {
to.setHighAvailability(adaptIn(from.getHighAvailability()));
}
if (from.isSetId()) {
to.setId(from.getId());
}
if (from.isSetIo()) {
to.setIo(adaptIn(from.getIo()));
}
if (from.isSetHref()) {
to.setHref(from.getHref());
}
if (from.isSetLargeIcon()) {
to.setLargeIcon(adaptIn(from.getLargeIcon()));
}
if (from.isSetMemory()) {
to.setMemory(from.getMemory());
}
if (from.isSetMemoryPolicy()) {
to.setMemoryPolicy(adaptIn(from.getMemoryPolicy()));
}
if (from.isSetMigration()) {
to.setMigration(adaptIn(from.getMigration()));
}
if (from.isSetMigrationDowntime()) {
to.setMigrationDowntime(from.getMigrationDowntime());
}
if (from.isSetName()) {
to.setName(from.getName());
}
if (from.isSetOrigin()) {
to.setOrigin(from.getOrigin());
}
if (from.isSetOs()) {
to.setOs(adaptIn(from.getOs()));
}
if (from.isSetRngDevice()) {
to.setRngDevice(adaptIn(from.getRngDevice()));
}
if (from.isSetSerialNumber()) {
to.setSerialNumber(adaptIn(from.getSerialNumber()));
}
if (from.isSetSmallIcon()) {
to.setSmallIcon(adaptIn(from.getSmallIcon()));
}
if (from.isSetSoundcardEnabled()) {
to.setSoundcardEnabled(from.isSoundcardEnabled());
}
if (from.isSetSso()) {
to.setSso(adaptIn(from.getSso()));
}
if (from.isSetStartPaused()) {
to.setStartPaused(from.isStartPaused());
}
if (from.isSetStateless()) {
to.setStateless(from.isStateless());
}
if (from.isSetStatus() && from.getStatus().isSetState()) {
to.setStatus(TemplateStatus.fromValue(from.getStatus().getState()));
}
if (from.isSetStorageDomain()) {
to.setStorageDomain(adaptIn(from.getStorageDomain()));
}
if (from.isSetTimeZone()) {
to.setTimeZone(adaptIn(from.getTimeZone()));
}
if (from.isSetTunnelMigration()) {
to.setTunnelMigration(from.isTunnelMigration());
}
if (from.isSetType()) {
to.setType(VmType.fromValue(from.getType()));
}
if (from.isSetUsb()) {
to.setUsb(adaptIn(from.getUsb()));
}
if (from.isSetVersion()) {
to.setVersion(adaptIn(from.getVersion()));
}
if (from.isSetVirtioScsi()) {
to.setVirtioScsi(adaptIn(from.getVirtioScsi()));
}
if (from.isSetVm()) {
to.setVm(adaptIn(from.getVm()));
}
// new structured "time_zone" element containing the name of the time zone and the UTC offset:
if (from.isSetTimezone() && !to.isSetTimeZone()) {
TimeZone timeZone = new TimeZone();
timeZone.setName(from.getTimezone());
to.setTimeZone(timeZone);
}
return to;
}
use of org.ovirt.engine.api.model.CustomProperties in project ovirt-engine by oVirt.
the class VnicProfileMapper method map.
@Mapping(from = org.ovirt.engine.core.common.businessentities.network.VnicProfile.class, to = VnicProfile.class)
public static VnicProfile map(org.ovirt.engine.core.common.businessentities.network.VnicProfile entity, VnicProfile template) {
VnicProfile model = template != null ? template : new VnicProfile();
if (entity.getId() != null) {
model.setId(entity.getId().toString());
}
if (entity.getName() != null) {
model.setName(entity.getName());
}
if (entity.getDescription() != null) {
model.setDescription(entity.getDescription());
}
if (entity.getNetworkId() != null) {
model.setNetwork(new Network());
model.getNetwork().setId(entity.getNetworkId().toString());
}
model.setPortMirroring(entity.isPortMirroring());
if (entity.getCustomProperties() != null && !entity.getCustomProperties().isEmpty()) {
CustomProperties hooks = new CustomProperties();
hooks.getCustomProperties().addAll(CustomPropertiesParser.parse(DevicePropertiesUtils.getInstance().convertProperties(entity.getCustomProperties()), false));
model.setCustomProperties(hooks);
}
if (entity.getNetworkQosId() != null) {
model.setQos(new Qos());
model.getQos().setId(entity.getNetworkQosId().toString());
}
final VnicPassThrough vnicPassThrough = new VnicPassThrough();
vnicPassThrough.setMode(map(entity.isPassthrough()));
model.setPassThrough(vnicPassThrough);
if (entity.getNetworkFilterId() != null) {
model.setNetworkFilter(new NetworkFilter());
model.getNetworkFilter().setId(entity.getNetworkFilterId().toString());
}
if (entity.isPassthrough()) {
model.setMigratable(entity.isMigratable());
}
return model;
}
Aggregations