auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void isSoundcardEnabled ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetSoundDevices , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }

Target:
public void isVirtioScsiEnabledForVm ( 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 ! ( ( ( java.util.List < ? > ) ( source ) ) . isEmpty ( ) ) ; } return false ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetVirtioScsiControllers , new org.ovirt.engine.core.common.queries.IdQueryParameters ( vmId ) , aQuery ) ; }
Source:
protected void writeOS ( ) { _writer.writeStartElement ( "OperatingSystemSection" ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , vmBase.getId ( ) . toString ( ) ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_URI , "required" , "false" ) ; _writer.writeElement ( "Info" , "Guest Operating System" ) ; _writer.writeElement ( "Description" , osRepository.getUniqueOsNames ( ) . get ( vmBase.getOsId ( ) ) ) ; _writer.writeEndElement ( ) ; }

Target:
protected void writeOS ( ) { _writer.writeStartElement ( "OperatingSystemSection" ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_PREFIX , org.ovirt.engine.core.utils.ovf.OVF_URI , "id" , vmBase.getId ( ) . toString ( ) ) ; _writer.writeAttributeString ( org.ovirt.engine.core.utils.ovf.OVF_PREFIX , org.ovirt.engine.core.utils.ovf.OVF_URI , "required" , "false" ) ; _writer.writeElement ( "Info" , "Guest Operating System" ) ; _writer.writeElement ( "Description" , osRepository.getUniqueOsNames ( ) . get ( vmBase.getOsId ( ) ) ) ; _writer.writeEndElement ( ) ; }
Source:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand ( new org.ovirt.engine.core.common.action.gluster.GlusterHookStatusChangeParameters ( CLUSTER_ID , HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }

Target:
public void executeCommandWhenFailed ( ) { cmd = org.mockito.Mockito.spy ( new org.ovirt.engine.core.bll.gluster.DisableGlusterHookCommand < org.ovirt.engine.core.common.action.gluster.GlusterHookParameters > ( new org.ovirt.engine.core.common.action.gluster.GlusterHookParameters ( HOOK_ID ) ) ) ; setupMocks ( cmd ) ; mockBackendStatusChange ( cmd , false ) ; cmd.executeCommand ( ) ; org.junit.Assert.assertFalse ( cmd.getReturnValue ( ) . getSucceeded ( ) ) ; org.junit.Assert.assertEquals ( cmd.getAuditLogTypeValue ( ) , AuditLogType.GLUSTER_HOOK_DISABLE_FAILED ) ; }
Source:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterPolicyModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getEditCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }

Target:
public org.ovirt.engine.ui.common.presenter.AbstractModelBoundPopupPresenterWidget < ? extends org.ovirt.engine.ui.uicommonweb.models.Model , ? > getModelPopup ( org.ovirt.engine.ui.uicommonweb.models.clusters.ClusterGeneralModel source , org.ovirt.engine.ui.uicommonweb.UICommand lastExecutedCommand , org.ovirt.engine.ui.uicommonweb.models.Model windowModel ) { if ( lastExecutedCommand == ( getModel ( ) . getEditPolicyCommand ( ) ) ) { return popupProvider.get ( ) ; } else { return super . getModelPopup ( source , lastExecutedCommand , windowModel ) ; } }
Source:
private void loadSourceFile ( ) throws java.io.FileNotFoundException { java.lang.String template = "krb5.conf.template" ; sourceFile = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.kerberos.KrbConfCreator.class . getClassLoader ( ) . getResourceAsStream ( template ) ; if ( ( sourceFile ) == null ) { throw new java.io.FileNotFoundException ( ( template + " was not found" ) ) ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.kerberos.KrbConfCreator.log.debug ( ( "loaded template kr5.conf file " + template ) ) ; }

Target:
private void loadSourceFile ( ) throws java.io.FileNotFoundException { java.lang.String template = "krb5.conf.template" ; sourceFile = org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.kerberos.KrbConfCreator.class . getClassLoader ( ) . getResourceAsStream ( template ) ; if ( ( sourceFile ) == null ) { throw new java.io.FileNotFoundException ( ( template + " was not found" ) ) ; } org.ovirt.engine.extensions.aaa.builtin.kerberosldap.utils.kerberos.KrbConfCreator.log.debug ( "loaded template kr5.conf file {}" , template ) ; }
Source:
public void getPermissionsByAdElementId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid userId ) { 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.Permission > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Permission > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetPermissionsByAdElementId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( userId ) , aQuery ) ; }

Target:
public void getUserMessageOfTheDayViaPublic ( 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 ( ) . runPublicQuery ( VdcQueryType.GetConfigurationValue , new org.ovirt.engine.core.common.queries.GetConfigurationValueParameters ( org.ovirt.engine.core.common.queries.ConfigurationValues.UserMessageOfTheDay , getDefaultConfigurationVersion ( ) ) , aQuery ) ; }
Source:
private void vdsGroupHasVds ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( new org.ovirt.engine.core.common.businessentities.VDS ( ) ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }

