use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputFactoryTest method decodeRequestQueue.
private static MultipartRequestQueueCase decodeRequestQueue(ByteBuf output) {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder builder = new MultipartRequestQueueBuilder();
builder.setPortNo(output.readUnsignedInt());
builder.setQueueId(output.readUnsignedInt());
caseBuilder.setMultipartRequestQueue(builder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder in project openflowplugin by opendaylight.
the class OneQueueOnePortService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetQueueStatisticsFromGivenPortInput input) throws ServiceException {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
// Select specific queue
mprQueueBuilder.setQueueId(input.getQueueId().getValue());
// Select specific port
final short version = getVersion();
mprQueueBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(OpenflowVersion.get(version), input.getNodeConnectorId()));
caseBuilder.setMultipartRequestQueue(mprQueueBuilder.build());
// Set request body to main multipart request
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPQUEUE, xid.getValue(), version);
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setQueue.
private MultipartRequestQueueCase setQueue(ByteBuf input) {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder queueBuilder = new MultipartRequestQueueBuilder();
queueBuilder.setPortNo(input.readUnsignedInt());
queueBuilder.setQueueId(input.readUnsignedInt());
caseBuilder.setMultipartRequestQueue(queueBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactoryTest method testQueue.
/**
* Testing OF10StatsRequestInputFactory (Queue) for correct serialization.
*/
@Test
public void testQueue() throws Exception {
MultipartRequestInputBuilder builder = new MultipartRequestInputBuilder();
BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
builder.setType(MultipartType.OFPMPQUEUE);
builder.setFlags(new MultipartRequestFlags(false));
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder queueBuilder = new MultipartRequestQueueBuilder();
queueBuilder.setPortNo(15L);
queueBuilder.setQueueId(16L);
caseBuilder.setMultipartRequestQueue(queueBuilder.build());
builder.setMultipartRequestBody(caseBuilder.build());
MultipartRequestInput message = builder.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
multipartFactory.serialize(message, out);
BufferHelper.checkHeaderV10(out, (byte) 16, 20);
Assert.assertEquals("Wrong type", 5, out.readUnsignedShort());
Assert.assertEquals("Wrong flags", 0, out.readUnsignedShort());
Assert.assertEquals("Wrong port-no", 15, out.readUnsignedShort());
out.skipBytes(2);
Assert.assertEquals("Wrong queue-id", 16, out.readUnsignedInt());
Assert.assertTrue("Unread data", out.readableBytes() == 0);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.queue._case.MultipartRequestQueueBuilder in project openflowplugin by opendaylight.
the class AllQueuesOnePortService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetAllQueuesStatisticsFromGivenPortInput input) throws ServiceException {
MultipartRequestQueueCaseBuilder caseBuilder = new MultipartRequestQueueCaseBuilder();
MultipartRequestQueueBuilder mprQueueBuilder = new MultipartRequestQueueBuilder();
// Select all queues
// Select specific port
final short version = getVersion();
mprQueueBuilder.setPortNo(InventoryDataServiceUtil.portNumberfromNodeConnectorId(OpenflowVersion.get(version), input.getNodeConnectorId()));
mprQueueBuilder.setQueueId(OFConstants.OFPQ_ALL);
caseBuilder.setMultipartRequestQueue(mprQueueBuilder.build());
// Set request body to main multipart request
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPQUEUE, xid.getValue(), version);
mprInput.setMultipartRequestBody(caseBuilder.build());
return mprInput.build();
}
Aggregations