Search in sources :

Example 1 with IngressElementCountersRequestConfigBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.IngressElementCountersRequestConfigBuilder 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)

Example 2 with IngressElementCountersRequestConfigBuilder

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

the class StatisticsImpl method creatIngressEelementCountersContainerInConfig.

private void creatIngressEelementCountersContainerInConfig(ReadWriteTransaction transaction, InstanceIdentifier<IngressElementCountersRequestConfig> ecrcIdentifier) {
    IngressElementCountersRequestConfigBuilder iecrcb = new IngressElementCountersRequestConfigBuilder();
    List<CounterRequests> counterRequests = new ArrayList<>();
    iecrcb.setCounterRequests(counterRequests);
    IngressElementCountersRequestConfig iecrc = iecrcb.build();
    transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, iecrc, 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) ArrayList(java.util.ArrayList) CounterRequests(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests)

Aggregations

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