auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void endWithFailure ( ) { enclosingCommand.getParameters ( ) . getDiskImage ( ) . setImageStatus ( ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( enclosingCommand.getParameters ( ) . getDiskImage ( ) . getImageId ( ) , enclosingCommand.getParameters ( ) . getDiskImage ( ) . getImageStatus ( ) ) ; compensate ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }

Target:
public void endWithFailure ( ) { enclosingCommand.getParameters ( ) . getDiskImage ( ) . setImageStatus ( ImageStatus.ILLEGAL ) ; org.ovirt.engine.core.bll.storage.disk.image.ImagesHandler.updateImageStatus ( enclosingCommand.getParameters ( ) . getDiskImage ( ) . getImageId ( ) , enclosingCommand.getParameters ( ) . getDiskImage ( ) . getImageStatus ( ) ) ; compensate ( ) ; enclosingCommand.getReturnValue ( ) . setSucceeded ( true ) ; }
Source:
private void refreshGlusterStorageDevices ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { backend.runInternalAction ( VdcActionType.SyncStorageDevices , new org.ovirt.engine.core.common.action.gluster.SyncGlusterStorageDevicesParameter ( vds.getId ( ) , true ) ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.error ( "Could not refresh storage devices from gluster host '{}'" , vds.getName ( ) ) ; } }

Target:
private void refreshGlusterStorageDevices ( org.ovirt.engine.core.common.businessentities.VDS vds ) { try { backend.runInternalAction ( ActionType.SyncStorageDevices , new org.ovirt.engine.core.common.action.gluster.SyncGlusterStorageDevicesParameter ( vds.getId ( ) , true ) ) ; } catch ( org.ovirt.engine.core.common.errors.EngineException e ) { log.error ( "Could not refresh storage devices from gluster host '{}'" , vds.getName ( ) ) ; } }
Source:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.permissions > permissionColumn = new org.ovirt.engine.ui.common.widget.table.column.ObjectNameColumn < org.ovirt.engine.core.common.businessentities.permissions > ( ) { @ java.lang.Override protected java.lang.Object [ ] getRawValue ( org.ovirt.engine.core.common.businessentities.permissions object ) { return new java.lang.Object [ ] { object.getObjectType ( ) , object.getObjectName ( ) , getModel ( ) . getEntity ( ) , object.getObjectId ( ) } ; } } ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionWithInheritedPermissionListModelTable.getTable ( ) . addColumn ( permissionColumn , constants.inheritedPermission ( ) ) ; }

