- private static boolean checkExist(final EffectiveModelContext schemaContext, final RestconfStrategy strategy) {
- try {
- return strategy.exists(LogicalDatastoreType.OPERATIONAL,
- IdentifierCodec.deserialize(Rfc8040.MonitoringModule.PATH_TO_STREAMS, schemaContext)).get();
- } catch (final InterruptedException | ExecutionException exception) {
- throw new RestconfDocumentedException("Problem while checking data if exists", exception);
- }
- }
-
- private static void writeDataToDS(final EffectiveModelContext schemaContext, final String name,
- final RestconfStrategy strategy, final boolean exist,
- final NormalizedNode<?, ?> mapToStreams) {
- final String pathId;
- if (exist) {
- pathId = Rfc8040.MonitoringModule.PATH_TO_STREAM_WITHOUT_KEY + name;
- } else {
- pathId = Rfc8040.MonitoringModule.PATH_TO_STREAMS;
- }
- strategy.merge(LogicalDatastoreType.OPERATIONAL, IdentifierCodec.deserialize(pathId, schemaContext),
- mapToStreams);
+ transaction.merge(LogicalDatastoreType.OPERATIONAL,
+ Rfc8040.MonitoringModule.restconfStateStreamPath(mapToStreams.getIdentifier()), mapToStreams);