Target:
private void VdsExistWithHigherVersion ( ) { org.ovirt.engine.core.common.businessentities.VDS vds = new org.ovirt.engine.core.common.businessentities.VDS ( ) ; vds.setStatus ( VDSStatus.Up ) ; vds.setVdsGroupCompatibilityVersion ( org.ovirt.engine.core.bll.UpdateVdsGroupCommandTest.VERSION_1_2 ) ; java.util.List < org.ovirt.engine.core.common.businessentities.VDS > vdsList = new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.VDS > ( ) ; vdsList.add ( vds ) ; org.mockito.Mockito.when ( vdsDAO.getAllForVdsGroup ( org.mockito.Matchers.any ( org.ovirt.engine.core.compat.Guid.class ) ) ) . thenReturn ( vdsList ) ; }
Source:
private org.ovirt.engine.core.bll.network.host.SetupNetworksHelper qosCommitmentReportedBondSpeed ( int totalCommitment ) { return qosCommitmentBondSetup ( totalCommitment , null , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.DEFAULT_SPEED , org.ovirt.engine.core.bll.network.host.SetupNetworksHelperTest.BOND_MODE_4 ) ; }

Target:
public void setUp ( ) throws java.lang.Exception { effectiveHostNetworkQos = new org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos ( qosDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkDao.class , networkDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.NetworkAttachmentDao.class , networkAttachmentDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.network.InterfaceDao.class , interfaceDao ) ; injectorRule.bind ( org.ovirt.engine.core.dao.gluster.GlusterBrickDao.class , brickDao ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.EffectiveHostNetworkQos.class , effectiveHostNetworkQos ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils.class , new org.ovirt.engine.core.vdsbroker.NetworkImplementationDetailsUtils ( effectiveHostNetworkQos , networkAttachmentDao , calculateBaseNic ) ) ; injectorRule.bind ( org.ovirt.engine.core.vdsbroker.CalculateBaseNic.class , calculateBaseNic ) ; }
Source:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . GetVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.logMonitorLockReleased ( "Refresh host capabilities" ) ; }

Target:
protected void executeCommand ( ) { try ( org.ovirt.engine.core.utils.lock.EngineLock monitoringLock = org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.acquireMonitorLock ( ) ) { org.ovirt.engine.core.vdsbroker.ResourceManager.getInstance ( ) . getVdsManager ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVdsId ( ) ) . refreshHost ( org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.getVds ( ) ) ; org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.setSucceeded ( true ) ; } org.ovirt.engine.core.bll.RefreshHostCapabilitiesCommand.logMonitorLockReleased ( "Refresh host capabilities" ) ; }
Source:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) , org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.DiskVmElement.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.mockito.Mockito.when ( command.getDiskValidator ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.storage.Disk.class ) ) ) . thenReturn ( diskValidator ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }

Target:
public void validateFailedDiskInterfaceUnsupported ( ) { mockVmStatusUp ( ) ; createVirtIODisk ( ) ; initStorageDomain ( ) ; org.mockito.Mockito.when ( diskVmElementValidator.isDiskInterfaceSupported ( org.mockito.Matchers.any ( org.ovirt.engine.core.common.businessentities.VM.class ) ) ) . thenReturn ( new org.ovirt.engine.core.bll.ValidationResult ( org.ovirt.engine.core.common.errors.EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ) ; org.ovirt.engine.core.bll.ValidateTestUtils.runAndAssertValidateFailure ( command , EngineMessage.ACTION_TYPE_DISK_INTERFACE_UNSUPPORTED ) ; }
Source:
public void updateStorageTypesByDomainType ( org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType ) { java.util.Set < org.ovirt.engine.core.common.businessentities.storage.StorageType > filteredStorageTypes = new java.util.LinkedHashSet < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel currModel : getItems ( ) ) { if ( ( currModel.getRole ( ) ) == storageDomainType ) { filteredStorageTypes.add ( currModel.getType ( ) ) ; } } getAvailableStorageTypeItems ( ) . setItems ( filteredStorageTypes ) ; }

Target:
public void updateStorageTypesByDomainType ( ) { org.ovirt.engine.core.common.businessentities.StorageDomainType storageDomainType = getAvailableStorageDomainTypeItems ( ) . getSelectedItem ( ) ; java.util.Set < org.ovirt.engine.core.common.businessentities.storage.StorageType > filteredStorageTypes = new java.util.LinkedHashSet < > ( ) ; for ( org.ovirt.engine.ui.uicommonweb.models.storage.IStorageModel currModel : getStorageModels ( ) ) { if ( ( currModel.getRole ( ) ) == storageDomainType ) { filteredStorageTypes.add ( currModel.getType ( ) ) ; } } getAvailableStorageTypeItems ( ) . setItems ( filteredStorageTypes ) ; }
Source:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Arrays.asList ( unlabeledNetwork ) , java.util.Collections.< org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface > emptyList ( ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.hamcrest.CoreMatchers.is ( true ) ) ; }

