use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network in project netvirt by opendaylight.
the class QosPolicyChangeListener method add.
private void add(InstanceIdentifier<DscpmarkingRules> identifier, DscpmarkingRules input) {
LOG.trace("Adding DscpMarkingRules : key: {}, value={}", identifier, input);
Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosNeutronUtils.handleNeutronNetworkQosUpdate(network, qosUuid);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.setPortDscpMarking(port, input);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network in project netvirt by opendaylight.
the class QosPolicyChangeListener method add.
protected void add(InstanceIdentifier<BandwidthLimitRules> identifier, BandwidthLimitRules input) {
LOG.trace("Adding BandwidthlimitRules : key: {}, value={}", identifier, input);
Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosNeutronUtils.handleNeutronNetworkQosUpdate(network, qosUuid);
qosAlertManager.addToQosAlertCache(network);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
qosAlertManager.addToQosAlertCache(port);
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.setPortBandwidthLimits(port, input, wrtConfigTxn);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network in project netvirt by opendaylight.
the class QosPolicyChangeListener method update.
private void update(Uuid qosUuid, DscpmarkingRules update) {
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosNeutronUtils.handleNeutronNetworkQosUpdate(network, qosUuid);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.setPortDscpMarking(port, update);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network in project netvirt by opendaylight.
the class QosPolicyChangeListener method remove.
private void remove(InstanceIdentifier<DscpmarkingRules> identifier, DscpmarkingRules input) {
LOG.trace("Removing DscpMarkingRules : key: {}, value={}", identifier, input);
Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosNeutronUtils.handleNeutronNetworkQosDscpRuleRemove(network);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.unsetPortDscpMark(port);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network in project netvirt by opendaylight.
the class QosPolicyChangeListener method remove.
private void remove(InstanceIdentifier<BandwidthLimitRules> identifier, BandwidthLimitRules input) {
LOG.trace("Removing BandwidthLimitRules : key: {}, value={}", identifier, input);
Uuid qosUuid = identifier.firstKeyOf(QosPolicy.class).getUuid();
BandwidthLimitRulesBuilder bwLimitBuilder = new BandwidthLimitRulesBuilder();
BandwidthLimitRules zeroBwLimitRule = bwLimitBuilder.setMaxBurstKbps(BigInteger.ZERO).setMaxKbps(BigInteger.ZERO).build();
for (Network network : qosNeutronUtils.getQosNetworks(qosUuid)) {
qosAlertManager.removeFromQosAlertCache(network);
qosNeutronUtils.handleNeutronNetworkQosBwRuleRemove(network, zeroBwLimitRule);
}
for (Port port : qosNeutronUtils.getQosPorts(qosUuid)) {
qosAlertManager.removeFromQosAlertCache(port);
jobCoordinator.enqueueJob("QosPort-" + port.getUuid().getValue(), () -> {
WriteTransaction wrtConfigTxn = dataBroker.newWriteOnlyTransaction();
List<ListenableFuture<Void>> futures = new ArrayList<>();
qosNeutronUtils.setPortBandwidthLimits(port, zeroBwLimitRule, wrtConfigTxn);
futures.add(wrtConfigTxn.submit());
return futures;
});
}
}
Aggregations