- createData(payload, path, strategy, schemaContext, false);
- }
-
- /**
- * Create data within one transaction. If {@code errorIfExists} is set to {@code true} then data will be checked
- * for existence before created, otherwise they will be overwritten.
- *
- * @param data Data to be created
- * @param path Path for data to be created
- * @param strategy Object that perform the actual DS operations
- * @param errorIfExists Enable checking for existence of data (throws error if already exists)
- */
- private static void createData(final NormalizedNode<?, ?> data,
- final YangInstanceIdentifier path,
- final RestconfStrategy strategy,
- final EffectiveModelContext schemaContext,
- final boolean errorIfExists) {
- if (errorIfExists) {
- strategy.create(LogicalDatastoreType.CONFIGURATION, path, data, schemaContext);
- } else {
- strategy.replace(LogicalDatastoreType.CONFIGURATION, path, data, schemaContext);
- }