Target:
public void initTable ( org.ovirt.engine.ui.common.CommonApplicationConstants constants ) { super . initTable ( constants ) ; org.ovirt.engine.ui.common.widget.table.column.TextColumnWithTooltip < org.ovirt.engine.core.common.businessentities.permissions > permissionColumn = new org.ovirt.engine.ui.common.widget.table.column.ObjectNameColumn < org.ovirt.engine.core.common.businessentities.permissions > ( ) { @ java.lang.Override protected java.lang.Object [ ] getRawValue ( org.ovirt.engine.core.common.businessentities.permissions object ) { return new java.lang.Object [ ] { object.getObjectType ( ) , object.getObjectName ( ) , getModel ( ) . getEntity ( ) , object.getObjectId ( ) } ; } } ; org.ovirt.engine.ui.common.widget.uicommon.permissions.PermissionWithInheritedPermissionListModelTable.getTable ( ) . addColumn ( permissionColumn , constants.inheritedPermission ( ) , "300px" ) ; }
Source:
public void shouldDetectNeverStartedVM ( ) { final org.ovirt.engine.core.common.businessentities.VM newVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasItems ( org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( tooOldHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( newEnoughHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasSize ( 2 ) ) ; }

Target:
public void shouldWeightNewestHostsBetterOnVmStarts ( ) { final org.ovirt.engine.core.common.businessentities.VM newVM = new org.ovirt.engine.core.common.businessentities.VM ( ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasItems ( org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( tooOldHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BAD_WEIGHT ) , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnitTest.weight ( newEnoughHost , org.ovirt.engine.core.bll.scheduling.policyunits.InClusterUpgradeWeightPolicyUnit.BEST_WEIGHT ) ) ) ; org.hamcrest.MatcherAssert.assertThat ( filter ( newVM , tooOldHost , newEnoughHost ) , org.hamcrest.Matchers.hasSize ( 2 ) ) ; }
Source:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }

Target:
private void doTestBadRemove ( boolean valid , boolean success , java.lang.String detail ) throws java.lang.Exception { setUpGetDomainExpectations ( StorageType.NFS , true ) ; setUpGetConnectionExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.DetachStorageDomainFromPool , org.ovirt.engine.core.common.action.DetachStorageDomainFromPoolParameters.class , new java.lang.String [ ] { "StorageDomainId" , "StoragePoolId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.STORAGE_DOMAIN_ID , org.ovirt.engine.api.restapi.resource.BackendAttachedStorageDomainResourceTest.DATA_CENTER_ID } , valid , success ) ) ; try { resource.remove ( ) ; fail ( "expected WebApplicationException" ) ; } catch ( javax.ws.rs.WebApplicationException wae ) { verifyFault ( wae , detail ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc desktopLogoff ( java.lang.String vmId , java.lang.String force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.desktopLogoff" ) . withParameter ( "vmID" , vmId ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturnForXmlRpc ( response ) ; }

Target:
public org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn desktopLogoff ( java.lang.String vmId , java.lang.String force ) { org.ovirt.vdsm.jsonrpc.client.JsonRpcRequest request = new org.ovirt.vdsm.jsonrpc.client.RequestBuilder ( "VM.desktopLogoff" ) . withParameter ( "vmID" , vmId ) . withParameter ( "force" , force ) . build ( ) ; java.util.Map < java.lang.String , java.lang.Object > response = new org.ovirt.engine.core.vdsbroker.jsonrpc.FutureMap ( this . client , request ) ; return new org.ovirt.engine.core.vdsbroker.vdsbroker.StatusOnlyReturn ( response ) ; }
Source:
private void assertGetAllForStoragePoolValidResult ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result ) { org.junit.Assert.assertNotNull ( result ) ; org.junit.Assert.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster group : result ) { org.junit.Assert.assertEquals ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER , group.getStoragePoolId ( ) ) ; } }

Target:
private void assertGetAllForStoragePoolValidResult ( java.util.List < org.ovirt.engine.core.common.businessentities.Cluster > result ) { org.junit.jupiter.api.Assertions.assertNotNull ( result ) ; org.junit.jupiter.api.Assertions.assertFalse ( result.isEmpty ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.Cluster group : result ) { org.junit.jupiter.api.Assertions.assertEquals ( FixturesTool.STORAGE_POOL_RHEL6_ISCSI_OTHER , group.getStoragePoolId ( ) ) ; } }
Source:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }

Target:
public com.google.gwt.resources.client.ImageResource getValue ( org.ovirt.engine.core.common.businessentities.Disk object ) { setTitle ( ( ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? getDefaultTitle ( ) : null ) ) ; return ( object.getDiskStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.Disk.DiskStorageType.LUN ) ? org.ovirt.engine.ui.common.widget.uicommon.disks.DisksViewColumns.resources.externalDiskIcon ( ) : null ; }
Source:
private org.ovirt.engine.core.common.businessentities.Tags setUpTagExpectations ( org.ovirt.engine.core.compat.Guid tagId ) { org.ovirt.engine.core.common.businessentities.Tags mock = control.createMock ( org.ovirt.engine.core.common.businessentities.Tags.class ) ; org.easymock.EasyMock.expect ( mock.getTagId ( ) ) . andReturn ( tagId ) . anyTimes ( ) ; org.easymock.EasyMock.expect ( mock.getParentId ( ) ) . andReturn ( org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.USER_ID ) . anyTimes ( ) ; return mock ; }

Target:
private org.ovirt.engine.core.common.businessentities.Tags setUpTagExpectations ( org.ovirt.engine.core.compat.Guid tagId ) { org.ovirt.engine.core.common.businessentities.Tags tags = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.Tags.class ) ; org.mockito.Mockito.when ( tags.getTagId ( ) ) . thenReturn ( tagId ) ; org.mockito.Mockito.when ( tags.getParentId ( ) ) . thenReturn ( org.ovirt.engine.api.restapi.resource.BackendUserTagResourceTest.USER_ID ) ; return tags ; }
Source:
public boolean Validate ( ) { if ( ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { return true ; } boolean isValid = true ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : getDisks ( ) ) { diskModel.getQuota ( ) . ValidateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation ( ) } ) ; isValid &= diskModel.getQuota ( ) . getIsValid ( ) ; } return isValid ; }

