use of org.onosproject.openstacktelemetry.api.FlowInfo in project onos by opennetworkinglab.
the class TinaFlowInfoByteBufferCodecTest method testEncodeDecode.
@Test
public void testEncodeDecode() {
ByteBuffer buffer = codec.encode(info);
FlowInfo decoded = codec.decode(ByteBuffer.wrap(buffer.array()));
new EqualsTester().addEqualityGroup(info, decoded).testEquals();
}
use of org.onosproject.openstacktelemetry.api.FlowInfo in project onos by opennetworkinglab.
the class OpenstackTelemetryWebResource method getFlowInfoBulk.
/**
* Get flow information list.
*
* @return Flow information list
*/
@GET
@Path("list")
@Produces(MediaType.APPLICATION_JSON)
public Response getFlowInfoBulk() {
log.info("GET BULK FLOW RULE");
Set<FlowInfo> flowInfoSet;
flowInfoSet = statsFlowRuleService.getOverlayFlowInfos();
JsonCodec<FlowInfo> flowInfoCodec = new FlowInfoJsonCodec();
ObjectNode nodeJson;
int idx = 0;
for (FlowInfo flowInfo : flowInfoSet) {
nodeJson = flowInfoCodec.encode(flowInfo, this);
root.put("FlowInfo" + idx++, nodeJson.toString());
}
return ok(root).build();
}
Aggregations