use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.ElanDpnInterfacesListKey in project netvirt by opendaylight.
the class DhcpServiceUtils method getDpnsForElan.
@Nonnull
public static List<BigInteger> getDpnsForElan(String elanInstanceName, DataBroker broker) {
List<BigInteger> elanDpns = new LinkedList<>();
InstanceIdentifier<ElanDpnInterfacesList> elanDpnInstanceIdentifier = InstanceIdentifier.builder(ElanDpnInterfaces.class).child(ElanDpnInterfacesList.class, new ElanDpnInterfacesListKey(elanInstanceName)).build();
Optional<ElanDpnInterfacesList> elanDpnOptional = MDSALUtil.read(broker, LogicalDatastoreType.OPERATIONAL, elanDpnInstanceIdentifier);
if (elanDpnOptional.isPresent()) {
List<DpnInterfaces> dpns = elanDpnOptional.get().getDpnInterfaces();
for (DpnInterfaces dpnInterfaces : dpns) {
elanDpns.add(dpnInterfaces.getDpId());
}
}
return elanDpns;
}
Aggregations