Target:
public void testNotRemovingLabeledNetworksReferencingUnlabeledNetworkRemovalIsOk ( ) throws java.lang.Exception { org.ovirt.engine.core.common.businessentities.network.Network unlabeledNetwork = new org.ovirt.engine.core.common.businessentities.network.Network ( ) ; unlabeledNetwork.setId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; org.ovirt.engine.core.common.businessentities.network.NetworkAttachment networkAttachment = createNetworkAttachment ( unlabeledNetwork ) ; org.ovirt.engine.core.bll.network.host.HostSetupNetworksValidator validator = createHostSetupNetworksValidator ( java.util.Collections.singletonList ( unlabeledNetwork ) ) ; org.junit.Assert.assertThat ( validator.notRemovingLabeledNetworks ( networkAttachment ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.isValid ( ) ) ; }
Source:
private void setupGetHostExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.GetVdsByVdsIdParameters.class , new java.lang.String [ ] { "VdsId" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , getHostModel ( ) ) ; } }

Target:
private void setupGetHostExpectations ( int times ) throws java.lang.Exception { while ( ( times -- ) > 0 ) { setUpGetEntityExpectations ( VdcQueryType.GetVdsByVdsId , org.ovirt.engine.core.common.queries.IdQueryParameters.class , new java.lang.String [ ] { "Id" } , new java.lang.Object [ ] { org.ovirt.engine.api.restapi.resource.BackendHostNicsResourceTest.PARENT_GUID } , getHostModel ( ) ) ; } }
Source:
public 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 ) ; }

Target:
public void getStorageDomainById ( org.ovirt.engine.ui.frontend.AsyncQuery < org.ovirt.engine.core.common.businessentities.StorageDomain > aQuery , org.ovirt.engine.core.compat.Guid storageDomainId ) { aQuery.converterCallback = new org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.CastingConverter < > ( ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetStorageDomainById , new org.ovirt.engine.core.common.queries.IdQueryParameters ( storageDomainId ) , aQuery ) ; }
Source:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork > getAllImportedNetworks ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = importedNetworks.flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork > ( ) ; }

Target:
java.lang.Iterable < org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork > getAllImportedNetworks ( ) { org.ovirt.engine.ui.uicommonweb.models.ListModel tableModel = importedNetworks.asEditor ( ) . flush ( ) ; return ( tableModel != null ) && ( ( tableModel.getItems ( ) ) != null ) ? tableModel.getItems ( ) : new java.util.ArrayList < org.ovirt.engine.ui.uicommonweb.models.providers.ExternalNetwork > ( ) ; }
Source:
public void validateEnums ( org.ovirt.engine.api.model.Storage connection ) { if ( connection.isSetType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageType.class , connection.getType ( ) , true ) ; } if ( connection.isSetNfsVersion ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.NfsVersion.class , connection.getNfsVersion ( ) , true ) ; } }

Target:
public void validateEnums ( org.ovirt.engine.api.model.StorageConnection connection ) { if ( connection.isSetType ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.StorageType.class , connection.getType ( ) , true ) ; } if ( connection.isSetNfsVersion ( ) ) { org.ovirt.engine.api.common.util.EnumValidator.validateEnum ( org.ovirt.engine.api.model.NfsVersion.class , connection.getNfsVersion ( ) , true ) ; } }
Source:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.Assert.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.Assert.assertFalse ( model.isSetVm ( ) ) ; org.junit.Assert.assertTrue ( model.isSparse ( ) ) ; org.junit.Assert.assertTrue ( model.isPropagateErrors ( ) ) ; org.junit.Assert.assertEquals ( model.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }

Target:
static void verifyModelSpecific ( org.ovirt.engine.api.model.Disk model , int index ) { org.junit.jupiter.api.Assertions.assertEquals ( GUIDS [ index ] . toString ( ) , model.getId ( ) ) ; org.junit.jupiter.api.Assertions.assertFalse ( model.isSetVm ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isSparse ( ) ) ; org.junit.jupiter.api.Assertions.assertTrue ( model.isPropagateErrors ( ) ) ; org.junit.jupiter.api.Assertions.assertEquals ( model.getStorageDomains ( ) . getStorageDomains ( ) . get ( 0 ) . getId ( ) , org.ovirt.engine.api.restapi.resource.BackendStorageDomainDiskResourceTest.STORAGE_DOMAIN_ID.toString ( ) ) ; }
Source:
public void getClustersHavingHosts ( 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.getInstance ( ) . runQuery ( VdcQueryType.GetAllClustersHavingHosts , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }

Target:
public void getRoleActionGroupsByRoleId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid roleId ) { 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.ActionGroup > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.ActionGroup > ( ) ; } } ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetRoleActionGroupsByRoleId , new org.ovirt.engine.core.common.queries.IdQueryParameters ( roleId ) , aQuery ) ; }
Source:
private void sortSnapshots ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { java.util.Collections.sort ( snapshots , java.util.Collections.reverseOrder ( new org.ovirt.engine.ui.uicommonweb.Linq.SnapshotByCreationDateCommparer ( ) { @ java.lang.Override public int compare ( org.ovirt.engine.core.common.businessentities.Snapshot x , org.ovirt.engine.core.common.businessentities.Snapshot y ) { if ( ( x.getType ( ) ) == ( Snapshot.SnapshotType.ACTIVE ) ) { return 1 ; } if ( ( y.getType ( ) ) == ( Snapshot.SnapshotType.ACTIVE ) ) { return - 1 ; } return super . compare ( x , y ) ; } } ) ) ; }

Target:
private void sortSnapshots ( java.util.ArrayList < org.ovirt.engine.core.common.businessentities.Snapshot > snapshots ) { java.util.Collections.sort ( snapshots , java.util.Comparator.comparing ( ( org.ovirt.engine.core.common.businessentities.Snapshot s ) -> ( s.getType ( ) ) == Snapshot.SnapshotType.ACTIVE ) . reversed ( ) . thenComparing ( Linq.SnapshotByCreationDateCommparer ) ) ; }
Source:
private org.ovirt.engine.core.common.vdscommands.VDSReturnValue runFenceAction ( org.ovirt.engine.core.common.businessentities.pm.FenceActionType action , org.ovirt.engine.core.common.businessentities.FenceAgent agent , org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { auditFenceAction ( action , agent , proxyHost ) ; org.ovirt.engine.core.common.businessentities.FenceAgent realAgent = new org.ovirt.engine.core.common.businessentities.FenceAgent ( agent ) ; realAgent.setType ( org.ovirt.engine.core.utils.pm.VdsFenceOptions.getRealAgent ( agent.getType ( ) ) ) ; realAgent.setOptions ( getOptions ( agent ) ) ; return getBackend ( ) . getResourceManager ( ) . RunVdsCommand ( VDSCommandType.FenceVds , new org.ovirt.engine.core.common.vdscommands.FenceVdsVDSCommandParameters ( proxyHost.getId ( ) , _vds.getId ( ) , realAgent , action , fencingPolicy ) ) ; }

Target:
protected java.util.Map < java.lang.String , java.lang.Object > convertFencingPolicy ( org.ovirt.engine.core.common.businessentities.VDS proxyHost ) { java.util.Map < java.lang.String , java.lang.Object > map = null ; if ( ( ( fencingPolicy ) != null ) && ( org.ovirt.engine.core.common.utils.FencingPolicyHelper.isFencingPolicySupported ( proxyHost.getSupportedClusterVersionsSet ( ) ) ) ) { map = new java.util.HashMap < > ( ) ; if ( fencingPolicy.isSkipFencingIfSDActive ( ) ) { map.put ( VdsProperties.STORAGE_DOMAIN_HOST_ID_MAP , createStorageDomainHostIdMap ( ) ) ; } } return map ; }
Source:
private boolean networkAttachedToHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsAttachedToNetwork = getDbFacade ( ) . getVdsDao ( ) . getAllForNetwork ( attachment.getNetworkId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS hostAttachedToNetwork : hostsAttachedToNetwork ) { if ( hostAttachedToNetwork.getId ( ) . equals ( host.getId ( ) ) ) { return true ; } } return false ; }

Target:
private boolean networkAttachedToHost ( ) { java.util.List < org.ovirt.engine.core.common.businessentities.VDS > hostsAttachedToNetwork = vdsDao.getAllForNetwork ( attachment.getNetworkId ( ) ) ; for ( org.ovirt.engine.core.common.businessentities.VDS hostAttachedToNetwork : hostsAttachedToNetwork ) { if ( hostAttachedToNetwork.getId ( ) . equals ( host.getId ( ) ) ) { return true ; } } return false ; }
Source:
public void taskEndSuccessfully ( ) { super . endSuccessfully ( ) ; }

Target:
private void attachDiskToTemplate ( org.ovirt.engine.core.compat.Guid templateId ) { org.ovirt.engine.core.common.businessentities.storage.DiskImage templateDiskImage = org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getParameters ( ) . getDiskImage ( ) ; org.ovirt.engine.core.common.businessentities.storage.DiskVmElement dve = new org.ovirt.engine.core.common.businessentities.storage.DiskVmElement ( templateDiskImage.getId ( ) , templateId ) ; dve.setDiskInterface ( DiskInterface.VirtIO ) ; org.ovirt.engine.core.bll.storage.repoimage.ImportRepoImageCommand.getDiskVmElementDao ( ) . save ( dve ) ; vmDeviceUtils.addDiskDevice ( templateId , templateDiskImage.getId ( ) ) ; }
Source:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }

Target:
public void nameIsUsed ( ) { org.mockito.Mockito.when ( hostDao.getByName ( org.mockito.Matchers.any ( java.lang.String.class ) ) ) . thenReturn ( org.mockito.Mockito.mock ( org.ovirt.engine.core.common.businessentities.VDS.class ) ) ; org.mockito.Mockito.when ( dbFacade.getVdsDao ( ) ) . thenReturn ( hostDao ) ; validator = new org.ovirt.engine.core.bll.validator.HostValidator ( dbFacade , host , hostedEngineHelper ) ; org.junit.Assert.assertThat ( validator.nameNotUsed ( ) , org.ovirt.engine.core.bll.validator.ValidationResultMatchers.failsWith ( EngineMessage.ACTION_TYPE_FAILED_NAME_ALREADY_USED ) ) ; }
Source:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( ) { if ( ( cluster ) == null ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cluster.setCompatibilityVersion ( Version.v3_3 ) ; cluster.setCpuName ( "Intel Conroe Family" ) ; cluster.setArchitecture ( ArchitectureType.x86_64 ) ; } return cluster ; }

Target:
private org.ovirt.engine.core.common.businessentities.Cluster createCluster ( ) { if ( ( cluster ) == null ) { cluster = new org.ovirt.engine.core.common.businessentities.Cluster ( ) ; cluster.setClusterId ( org.ovirt.engine.core.compat.Guid.newGuid ( ) ) ; cluster.setCompatibilityVersion ( Version.v4_0 ) ; cluster.setCpuName ( "Intel Conroe Family" ) ; cluster.setArchitecture ( ArchitectureType.x86_64 ) ; } return cluster ; }
Source:
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.RunQuery ( VdcQueryType.Search , searchParams , aQuery ) ; }

Target:
public static void getLunsByVgId ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , java.lang.String vgId , org.ovirt.engine.core.compat.Guid vdsId ) { 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.LUNs > ) ( source ) ) : new java.util.ArrayList < org.ovirt.engine.core.common.businessentities.LUNs > ( ) ; } } ; org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters params = new org.ovirt.engine.core.common.queries.GetLunsByVgIdParameters ( vgId , vdsId ) ; org.ovirt.engine.ui.frontend.Frontend.getInstance ( ) . runQuery ( VdcQueryType.GetLunsByVgId , params , aQuery ) ; }
Source:
protected boolean isStorageDomainNotInPool ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean returnValue = false ; if ( storageDomain != null ) { returnValue = getDbFacade ( ) . getStoragePoolIsoMapDao ( ) . getAllForStorage ( storageDomain.getId ( ) ) . isEmpty ( ) ; if ( ! returnValue ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } } return returnValue ; }

Target:
protected boolean isStorageDomainNotInPool ( org.ovirt.engine.core.common.businessentities.StorageDomain storageDomain ) { boolean returnValue = false ; if ( storageDomain != null ) { returnValue = getStoragePoolIsoMapDAO ( ) . getAllForStorage ( storageDomain.getId ( ) ) . isEmpty ( ) ; if ( ! returnValue ) { addCanDoActionMessage ( VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL ) ; } } return returnValue ; }
Source:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.PropertyChangedEventArgs args ) { if ( ( object.getVersion ( ) . getSelectedItem ( ) ) != null ) { java.lang.String clusterVersion = object.getVersion ( ) . getSelectedItem ( ) . getValue ( ) ; serialNumberPolicyEditor.setVisible ( org.ovirt.engine.ui.uicommonweb.dataprovider.AsyncDataProvider.getInstance ( ) . isSerialNumberPolicySupported ( clusterVersion ) ) ; } }

Target:
public org.ovirt.engine.ui.common.widget.HasEnabledWithHints getCustomMigrationBandwidthLimitEditor ( ) { return customMigrationBandwidthLimitEditor ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { java.util.List < java.lang.String > pmOptions = ( ( java.util.ArrayList < java.lang.String > ) ( returnValue ) ) ; if ( pmOptions != null ) { getPmSecondaryPort ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmPortKey ) ) ; getPmSecondarySlot ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSlotKey ) ) ; getPmSecondarySecure ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmSecureKey ) ) ; getPmSecondaryEncryptOptions ( ) . setIsAvailable ( pmOptions.contains ( org.ovirt.engine.ui.uicommonweb.models.hosts.HostModel.PmEncryptOptions ) ) ; } }

