use of org.opendaylight.yang.gen.v1.urn.opendaylight.neutron.provider.ext.rev150712.neutron.networks.network.SegmentsKey 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.augmentation(NetworkProviderExtension.class);
if (providerExtension != null) {
segmentationId = providerExtension.getSegmentationId();
if (segmentationId == null) {
Map<SegmentsKey, Segments> providerSegmentsMap = providerExtension.getSegments();
if (providerSegmentsMap != null && providerSegmentsMap.size() > 0) {
for (Segments providerSegment : providerSegmentsMap.values()) {
if (isNetworkSegmentType(providerSegment, networkType)) {
segmentationId = providerSegment.getSegmentationId();
break;
}
}
}
}
}
return segmentationId;
}
Aggregations