use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class AllPortStatsService method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final GetAllNodeConnectorsStatisticsInput input) throws ServiceException {
MultipartRequestInputBuilder mprInput = RequestInputUtils.createMultipartHeader(MultipartType.OFPMPPORTSTATS, xid.getValue(), getVersion());
mprInput.setMultipartRequestBody(PORT_STATS_CASE);
return mprInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SalPortServiceImpl method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final UpdatePortInput input) throws ServiceException {
final Optional<PortModInput> ofPortModInput = convertorExecutor.convert(getPortFromInput(input), data);
final PortModInputBuilder mdInput = new PortModInputBuilder(ofPortModInput.orElse(PortConvertor.defaultResult(getVersion()))).setXid(xid.getValue());
return mdInput.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class DeviceContextImplTest method testProcessReply.
@Test
public void testProcessReply() {
final Error mockedError = mock(Error.class);
deviceContext.processReply(mockedError);
verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_FAILURE));
final OfHeader mockedOfHeader = mock(OfHeader.class);
deviceContext.processReply(mockedOfHeader);
verify(messageSpy).spyMessage(any(Class.class), eq(MessageSpy.StatisticsGroup.FROM_SWITCH_PUBLISHED_SUCCESS));
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class SingleLayerExperimenterMultipartServiceTest method buildRequest.
@Test
public void buildRequest() throws Exception {
final SendExperimenterMpRequestInput input = new SendExperimenterMpRequestInputBuilder().setExperimenterMessageOfChoice(mockExperimenter()).build();
final OfHeader ofHeader = service.buildRequest(DUMMY_XID, input);
assertEquals(MultipartRequest.class, ofHeader.getImplementedInterface());
final MultipartRequestExperimenter result = MultipartRequestExperimenter.class.cast(MultipartRequest.class.cast(ofHeader).getMultipartRequestBody());
assertEquals(DummyExperimenter.class, result.getExperimenterMessageOfChoice().getImplementedInterface());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.OfHeader in project openflowplugin by opendaylight.
the class NodeConfigServiceImplTest method testBuildRequest.
@Test
public void testBuildRequest() throws Exception {
nodeConfigService = new NodeConfigServiceImpl(mockedRequestContextStack, mockedDeviceContext);
final OfHeader request = nodeConfigService.buildRequest(new Xid(DUMMY_XID_VALUE), dummyConfigInput());
assertTrue(request instanceof org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput);
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput setConfigInput = (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.SetConfigInput) request;
assertEquals(DUMMY_FLAG, setConfigInput.getFlags());
assertEquals(DUMMY_MISS_SEARCH_LENGTH, setConfigInput.getMissSendLen());
assertEquals(DUMMY_XID_VALUE, setConfigInput.getXid());
}
Aggregations