auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > searchDirectoryGroups ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } java.lang.String directoryName = data.getDomain ( ) ; org.ovirt.engine.core.extensions.mgr.ExtensionProxy authz = org.ovirt.engine.core.utils.extensionsmgr.EngineExtensionsManager.getInstance ( ) . getExtensionByName ( directoryName ) ; if ( authz == null ) { return java.util.Collections.emptyList ( ) ; } return org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByQuery ( authz , data.getQuery ( ) ) ; }

Target:
private java.util.List < org.ovirt.engine.core.aaa.DirectoryGroup > searchDirectoryGroups ( ) { org.ovirt.engine.core.bll.QueryData data = initQueryData ( true ) ; if ( data == null ) { return java.util.Collections.emptyList ( ) ; } org.ovirt.engine.core.extensions.mgr.ExtensionProxy authz = org.ovirt.engine.core.aaa.AuthenticationProfileRepository.getInstance ( ) . getProfile ( data.getDomain ( ) ) . getAuthz ( ) ; if ( authz == null ) { return java.util.Collections.emptyList ( ) ; } return org.ovirt.engine.core.aaa.AuthzUtils.findGroupsByQuery ( authz , data.getQuery ( ) ) ; }
Source:
public static void getHostPublicKey ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.lang.String ) ( source ) ) : "" ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetServerSSHPublicKey , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.StorageDomain ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setVmIp ( "111" ) ; dao.updateAll ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmDynamic [ ] { existingVm , existingVm2 } ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }

Target:
public void testUpdateAll ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.VmDynamic existingVm2 = dao.get ( new org.ovirt.engine.core.compat.Guid ( "77296e00-0cad-4e5a-9299-008a7b6f4356" ) ) ; existingVm.setStatus ( VMStatus.Down ) ; existingVm2.setVmIp ( "111" ) ; existingVm2.setVmFQDN ( "localhost.localdomain" ) ; dao.updateAll ( java.util.Arrays.asList ( new org.ovirt.engine.core.common.businessentities.VmDynamic [ ] { existingVm , existingVm2 } ) ) ; org.junit.Assert.assertEquals ( existingVm , dao.get ( existingVm.getId ( ) ) ) ; org.junit.Assert.assertEquals ( existingVm2 , dao.get ( existingVm2.getId ( ) ) ) ; }
Source:
public void testDedicatedHostNotExist ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; assertCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_DEDICATED_VDS_NOT_IN_SAME_CLUSTER ) ; }

