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());
}
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);
}
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);
}
}
}
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);
}
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);
}
Aggregations