Search in sources :

Example 6 with ExperimenterInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder in project openflowplugin by opendaylight.

the class ExperimenterInputMessageFactoryTest method testV10Real.

/**
 * Testing of {@link ExperimenterInputMessageFactory} for correct serializer
 * lookup and serialization.
 */
@Test(expected = IllegalStateException.class)
public void testV10Real() throws Exception {
    startUp(true);
    ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF10_VERSION_ID);
    builder.setExperimenter(new ExperimenterId(42L));
    builder.setExpType(21L);
    builder.setExperimenterDataOfChoice(vendorData);
    ExperimenterInput input = builder.build();
    expFactory.serialize(input, out);
}
Also used : ExperimenterInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId) ExperimenterInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput) Test(org.junit.Test)

Example 7 with ExperimenterInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder in project openflowplugin by opendaylight.

the class ExperimenterInputMessageFactoryTest method testV13Real.

/**
 * Testing of {@link ExperimenterInputMessageFactory} for correct serializer
 * lookup and serialization.
 */
@Test(expected = IllegalStateException.class)
public void testV13Real() throws Exception {
    startUp(true);
    ExperimenterInputBuilder builder = new ExperimenterInputBuilder();
    BufferHelper.setupHeader(builder, EncodeConstants.OF13_VERSION_ID);
    builder.setExperimenter(new ExperimenterId(42L));
    builder.setExpType(22L);
    builder.setExperimenterDataOfChoice(vendorData);
    ExperimenterInput input = builder.build();
    expFactory.serialize(input, out);
}
Also used : ExperimenterInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder) ExperimenterId(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId) ExperimenterInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput) Test(org.junit.Test)

Example 8 with ExperimenterInputBuilder

use of org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder in project openflowplugin by opendaylight.

the class SalBundleServiceImpl method controlBundle.

@Override
public Future<RpcResult<Void>> controlBundle(ControlBundleInput input) {
    final SendExperimenterInputBuilder experimenterInputBuilder = new SendExperimenterInputBuilder();
    experimenterInputBuilder.setNode(input.getNode());
    experimenterInputBuilder.setExperimenterMessageOfChoice(new BundleControlSalBuilder().setSalControlData(new SalControlDataBuilder(input).build()).build());
    return experimenterMessageService.sendExperimenter(experimenterInputBuilder.build());
}
Also used : BundleControlSalBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.BundleControlSalBuilder) SalControlDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.bundle.control.sal.SalControlDataBuilder) SendExperimenterInputBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterInputBuilder)

Aggregations

ExperimenterInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInputBuilder)6 Test (org.junit.Test)5 ExperimenterId (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.ExperimenterId)5 ExperimenterInput (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.ExperimenterInput)5 SendExperimenterInputBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.experimenter.message.service.rev151020.SendExperimenterInputBuilder)2 ExperimenterDataOfChoice (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.experimenter.core.ExperimenterDataOfChoice)2 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)1 ByteBuf (io.netty.buffer.ByteBuf)1 ArrayList (java.util.ArrayList)1 BundleMessageDataInjector (org.opendaylight.openflowplugin.extension.api.BundleMessageDataInjector)1 TypeVersionKey (org.opendaylight.openflowplugin.extension.api.TypeVersionKey)1 ConversionException (org.opendaylight.openflowplugin.extension.api.exception.ConversionException)1 ConverterNotFoundException (org.opendaylight.openflowplugin.extension.api.exception.ConverterNotFoundException)1 ServiceException (org.opendaylight.openflowplugin.impl.services.util.ServiceException)1 ExperimenterMessageOfChoice (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.experimenter.types.rev151020.experimenter.core.message.ExperimenterMessageOfChoice)1 Message (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.add.bundle.messages.input.messages.Message)1 BundleAddMessageSalBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.BundleAddMessageSalBuilder)1 BundleControlSalBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.BundleControlSalBuilder)1 SalAddMessageDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.bundle.add.message.sal.SalAddMessageDataBuilder)1 SalControlDataBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.bundle.service.rev170124.send.experimenter.input.experimenter.message.of.choice.bundle.control.sal.SalControlDataBuilder)1