Target:
public boolean Validate ( ) { if ( ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.DISABLED ) ) || ( ( getQuotaEnforcementType ( ) ) == ( org.ovirt.engine.core.common.businessentities.QuotaEnforcementTypeEnum.SOFT_ENFORCEMENT ) ) ) { return true ; } boolean isValid = true ; for ( org.ovirt.engine.ui.uicommonweb.models.vms.DiskModel diskModel : getDisks ( ) ) { diskModel.getQuota ( ) . validateSelectedItem ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.SelectedQuotaValidation ( ) } ) ; isValid &= diskModel.getQuota ( ) . getIsValid ( ) ; } return isValid ; }
Source:
private void testDiscardFieldsParsing ( org.ovirt.engine.core.compat.Version poolCompatibilityVersion , java.lang.Long expectedDiscardMaxSize , java.lang.Boolean expectedDiscardZeroesData ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < > ( ) ; xlun.put ( "discard_max_bytes" , 1024L ) ; xlun.put ( "discard_zeroes_data" , 1 ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLun ( xlun , poolCompatibilityVersion ) ; org.junit.Assert.assertEquals ( lun.getDiscardMaxSize ( ) , expectedDiscardMaxSize ) ; org.junit.Assert.assertEquals ( lun.getDiscardZeroesData ( ) , expectedDiscardZeroesData ) ; }

Target:
private void testDiscardFieldParsing ( org.ovirt.engine.core.compat.Version poolCompatibilityVersion , java.lang.Long expectedDiscardMaxSize ) { java.util.Map < java.lang.String , java.lang.Object > xlun = new java.util.HashMap < > ( ) ; xlun.put ( "discard_max_bytes" , 1024L ) ; org.ovirt.engine.core.common.businessentities.storage.LUNs lun = org.ovirt.engine.core.vdsbroker.vdsbroker.GetDeviceListVDSCommand.parseLun ( xlun , poolCompatibilityVersion ) ; org.junit.Assert.assertEquals ( lun.getDiscardMaxSize ( ) , expectedDiscardMaxSize ) ; }
Source:
private static void checkMessages ( ) { org.ovirt.engine.core.common.AuditLogType [ ] values = org.ovirt.engine.core.common.AuditLogType.values ( ) ; if ( ( values.length ) != ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.size ( ) ) ) { for ( org.ovirt.engine.core.common.AuditLogType value : values ) { if ( ! ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.containsKey ( value ) ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.log.infoFormat ( "AuditLogType: {0} not exist in string table" , value.toString ( ) ) ; } } } }

Target:
private static void initMessages ( ) { java.util.ResourceBundle bundle = org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.readMessagesFromBundle ( ) ; for ( org.ovirt.engine.core.common.AuditLogType auditLogType : org.ovirt.engine.core.common.AuditLogType.values ( ) ) { org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.messages.put ( auditLogType , org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector.getMessage ( bundle , auditLogType ) ) ; } }
Source:
protected final void decreasePendingVms ( org.ovirt.engine.core.common.businessentities.VmStatic vm ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "PendingVms for the guest '{}' running on host '{}' was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVms ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }

Target:
protected final void decreasePendingVm ( org.ovirt.engine.core.common.businessentities.VmStatic vm ) { org.ovirt.engine.core.compat.Guid vdsId = getCurrentVdsId ( ) ; if ( ( vdsId == null ) || ( vdsId.equals ( lastDecreasedVds ) ) ) { org.ovirt.engine.core.bll.RunVmCommandBase.log.debug ( "PendingVms for the guest '{}' running on host '{}' was already released, not releasing again" , vm.getName ( ) , vdsId ) ; return ; } lastDecreasedVds = vdsId ; org.ovirt.engine.core.bll.VmHandler.decreasePendingVm ( vm , vdsId ) ; getBlockingQueue ( vdsId ) . offer ( java.lang.Boolean.TRUE ) ; }
Source:
private boolean isRunningConfigurationNeeded ( ) { return ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . isNextRunConfigurationExists ( ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) ) ) ) ; }

