Search in sources :

Example 11 with PortBuilder

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();
}
Also used : MatchEntryBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder) InPortCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.InPortCaseBuilder) InPortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entry.value.grouping.match.entry.value.in.port._case.InPortBuilder) PortNumber(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)

Example 12 with PortBuilder

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);
}
Also used : Uuid(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid) PortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder) Port(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port) ArrayList(java.util.ArrayList) FixedIps(org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps) MacAddress(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress) Test(org.junit.Test)

Example 13 with PortBuilder

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.");
    }
}
Also used : ConversionException(org.opendaylight.openflowplugin.extension.api.exception.ConversionException) PortModCaseDataBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.bundle.port.mod._case.PortModCaseDataBuilder) BundlePortModCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.onf.rev170124.bundle.add.message.grouping.bundle.inner.message.BundlePortModCaseBuilder) PortBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder) PortModInput(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.PortModInput)

Example 14 with PortBuilder

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();
}
Also used : MultipartRequestPortDescBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.desc._case.MultipartRequestPortDescBuilder) MultipartRequestPortDescCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortDescCaseBuilder)

Example 15 with PortBuilder

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();
}
Also used : MultipartRequestPortStatsCaseBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder) MultipartRequestPortStatsBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder)

Aggregations

Test (org.junit.Test)9 ArrayList (java.util.ArrayList)6 MacAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.MacAddress)6 MatchEntryBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntryBuilder)6 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)4 PortBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.PortBuilder)4 PortNumber (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.types.rev130731.PortNumber)4 BigInteger (java.math.BigInteger)3 VersionDatapathIdConvertorData (org.opendaylight.openflowplugin.openflow.md.core.sal.convertor.data.VersionDatapathIdConvertorData)3 PortNumberUni (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.PortNumberUni)3 PortBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.port.rev130925.port.mod.port.PortBuilder)3 FixedIps (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.port.attributes.FixedIps)3 Port (org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.ports.rev150712.ports.attributes.ports.Port)3 MatchEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.entries.grouping.MatchEntry)3 MatchBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.oxm.rev150225.match.grouping.MatchBuilder)3 MultipartRequestPortStatsCaseBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.MultipartRequestPortStatsCaseBuilder)3 MultipartRequestPortStatsBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.protocol.rev130731.multipart.request.multipart.request.body.multipart.request.port.stats._case.MultipartRequestPortStatsBuilder)3 IpAddress (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress)2 Ipv4Address (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address)2 SctpMatch (org.opendaylight.yang.gen.v1.urn.opendaylight.model.match.types.rev131026.match.layer._4.match.SctpMatch)2