+ return Optional.empty();
+ }
+
+ public Optional<RemoteUcastMacs> getRemoteUcastMacs(final InstanceIdentifier<?> iid, final RemoteUcastMacsKey key) {
+ Optional<HwvtepGlobalAugmentation> nodeOptional = getHwvtepGlobalAugmentation(requireNonNull(iid));
+ if (nodeOptional.isPresent()) {
+ RemoteUcastMacs mac = nodeOptional.get().nonnullRemoteUcastMacs().get(key);
+ if (mac != null) {
+ return Optional.of(mac);
+ }
+ }
+ return Optional.empty();
+ }
+
+ public Optional<LogicalRouters> getLogicalRouters(final InstanceIdentifier<?> iid,
+ final LogicalRoutersKey logicalRoutersKey) {
+ Optional<HwvtepGlobalAugmentation> nodeOptional = getHwvtepGlobalAugmentation(requireNonNull(iid));
+ if (nodeOptional.isPresent()) {
+ LogicalRouters lrouter = nodeOptional.get().nonnullLogicalRouters().get(logicalRoutersKey);
+ if (lrouter != null) {
+ return Optional.of(lrouter);
+ }
+ }
+ return Optional.empty();
+ }
+
+ public Optional<Acls> getAcls(final InstanceIdentifier<Acls> iid) {
+ Optional<Acls> acl = new MdsalUtils(db).readOptional(LogicalDatastoreType.OPERATIONAL, iid);
+ return acl;
+ }
+
+ public ReadWriteTransaction getReadWriteTransaction() {
+ return transaction;
+ }
+
+ public void setPhysicalLocatorInFlight(final InstanceIdentifier<TerminationPoint> iid,
+ final UUID uuid) {
+ inflightLocators.put(iid, uuid);
+ }
+
+ public UUID getPhysicalLocatorInFlight(final InstanceIdentifier<TerminationPoint> iid) {
+ return inflightLocators.get(iid);
+ }
+
+ public HwvtepConnectionInstance getConnectionInstance() {
+ return connectionInstance;
+ }
+
+ public HwvtepDeviceInfo getDeviceInfo() {
+ return deviceInfo;
+ }
+
+ public void updateCurrentTxData(final Class<? extends Identifiable> cls, final InstanceIdentifier key,
+ final UUID uuid) {
+ HwvtepSouthboundUtil.updateData(currentTxUUIDs, cls, key, uuid);
+ }
+
+ public void updateCurrentTxDeleteData(final Class<? extends Identifiable> cls, final InstanceIdentifier key) {
+ HwvtepSouthboundUtil.updateData(currentTxDeletedKeys, cls, key, Boolean.TRUE);
+ }
+
+ public UUID getUUIDFromCurrentTx(final Class<? extends Identifiable> cls, final InstanceIdentifier key) {
+ return HwvtepSouthboundUtil.getData(currentTxUUIDs, cls, key);
+ }
+
+ public boolean isKeyPartOfCurrentTx(final Class<? extends Identifiable> cls, final InstanceIdentifier key) {
+ return HwvtepSouthboundUtil.containsKey(currentTxUUIDs, cls, key);
+ }
+
+ public Set<InstanceIdentifier> getDeletedKeysInCurrentTx(final Class<? extends Identifiable> cls) {
+ if (currentTxDeletedKeys.containsKey(cls)) {
+ return currentTxDeletedKeys.get(cls).keySet();
+ }
+ return Collections.emptySet();
+ }
+
+ public List<? extends Identifiable> getUpdatedData(final InstanceIdentifier<Node> key,
+ final Class<? extends Identifiable> cls) {
+ List<Identifiable> result = null;
+ if (modifiedData.get(key) != null && modifiedData.get(key).getLeft() != null) {
+ result = modifiedData.get(key).getLeft().get(cls);
+ }
+ if (result == null) {
+ result = Collections.emptyList();
+ }
+ return result;
+ }
+
+ public List<? extends Identifiable> getDeletedData(final InstanceIdentifier<Node> key,
+ final Class<? extends Identifiable> cls) {
+ List<Identifiable> result = null;
+ if (modifiedData.get(key) != null && modifiedData.get(key).getRight() != null) {
+ result = modifiedData.get(key).getRight().get(cls);
+ }
+ if (result == null) {
+ result = Collections.emptyList();
+ }
+ return result;
+ }
+
+ public void setModifiedData(final Map<InstanceIdentifier<Node>,
+ Pair<Map<Class<? extends Identifiable>, List<Identifiable>>,
+ Map<Class<? extends Identifiable>, List<Identifiable>>>> modifiedData) {
+ this.modifiedData = modifiedData;
+ }
+
+ public boolean isInReconciliation() {
+ return inReconciliation;
+ }
+
+ public void setInReconciliation(final boolean inReconciliation) {
+ this.inReconciliation = inReconciliation;
+ }
+
+ public DataBroker getDataBroker() {
+ return db;
+ }
+
+
+ public void clearIntransitKeys() {
+ currentTxUUIDs.forEach((cls, map) -> {
+ map.forEach((iid, uuid) -> deviceInfo.clearInTransit(cls, iid));
+ });
+ currentTxDeletedKeys.forEach((cls, map) -> {
+ map.forEach((iid, val) -> deviceInfo.clearInTransit(cls, iid));
+ });
+ currentTxUUIDs.clear();
+ currentTxDeletedKeys.clear();
+ deviceInfo.onOperDataAvailable();
+ }
+
+ public long getTransactionId() {
+ return transactionId;