Target:
public void eventRaised ( org.ovirt.engine.ui.uicompat.Event < ? extends org.ovirt.engine.ui.uicompat.EventArgs > ev , java.lang.Object sender , org.ovirt.engine.ui.uicompat.EventArgs args ) { setKernelCmdlineParsable ( false ) ; resetKernelCmdlineCheckboxes ( ) ; }
Source:
void updateStyles ( java.lang.Boolean isNarrowStyle ) { java.lang.String editorStyle = style.editorContentNarrow ( ) ; updateEditorStyle ( diskAliasLabel , editorStyle ) ; updateEditorStyle ( diskAliasEditor , editorStyle ) ; updateEditorStyle ( diskSizeLabel , editorStyle ) ; updateEditorStyle ( sourceStorageLabel , editorStyle ) ; updateEditorStyle ( volumeTypeListEditor , editorStyle ) ; updateEditorStyle ( volumeFormatListEditor , editorStyle ) ; updateEditorStyle ( sourceStorageListEditor , editorStyle ) ; updateEditorStyle ( storageListEditor , editorStyle ) ; updateEditorStyle ( diskProfileListEditor , editorStyle ) ; updateEditorStyle ( quotaListEditor , editorStyle ) ; }

Target:
void updateStyles ( java.lang.Boolean isNarrowStyle ) { java.lang.String editorStyle = ( isNarrowStyle ) ? style.editorContentNarrow ( ) : style.editorContent ( ) ; updateEditorStyle ( diskAliasLabel , editorStyle ) ; updateEditorStyle ( diskAliasEditor , editorStyle ) ; updateEditorStyle ( diskSizeLabel , editorStyle ) ; updateEditorStyle ( sourceStorageLabel , editorStyle ) ; updateEditorStyle ( volumeTypeListEditor , editorStyle ) ; updateEditorStyle ( volumeFormatListEditor , editorStyle ) ; updateEditorStyle ( sourceStorageListEditor , editorStyle ) ; updateEditorStyle ( storageListEditor , editorStyle ) ; updateEditorStyle ( diskProfileListEditor , editorStyle ) ; updateEditorStyle ( quotaListEditor , editorStyle ) ; }
Source:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; img.setstorage_ids ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return img ; }

Target:
private static org.ovirt.engine.core.common.businessentities.DiskImage createDiskImage ( int size ) { org.ovirt.engine.core.common.businessentities.DiskImage img = new org.ovirt.engine.core.common.businessentities.DiskImage ( ) ; img.setSizeInGigabytes ( size ) ; img.setActualSize ( size ) ; img.setId ( org.ovirt.engine.core.compat.Guid.NewGuid ( ) ) ; img.setStorageIds ( new java.util.ArrayList < org.ovirt.engine.core.compat.Guid > ( java.util.Arrays.asList ( org.ovirt.engine.core.bll.AddVmCommandTest.STORAGE_DOMAIN_ID ) ) ) ; return img ; }
Source:
protected boolean isPostZero ( ) { if ( ( cachedPostZero ) == null ) { cachedPostZero = org.ovirt.engine.core.dal.dbbroker.DbFacade.getInstance ( ) . getDiskDao ( ) . getAllForVm ( vmId ) . contains ( new java.lang.Object ( ) { @ java.lang.Override public boolean equals ( java.lang.Object obj ) { return ( obj != null ) && ( ( ( org.ovirt.engine.core.common.businessentities.Disk ) ( obj ) ) . isWipeAfterDelete ( ) ) ; } } ) ; } return cachedPostZero ; }

Target:
protected boolean isPostZero ( ) { if ( ( cachedPostZero ) == null ) { cachedPostZero = isDiskWithWipeAfterDeleteExist ( getDiskDao ( ) . getAllForVm ( vmId ) ) ; } return cachedPostZero ; }
Source:
public static void GetGlusterVolumeBrickDetails ( org.ovirt.engine.ui.frontend.AsyncQuery aQuery , org.ovirt.engine.core.compat.Guid clusterId , java.lang.String volume , java.lang.String brick ) { 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.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters parameters = new org.ovirt.engine.core.common.queries.gluster.GlusterVolumeAdvancedDetailsParameters ( clusterId , volume , brick , true ) ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetGlusterVolumeAdvancedDetails , parameters , aQuery ) ; }

Target:
public static void GetCustomPropertiesList ( 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.HashMap < org.ovirt.engine.core.compat.Version , java.lang.String > ) ( source ) ) : null ; } } ; org.ovirt.engine.ui.frontend.Frontend.RunQuery ( VdcQueryType.GetVmCustomProperties , new org.ovirt.engine.core.common.queries.VdcQueryParametersBase ( ) , aQuery ) ; }
Source:
private void removeImage ( ) { org.ovirt.engine.core.common.action.RemoveImageParameters removeImageParams = new org.ovirt.engine.core.common.action.RemoveImageParameters ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getParameters ( ) . getDestinationImageId ( ) ) ; removeImageParams.setStorageDomainId ( getDestinationStorageDomainId ( ) ) ; removeImageParams.setDbOperationScope ( ImageDbOperationScope.NONE ) ; removeImageParams.setShouldLockImage ( false ) ; removeImageParams.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( VdcActionType.RemoveImage , removeImageParams ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { addAuditLogOnRemoveFailure ( ) ; } }

