use of org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter in project ovirt-engine by oVirt.
the class BackendVmNicFilterParametersResource method list.
@Override
public NetworkFilterParameters list() {
NetworkFilterParameters parameters = new NetworkFilterParameters();
List<VmNicFilterParameter> entities = getBackendCollection(QueryType.GetVmInterfaceFilterParametersByVmInterfaceId, new IdQueryParameters(nicId));
for (VmNicFilterParameter entity : entities) {
NetworkFilterParameter parameter = populate(map(entity), entity);
parameters.getNetworkFilterParameters().add(addLinks(parameter));
}
return parameters;
}
use of org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter in project ovirt-engine by oVirt.
the class VmInfoBuildUtils method addNetworkFiltersToNic.
public void addNetworkFiltersToNic(Map<String, Object> struct, VmNic vmNic) {
final NetworkFilter networkFilter = fetchVnicProfileNetworkFilter(vmNic);
if (networkFilter != null) {
final String networkFilterName = networkFilter.getName();
struct.put(VdsProperties.NW_FILTER, networkFilterName);
final List<VmNicFilterParameter> vmNicFilterParameters = getAllNetworkFiltersForVmNic(vmNic.getId());
struct.put(VdsProperties.NETWORK_FILTER_PARAMETERS, mapVmNicFilterParameter(vmNicFilterParameters));
}
}
use of org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter in project ovirt-engine by oVirt.
the class VmNicFilterParameterValidatorTest method setUp.
@Before
public void setUp() {
validator = new VmNicFilterParameterValidator(vmNicFilterParameterDao, vmNicDao);
VmNetworkInterface vmNetworkInterface = new VmNetworkInterface();
vmNetworkInterface.setVmId(usedId);
when(vmNicDao.get(usedId)).thenReturn(vmNetworkInterface);
when(vmNicFilterParameterDao.get(usedId)).thenReturn(new VmNicFilterParameter());
when(vmDao.get(usedId)).thenReturn(new VM());
}
use of org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter in project ovirt-engine by oVirt.
the class VmInfoBuildUtilsTest method createVmNicFilterParameters.
List<VmNicFilterParameter> createVmNicFilterParameters() {
List<VmNicFilterParameter> vmNicFilterParameters = new ArrayList();
vmNicFilterParameters.add(new VmNicFilterParameter(NETWORK_FILTER_PARAMETER_0_ID, VM_NIC_ID, NETWORK_FILTER_PARAMETER_0_NAME, NETWORK_FILTER_PARAMETER_0_VALUE));
vmNicFilterParameters.add(new VmNicFilterParameter(NETWORK_FILTER_PARAMETER_1_ID, VM_NIC_ID, NETWORK_FILTER_PARAMETER_1_NAME, NETWORK_FILTER_PARAMETER_1_VALUE));
return vmNicFilterParameters;
}
use of org.ovirt.engine.core.common.businessentities.network.VmNicFilterParameter in project ovirt-engine by oVirt.
the class BaseEditVmInterfaceModel method initNetworkFilterParameters.
protected void initNetworkFilterParameters(AsyncQuery<List<NetworkFilterParameterModel>> aQuery) {
aQuery.converterCallback = returnValue -> {
List<NetworkFilterParameterModel> parameters = new ArrayList<>();
if (returnValue == null) {
return parameters;
}
for (VmNicFilterParameter parameter : (List<VmNicFilterParameter>) returnValue) {
parameters.add(new NetworkFilterParameterModel(parameter));
}
return parameters;
};
AsyncDataProvider.getInstance().getVnicInteraceNetworkFilterParameters(aQuery, getNic().getId());
}
Aggregations