/** * Get mapped name for the interface. Best effort only! The mapping might not yet be stored in context * data tree (write transaction is still in progress and context changes have not been committed yet, or * VPP sends the notification before it returns create request(that would store mapping)). * <p/> * In case mapping is not available, index is used as name. TODO inconsistent behavior, maybe just use indices ? */ private InterfaceNameOrIndex getIfcName(final SwInterfaceSetFlagsNotification swInterfaceSetFlagsNotification) { final Optional<String> optionalName = interfaceContext.getNameIfPresent(swInterfaceSetFlagsNotification.swIfIndex, mappingContext); return optionalName.isPresent() ? new InterfaceNameOrIndex(optionalName.get()) : new InterfaceNameOrIndex((long) swInterfaceSetFlagsNotification.swIfIndex); }