Target:
public void testDedicatedHostNotExistOrNotSameCluster ( ) { prepareVmToPassCanDoAction ( ) ; org.mockito.Mockito.doReturn ( vdsDAO ) . when ( command ) . getVdsDAO ( ) ; org.mockito.Mockito.doReturn ( false ) . when ( command ) . isDedicatedVdsExistOnSameCluster ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VmBase.class ) , org.mockito.Matchers.any ( java.util.ArrayList.class ) ) ; vmStatic.setDedicatedVmForVds ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.junit.Assert.assertFalse ( "canDoAction should have failed with invalid dedicated host." , command.canDoAction ( ) ) ; }
Source:
private boolean hasUpServer ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { if ( ( getClusterUtils ( ) . hasMultipleServers ( cluster.getId ( ) ) ) && ( ( getClusterUtils ( ) . getUpServer ( cluster.getId ( ) ) ) == null ) ) { addCanDoActionMessage ( java.lang.String.format ( "$clusterName %1$s" , cluster.getname ( ) ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; return false ; } return true ; }

Target:
private void addNoUpServerMessage ( org.ovirt.engine.core.common.businessentities.VDSGroup cluster ) { addCanDoActionMessage ( java.lang.String.format ( "$clusterName %1$s" , cluster.getname ( ) ) ) ; addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_NO_UP_SERVER_FOUND ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageConnection conn ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections entity = org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( conn , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getStorageConnectionIds ( ) . add ( entity.getId ( ) ) ; return performAction ( VdcActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.StorageConnection conn ) { org.ovirt.engine.core.common.businessentities.StorageServerConnections entity = org.ovirt.engine.api.restapi.types.StorageDomainMapper.map ( conn , null ) ; org.ovirt.engine.core.common.businessentities.IscsiBond iscsiBond = getIscsiBond ( ) ; iscsiBond.getStorageConnectionIds ( ) . add ( entity.getId ( ) ) ; return performAction ( ActionType.EditIscsiBond , new org.ovirt.engine.core.common.action.EditIscsiBondParameters ( iscsiBond ) ) ; }
Source:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setName ( "testVm" ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) , org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; }

Target:
protected org.ovirt.engine.core.common.action.ImportVmParameters createParameters ( ) { final org.ovirt.engine.core.common.businessentities.VM v = createVM ( ) ; v.setName ( "testVm" ) ; return new org.ovirt.engine.core.common.action.ImportVmParameters ( v , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) , org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; }
Source:
public static org.ovirt.engine.core.vdsbroker.irsbroker.IIrsServer createIrsServer ( java.lang.String hostname , int port , int clientTimeOut , int connectionTimeOut , int clientRetries , int heartbeat ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIIrsServer ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( hostname , port , connectionTimeOut , clientTimeOut , clientRetries , heartbeat , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.EncryptHostCommunication ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.VdsmSSLProtocol ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.EventProcessingPoolSize ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.IrsRequestQueueName ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.IrsResponseQueueName ) , null ) ) ; }

Target:
public static org.ovirt.engine.core.vdsbroker.irsbroker.IIrsServer createIrsServer ( java.lang.String hostname , int port , int clientTimeOut , int connectionTimeOut , int clientRetries , int heartbeat , java.util.concurrent.ScheduledExecutorService executorService ) { return new org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcIIrsServer ( org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createStompClient ( hostname , port , connectionTimeOut , clientTimeOut , clientRetries , heartbeat , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.EncryptHostCommunication ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.VdsmSSLProtocol ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.EventProcessingPoolSize ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.IrsRequestQueueName ) , org.ovirt.engine.core.common.config.Config.getValue ( ConfigValues.IrsResponseQueueName ) , null , executorService ) ) ; }
Source:
public void compensate ( ) { for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( parameters.getImageId ( ) , ImageStatus.OK ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( parameters.getDestinationImageId ( ) , ImageStatus.OK ) ; } }

Target:
private java.util.LinkedHashSet < org.ovirt.engine.core.compat.Guid > getMovedDiskIds ( ) { if ( ( movedVmDiskIds ) == null ) { movedVmDiskIds = new java.util.LinkedHashSet < > ( ) ; for ( org.ovirt.engine.core.common.action.LiveMigrateDiskParameters parameters : enclosingCommand.getParameters ( ) . getParametersList ( ) ) { movedVmDiskIds.add ( parameters.getImageGroupID ( ) ) ; } } return movedVmDiskIds ; }
Source:
public void getGlusterVolumeGeoRepStatusForMasterVolume ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid masterVolumeId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterGeoRepSession > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterVolumeGeoRepSessions , new org.ovirt.engine.core.common.queries.IdQueryParameters ( masterVolumeId ) , aQuery ) ; }

Target:
public void getGlusterHooks ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? source : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.gluster.GlusterHookEntity > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetGlusterHooks , new org.ovirt.engine.core.common.queries.gluster.GlusterParameters ( clusterId ) , aQuery ) ; }
Source:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > command = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }

Target:
public void validateSpaceNotWithinThreshold ( ) throws java.lang.Exception { org.ovirt.engine.core.bll.AddVmCommand < org.ovirt.engine.core.common.action.AddVmParameters > command = setupCanAddVmTests ( 0 , 0 ) ; org.mockito.Mockito.doReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN ) ) . when ( storageDomainValidator ) . isDomainWithinThresholds ( ) ; org.mockito.Mockito.doReturn ( storageDomainValidator ) . when ( command ) . createStorageDomainValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.StorageDomain.class ) ) ; org.junit.Assert.assertFalse ( command.validateSpaceRequirements ( ) ) ; }
Source:
public void Executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; dataCenterGuideModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }

Target:
public void executed ( org.ovirt.engine.ui.uicompat.FrontendActionAsyncResult result ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( result.getState ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase vdcReturnValueBase = result.getReturnValue ( ) ; dataCenterGuideModel.storageDomain.setStorage ( ( ( java.lang.String ) ( vdcReturnValueBase.getActionReturnValue ( ) ) ) ) ; }
Source:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }

Target:
public void getVMsWithVNumaNodesByClusterId ( org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery , org.ovirt.engine.core.compat.Guid clusterId ) { asyncQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VM > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetAllVmsWithNumaByVdsGroupId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( clusterId ) , asyncQuery ) ; }
Source:
public void getDiskList ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.storage.DiskImage > ( ) ; } } ; org.ovirt.engine.core.common.queries.SearchParameters searchParams = new org.ovirt.engine.core.common.queries.SearchParameters ( "Disks:" , org.ovirt.engine.core.common.interfaces.SearchType.Disk ) ; searchParams.setMaxCount ( 9999 ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public void getVnicProfilesByDcId ( org.ovirt.engine.ui.frontend.AsyncQuery < java.util.List < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > > aQuery , org.ovirt.engine.core.compat.Guid dcId ) { if ( ( aQuery.converterCallback ) == null ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.ListConverter < > ( ) ; } org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByDataCenterId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( dcId ) , aQuery ) ; }
Source:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = getAsyncTaskDao ( ) . get ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.AsyncTaskManager.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } return null ; }

Target:
public java.lang.Void runInTransaction ( ) { for ( org.ovirt.engine.core.compat.Guid asyncTaskId : getReturnValue ( ) . getTaskPlaceHolderIdList ( ) ) { org.ovirt.engine.core.common.businessentities.AsyncTasks task = org.ovirt.engine.core.bll.tasks.TaskManagerUtil.getAsyncTaskFromDb ( asyncTaskId ) ; if ( ( task != null ) && ( org.ovirt.engine.core.compat.Guid.isNullOrEmpty ( task.getVdsmTaskId ( ) ) ) ) { org.ovirt.engine.core.bll.tasks.TaskManagerUtil.removeTaskFromDbByTaskId ( task.getTaskId ( ) ) ; } } return null ; }
Source:
public void testSave ( ) { newVmStatistics.setId ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; newVmStatistics.setMigrationProgressPercent ( 0 ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }

Target:
public void testSave ( ) { newVmStatistics.setId ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; newVmStatistics.setCpuSys ( 22.0 ) ; newVmStatistics.setCpuUser ( 35.0 ) ; newVmStatistics.setUsageCpuPercent ( 44 ) ; newVmStatistics.setUsageMemPercent ( 67 ) ; newVmStatistics.setDisksUsage ( "disk_usage" ) ; newVmStatistics.setGuestMemoryBuffered ( 32L ) ; newVmStatistics.setGuestMemoryCached ( 34L ) ; dao.save ( newVmStatistics ) ; org.ovirt.engine.core.common.businessentities.VmStatistics stats = dao.get ( org.ovirt.engine.core.dao.VmStatisticsDaoTest.NEW_VM_ID ) ; org.junit.Assert.assertNotNull ( stats ) ; org.junit.Assert.assertEquals ( newVmStatistics , stats ) ; }
Source:
public org.ovirt.engine.core.bll.ValidationResult sriovFeatureSupported ( ) { org.ovirt.engine.core.common.businessentities.VDS host = getDbFacade ( ) . getVdsDao ( ) . get ( getNic ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version clusterCompVer = host.getVdsGroupCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED ) . unless ( org.ovirt.engine.core.common.FeatureSupported.sriov ( clusterCompVer ) ) ; }

Target:
public org.ovirt.engine.core.bll.ValidationResult sriovFeatureSupported ( ) { org.ovirt.engine.core.common.businessentities.VDS host = getDbFacade ( ) . getVdsDao ( ) . get ( getNic ( ) . getVdsId ( ) ) ; org.ovirt.engine.core.compat.Version clusterCompVer = host.getClusterCompatibilityVersion ( ) ; return org.ovirt.engine.core.bll.ValidationResult.failWith ( EngineMessage.ACTION_TYPE_FAILED_SRIOV_FEATURE_NOT_SUPPORTED ) . unless ( org.ovirt.engine.core.common.FeatureSupported.sriov ( clusterCompVer ) ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc sendHcCmdToDesktop ( java.lang.String vmId , java.lang.String hcCommand ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.sendHcCmdToDesktop ( vmId , hcCommand ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc diskSizeExtend ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > diskParams , java.lang.String newSize ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.diskSizeExtend ( vmId , diskParams , newSize ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.ImageSizeReturnForXmlRpc ( xmlRpcReturnValue ) ; return wrapper ; } catch ( java.lang.reflect.UndeclaredThrowableException ute ) { throw new org.ovirt.engine.core.vdsbroker.xmlrpc.XmlRpcRunTimeException ( ute ) ; } }
Source:
private java.lang.String getTranslatedStorageError ( java.lang.String errorCode ) { java.lang.String translatedError = errorCode ; org.ovirt.engine.core.common.errors.EngineError error = org.ovirt.engine.core.common.errors.EngineError.forValue ( java.lang.Integer.parseInt ( errorCode ) ) ; if ( error != null ) { translatedError = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . TranslateErrorTextSingle ( error.toString ( ) ) ; } return translatedError ; }

Target:
private java.lang.String getTranslatedStorageError ( java.lang.String errorCode ) { java.lang.String translatedError = errorCode ; org.ovirt.engine.core.common.errors.EngineError error = org.ovirt.engine.core.common.errors.EngineError.forValue ( java.lang.Integer.parseInt ( errorCode ) ) ; if ( error != null ) { translatedError = org.ovirt.engine.core.bll.Backend.getInstance ( ) . getVdsErrorsTranslator ( ) . translateErrorTextSingle ( error.toString ( ) ) ; } return translatedError ; }
Source:
public void init ( ) { broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( getProfileName ( ) ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Kerberos/LDAP authentication (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; }

Target:
public void init ( ) { broker = org.ovirt.engine.core.bll.adbroker.LdapFactory.getInstance ( getProfileName ( ) ) ; context.put ( ExtensionProperties.AUTHOR , "The oVirt Project" ) ; context.put ( ExtensionProperties.EXTENSION_NAME , "Internal Kerberos/LDAP authentication (Built-in)" ) ; context.put ( ExtensionProperties.LICENSE , "ASL 2.0" ) ; context.put ( ExtensionProperties.HOME , "http://www.ovirt.org" ) ; context.put ( ExtensionProperties.VERSION , "N/A" ) ; if ( ( org.ovirt.engine.core.aaa.provisional.ProvisionalAuthenticator.passwordChangeMsgPerDomain ) == null ) { synchronized ( org.ovirt.engine.core.aaa.provisional.ProvisionalAuthenticator.class ) { if ( ( org.ovirt.engine.core.aaa.provisional.ProvisionalAuthenticator.passwordChangeMsgPerDomain ) == null ) { org.ovirt.engine.core.aaa.provisional.ProvisionalAuthenticator.passwordChangeMsgPerDomain = new java.util.HashMap < > ( ) ; java.lang.String changePasswordUrl = org.ovirt.engine.core.common.config.Config.< java.lang.String > getValue ( ConfigValues.ChangePasswordMsg ) ; java.lang.String [ ] pairs = changePasswordUrl.split ( "," ) ; for ( java.lang.String pair : pairs ) { java.lang.String [ ] pairParts = pair.split ( ":" , 2 ) ; if ( ( pairParts.length ) >= 2 ) { try { org.ovirt.engine.core.aaa.provisional.ProvisionalAuthenticator.passwordChangeMsgPerDomain.put ( pairParts [ 0 ] , java.net.URLDecoder.decode ( pairParts [ 1 ] , "UTF-8" ) ) ; } catch ( java.io.UnsupportedEncodingException e ) { throw new org.ovirt.engine.api.extensions.AAAExtensionException ( org.ovirt.engine.api.extensions.AAAExtensionException.AAAExtensionError.INVALID_CONFIGURATION , ( "error in obtaining the password change message or url for " + ( pairParts [ 0 ] ) ) ) ; } } } } } } java.lang.String changePasswordMsgOrUrl = org.ovirt.engine.core.aaa.provisional.ProvisionalAuthenticator.passwordChangeMsgPerDomain.get ( getProfileName ( ) ) ; if ( changePasswordMsgOrUrl != null ) { org.ovirt.engine.core.aaa.provisional.ExtensionProperties key = ( containsURL ( changePasswordMsgOrUrl ) ) ? ExtensionProperties.AAA_CHANGE_EXPIRED_PASSWORD_URL : ExtensionProperties.AAA_CHANGE_EXPIRED_PASSWORD_MSG ; context.put ( key , changePasswordMsgOrUrl ) ; } }
Source:
public void getVmConfigurationBySnapshot ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid snapshotSourceId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source != null ? ( ( org.ovirt.engine.core.common.businessentities.VM ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmConfigurationBySnapshot , new org.ovirt.engine.core.common.queries.IdQueryParameters ( snapshotSourceId ) . withoutRefresh ( ) , aQuery ) ; }

Target:
public void getNextAvailableDiskAliasNameByVMId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetNextAvailableDiskAliasNameByVMId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTask dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = org.ovirt.engine.core.bll.CommandsFactory.createCommand ( actionType , parameters ) ; command.getContext ( ) . withExecutionContext ( context ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }

Target:
public org.ovirt.engine.core.common.action.VdcReturnValueBase endAction ( org.ovirt.engine.core.bll.tasks.interfaces.SPMTask task , org.ovirt.engine.core.bll.job.ExecutionContext context ) { org.ovirt.engine.core.common.businessentities.AsyncTask dbAsyncTask = task.getParameters ( ) . getDbAsyncTask ( ) ; org.ovirt.engine.core.common.action.VdcActionType actionType = getEndActionType ( dbAsyncTask ) ; org.ovirt.engine.core.common.action.VdcActionParametersBase parameters = dbAsyncTask.getActionParameters ( ) ; org.ovirt.engine.core.bll.CommandBase < ? > command = buildCommand ( actionType , parameters , context , coco.getCommandStatus ( dbAsyncTask.getCommandId ( ) ) ) ; return new org.ovirt.engine.core.bll.tasks.DecoratedCommand ( command ) . endAction ( ) ; }
Source:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; dataCenterGuideModel.isoStorageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }

Target:
public void onSuccess ( java.lang.Object target , java.lang.Object returnValue ) { org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel dataCenterGuideModel = ( ( org.ovirt.engine.ui.uicommonweb.models.datacenters.DataCenterGuideModel ) ( target ) ) ; java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > storageDomains = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.StorageDomain > ) ( returnValue ) ) ; dataCenterGuideModel.isoStorageDomains = storageDomains ; dataCenterGuideModel.updateOptionsNonLocalFS ( ) ; }
Source:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; }

Target:
public void postDataCenterWithClusterSelectedItemChanged ( ) { updateDefaultHost ( ) ; updateCustomPropertySheet ( ) ; updateMinAllocatedMemory ( ) ; updateNumOfSockets ( ) ; if ( ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) != null ) { org.ovirt.engine.core.common.businessentities.VmTemplate template = ( ( org.ovirt.engine.core.common.businessentities.VmTemplate ) ( getModel ( ) . getTemplate ( ) . getSelectedItem ( ) ) ) ; updateQuotaByCluster ( template.getQuotaId ( ) , template.getQuotaName ( ) ) ; } updateCpuPinningVisibility ( ) ; updateTemplate ( ) ; initNetworkInterfaces ( networkBehavior , null ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool entity = map ( dataCenter ) ; return performCreation ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class ) ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.DataCenter dataCenter ) { validateParameters ( dataCenter , "name" , "storageType" ) ; validateEnums ( org.ovirt.engine.api.model.DataCenter.class , dataCenter ) ; validateEnum ( org.ovirt.engine.api.model.StorageType.class , dataCenter.getStorageType ( ) . toUpperCase ( ) ) ; org.ovirt.engine.core.common.businessentities.storage_pool entity = map ( dataCenter ) ; return performCreation ( VdcActionType.AddEmptyStoragePool , new org.ovirt.engine.core.common.action.StoragePoolManagementParameter ( entity ) , new org.ovirt.engine.api.restapi.resource.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetStoragePoolById , org.ovirt.engine.core.common.queries.StoragePoolQueryParametersBase.class ) ) ; }
Source:
public static java.lang.String formatReturnValues ( java.util.List < org.ovirt.engine.core.common.action.VdcReturnValueBase > values ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.action.VdcReturnValueBase val : values ) { msg.append ( val.getFault ( ) . getMessage ( ) ) ; } return msg.toString ( ) ; }

