Search in sources :

Example 1 with NetworkFilter

use of org.ovirt.engine.core.common.businessentities.network.NetworkFilter in project ovirt-engine by oVirt.

the class VmInfoBuildUtilsTest method setUp.

@Before
public void setUp() {
    injectorRule.bind(AuditLogDirector.class, auditLogDirector);
    diskImage.setDiskProfileId(Guid.newGuid());
    qos = new StorageQos();
    qos.setId(Guid.newGuid());
    vmDevice = new VmDevice();
    VnicProfile vnicProfile = new VnicProfile();
    vnicProfile.setNetworkFilterId(NETWORK_FILTER_ID);
    when(vnicProfileDao.get(VNIC_PROFILE_ID)).thenReturn(vnicProfile);
    NetworkFilter networkFilter = new NetworkFilter();
    networkFilter.setName(NETWORK_FILTER_NAME);
    when(networkFilterDao.getNetworkFilterById(NETWORK_FILTER_ID)).thenReturn(networkFilter);
    when(vmNicFilterParameterDao.getAllForVmNic(VM_NIC_ID)).thenReturn(createVmNicFilterParameters());
}
Also used : StorageQos(org.ovirt.engine.core.common.businessentities.qos.StorageQos) VmDevice(org.ovirt.engine.core.common.businessentities.VmDevice) NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter) VnicProfile(org.ovirt.engine.core.common.businessentities.network.VnicProfile) Before(org.junit.Before)

Example 2 with NetworkFilter

use of org.ovirt.engine.core.common.businessentities.network.NetworkFilter in project ovirt-engine by oVirt.

the class GetAllSupportedNetworkFiltersByVersionQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    Version version = getParameters().getVersion();
    Collection<NetworkFilter> networkFilters = networkFilterDao.getAllSupportedNetworkFiltersByVersion(version);
    getQueryReturnValue().setReturnValue(networkFilters);
}
Also used : Version(org.ovirt.engine.core.compat.Version) NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter)

Example 3 with NetworkFilter

use of org.ovirt.engine.core.common.businessentities.network.NetworkFilter in project ovirt-engine by oVirt.

the class AddVnicProfileCommand method updateDefaultNetworkFilterIfRequired.

private void updateDefaultNetworkFilterIfRequired() {
    if (getParameters().isUseDefaultNetworkFilterId() && !getVnicProfile().isPassthrough()) {
        final NetworkFilter networkFilter = networkHelper.resolveVnicProfileDefaultNetworkFilter();
        if (networkFilter != null) {
            final Guid networkFilterId = networkFilter.getId();
            setNetworkFilterId(networkFilterId);
        }
    }
}
Also used : NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter) Guid(org.ovirt.engine.core.compat.Guid)

Example 4 with NetworkFilter

use of org.ovirt.engine.core.common.businessentities.network.NetworkFilter in project ovirt-engine by oVirt.

the class VnicProfileValidator method validNetworkFilterId.

public ValidationResult validNetworkFilterId() {
    final Guid networkFilterId = getNetworkFilterId();
    if (networkFilterId == null) {
        return ValidationResult.VALID;
    }
    NetworkFilter networkFilter = networkFilterDao.getNetworkFilterById(networkFilterId);
    return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_INVALID_VNIC_PROFILE_NETWORK_FILTER_ID, ReplacementUtils.createSetVariableString(VAR_VNIC_PROFILE_NAME, vnicProfile.getName()), ReplacementUtils.createSetVariableString(VAR_NETWORK_FILTER_ID, networkFilterId)).when(networkFilter == null);
}
Also used : NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter) Guid(org.ovirt.engine.core.compat.Guid)

Example 5 with NetworkFilter

use of org.ovirt.engine.core.common.businessentities.network.NetworkFilter in project ovirt-engine by oVirt.

the class GetNetworkFilterByIdQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    final NetworkFilter networkFilter = networkFilterDao.getNetworkFilterById(getParameters().getId());
    getQueryReturnValue().setReturnValue(networkFilter);
}
Also used : NetworkFilter(org.ovirt.engine.core.common.businessentities.network.NetworkFilter)

Aggregations

NetworkFilter (org.ovirt.engine.core.common.businessentities.network.NetworkFilter)20 Test (org.junit.Test)7 VnicProfile (org.ovirt.engine.core.common.businessentities.network.VnicProfile)4 Version (org.ovirt.engine.core.compat.Version)3 Network (org.ovirt.engine.core.common.businessentities.network.Network)2 Guid (org.ovirt.engine.core.compat.Guid)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Before (org.junit.Before)1 VmDevice (org.ovirt.engine.core.common.businessentities.VmDevice)1 NetworkQoS (org.ovirt.engine.core.common.businessentities.network.NetworkQoS)1 VmInterfaceType (org.ovirt.engine.core.common.businessentities.network.VmInterfaceType)1 VmNicFilterParameter (org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter)1 StorageQos (org.ovirt.engine.core.common.businessentities.qos.StorageQos)1