Target:
private boolean isRunningConfigurationNeeded ( ) { return ( ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . isNextRunConfigurationExists ( ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValid ( org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) . getVmStaticData ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getVm ( ) . getStatus ( ) ) ) ) ) || ( ! ( org.ovirt.engine.core.bll.VmHandler.isUpdateValidForVmDevices ( getVmId ( ) , org.ovirt.engine.core.bll.UpdateVmCommand.getParameters ( ) ) ) ) ; }
Source:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isRequired ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isRequired ) ) ; } }

Target:
protected void setUpEntityQueryExpectations ( int times , boolean isDisplay , boolean isMigration , boolean isRequired ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpEntityQueryExpectations ( VdcQueryType.GetAllNetworksByClusterId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendClusterNetworksResourceTest.CLUSTER_ID } , getEntityList ( isDisplay , isMigration , isRequired ) ) ; } }
Source:
private org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getVlanDevice ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , final java.lang.Integer vlanId ) { if ( vlanId == null ) { return null ; } return org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( getNics ( ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface t ) { return ( baseNic.getName ( ) . equals ( t.getBaseInterface ( ) ) ) && ( java.util.Objects.equals ( t.getVlanId ( ) , vlanId ) ) ; } } ) ; }

Target:
protected org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface getVlanDevice ( final org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface baseNic , final java.lang.Integer vlanId ) { if ( vlanId == null ) { return null ; } return org.ovirt.engine.core.utils.linq.LinqUtils.firstOrNull ( getNics ( baseNic.getVdsId ( ) ) , new org.ovirt.engine.core.utils.linq.Predicate < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > ( ) { @ java.lang.Override public boolean eval ( org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface t ) { return ( baseNic.getName ( ) . equals ( t.getBaseInterface ( ) ) ) && ( java.util.Objects.equals ( t.getVlanId ( ) , vlanId ) ) ; } } ) ; }
Source:
protected boolean isStorageDomainTypeCorrect ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { if ( ( ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ISO ) ) && ( ( storageDomain.getStorageDomainType ( ) ) != ( org.ovirt.engine.core.common.businessentities.StorageDomainType.ImportExport ) ) ) && ( ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) . getStorageType ( ) ) != ( storageDomain.getStorageType ( ) ) ) ) { addCanDoActionMessage ( VdcBllMessages.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_TYPE_NOT_MATCH ) ; return false ; } return true ; }

Target:
protected boolean isStorageDomainCompatibleWithDC ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { org.ovirt.engine.core.bll.storage.StoragePoolValidator spv = new org.ovirt.engine.core.bll.storage.StoragePoolValidator ( org.ovirt.engine.core.bll.storage.StorageHandlingCommandBase.getStoragePool ( ) ) ; if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.GLUSTERFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isGlusterSupportedInDC ( ) ; return validate ( result ) ; } if ( ( storageDomain.getStorageType ( ) ) == ( org.ovirt.engine.core.common.businessentities.StorageType.POSIXFS ) ) { org.ovirt.engine.core.bll.ValidationResult result = spv.isPosixSupportedInDC ( ) ; return validate ( result ) ; } return true ; }
Source:
public static void getClusterList ( 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 ) { if ( source != null ) { java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > list = ( ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ) ( source ) ) ; java.util.Collections.sort ( list , new org.ovirt.engine.core.common.businessentities.comparators.NameableComparator ( ) ) ; return list ; } return new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDSGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetAllVdsGroups , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public static 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.DiskImage > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.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 ) ; }
Source:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.gluster.IdQueryParameters.class ) , true ) ; }

Target:
public javax.ws.rs.core.Response add ( org.ovirt.engine.api.model.GlusterVolume volume ) { validateParameters ( volume , "name" , "volumeType" , "bricks" ) ; validateEnumParameters ( volume ) ; org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity volumeEntity = getMapper ( org.ovirt.engine.api.model.GlusterVolume.class , org.ovirt.engine.core.common.businessentities.gluster.GlusterVolumeEntity.class ) . map ( volume , null ) ; volumeEntity.setClusterId ( asGuid ( parent.get ( ) . getId ( ) ) ) ; mapBricks ( volume , volumeEntity ) ; return performCreation ( VdcActionType.CreateGlusterVolume , new org.ovirt.engine.core.common.action.gluster.CreateGlusterVolumeParameters ( volumeEntity ) , new org.ovirt.engine.api.restapi.resource.gluster.QueryIdResolver ( org.ovirt.engine.core.common.queries.VdcQueryType.GetGlusterVolumeById , org.ovirt.engine.core.common.queries.IdQueryParameters.class ) , true ) ; }
Source:
public org.ovirt.engine.api.model.Network update ( org.ovirt.engine.api.model.Network incoming ) { return performUpdate ( incoming , new org.ovirt.engine.api.restapi.resource.BackendNetworkResource.UpdatedNetworkResolver ( ) , VdcActionType.UpdateNetwork , new org.ovirt.engine.api.restapi.resource.BackendNetworkResource.UpdateParametersProvider ( ) ) ; }

