Search in sources :

Example 11 with ElanInterfaces

use of org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanInterfaces in project netvirt by opendaylight.

the class ElanServiceProvider method getElanInterfaces.

@Override
@Nonnull
public List<String> getElanInterfaces(String elanInstanceName) {
    List<String> elanInterfaces = new ArrayList<>();
    InstanceIdentifier<ElanInterfaces> elanInterfacesIdentifier = InstanceIdentifier.builder(ElanInterfaces.class).build();
    Optional<ElanInterfaces> elanInterfacesOptional = ElanUtils.read(broker, LogicalDatastoreType.CONFIGURATION, elanInterfacesIdentifier);
    if (!elanInterfacesOptional.isPresent()) {
        return elanInterfaces;
    }
    List<ElanInterface> elanInterfaceList = elanInterfacesOptional.get().getElanInterface();
    for (ElanInterface elanInterface : elanInterfaceList) {
        if (elanInterface.getElanInstanceName().equals(elanInstanceName)) {
            elanInterfaces.add(elanInterface.getName());
        }
    }
    return elanInterfaces;
}
Also used : ElanInterfaces(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanInterfaces) ElanInterface(org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface) ArrayList(java.util.ArrayList) Nonnull(javax.annotation.Nonnull)

Aggregations

Elan (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.Elan)7 ArrayList (java.util.ArrayList)6 ElanInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.instances.ElanInstance)4 ListenableFuture (com.google.common.util.concurrent.ListenableFuture)3 ElanDpnInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.ElanDpnInterfaces)3 ElanInterface (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.interfaces.ElanInterface)3 BigInteger (java.math.BigInteger)2 ReadWriteTransaction (org.opendaylight.controller.md.sal.binding.api.ReadWriteTransaction)2 WriteTransaction (org.opendaylight.controller.md.sal.binding.api.WriteTransaction)2 InterfaceInfo (org.opendaylight.genius.interfacemanager.globals.InterfaceInfo)2 EtreeInstance (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.etree.rev160614.EtreeInstance)2 ElanInterfaceMac (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan._interface.forwarding.entries.ElanInterfaceMac)2 DpnInterfaces (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.dpn.interfaces.elan.dpn.interfaces.list.DpnInterfaces)2 ElanBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.ElanBuilder)2 ElanKey (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.elan.state.ElanKey)2 MacEntry (org.opendaylight.yang.gen.v1.urn.opendaylight.netvirt.elan.rev150602.forwarding.entries.MacEntry)2 Optional (com.google.common.base.Optional)1 Collections (java.util.Collections)1 Collections.emptyList (java.util.Collections.emptyList)1 List (java.util.List)1