Target:
public static java.lang.String formatReturnValues ( java.util.List < org.ovirt.engine.core.common.action.ActionReturnValue > values ) { java.lang.StringBuilder msg = new java.lang.StringBuilder ( ) ; for ( org.ovirt.engine.core.common.action.ActionReturnValue val : values ) { msg.append ( val.getFault ( ) . getMessage ( ) ) ; } return msg.toString ( ) ; }
Source:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = dbFacade.getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getoption_value ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }

Target:
private org.ovirt.engine.core.common.action.VdcReturnValueBase notAllowToRunAction ( org.ovirt.engine.core.common.action.VdcActionType actionType ) { java.lang.String mode = dbFacade.getVdcOptionDao ( ) . getByNameAndVersion ( ConfigValues.EngineMode.name ( ) , ConfigCommon.defaultConfigurationVersion ) . getOptionValue ( ) ; if ( EngineWorkingMode.MAINTENANCE.name ( ) . equalsIgnoreCase ( mode ) ) { return getErrorCommandReturnValue ( EngineMessage.ENGINE_IS_RUNNING_IN_MAINTENANCE_MODE ) ; } else if ( EngineWorkingMode.PREPARE.name ( ) . equalsIgnoreCase ( mode ) ) { return notAllowedInPrepForMaintMode ( actionType ) ; } return null ; }
Source:
public void testUpdateLibrbdVersion ( ) { org.ovirt.engine.core.compat.RpmVersion librbdVersion = new org.ovirt.engine.core.compat.RpmVersion ( "librbd1-0.80.9-1.fc21.x86_64_updated" ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic before = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertNotEquals ( librbdVersion , before.getLibrbdVersion ( ) ) ; before.setLibrbdVersion ( librbdVersion ) ; dao.update ( before ) ; org.ovirt.engine.core.common.businessentities.VdsDynamic after = dao.get ( FixturesTool.VDS_GLUSTER_SERVER2 ) ; org.junit.Assert.assertEquals ( librbdVersion , after.getLibrbdVersion ( ) ) ; }

Target:
protected void updateExistingEntity ( ) { existingEntity.setGlusterVersion ( new org.ovirt.engine.core.compat.RpmVersion ( "glusterfs-3.4.0.34.1u2rhs-1.el6rhs" ) ) ; existingEntity.setLibrbdVersion ( new org.ovirt.engine.core.compat.RpmVersion ( "librbd1-0.80.9-1.fc21.x86_64_updated" ) ) ; existingEntity.getReportedDnsResolverConfiguration ( ) . setNameServers ( java.util.Collections.singletonList ( new org.ovirt.engine.core.common.businessentities.network.NameServer ( "1.1.1.1" ) ) ) ; }
Source:
protected boolean validate ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) . getExecutionContext ( ) , true ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }

Target:
protected boolean validateCreateImage ( ) { org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = org.ovirt.engine.core.bll.tasks.CommandHelper.canDoAction ( VdcActionType.AddDisk , getAddDiskParameters ( ) , org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getContext ( ) . clone ( ) . getExecutionContext ( ) , true ) ; org.ovirt.engine.core.bll.storage.disk.image.UploadDiskImageCommand.getReturnValue ( ) . setValidationMessages ( returnValue.getValidationMessages ( ) ) ; return returnValue.isValid ( ) ; }
Source:
public void testGetNextConfiguration ( ) throws java.lang.Exception { setUriInfo ( addMatrixParameterExpectations ( setUpBasicUriExpectations ( ) , BackendVmResource.NEXT_RUN ) ) ; setUpGetEntityNextRunExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }

Target:
public void testGetNextConfiguration ( ) throws java.lang.Exception { setUriInfo ( addMatrixParameterExpectations ( setUpBasicUriExpectations ( ) , BackendVmResource.NEXT_RUN ) ) ; setUpGetEntityNextRunExpectations ( ) ; setUpGetPayloadExpectations ( 0 , 1 ) ; setUpGetBallooningExpectations ( ) ; setUpGetNextRunGraphicsExpectations ( 1 ) ; setUpGetCertuficateExpectations ( ) ; control.replay ( ) ; org.ovirt.engine.api.model.Vm response = resource.get ( ) ; verifyModel ( response , 0 ) ; verifyCertificate ( response ) ; }
Source:
private void _writeFile ( java.io.File file , java.lang.String content , boolean executable ) throws java.io.IOException { java.io.File f = file.getParentFile ( ) ; if ( f == null ) { throw new java.io.IOException ( ( "File not found " + f ) ) ; } if ( ! ( f.mkdirs ( ) ) ) { } try ( java.io.OutputStream os = new java.io.FileOutputStream ( file ) ) { os.write ( content.getBytes ( "UTF-8" ) ) ; file.setExecutable ( executable ) ; } }

