Search in sources :

Example 1 with NetworkLabel

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

the class GetNetworkLabelsByHostNicIdQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    VdsNetworkInterface nic = interfaceDao.get(getParameters().getId());
    getQueryReturnValue().setReturnValue(nic == null || !NetworkUtils.isLabeled(nic) ? Collections.<NetworkLabel>emptyList() : convertToNetworkLabels(nic.getLabels()));
}
Also used : VdsNetworkInterface(org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface) NetworkLabel(org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel)

Example 2 with NetworkLabel

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

the class GetNetworkLabelsByNetworkIdQuery method executeQueryCommand.

@Override
protected void executeQueryCommand() {
    Network network = networkDao.get(getParameters().getId(), getUserID(), getParameters().isFiltered());
    getQueryReturnValue().setReturnValue(network == null || !NetworkUtils.isLabeled(network) ? Collections.<NetworkLabel>emptyList() : new ArrayList<>(Arrays.asList(new NetworkLabel(network.getLabel()))));
}
Also used : Network(org.ovirt.engine.core.common.businessentities.network.Network) ArrayList(java.util.ArrayList) NetworkLabel(org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel)

Aggregations

NetworkLabel (org.ovirt.engine.core.common.businessentities.network.pseudo.NetworkLabel)2 ArrayList (java.util.ArrayList)1 Network (org.ovirt.engine.core.common.businessentities.network.Network)1 VdsNetworkInterface (org.ovirt.engine.core.common.businessentities.network.VdsNetworkInterface)1