2 * Copyright (c) 2017 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.groupbasedpolicy.renderer.vpp.util;
10 import com.google.common.base.Optional;
11 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
12 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
13 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.InterfacesState;
14 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.interfaces.rev140508.interfaces.state.Interface;
15 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
17 import java.util.List;
20 * Created by Shakib Ahmed on 7/18/17.
22 public class InterfaceUtil {
24 public static List<Interface> getOperationalInterfaces(DataBroker vppDataBroker) {
25 final Optional<InterfacesState> opInterfaceState = GbpNetconfTransaction.read(vppDataBroker,
26 LogicalDatastoreType.OPERATIONAL, InstanceIdentifier.create(InterfacesState.class),
27 GbpNetconfTransaction.RETRY_COUNT);
29 if (!opInterfaceState.isPresent()) {
33 return opInterfaceState.get().getInterface();