Target:
private void writeFile ( java.io.File file , java.lang.String content , boolean executable ) throws java.io.IOException { java.io.File f = file.getParentFile ( ) ; if ( f == null ) { throw new java.io.IOException ( ( "File not found " + f ) ) ; } if ( ! ( f.mkdirs ( ) ) ) { } try ( java.io.OutputStream os = new java.io.FileOutputStream ( file ) ) { os.write ( content.getBytes ( "UTF-8" ) ) ; file.setExecutable ( executable ) ; } }
Source:
protected void handleCopyResult ( org.ovirt.engine.core.common.businessentities.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcActionParametersBase parameters , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalTaskIdList ( ) ) ; newDiskImages.add ( copiedDiskImage ) ; } }

Target:
private void handleCopyResult ( org.ovirt.engine.core.common.businessentities.DiskImage srcDiskImage , org.ovirt.engine.core.common.businessentities.DiskImage copiedDiskImage , org.ovirt.engine.core.common.action.VdcReturnValueBase result ) { if ( ! ( result.getSucceeded ( ) ) ) { throw new org.ovirt.engine.core.common.errors.VdcBLLException ( org.ovirt.engine.core.common.errors.VdcBllErrors.VolumeCreationError ) ; } else { org.ovirt.engine.core.bll.ImagesHandler.addDiskImageWithNoVmDevice ( copiedDiskImage ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getTaskIdList ( ) . addAll ( result.getInternalVdsmTaskIdList ( ) ) ; org.ovirt.engine.core.bll.AddVmAndCloneImageCommand.getSrcDiskIdToTargetDiskIdMapping ( ) . put ( srcDiskImage.getId ( ) , copiedDiskImage.getId ( ) ) ; } }
Source:
public void getClusterListByName ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String name ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.Search , new org.ovirt.engine.core.common.queries.SearchParameters ( ( ( "Cluster: name=" + name ) + " sortby name" ) , org.ovirt.engine.core.common.interfaces.SearchType.Cluster ) , aQuery ) ; }

