Search in sources :

Example 1 with RuleTypes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypes in project netvirt by opendaylight.

the class QosPolicyChangeListener method getRuleTypes.

private RuleTypes getRuleTypes(String ruleType) {
    RuleTypesBuilder rtBuilder = new RuleTypesBuilder();
    rtBuilder.setRuleType(ruleType);
    return rtBuilder.build();
}
Also used : RuleTypesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypesBuilder) QosRuleTypesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypesBuilder)

Example 2 with RuleTypes

use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypes in project netvirt by opendaylight.

the class QosPolicyChangeListener method supportedQoSRuleTypes.

private void supportedQoSRuleTypes() {
    QosRuleTypesBuilder qrtBuilder = new QosRuleTypesBuilder();
    List<RuleTypes> value = new ArrayList<>();
    value.add(getRuleTypes("bandwidth_limit_rules"));
    value.add(getRuleTypes("dscp_marking_rules"));
    qrtBuilder.setRuleTypes(value);
    LoggingFutures.addErrorLogging(txRunner.callWithNewWriteOnlyTransactionAndSubmit(OPERATIONAL, tx -> {
        InstanceIdentifier instanceIdentifier = InstanceIdentifier.create(Neutron.class).child(QosRuleTypes.class);
        tx.merge(instanceIdentifier, qrtBuilder.build());
    }), LOG, "Error setting up supported QoS rule types");
}
Also used : QosRuleTypesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypesBuilder) CONFIGURATION(org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION) RuleTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypes) LoggerFactory(org.slf4j.LoggerFactory) Executors(org.opendaylight.infrautils.utils.concurrent.Executors) ManagedNewTransactionRunner(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner) Singleton(javax.inject.Singleton) Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) RuleTypesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypesBuilder) Neutron(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.rev150712.Neutron) QosPolicies(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosPolicies) ArrayList(java.util.ArrayList) QosServiceRecoveryHandler(org.opendaylight.netvirt.qosservice.recovery.QosServiceRecoveryHandler) RecoverableListener(org.opendaylight.serviceutils.srm.RecoverableListener) QosRuleTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypes) Inject(javax.inject.Inject) QosRuleTypesBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypesBuilder) PreDestroy(javax.annotation.PreDestroy) DscpmarkingRules(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.DscpmarkingRules) LoggingFutures(org.opendaylight.infrautils.utils.concurrent.LoggingFutures) Logger(org.slf4j.Logger) AbstractClusteredAsyncDataTreeChangeListener(org.opendaylight.serviceutils.tools.listener.AbstractClusteredAsyncDataTreeChangeListener) JobCoordinator(org.opendaylight.infrautils.jobcoordinator.JobCoordinator) ServiceRecoveryRegistry(org.opendaylight.serviceutils.srm.ServiceRecoveryRegistry) Port(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port) List(java.util.List) Network(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.networks.rev150712.networks.attributes.networks.Network) ManagedNewTransactionRunnerImpl(org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) LogicalDatastoreType(org.opendaylight.mdsal.common.api.LogicalDatastoreType) QosPolicy(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.QosPolicy) Collections(java.util.Collections) NonNull(org.eclipse.jdt.annotation.NonNull) OPERATIONAL(org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL) DataBroker(org.opendaylight.mdsal.binding.api.DataBroker) BandwidthLimitRules(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.policies.qos.policy.BandwidthLimitRules) ArrayList(java.util.ArrayList) InstanceIdentifier(org.opendaylight.yangtools.yang.binding.InstanceIdentifier) RuleTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypes) QosRuleTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypes) QosRuleTypes(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypes)

Aggregations

QosRuleTypesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.QosRuleTypesBuilder)2 RuleTypesBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.qos.rev160613.qos.attributes.qos.rule.types.RuleTypesBuilder)2 ArrayList (java.util.ArrayList)1 Collections (java.util.Collections)1 List (java.util.List)1 PreDestroy (javax.annotation.PreDestroy)1 Inject (javax.inject.Inject)1 Singleton (javax.inject.Singleton)1 NonNull (org.eclipse.jdt.annotation.NonNull)1 JobCoordinator (org.opendaylight.infrautils.jobcoordinator.JobCoordinator)1 Executors (org.opendaylight.infrautils.utils.concurrent.Executors)1 LoggingFutures (org.opendaylight.infrautils.utils.concurrent.LoggingFutures)1 DataBroker (org.opendaylight.mdsal.binding.api.DataBroker)1 CONFIGURATION (org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION)1 OPERATIONAL (org.opendaylight.mdsal.binding.util.Datastore.OPERATIONAL)1 ManagedNewTransactionRunner (org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner)1 ManagedNewTransactionRunnerImpl (org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl)1 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)1 QosServiceRecoveryHandler (org.opendaylight.netvirt.qosservice.recovery.QosServiceRecoveryHandler)1 RecoverableListener (org.opendaylight.serviceutils.srm.RecoverableListener)1