Target:
private void removeImage ( ) { org.ovirt.engine.core.common.action.RemoveImageParameters removeImageParams = new org.ovirt.engine.core.common.action.RemoveImageParameters ( org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getParameters ( ) . getDestinationImageId ( ) ) ; removeImageParams.setStorageDomainId ( getDestinationStorageDomainId ( ) ) ; removeImageParams.setDbOperationScope ( ImageDbOperationScope.NONE ) ; removeImageParams.setShouldLockImage ( false ) ; removeImageParams.setEntityInfo ( new org.ovirt.engine.core.common.asynctasks.EntityInfo ( org.ovirt.engine.core.common.VdcObjectType.Disk , org.ovirt.engine.core.bll.snapshots.CreateSnapshotFromTemplateCommand.getDestinationDiskImage ( ) . getId ( ) ) ) ; org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalActionWithTasksContext ( ActionType.RemoveImage , removeImageParams ) ; if ( ! ( returnValue.getSucceeded ( ) ) ) { addAuditLogOnRemoveFailure ( ) ; } }
Source:
public void onTimer ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Start deleteAgedOutAuditLogs" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AuditLogAgingThreshold ) ) * ( - 1 ) ) ) ; auditLogDao.removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.info ( "Finished deleteAgedOutAuditLogs" ) ; } catch ( java.lang.RuntimeException e ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "deleteAgedOutAuditLog failed with exception" , e ) ; } }

Target:
public void cleanup ( ) { try { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.debug ( "Start cleanup" ) ; org.ovirt.engine.core.compat.DateTime latestTimeToKeep = org.ovirt.engine.core.compat.DateTime.getNow ( ) . addDays ( ( ( org.ovirt.engine.core.common.config.Config.< java.lang.Integer > getValue ( ConfigValues.AuditLogAgingThreshold ) ) * ( - 1 ) ) ) ; auditLogDao.removeAllBeforeDate ( latestTimeToKeep ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.debug ( "Finished cleanup" ) ; } catch ( java.lang.Throwable t ) { org.ovirt.engine.core.bll.AuditLogCleanupManager.log.error ( "Exception in performing audit log cleanup: {}" , org.apache.commons.lang.exception.ExceptionUtils.getRootCauseMessage ( t ) ) ; org.ovirt.engine.core.bll.AuditLogCleanupManager.log.debug ( "Exception" , t ) ; } }
Source:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToVdsGroupCommand.getVdsGroup ( ) . getCompatibilityVersion ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }

Target:
protected void executeCommand ( ) { final org.ovirt.engine.core.common.action.VdcReturnValueBase returnValue = runInternalAction ( VdcActionType.DetachNetworkFromClusterInternal , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getParameters ( ) ) ; setSucceeded ( returnValue.getSucceeded ( ) ) ; if ( returnValue.getSucceeded ( ) ) { if ( org.ovirt.engine.core.bll.network.cluster.NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval ( getPersistedNetwork ( ) , org.ovirt.engine.core.bll.network.cluster.DetachNetworkToClusterCommand.getCluster ( ) . getCompatibilityVersion ( ) ) ) { detachLabeledNetworksFromClusterHosts ( ) ; } } else { propagateFailure ( returnValue ) ; } }
Source:
public org.ovirt.engine.core.vdsbroker.vdsbroker.TaskInfoReturnForXmlRpc getTaskInfo ( java.lang.String taskUUID ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.getTaskInfo ( taskUUID ) ; org.ovirt.engine.core.vdsbroker.vdsbroker.TaskInfoReturnForXmlRpc wrapper = new org.ovirt.engine.core.vdsbroker.vdsbroker.TaskInfoReturnForXmlRpc ( 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 snapshot ( java.lang.String vmId , java.util.Map < java.lang.String , java.lang.String > [ ] disks ) { try { java.util.Map < java.lang.String , java.lang.Object > xmlRpcReturnValue = vdsServer.snapshot ( vmId , disks ) ; 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 static boolean isGlusterfsCliInstalled ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( org.ovirt.engine.core.common.FeatureSupported.glusterVolumeInfoSupported ( org.ovirt.engine.core.bll.storage.GLUSTERFSStorageHelper.getStoragePool ( vds.getId ( ) ) . getCompatibilityVersion ( ) ) ) { org.ovirt.engine.core.compat.RpmVersion glusterfsCliVer = vds.getGlusterfsCliVersion ( ) ; if ( ( ( glusterfsCliVer == null ) || ( ( glusterfsCliVer.getRpmRelease ( ) ) == null ) ) || ( glusterfsCliVer.getRpmRelease ( ) . isEmpty ( ) ) ) { return false ; } return true ; } return true ; }

Target:
public static boolean canVDSConnectToGlusterfs ( org.ovirt.engine.core.common.businessentities.VDS vds ) { if ( org.ovirt.engine.core.common.FeatureSupported.glusterVolumeInfoSupported ( org.ovirt.engine.core.bll.storage.GLUSTERFSStorageHelper.getStoragePool ( vds.getId ( ) ) . getCompatibilityVersion ( ) ) ) { org.ovirt.engine.core.compat.RpmVersion glusterfsCliVer = vds.getGlusterfsCliVersion ( ) ; return ( glusterfsCliVer != null ) && ( org.apache.commons.lang.StringUtils.isNotEmpty ( glusterfsCliVer.getRpmRelease ( ) ) ) ; } return true ; }
Source:
public static java.lang.String map ( org.ovirt.engine.core.common.businessentities.VdsProtocol protocol , java.lang.String template ) { java.lang.String result = null ; if ( protocol != null ) { switch ( protocol ) { case STOMP : result = VdsProtocol.STOMP.value ( ) ; break ; case AMQP : result = VdsProtocol.AMQP.value ( ) ; break ; case XML : default : result = VdsProtocol.XML.value ( ) ; break ; } } return result ; }

Target:
public static org.ovirt.engine.core.common.businessentities.VdsStatic map ( java.lang.String protocol , org.ovirt.engine.core.common.businessentities.VdsStatic template ) { org.ovirt.engine.core.common.businessentities.VdsStatic entity = ( template != null ) ? template : new org.ovirt.engine.core.common.businessentities.VdsStatic ( ) ; org.ovirt.engine.api.model.HostProtocol hostProtocol = org.ovirt.engine.api.model.HostProtocol.fromValue ( protocol ) ; org.ovirt.engine.core.common.businessentities.VdsProtocol result = null ; switch ( hostProtocol ) { case STOMP : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.STOMP ; break ; case AMQP : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.AMQP ; break ; case XML : default : result = org.ovirt.engine.core.common.businessentities.VdsProtocol.XML ; break ; } entity.setProtocol ( result ) ; return entity ; }
Source:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { vncImpl.setOptions ( ( ( org.ovirt.engine.core.common.console.ConsoleOptions ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ) ; vncImpl.getOptions ( ) . setTitle ( getClientTitle ( ) ) ; if ( ( vncImpl ) instanceof org.ovirt.engine.ui.uicommonweb.restapi.HasForeignMenuData ) { setForeignMenuData ( ( ( org.ovirt.engine.ui.uicommonweb.restapi.HasForeignMenuData ) ( vncImpl ) ) ) ; } vncImpl.invokeClient ( ) ; }

Target:
public void onSuccess ( java.lang.Object model , java.lang.Object returnValue ) { org.ovirt.engine.core.common.console.ConsoleOptions configuredOptions = ( ( org.ovirt.engine.core.common.console.ConsoleOptions ) ( ( ( org.ovirt.engine.core.common.queries.VdcQueryReturnValue ) ( returnValue ) ) . getReturnValue ( ) ) ) ; configuredOptions.setRemapCtrlAltDelete ( vncImpl.getOptions ( ) . isRemapCtrlAltDelete ( ) ) ; vncImpl.setOptions ( configuredOptions ) ; vncImpl.getOptions ( ) . setTitle ( getClientTitle ( ) ) ; if ( ( vncImpl ) instanceof org.ovirt.engine.ui.uicommonweb.restapi.HasForeignMenuData ) { setForeignMenuData ( ( ( org.ovirt.engine.ui.uicommonweb.restapi.HasForeignMenuData ) ( vncImpl ) ) ) ; } vncImpl.invokeClient ( ) ; }
Source:
public void onSucceeded ( org.ovirt.engine.core.compat.Guid cmdId , java.util.List < org.ovirt.engine.core.compat.Guid > childCmdIds ) { super . onSucceeded ( cmdId , childCmdIds ) ; log.info ( "Volume/Snapshot has been successfully deleted from Cinder. ID: {}" , getDiskId ( ) ) ; 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 ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . getParameters ( ) . setTaskGroupSuccess ( false ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.log.error ( "Failed deleting volume/snapshot from Cinder. ID: {}" , getDiskId ( ) ) ; org.ovirt.engine.core.bll.storage.RemoveCinderDiskCommandCallback.getCommand ( ) . endAction ( ) ; org.ovirt.engine.core.bll.tasks.CommandCoordinatorUtil.removeAllCommandsInHierarchy ( cmdId ) ; }