- /**
- * This private does a get on the interface subtree of the device with the
- * interface name as the key and return the class corresponding to the
- * interface type.
- *
- * @param interfaceName
- * Name of the interface
- * @param deviceDb
- * Reference to device's databroker.
- *
- * @return true/false based on status of operation
- */
-
- private Class<? extends InterfaceType> getInterfaceType(DataBroker deviceDb, String interfaceName) {
- ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
- InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
- Interface.class, new InterfaceKey(interfaceName));
- try {
- Optional<Interface> interfaceObject = rtx.read(LogicalDatastoreType.OPERATIONAL, interfacesIID).get();
- if (interfaceObject.isPresent()) {
- return interfaceObject.get().getType();
- } else {
- LOG.info("Interface subtree is not present for " + interfaceName);
- }
- } catch (InterruptedException | ExecutionException ex) {
- LOG.info("Read failed on interface subtree for");
- return null;
- }
- return null;
- }
-