use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder in project openflowplugin by opendaylight.
the class MatchResponseConvertorTest method toOfPort.
private static MatchEntry toOfPort(final Class<? extends MatchField> field, final Long portNumber) {
MatchEntryBuilder builder = new MatchEntryBuilder();
builder.setOxmClass(OpenflowBasicClass.class);
builder.setHasMask(false);
builder.setOxmMatchField(field);
InPortCaseBuilder inPortCaseBuilder = new InPortCaseBuilder();
InPortBuilder portBuilder = new InPortBuilder();
portBuilder.setPortNumber(new PortNumber(portNumber));
inPortCaseBuilder.setInPort(portBuilder.build());
builder.setMatchEntryValue(inPortCaseBuilder.build());
return builder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder in project netvirt by opendaylight.
the class NeutronPortChangeListenerTest method addPort__NoFixedIps.
@Test
public void addPort__NoFixedIps() throws Exception {
PortBuilder pb = new PortBuilder();
pb.setUuid(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setNetworkId(new Uuid("12345678-1234-1234-1234-123456789012"));
pb.setMacAddress(new MacAddress("AA:BB:CC:DD:EE:FF"));
List<FixedIps> fixedIps = new ArrayList<>();
pb.setFixedIps(fixedIps);
Port port = pb.build();
neutronPortChangeListener.add(InstanceIdentifier.create(Port.class), port);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder in project openflowplugin by opendaylight.
the class BundleAddMessageConverter method convertBundlePortCase.
private BundlePortModCase convertBundlePortCase(final BundleInnerMessage messageCase, final VersionDatapathIdConvertorData data) throws ConversionException {
Optional<PortModInput> portModInput = Optional.empty();
final Class<?> clazz = messageCase.getImplementedInterface();
if (clazz.equals(BundleUpdatePortCase.class)) {
portModInput = CONVERTER_EXECUTOR.convert(new PortBuilder(((BundleUpdatePortCase) messageCase).getUpdatePortCaseData().getPort().getPort().get(0)).build(), data);
}
if (portModInput.isPresent()) {
return new BundlePortModCaseBuilder().setPortModCaseData(new PortModCaseDataBuilder(portModInput.get()).setXid(xid).build()).build();
} else {
throw new ConversionException("BundlePortCase conversion unsuccessful.");
}
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder in project openflowplugin by opendaylight.
the class MultipartRequestInputMessageFactory method setPortDesc.
private MultipartRequestPortDescCase setPortDesc(ByteBuf input) {
MultipartRequestPortDescCaseBuilder caseBuilder = new MultipartRequestPortDescCaseBuilder();
MultipartRequestPortDescBuilder portBuilder = new MultipartRequestPortDescBuilder();
portBuilder.setEmpty(true);
caseBuilder.setMultipartRequestPortDesc(portBuilder.build());
return caseBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder in project openflowplugin by opendaylight.
the class OF10StatsRequestInputFactory method setPortStats.
private MultipartRequestPortStatsCase setPortStats(ByteBuf input) {
MultipartRequestPortStatsCaseBuilder caseBuilder = new MultipartRequestPortStatsCaseBuilder();
MultipartRequestPortStatsBuilder portBuilder = new MultipartRequestPortStatsBuilder();
portBuilder.setPortNo((long) input.readUnsignedShort());
caseBuilder.setMultipartRequestPortStats(portBuilder.build());
return caseBuilder.build();
}
Aggregations