BUG-5280: add {Create,Close,Purge}LocalHistoryPayload
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / main / java / org / opendaylight / controller / cluster / datastore / FrontendClientMetadataBuilder.java
index 0dab830584b70fd6e1f388ae2d819619a6c401a7..cd1235b46072ce68a269fb393375795c9bed0d0e 100644 (file)
@@ -54,6 +54,11 @@ final class FrontendClientMetadataBuilder implements Builder<FrontendClientMetad
         return identifier;
     }
 
+    void onHistoryCreated(final LocalHistoryIdentifier historyId) {
+        // TODO Auto-generated method stub
+
+    }
+
     void onHistoryClosed(final LocalHistoryIdentifier historyId) {
         ensureHistory(historyId).onHistoryClosed();
     }
@@ -69,13 +74,6 @@ final class FrontendClientMetadataBuilder implements Builder<FrontendClientMetad
     }
 
     private FrontendHistoryMetadataBuilder ensureHistory(final LocalHistoryIdentifier historyId) {
-        final FrontendHistoryMetadataBuilder existing = currentHistories.get(historyId);
-        if (existing != null) {
-            return existing;
-        }
-
-        final FrontendHistoryMetadataBuilder ret = new FrontendHistoryMetadataBuilder(historyId);
-        currentHistories.put(historyId, ret);
-        return ret;
+        return currentHistories.computeIfAbsent(historyId, FrontendHistoryMetadataBuilder::new);
     }
 }