use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.GetAclPortStatisticsOutputBuilder in project netvirt by opendaylight.
the class AclLiveStatisticsRpcServiceImpl method getAclPortStatistics.
@Override
public Future<RpcResult<GetAclPortStatisticsOutput>> getAclPortStatistics(GetAclPortStatisticsInput input) {
LOG.trace("Get ACL port statistics for input: {}", input);
RpcResultBuilder<GetAclPortStatisticsOutput> rpcResultBuilder;
if (this.securityGroupMode != SecurityGroupMode.Stateful) {
rpcResultBuilder = RpcResultBuilder.failed();
rpcResultBuilder.withError(ErrorType.APPLICATION, "operation-not-supported", "Operation not supported for ACL " + this.securityGroupMode + " mode");
return Futures.immediateFuture(rpcResultBuilder.build());
}
// Default direction is Both
Direction direction = input.getDirection() == null ? Direction.Both : input.getDirection();
List<AclPortStats> lstAclInterfaceStats = AclLiveStatisticsHelper.getAclPortStats(direction, input.getInterfaceNames(), this.odlDirectStatsService, this.dataBroker);
GetAclPortStatisticsOutputBuilder output = new GetAclPortStatisticsOutputBuilder().setAclPortStats(lstAclInterfaceStats);
rpcResultBuilder = RpcResultBuilder.success();
rpcResultBuilder.withResult(output.build());
return Futures.immediateFuture(rpcResultBuilder.build());
}
Aggregations