use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.provider.ext.rev150712.NetworkProviderExtension in project netvirt by opendaylight.
the class NeutronUtils method getSegmentationIdFromNeutronNetwork.
public static <T extends NetworkTypeBase> String getSegmentationIdFromNeutronNetwork(Network network, Class<T> networkType) {
String segmentationId = null;
NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
segmentationId = providerExtension.getSegmentationId();
if (segmentationId == null) {
List<Segments> providerSegments = providerExtension.getSegments();
if (providerSegments != null && providerSegments.size() > 0) {
for (Segments providerSegment : providerSegments) {
if (isNetworkSegmentType(providerSegment, networkType)) {
segmentationId = providerSegment.getSegmentationId();
break;
}
}
}
}
}
return segmentationId;
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.provider.ext.rev150712.NetworkProviderExtension in project netvirt by opendaylight.
the class NeutronUtils method getSegmentationIdFromNeutronNetworkSegment.
public static String getSegmentationIdFromNeutronNetworkSegment(Network network, Long index) {
String segmentationId = null;
NetworkProviderExtension providerExtension = network.getAugmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
List<Segments> providerSegments = providerExtension.getSegments();
if (providerSegments != null && providerSegments.size() > 0) {
for (Segments providerSegment : providerSegments) {
if (Objects.equals(providerSegment.getSegmentationIndex(), index)) {
segmentationId = providerSegment.getSegmentationId();
break;
}
}
}
}
return segmentationId;
}
Aggregations