Search in sources :

Example 1 with CounterRequestsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsBuilder in project netvirt by opendaylight.

the class StatisticsImpl method putEgressElementCounterRequestInConfig.

private void putEgressElementCounterRequestInConfig(AcquireElementCountersRequestHandlerInput input, ElementCountersDirection direcion, ReadWriteTransaction transaction, String requestKey, InstanceIdentifier<EgressElementCountersRequestConfig> ecrcIdentifier, Optional<EgressElementCountersRequestConfig> eecrcOpt, String generatedUniqueId) {
    EgressElementCountersRequestConfig requestConfig = eecrcOpt.get();
    CounterRequestsBuilder crb = new CounterRequestsBuilder();
    crb.setRequestId(requestKey);
    crb.setKey(new CounterRequestsKey(requestKey));
    crb.setFilters(input.getIncomingTraffic().getFilters());
    crb.setPortId(input.getPortId());
    crb.setLportTag(getLportTag(input.getPortId()));
    crb.setDpn(getDpn(input.getPortId()));
    crb.setTrafficDirection(direcion.toString());
    crb.setGeneratedUniqueId(generatedUniqueId);
    List<CounterRequests> counterRequests = requestConfig.getCounterRequests();
    counterRequests.add(crb.build());
    EgressElementCountersRequestConfigBuilder ecrcb = new EgressElementCountersRequestConfigBuilder();
    ecrcb.setCounterRequests(counterRequests);
    requestConfig = ecrcb.build();
    transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, requestConfig, WriteTransaction.CREATE_MISSING_PARENTS);
}
Also used : EgressElementCountersRequestConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfig) EgressElementCountersRequestConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfigBuilder) CounterRequestsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsKey) CounterRequestsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsBuilder) CounterRequests(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests)

Example 2 with CounterRequestsBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsBuilder in project netvirt by opendaylight.

the class StatisticsImpl method putIngressElementCounterRequestInConfig.

private void putIngressElementCounterRequestInConfig(AcquireElementCountersRequestHandlerInput input, ElementCountersDirection direcion, ReadWriteTransaction transaction, String requestKey, InstanceIdentifier<IngressElementCountersRequestConfig> ecrcIdentifier, Optional<IngressElementCountersRequestConfig> iecrcOpt, String generatedUniqueId) {
    IngressElementCountersRequestConfig requestConfig = iecrcOpt.get();
    CounterRequestsBuilder crb = new CounterRequestsBuilder();
    crb.setRequestId(requestKey);
    crb.setKey(new CounterRequestsKey(requestKey));
    crb.setFilters(input.getOutgoingTraffic().getFilters());
    crb.setPortId(input.getPortId());
    crb.setLportTag(getLportTag(input.getPortId()));
    crb.setDpn(getDpn(input.getPortId()));
    crb.setTrafficDirection(direcion.toString());
    crb.setGeneratedUniqueId(generatedUniqueId);
    List<CounterRequests> counterRequests = requestConfig.getCounterRequests();
    counterRequests.add(crb.build());
    IngressElementCountersRequestConfigBuilder ecrcb = new IngressElementCountersRequestConfigBuilder();
    ecrcb.setCounterRequests(counterRequests);
    requestConfig = ecrcb.build();
    transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, requestConfig, WriteTransaction.CREATE_MISSING_PARENTS);
}
Also used : IngressElementCountersRequestConfig(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfig) IngressElementCountersRequestConfigBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfigBuilder) CounterRequestsKey(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsKey) CounterRequestsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsBuilder) CounterRequests(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests)

Aggregations

CounterRequests (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests)2 CounterRequestsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsBuilder)2 CounterRequestsKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequestsKey)2 EgressElementCountersRequestConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfig)1 EgressElementCountersRequestConfigBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.EgressElementCountersRequestConfigBuilder)1 IngressElementCountersRequestConfig (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfig)1 IngressElementCountersRequestConfigBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfigBuilder)1