use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.ExperimenterBuilder in project openflowplugin by opendaylight.
the class SalBundleServiceImplTest method testAddBundleMessages.
@Test
public void testAddBundleMessages() throws Exception {
final List<Message> innerMessages = createMessages();
final Messages messages = new MessagesBuilder().setMessage(innerMessages).build();
final AddBundleMessagesInput input = new AddBundleMessagesInputBuilder().setNode(NODE_REF).setBundleId(BUNDLE_ID).setFlags(BUNDLE_FLAGS).setBundleProperty(properties).setMessages(messages).build();
final SalAddMessageDataBuilder dataBuilder = new SalAddMessageDataBuilder();
dataBuilder.setBundleId(BUNDLE_ID).setFlags(BUNDLE_FLAGS).setBundleProperty(properties);
final BundleAddMessageSalBuilder addMessageBuilder = new BundleAddMessageSalBuilder();
final SendExperimenterInputBuilder experimenterBuilder = new SendExperimenterInputBuilder().setNode(NODE_REF);
Mockito.when(experimenterMessageService.sendExperimenter(Matchers.any())).thenReturn(SettableFuture.create());
service.addBundleMessages(input);
for (Message msg : innerMessages) {
Mockito.verify(experimenterMessageService).sendExperimenter(experimenterBuilder.setExperimenterMessageOfChoice(addMessageBuilder.setSalAddMessageData(dataBuilder.setNode(NODE_REF).setBundleInnerMessage(msg.getBundleInnerMessage()).build()).build()).build());
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.ExperimenterBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setExperimenter.
private MultipartRequestExperimenterCase setExperimenter(ByteBuf input) {
MultipartRequestExperimenterCaseBuilder caseBuilder = new MultipartRequestExperimenterCaseBuilder();
MultipartRequestExperimenterBuilder experimenterBuilder = new MultipartRequestExperimenterBuilder();
caseBuilder.setMultipartRequestExperimenter(experimenterBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.ExperimenterBuilder in project openflowplugin by opendaylight.
the class AbstractOxmExperimenterMatchEntryDeserializer method createExperimenterIdCase.
protected ExperimenterIdCaseBuilder createExperimenterIdCase(MatchEntryBuilder entryBuilder, ByteBuf input) {
ExperimenterIdCaseBuilder expCaseBuilder = new ExperimenterIdCaseBuilder();
ExperimenterBuilder expBuilder = new ExperimenterBuilder();
expBuilder.setExperimenter(new ExperimenterId(input.readUnsignedInt()));
expCaseBuilder.setExperimenter(expBuilder.build());
return expCaseBuilder;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.band.type.band.type.ExperimenterBuilder in project openflowplugin by opendaylight.
the class MatchConvertor method tcpFlagsMatch.
private static void tcpFlagsMatch(List<MatchEntry> matchEntryList, TcpFlagsMatch tcpFlagsMatch) {
ExperimenterIdCaseBuilder expIdCaseBuilder = new ExperimenterIdCaseBuilder();
if (tcpFlagsMatch != null) {
MatchEntryBuilder matchEntryBuilder = new MatchEntryBuilder();
matchEntryBuilder.setOxmClass(ExperimenterClass.class);
matchEntryBuilder.setHasMask(false);
matchEntryBuilder.setOxmMatchField(TcpFlags.class);
TcpFlagsContainerBuilder tcpFlagsContainerBuilder = new TcpFlagsContainerBuilder();
TcpFlagsBuilder tcpFlagsBuilder = new TcpFlagsBuilder();
tcpFlagsBuilder.setFlags(tcpFlagsMatch.getTcpFlags());
if (tcpFlagsMatch.getTcpFlagsMask() != null) {
matchEntryBuilder.setHasMask(true);
tcpFlagsBuilder.setMask(ByteUtil.unsignedShortToBytes(tcpFlagsMatch.getTcpFlagsMask()));
}
tcpFlagsContainerBuilder.setTcpFlags(tcpFlagsBuilder.build());
// Set experimenter ID.
ExperimenterBuilder experimenterBuilder = new ExperimenterBuilder();
experimenterBuilder.setExperimenter(new ExperimenterId(OFApprovedExperimenterIds.MATCH_TCP_FLAGS_EXP_ID));
expIdCaseBuilder.setExperimenter(experimenterBuilder.build());
expIdCaseBuilder.addAugmentation(TcpFlagsContainer.class, tcpFlagsContainerBuilder.build());
matchEntryBuilder.setMatchEntryValue(expIdCaseBuilder.build());
matchEntryList.add(matchEntryBuilder.build());
}
}
Aggregations