NormalizedNode<?, ?> data = payload.getData();
try {
- mergeDataWithinTransaction(LogicalDatastoreType.CONFIGURATION, path, data, strategy, schemaContext);
+ LOG.trace("Merge CONFIGURATION within Restconf Patch: {} with payload {}", path, data);
+ TransactionUtil.ensureParentsByMerge(path, schemaContext, strategy);
+ strategy.merge(LogicalDatastoreType.CONFIGURATION, path, data);
} catch (final RestconfDocumentedException e) {
strategy.cancel();
throw new IllegalArgumentException(e);
return response.build();
}
-
- /**
- * Merge data within one transaction.
- *
- * @param dataStore Datastore to merge data to
- * @param path Path for data to be merged
- * @param payload Data to be merged
- * @param strategy Object that perform the actual DS operations
- * @param schemaContext global schema context
- */
- private static void mergeDataWithinTransaction(final LogicalDatastoreType dataStore,
- final YangInstanceIdentifier path,
- final NormalizedNode<?, ?> payload,
- final RestconfStrategy strategy,
- final EffectiveModelContext schemaContext) {
- LOG.trace("Merge {} within Restconf Patch: {} with payload {}", dataStore.name(), path, payload);
- TransactionUtil.ensureParentsByMerge(path, schemaContext, strategy);
- strategy.merge(dataStore, path, payload);
- }
}