Target:
public void getPoolById ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid poolId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmPoolById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( poolId ) , aQuery ) ; }
Source:
public void OnRemove ( ) { for ( java.lang.Object item : getSelectedItems ( ) ) { org.ovirt.engine.core.common.businessentities.Role role = ( ( org.ovirt.engine.core.common.businessentities.Role ) ( item ) ) ; org.ovirt.engine.ui.frontend.Frontend.RunAction ( VdcActionType.RemoveRole , new org.ovirt.engine.core.common.action.RolesParameterBase ( role.getId ( ) ) ) ; } Cancel ( ) ; getSearchCommand ( ) . Execute ( ) ; }

Target:
private void searchAllRoles ( ) { setItemsFilter ( null ) ; getSearchCommand ( ) . execute ( ) ; }
Source:
public void getVnicProfilesByNetworkId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid networkId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.VnicProfileView > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVnicProfilesByNetworkId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( networkId ) , aQuery ) ; }

Target:
public void getVmGuestAgentInterfacesByVmId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid vmId ) { aQuery.converterCallback = new org.ovirt.engine.ui.frontend.IAsyncConverter ( ) { @ java.lang.Override public java.lang.Object Convert ( java.lang.Object source , org.ovirt.engine.ui.frontend.AsyncQuery _asyncQuery ) { if ( source == null ) { return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VmGuestAgentInterface > ( ) ; } return source ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVmGuestAgentInterfacesByVmId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setUsedDiskSize ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.USED_SPACE_GB ) ; sd.setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_POOLD_ID ) ; sd.setId ( storageDomainId ) ; return sd ; }

