Source:
protected void readGeneralData ( ) { org.ovirt.engine.core.compat.backendcompat.XmlNode content = _document.SelectSingleNode ( "//*/Content" ) ; org.ovirt.engine.core.compat.backendcompat.XmlNode node ; vmBase.setVmInit ( new org.ovirt.engine.core.common.businessentities.VmInit ( ) ) ; vmBase.setOvfVersion ( getVersion ( ) ) ; node = content.SelectSingleNode ( OvfProperties.DESCRIPTION ) ; if ( node != null ) { vmBase.setDescription ( node.innerText ) ; } node = content.SelectSingleNode ( OvfProperties.DOMAIN ) ; if ( node != null ) { vmBase.getVmInit ( ) . setDomain ( node.innerText ) ; } node = content.SelectSingleNode ( OvfProperties.CREATION_DATE ) ; if ( node != null ) { java.util.Date creationDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( creationDate != null ) { vmBase.setCreationDate ( creationDate ) ; } } node = content.SelectSingleNode ( OvfProperties.EXPORT_DATE ) ; if ( node != null ) { java.util.Date exportDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( exportDate != null ) { vmBase.setExportDate ( exportDate ) ; } } node = content.SelectSingleNode ( OvfProperties.TIMEZONE ) ; if ( ( node != null ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) ) { vmBase.setTimeZone ( node.innerText ) ; } else { if ( osRepository.isWindows ( vmBase.getOsId ( ) ) ) { vmBase.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } else { vmBase.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultGeneralTimeZone ) ) ; } } node = content.SelectSingleNode ( OvfProperties.DEFAULT_BOOT_SEQUENCE ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDefaultBootSequence ( org.ovirt.engine.core.common.businessentities.BootSequence.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.INITRD_URL ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setInitrdUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.KERNEL_URL ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.KERNEL_PARAMS ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelParams ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.GENERATION ) ; if ( node != null ) { vmBase.setDbGeneration ( java.lang.Long.parseLong ( node.innerText ) ) ; } else { vmBase.setDbGeneration ( 1L ) ; } node = content.SelectSingleNode ( getDefaultDisplayTypeStringRepresentation ( ) ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { defaultDisplayType = org.ovirt.engine.core.common.businessentities.DisplayType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ; vmBase.setDefaultDisplayType ( defaultDisplayType ) ; } } org.ovirt.engine.core.compat.backendcompat.XmlNodeList list = content.SelectNodes ( "Section" ) ; if ( list != null ) { node = getNode ( list , "xsi:type" , "ovf:OperatingSystemSection_Type" ) ; if ( node != null ) { readOsSection ( node ) ; if ( ( ( ! ( osRepository.isLinux ( vmBase.getOsId ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.FeatureSupported.singleQxlPci ( new org.ovirt.engine.core.compat.Version ( getVersion ( ) ) ) ) ) ) || ( ( vmBase.getDefaultDisplayType ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) { vmBase.setSingleQxlPci ( false ) ; } } node = getNode ( list , "xsi:type" , "ovf:VirtualHardwareSection_Type" ) ; if ( node != null ) { readHardwareSection ( node ) ; } node = getNode ( list , "xsi:type" , "ovf:SnapshotsSection_Type" ) ; if ( node != null ) { readSnapshotsSection ( node ) ; } } node = content.SelectSingleNode ( OvfProperties.ORIGIN ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setOrigin ( org.ovirt.engine.core.common.businessentities.OriginType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.VM_TYPE ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVmType ( org.ovirt.engine.core.common.businessentities.VmType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.IS_SMARTCARD_ENABLED ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSmartcardEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.DELETE_PROTECTED ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDeleteProtected ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.SSO_METHOD ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSsoMethod ( org.ovirt.engine.core.common.businessentities.SsoMethod.fromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.TUNNEL_MIGRATION ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setTunnelMigration ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.VNC_KEYBOARD_LAYOUT ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVncKeyboardLayout ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.MIN_ALLOCATED_MEMORY ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMinAllocatedMem ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.IS_STATELESS ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setStateless ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.IS_RUN_AND_PAUSE ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setRunAndPause ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.CREATED_BY_USER_ID ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setCreatedByUserId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.MIGRATION_DOWNTIME ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMigrationDowntime ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.SERIAL_NUMBER_POLICY ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setSerialNumberPolicy ( org.ovirt.engine.core.common.businessentities.SerialNumberPolicy.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.CUSTOM_SERIAL_NUMBER ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setCustomSerialNumber ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.AUTO_STARTUP ) ; if ( node != null ) { vmBase.setAutoStartup ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.PRIORITY ) ; if ( node != null ) { vmBase.setPriority ( java.lang.Integer.parseInt ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.IS_BOOT_MENU_ENABLED ) ; if ( node != null ) { vmBase.setBootMenuEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.IS_SPICE_FILE_TRANSFER_ENABLED ) ; if ( node != null ) { vmBase.setSpiceFileTransferEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.IS_SPICE_COPY_PASTE_ENABLED ) ; if ( node != null ) { vmBase.setSpiceCopyPasteEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } readGeneralData ( content ) ; readVmInit ( content ) ; }

Target:
protected void readGeneralData ( ) { org.ovirt.engine.core.utils.ovf.xml.XmlNode content = _document.SelectSingleNode ( "//*/Content" ) ; org.ovirt.engine.core.utils.ovf.xml.XmlNode node ; vmBase.setVmInit ( new org.ovirt.engine.core.common.businessentities.VmInit ( ) ) ; vmBase.setOvfVersion ( getVersion ( ) ) ; node = content.SelectSingleNode ( OvfProperties.DESCRIPTION ) ; if ( node != null ) { vmBase.setDescription ( node.innerText ) ; } node = content.SelectSingleNode ( OvfProperties.COMMENT ) ; if ( node != null ) { vmBase.setComment ( node.innerText ) ; } node = content.SelectSingleNode ( OvfProperties.DOMAIN ) ; if ( node != null ) { vmBase.getVmInit ( ) . setDomain ( node.innerText ) ; } node = content.SelectSingleNode ( OvfProperties.CREATION_DATE ) ; if ( node != null ) { java.util.Date creationDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( creationDate != null ) { vmBase.setCreationDate ( creationDate ) ; } } node = content.SelectSingleNode ( OvfProperties.EXPORT_DATE ) ; if ( node != null ) { java.util.Date exportDate = org.ovirt.engine.core.utils.ovf.OvfParser.UtcDateStringToLocaDate ( node.innerText ) ; if ( exportDate != null ) { vmBase.setExportDate ( exportDate ) ; } } node = content.SelectSingleNode ( OvfProperties.TIMEZONE ) ; if ( ( node != null ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) ) { vmBase.setTimeZone ( node.innerText ) ; } else { if ( osRepository.isWindows ( vmBase.getOsId ( ) ) ) { vmBase.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultWindowsTimeZone ) ) ; } else { vmBase.setTimeZone ( org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.DefaultGeneralTimeZone ) ) ; } } node = content.SelectSingleNode ( OvfProperties.DEFAULT_BOOT_SEQUENCE ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDefaultBootSequence ( org.ovirt.engine.core.common.businessentities.BootSequence.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.INITRD_URL ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setInitrdUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.KERNEL_URL ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelUrl ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.KERNEL_PARAMS ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setKernelParams ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.GENERATION ) ; if ( node != null ) { vmBase.setDbGeneration ( java.lang.Long.parseLong ( node.innerText ) ) ; } else { vmBase.setDbGeneration ( 1L ) ; } node = content.SelectSingleNode ( getDefaultDisplayTypeStringRepresentation ( ) ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { defaultDisplayType = org.ovirt.engine.core.common.businessentities.DisplayType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ; vmBase.setDefaultDisplayType ( defaultDisplayType ) ; } } org.ovirt.engine.core.utils.ovf.xml.XmlNodeList list = content.SelectNodes ( "Section" ) ; if ( list != null ) { node = getNode ( list , "xsi:type" , "ovf:OperatingSystemSection_Type" ) ; if ( node != null ) { readOsSection ( node ) ; if ( ( ( ! ( osRepository.isLinux ( vmBase.getOsId ( ) ) ) ) || ( ! ( org.ovirt.engine.core.common.FeatureSupported.singleQxlPci ( new org.ovirt.engine.core.compat.Version ( getVersion ( ) ) ) ) ) ) || ( ( vmBase.getDefaultDisplayType ( ) ) != ( org.ovirt.engine.core.common.businessentities.DisplayType.qxl ) ) ) { vmBase.setSingleQxlPci ( false ) ; } } node = getNode ( list , "xsi:type" , "ovf:VirtualHardwareSection_Type" ) ; if ( node != null ) { readHardwareSection ( node ) ; } node = getNode ( list , "xsi:type" , "ovf:SnapshotsSection_Type" ) ; if ( node != null ) { readSnapshotsSection ( node ) ; } } node = content.SelectSingleNode ( OvfProperties.ORIGIN ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setOrigin ( org.ovirt.engine.core.common.businessentities.OriginType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.VM_TYPE ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVmType ( org.ovirt.engine.core.common.businessentities.VmType.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.IS_SMARTCARD_ENABLED ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSmartcardEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.DELETE_PROTECTED ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setDeleteProtected ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.SSO_METHOD ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setSsoMethod ( org.ovirt.engine.core.common.businessentities.SsoMethod.fromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.TUNNEL_MIGRATION ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setTunnelMigration ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.VNC_KEYBOARD_LAYOUT ) ; if ( node != null ) { if ( ! ( org.apache.commons.lang.StringUtils.isEmpty ( node.innerText ) ) ) { vmBase.setVncKeyboardLayout ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.MIN_ALLOCATED_MEMORY ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMinAllocatedMem ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.IS_STATELESS ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setStateless ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.IS_RUN_AND_PAUSE ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setRunAndPause ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.CREATED_BY_USER_ID ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setCreatedByUserId ( org.ovirt.engine.core.compat.Guid.createGuidFromString ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.MIGRATION_DOWNTIME ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setMigrationDowntime ( java.lang.Integer.parseInt ( node.innerText ) ) ; } } node = content.SelectSingleNode ( OvfProperties.SERIAL_NUMBER_POLICY ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setSerialNumberPolicy ( org.ovirt.engine.core.common.businessentities.SerialNumberPolicy.forValue ( java.lang.Integer.parseInt ( node.innerText ) ) ) ; } } node = content.SelectSingleNode ( OvfProperties.CUSTOM_SERIAL_NUMBER ) ; if ( node != null ) { if ( org.apache.commons.lang.StringUtils.isNotEmpty ( node.innerText ) ) { vmBase.setCustomSerialNumber ( node.innerText ) ; } } node = content.SelectSingleNode ( OvfProperties.AUTO_STARTUP ) ; if ( node != null ) { vmBase.setAutoStartup ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.PRIORITY ) ; if ( node != null ) { vmBase.setPriority ( java.lang.Integer.parseInt ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.IS_BOOT_MENU_ENABLED ) ; if ( node != null ) { vmBase.setBootMenuEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.IS_SPICE_FILE_TRANSFER_ENABLED ) ; if ( node != null ) { vmBase.setSpiceFileTransferEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } node = content.SelectSingleNode ( OvfProperties.IS_SPICE_COPY_PASTE_ENABLED ) ; if ( node != null ) { vmBase.setSpiceCopyPasteEnabled ( java.lang.Boolean.parseBoolean ( node.innerText ) ) ; } readGeneralData ( content ) ; readVmInit ( content ) ; }