use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.
the class OutboundQueueProviderImpl method createBarrierRequest.
@Nonnull
@Override
public BarrierInput createBarrierRequest(@Nonnull final Long xid) {
final BarrierInputBuilder biBuilder = new BarrierInputBuilder();
biBuilder.setVersion(ofVersion);
biBuilder.setXid(xid);
return biBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.
the class ConnectionAdapterImplTest method testConsume3.
/**
* Tests {@link ConnectionAdapterImpl#consume(DataObject)} with expected rpc.
*/
@Test
public void testConsume3() {
final BarrierInputBuilder inputBuilder = new BarrierInputBuilder();
inputBuilder.setVersion((short) EncodeConstants.OF13_VERSION_ID);
inputBuilder.setXid(42L);
final BarrierInput barrierInput = inputBuilder.build();
final RpcResponseKey key = new RpcResponseKey(42L, "org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierOutput");
final ResponseExpectedRpcListener<OfHeader> listener = new ResponseExpectedRpcListener<>(barrierInput, "failure", mockCache, key);
cache.put(key, listener);
final BarrierOutputBuilder barrierBuilder = new BarrierOutputBuilder();
barrierBuilder.setXid(42L);
final BarrierOutput barrierOutput = barrierBuilder.build();
adapter.consume(barrierOutput);
final ResponseExpectedRpcListener<?> ifPresent = cache.getIfPresent(key);
Assert.assertNull("Listener was not discarded", ifPresent);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.
the class FlowCapableTransactionServiceImpl method buildRequest.
@Override
protected OfHeader buildRequest(final Xid xid, final SendBarrierInput input) throws ServiceException {
final BarrierInputBuilder barrierInputOFJavaBuilder = new BarrierInputBuilder();
barrierInputOFJavaBuilder.setVersion(getVersion());
barrierInputOFJavaBuilder.setXid(xid.getValue());
return barrierInputOFJavaBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.
the class OF10BarrierInputMessageFactoryTest method test.
/**
* Testing of {@link OF10BarrierInputMessageFactory} for correct translation from POJO.
*/
@Test
public void test() throws Exception {
BarrierInputBuilder bib = new BarrierInputBuilder();
BufferHelper.setupHeader(bib, EncodeConstants.OF10_VERSION_ID);
BarrierInput bi = bib.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
barrierFactory.serialize(bi, out);
BufferHelper.checkHeaderV10(out, (byte) 18, 8);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.BarrierInputBuilder in project openflowplugin by opendaylight.
the class BarrierInputMessageFactoryTest method test.
/**
* Testing of {@link BarrierInputMessageFactory} for correct translation from POJO.
*/
@Test
public void test() throws Exception {
BarrierInputBuilder bib = new BarrierInputBuilder();
BufferHelper.setupHeader(bib, EncodeConstants.OF13_VERSION_ID);
BarrierInput bi = bib.build();
ByteBuf out = UnpooledByteBufAllocator.DEFAULT.buffer();
barrierFactory.serialize(bi, out);
BufferHelper.checkHeaderV13(out, BARRIER_REQUEST_MESSAGE_CODE_TYPE, 8);
}
Aggregations