Target:
private static org.ovirt.engine.core.common.businessentities.StorageDomain createStorageDomain ( int availableSpace , org.ovirt.engine.core.compat.Guid storageDomainId ) { org.ovirt.engine.core.common.businessentities.StorageDomain sd = new org.ovirt.engine.core.common.businessentities.StorageDomain ( ) ; sd.setStorageDomainType ( StorageDomainType.Master ) ; sd.setStatus ( StorageDomainStatus.Active ) ; sd.setAvailableDiskSize ( availableSpace ) ; sd.setStorageType ( StorageType.ISCSI ) ; sd.setStoragePoolId ( org.ovirt.engine.core.bll.RemoveSnapshotCommandTest.STORAGE_POOLD_ID ) ; sd.setId ( storageDomainId ) ; return sd ; }
Source:
public void PostUpdateVmTemplate ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; model.StopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { Cancel ( ) ; } }

Target:
public void postUpdateVmTemplate ( org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue ) { org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel model = ( ( org.ovirt.engine.ui.uicommonweb.models.vms.UnitVmModel ) ( getWindow ( ) ) ) ; model.stopProgress ( ) ; if ( ( returnValue != null ) && ( returnValue.getSucceeded ( ) ) ) { cancel ( ) ; } }
Source:
protected boolean canDoAction ( ) { org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.CopyImageGroupCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( disk != null ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ; return validate ( diskValidator.validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ; } return false ; }

Target:
protected boolean canDoAction ( ) { if ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . isImportEntity ( ) ) { return true ; } org.ovirt.engine.core.common.businessentities.storage.Disk disk = org.ovirt.engine.core.bll.CopyImageGroupCommand.getDiskDao ( ) . get ( org.ovirt.engine.core.bll.CopyImageGroupCommand.getParameters ( ) . getImageGroupID ( ) ) ; if ( disk != null ) { org.ovirt.engine.core.bll.validator.storage.DiskValidator diskValidator = new org.ovirt.engine.core.bll.validator.storage.DiskValidator ( disk ) ; return validate ( diskValidator.validateUnsupportedDiskStorageType ( DiskStorageType.LUN , DiskStorageType.CINDER ) ) ; } return false ; }
Source:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) ) , action ) ; }

Target:
public javax.ws.rs.core.Response deactivate ( org.ovirt.engine.api.model.Action action ) { boolean stopGlusterService = org.ovirt.engine.api.common.util.ParametersHelper.getBooleanParameter ( httpHeaders , uriInfo , org.ovirt.engine.api.restapi.resource.BackendHostResource.STOP_GLUSTER_SERVICE , true , false ) ; return doAction ( VdcActionType.MaintenanceNumberOfVdss , new org.ovirt.engine.core.common.action.MaintenanceNumberOfVdssParameters ( asList ( guid ) , false , ( action.isSetReason ( ) ? action.getReason ( ) : null ) , stopGlusterService ) , action ) ; }
Source:
public org.ovirt.engine.api.model.Disks list ( ) { org.ovirt.engine.api.model.Disks disks = new org.ovirt.engine.api.model.Disks ( ) ; if ( parent.getSnapshot ( ) . isVmConfigurationAvailable ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = parent.collection.getVmPreview ( parent.get ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.DiskImage disk : vm.getDiskList ( ) ) { org.ovirt.engine.api.model.Disk d = org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ; map ( d , parent.id ) ; disks.getDisks ( ) . add ( d ) ; } } return disks ; }

Target:
public org.ovirt.engine.api.model.Disks list ( ) { org.ovirt.engine.api.model.Disks disks = new org.ovirt.engine.api.model.Disks ( ) ; if ( parent.getSnapshot ( ) . isVmConfigurationAvailable ( ) ) { org.ovirt.engine.core.common.businessentities.VM vm = parent.collection.getVmPreview ( parent.get ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.storage.DiskImage disk : vm.getDiskList ( ) ) { org.ovirt.engine.api.model.Disk d = org.ovirt.engine.api.restapi.types.DiskMapper.map ( disk , null ) ; map ( d , parent.id ) ; disks.getDisks ( ) . add ( d ) ; } } return disks ; }