Target:
public org.ovirt.engine.api.model.Network get ( ) { org.ovirt.engine.api.model.Network entity = parent.lookupNetwork ( guid ) ; if ( entity == null ) { return notFound ( ) ; } org.ovirt.engine.api.model.Network network = map ( entity ) ; network.setDisplay ( null ) ; return addLinks ( network ) ; }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc reset ( java.lang.String vmId ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.reset ( vmId ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.OneVmReturnForXmlRpc ( 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.StatusOnlyReturnForXmlRpc desktopLogoff ( java.lang.String vmId , java.lang.String force ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.desktopLogoff ( vmId , force ) ; 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 ) ; } }
Source:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addNetworkAttachments ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment ... networkAttachments ) { if ( emptyParameters ( networkAttachments ) ) { return this ; } if ( ( parameters.getNetworkAttachments ( ) ) == null ) { parameters.setNetworkAttachments ( new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > ( ) ) ; } parameters.getNetworkAttachments ( ) . addAll ( java.util.Arrays.asList ( networkAttachments ) ) ; return this ; }

Target:
public org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidatorTest.ParametersBuilder addLabels ( org.ovirt.engine.core.common.businessentities.network.NicLabel ... nicLabels ) { if ( nullParameters ( nicLabels ) ) { return this ; } if ( ( parameters.getLabels ( ) ) == null ) { parameters.setLabels ( new java.util.HashSet < org.ovirt.engine.core.common.businessentities.network.NicLabel > ( ) ) ; } parameters.getLabels ( ) . addAll ( java.util.Arrays.asList ( nicLabels ) ) ; return this ; }
Source:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.bll.utils.Injector.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder ( network , context , managementNetworkUtil ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters , context ) ; } }

Target:
private static void removeNetworkFromHosts ( org.ovirt.engine.core.common.businessentities.network.Network network , org.ovirt.engine.core.bll.context.CommandContext context , java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > nics ) { final org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil managementNetworkUtil = org.ovirt.engine.core.di.Injector.get ( org.ovirt.engine.core.bll.network.cluster.ManagementNetworkUtil.class ) ; org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder builder = new org.ovirt.engine.core.bll.network.RemoveNetworkParametersBuilder ( network , context , managementNetworkUtil ) ; java.util.ArrayList < org.ovirt.engine.core.common.action.VdcActionParametersBase > parameters = builder.buildParameters ( nics ) ; if ( ! ( parameters.isEmpty ( ) ) ) { org.ovirt.engine.core.bll.network.NetworkParametersBuilder.updateParametersSequencing ( parameters ) ; org.ovirt.engine.core.bll.Backend.getInstance ( ) . runInternalMultipleActions ( VdcActionType.PersistentSetupNetworks , parameters , context ) ; } }
Source:
public boolean Validate ( ) { getPath ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . ValidateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }

Target:
public boolean Validate ( ) { getPath ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) } ) ; getVfsType ( ) . validateEntity ( new org.ovirt.engine.ui.uicommonweb.validation.IValidation [ ] { new org.ovirt.engine.ui.uicommonweb.validation.NotEmptyValidation ( ) , new org.ovirt.engine.ui.uicommonweb.validation.AsciiNameValidation ( ) } ) ; return ( getPath ( ) . getIsValid ( ) ) && ( getVfsType ( ) . getIsValid ( ) ) ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean openStackNetProvider = isTypeOpenStackNetwork ( ) ; getTenantName ( ) . setIsAvailable ( openStackNetProvider ) ; getPluginType ( ) . setIsAvailable ( openStackNetProvider ) ; }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { boolean providerNeutron = isTypeOpenStackNetwork ( ) ; getApiVersion ( ) . setIsAvailable ( providerNeutron ) ; getTenantName ( ) . setIsAvailable ( providerNeutron ) ; if ( providerNeutron ) { org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties properties = ( ( org.ovirt.engine.core.common.businessentities.OpenstackNetworkProviderProperties ) ( provider.getAdditionalProperties ( ) ) ) ; java.lang.String pluginName = ( properties == null ) ? new java.lang.String ( ) : properties.getPluginType ( ) ; getPluginType ( ) . setSelectedItem ( org.ovirt.engine.ui.uicommonweb.models.providers.NeutronPluginTranslator.getDisplayStringForPluginName ( pluginName ) ) ; } }
Source:
public void testJsonDiskDescription ( ) throws java.io.IOException { disk.setDiskAlias ( "DiskAlias" ) ; disk.setDiskDescription ( "DiskDescription" ) ; assertDiskDescriptionMap ( disk ) ; }

Target:
public void setUp ( ) { disk = new org.ovirt.engine.core.common.businessentities.storage.DiskImage ( ) ; metadataDiskDescriptionHandler = org.mockito.Mockito.spy ( org.ovirt.engine.core.bll.MetadataDiskDescriptionHandler.getInstance ( ) ) ; org.mockito.Mockito.doReturn ( auditLogDirector ) . when ( metadataDiskDescriptionHandler ) . getAuditLogDirector ( ) ; org.mockito.Mockito.doNothing ( ) . when ( auditLogDirector ) . log ( org.mockito.Matchers.any ( org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogableBase.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.AuditLogType.class ) ) ; }
Source:
public void tearDown ( ) throws java.lang.Exception { org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationStartedEvent ( mockAsyncQuery.getModel ( ) ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( mockAsyncQuery.getModel ( ) ) ) ; }

Target:
private void verifyAsyncQuerySucceeded ( ) { org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.atLeastOnce ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( mockAsyncQuery.getModel ( ) , false , true ) ) ; org.mockito.Mockito.verify ( mockEventBus , org.mockito.Mockito.never ( ) ) . fireEvent ( new org.ovirt.engine.ui.frontend.communication.AsyncOperationCompleteEvent ( mockAsyncQuery.getModel ( ) , false , false ) ) ; }
Source:
public static void beforeClass ( ) { org.ovirt.engine.core.notifier.utils.NotificationProperties.setDefaults ( "src/test/resources/conf/notifier-prop-test.conf" , "src/test/resources/conf/missing.conf" ) ; org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop = org.ovirt.engine.core.notifier.utils.NotificationProperties.getInstance ( ) ; org.junit.Assert.assertNotNull ( org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop ) ; }

Target:
public static void beforeClass ( ) throws java.io.UnsupportedEncodingException { org.ovirt.engine.core.notifier.utils.NotificationProperties.release ( ) ; org.ovirt.engine.core.notifier.utils.NotificationProperties.setDefaults ( java.net.URLDecoder.decode ( java.lang.ClassLoader.getSystemResource ( "conf/notifier-prop-test.conf" ) . getPath ( ) , "UTF-8" ) , "" ) ; org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop = org.ovirt.engine.core.notifier.utils.NotificationProperties.getInstance ( ) ; org.junit.Assert.assertNotNull ( org.ovirt.engine.core.notifier.utils.NotificationPropertiesTest.prop ) ; }
Source:
public void getGlusterHook ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid hookId , boolean includeServerHooks ) { 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.GetGlusterHookById , new org.ovirt.engine.core.common.queries.gluster.GlusterHookQueryParameters ( hookId , includeServerHooks ) , aQuery ) ; }

Target:
public void getGlusterHostsNewlyAdded ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , boolean isFingerprintRequired ) { 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.GetAddedGlusterServers , new org.ovirt.engine.core.common.queries.gluster.AddedGlusterServersParameters ( clusterId , isFingerprintRequired ) , aQuery ) ; }
Source:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( VdcActionType.UpdateStorageServerConnectionExtension , org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters.class , new java.lang.String [ ] { "StorageServerConnectionExtension" } , new java.lang.Object [ ] { getDefaultEntity ( ) } , true , true ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.update ( getDefaultModel ( ) ) ; assertNotNull ( extension ) ; assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }

Target:
public void testUpdate ( ) throws java.lang.Exception { setUpGetEntityExpectations ( ) ; setUpGetEntityExpectations ( ) ; setUriInfo ( setUpActionExpectations ( ActionType.UpdateStorageServerConnectionExtension , org.ovirt.engine.core.common.action.StorageServerConnectionExtensionParameters.class , new java.lang.String [ ] { "StorageServerConnectionExtension" } , new java.lang.Object [ ] { getDefaultEntity ( ) } , true , true ) ) ; org.ovirt.engine.api.model.StorageConnectionExtension extension = resource.update ( getDefaultModel ( ) ) ; assertNotNull ( extension ) ; assertEquals ( extension.getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageServerConnectionExtensionResourceTest.extensionID.toString ( ) ) ; }
Source:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createStompClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure ) { return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionTimeout , clientTimeout , connectionRetry , heartbeat , isSecure , ReactorType.STOMP ) ; }

Target:
public static org.ovirt.vdsm.jsonrpc.client.JsonRpcClient createStompClient ( java.lang.String hostname , int port , int connectionTimeout , int clientTimeout , int connectionRetry , int heartbeat , boolean isSecure , java.lang.String protocol ) { return org.ovirt.engine.core.vdsbroker.jsonrpc.JsonRpcUtils.createClient ( hostname , port , connectionTimeout , clientTimeout , connectionRetry , heartbeat , isSecure , ReactorType.STOMP , protocol ) ; }
Source:
public void edit ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkManageModel clusterNetworkManageModel ) { networks.asEditor ( ) . edit ( clusterNetworkManageModel ) ; initEntityModelCellTable ( constants , templates ) ; }

Target:
private void changeIsAttached ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterNetworkModel clusterNetworkModel , java.lang.Boolean value ) { clusterNetworkModel.setAttached ( value ) ; if ( ! value ) { if ( clusterNetworkModel.isDisplayNetwork ( ) ) { updateDisplayNetwork ( clusterNetworkModel , false ) ; } if ( clusterNetworkModel.isMigrationNetwork ( ) ) { updateMigrationNetwork ( clusterNetworkModel , false ) ; } if ( clusterNetworkModel.isGlusterNetwork ( ) ) { updateGlusterNetwork ( clusterNetworkModel , false ) ; } if ( clusterNetworkModel.isRequired ( ) ) { clusterNetworkModel.setRequired ( false ) ; } } }
Source:
private void init ( javax.xml.transform.Result result ) { try { javax.xml.stream.XMLOutputFactory factory = javax.xml.stream.XMLOutputFactory.newFactory ( ) ; writer = factory.createXMLStreamWriter ( result ) ; com.sun.xml.txw2.output.IndentingXMLStreamWriter indenter = new com.sun.xml.txw2.output.IndentingXMLStreamWriter ( writer ) ; indenter.setIndentStep ( " " ) ; writer = indenter ; } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.tool.XmlWriterException ( "Can't create XML writer" , exception ) ; } }

Target:
private void init ( javax.xml.transform.Result result , boolean indent ) { try { javax.xml.stream.XMLOutputFactory factory = javax.xml.stream.XMLOutputFactory.newFactory ( ) ; writer = factory.createXMLStreamWriter ( result ) ; if ( indent ) { com.sun.xml.txw2.output.IndentingXMLStreamWriter indenter = new com.sun.xml.txw2.output.IndentingXMLStreamWriter ( writer ) ; indenter.setIndentStep ( " " ) ; writer = indenter ; } } catch ( javax.xml.stream.XMLStreamException exception ) { throw new org.ovirt.api.metamodel.runtime.xml.XmlException ( "Can't create XML writer" , exception ) ; } }
Source:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; log.error ( "Failed deleting disk from Cinder. ID: {}" , getDiskId ( ) ) ; if ( getCommand ( ) . getParameters ( ) . getShouldBeLogged ( ) ) { new org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector ( ) . log ( getCommand ( ) , AuditLogType.USER_FINISHED_FAILED_REMOVE_DISK ) ; } org.ovirt.engine.core.bll.ImagesHandler.updateImageStatus ( getDiskId ( ) , ImageStatus.ILLEGAL ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }

