Search in sources :

Example 1 with GetAclPortStatisticsOutputBuilder

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());
}
Also used : GetAclPortStatisticsOutput(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.GetAclPortStatisticsOutput) GetAclPortStatisticsOutputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.GetAclPortStatisticsOutputBuilder) AclPortStats(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.acl.stats.output.AclPortStats) Direction(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.Direction)

Aggregations

Direction (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.Direction)1 GetAclPortStatisticsOutput (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.GetAclPortStatisticsOutput)1 GetAclPortStatisticsOutputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.GetAclPortStatisticsOutputBuilder)1 AclPortStats (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.acl.live.statistics.rev161129.acl.stats.output.AclPortStats)1