use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests 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);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests in project netvirt by opendaylight.
the class StatisticsImpl method deleteCounterRequest.
private void deleteCounterRequest(CounterRequests counterRequest, ElementCountersDirection direction) {
WriteTransaction tx = db.newWriteOnlyTransaction();
if (ElementCountersDirection.INGRESS.equals(direction)) {
tx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(IngressElementCountersRequestConfig.class).child(CounterRequests.class, new CounterRequestsKey(counterRequest.getKey().getRequestId())).build());
} else if (ElementCountersDirection.EGRESS.equals(direction)) {
tx.delete(LogicalDatastoreType.CONFIGURATION, InstanceIdentifier.builder(EgressElementCountersRequestConfig.class).child(CounterRequests.class, new CounterRequestsKey(counterRequest.getKey().getRequestId())).build());
}
tx.submit();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests in project netvirt by opendaylight.
the class StatisticsImpl method creatEgressEelementCountersContainerInConfig.
private void creatEgressEelementCountersContainerInConfig(ReadWriteTransaction transaction, InstanceIdentifier<EgressElementCountersRequestConfig> ecrcIdentifier) {
EgressElementCountersRequestConfigBuilder eecrcb = new EgressElementCountersRequestConfigBuilder();
List<CounterRequests> counterRequests = new ArrayList<>();
eecrcb.setCounterRequests(counterRequests);
EgressElementCountersRequestConfig eecrc = eecrcb.build();
transaction.put(LogicalDatastoreType.CONFIGURATION, ecrcIdentifier, eecrc, WriteTransaction.CREATE_MISSING_PARENTS);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests in project netvirt by opendaylight.
the class StatisticsImpl method removeAllElementCounterRequestsOnPort.
private void removeAllElementCounterRequestsOnPort(String interfaceId, List<CounterRequests> counterRequests) {
unbindCountersServiceIfBound(interfaceId, ElementCountersDirection.INGRESS);
unbindCountersServiceIfBound(interfaceId, ElementCountersDirection.EGRESS);
if (counterRequests != null) {
for (CounterRequests counterRequest : counterRequests) {
if (interfaceId.equals(counterRequest.getPortId())) {
countersRequestCleanup(counterRequest);
}
}
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.statistics.rev170120.counterrequestsconfig.CounterRequests in project netvirt by opendaylight.
the class StatisticsImpl method removeAllElementCounterRequests.
private void removeAllElementCounterRequests(List<CounterRequests> counterRequests) {
for (CounterRequests counterRequest : counterRequests) {
unbindCountersServiceIfBound(counterRequest.getPortId(), ElementCountersDirection.INGRESS);
unbindCountersServiceIfBound(counterRequest.getPortId(), ElementCountersDirection.EGRESS);
countersRequestCleanup(counterRequest);
}
}
Aggregations