Target:
public void onFailed ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onFailed ( cmdId , childCmdIds ) ; getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }
Source:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.api.model.Disk disk = get ( ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( disk.getImageId ( ) ) ; org.ovirt.engine.core.compat.Guid sourceStorageDomainId = getSourceStorageDomainId ( disk ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , sourceStorageDomainId , storageDomainId , org.ovirt.engine.core.common.businessentities.ImageOperation.Copy ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }

Target:
public javax.ws.rs.core.Response copy ( org.ovirt.engine.api.model.Action action ) { validateParameters ( action , "storageDomain.id|name" ) ; org.ovirt.engine.core.compat.Guid storageDomainId = getStorageDomainId ( action ) ; org.ovirt.engine.api.model.Disk disk = get ( ) ; org.ovirt.engine.core.compat.Guid imageId = asGuid ( disk.getImageId ( ) ) ; org.ovirt.engine.core.compat.Guid sourceStorageDomainId = getSourceStorageDomainId ( disk ) ; org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters params = new org.ovirt.engine.core.common.action.MoveOrCopyImageGroupParameters ( imageId , sourceStorageDomainId , storageDomainId , org.ovirt.engine.core.common.businessentities.storage.ImageOperation.Copy ) ; return doAction ( VdcActionType.MoveOrCopyDisk , params , action ) ; }
Source:
private void attachDisk ( org.ovirt.engine.core.common.businessentities.Disk disk ) { runInternalAction ( VdcActionType.AttachDiskToVm , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) , disk.getId ( ) , disk.getPlugged ( ) , disk.getReadOnly ( ) ) ) ; }

Target:
private void attachDetachDisk ( org.ovirt.engine.core.common.businessentities.Disk disk , org.ovirt.engine.core.common.action.VdcActionType actionType ) { runInternalAction ( actionType , new org.ovirt.engine.core.common.action.AttachDetachVmDiskParameters ( org.ovirt.engine.core.bll.CloneVmCommand.getParameters ( ) . getNewVmGuid ( ) , disk.getId ( ) , disk.getPlugged ( ) , disk.getReadOnly ( ) ) ) ; }
Source:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost = interfaceDao.getAllInterfacesForVds ( hostId ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networkDao.getAllForCluster ( vdsDao.get ( hostId ) . getVdsGroupId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment ) ; } }

Target:
public void fillReportedConfigurations ( java.util.List < org.ovirt.engine.core.common.businessentities.network.NetworkAttachment > networkAttachments , org.ovirt.engine.core.compat.Guid hostId ) { java.util.List < org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > allInterfacesForHost = interfaceDao.getAllInterfacesForVds ( hostId ) ; java.util.Map < java.lang.String , org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > networkNameToNicMap = nicsByNetworkId ( allInterfacesForHost ) ; org.ovirt.engine.core.common.businessentities.BusinessEntityMap < org.ovirt.engine.core.common.businessentities.network.Network > networkMap = new org.ovirt.engine.core.common.businessentities.BusinessEntityMap ( networkDao.getAllForCluster ( vdsDao.get ( hostId ) . getClusterId ( ) ) ) ; for ( org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment : networkAttachments ) { fillReportedConfigurations ( networkNameToNicMap , networkMap , networkAttachment ) ; } }
Source:
public void qosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; iface.setQosOverridden ( true ) ; org.ovirt.engine.core.common.businessentities.VDS host = org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForNics ( iface ) , host ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }

Target:
public void syncNetworkQosNotSupported ( ) { org.ovirt.engine.core.common.businessentities.network.Network network = createNetwork ( org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; mockExistingNetworks ( network ) ; org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface iface = createNicSyncedWithNetwork ( "eth0" , network ) ; mockExistingIfaces ( iface ) ; org.ovirt.engine.core.compat.Guid qosId = org.ovirt.engine.core.compat.Guid.newGuid ( ) ; org.mockito.Mockito.when ( qosDao.get ( qosId ) ) . thenReturn ( createQos ( ) ) ; network.setQosId ( qosId ) ; org.ovirt.engine.core.bll.network.host.SetupNetworksHelper helper = createHelper ( createParametersForSync ( iface ) ) ; validateAndExpectViolation ( helper , VdcBllMessages.ACTION_TYPE_FAILED_HOST_NETWORK_QOS_NOT_SUPPORTED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.MANAGEMENT_NETWORK_NAME ) ; }