- try {
- if (L2vlan.class.equals(intrf.getType())) {
- LOG.trace("SubnetRouteInterfaceListener add: Received interface {} up event", intrf);
- if (intrf.getOperStatus().equals(Interface.OperStatus.Up)) {
- List<Uuid> subnetIdList = getSubnetId(intrf);
- if (subnetIdList.isEmpty()) {
- LOG.trace("SubnetRouteInterfaceListener add: Port {} doesnt exist in configDS",
- intrf.getName());
- return;
- }
- for (Uuid subnetId : subnetIdList) {
- jobCoordinator.enqueueJob("SUBNETROUTE-" + subnetId,
- () -> {
- String interfaceName = intrf.getName();
- BigInteger dpnId = BigInteger.ZERO;
- LOG.info("{} add: Received port UP event for interface {} subnetId {}",
- LOGGING_PREFIX, interfaceName, subnetId);
- try {
- dpnId = InterfaceUtils.getDpIdFromInterface(intrf);
- } catch (Exception e) {
- LOG.error("{} add: Unable to obtain dpnId for interface {} in subnet {},"
- + " subnetroute inclusion for this interface failed",
- LOGGING_PREFIX, interfaceName, subnetId, e);
- }
- InstanceIdentifier<VpnInterface> id = VpnUtil
- .getVpnInterfaceIdentifier(interfaceName);
- Optional<VpnInterface> cfgVpnInterface = VpnUtil.read(dataBroker,
- LogicalDatastoreType.CONFIGURATION, id);
- List<ListenableFuture<Void>> futures = new ArrayList<>();
+ if (L2vlan.class.equals(intrf.getType())) {
+ LOG.trace("SubnetRouteInterfaceListener add: Received interface {} up event", intrf);
+ if (Interface.OperStatus.Up.equals(intrf.getOperStatus())) {
+ List<Uuid> subnetIdList = getSubnetId(intrf);
+ if (subnetIdList.isEmpty()) {
+ LOG.trace("SubnetRouteInterfaceListener add: Port {} doesn't exist in configDS",
+ intrf.getName());
+ return;
+ }
+ for (Uuid subnetId : subnetIdList) {
+ jobCoordinator.enqueueJob("SUBNETROUTE-" + subnetId,
+ () -> {
+ String interfaceName = intrf.getName();
+ Uint64 dpnId = Uint64.ZERO;
+ LOG.info("{} add: Received port UP event for interface {} subnetId {}",
+ LOGGING_PREFIX, interfaceName, subnetId);
+ try {
+ dpnId = InterfaceUtils.getDpIdFromInterface(intrf);
+ } catch (NullPointerException e) {
+ LOG.error("{} add: Unable to obtain dpnId for interface {} in subnet {},"
+ + " subnetroute inclusion for this interface failed", LOGGING_PREFIX,
+ interfaceName, subnetId, e);
+ }
+ List<ListenableFuture<Void>> futures = new ArrayList<>();
+ try {
+ InstanceIdentifier<VpnInterface> id = VpnUtil.getVpnInterfaceIdentifier(interfaceName);
+ Optional<VpnInterface> cfgVpnInterface = SingleTransactionDataBroker.syncReadOptional(
+ dataBroker, LogicalDatastoreType.CONFIGURATION, id);