Search in sources :

Example 1 with PatchEntity

use of org.opendaylight.restconf.common.patch.PatchEntity in project netconf by opendaylight.

the class JsonPatchBodyReader method readFrom.

private PatchContext readFrom(final InstanceIdentifierContext<?> path, final InputStream entityStream) throws IOException {
    final JsonReader jsonReader = new JsonReader(new InputStreamReader(entityStream, StandardCharsets.UTF_8));
    AtomicReference<String> patchId = new AtomicReference<>();
    final List<PatchEntity> resultList = read(jsonReader, path, patchId);
    jsonReader.close();
    return new PatchContext(path, resultList, patchId.get());
}
Also used : InputStreamReader(java.io.InputStreamReader) PatchContext(org.opendaylight.restconf.common.patch.PatchContext) PatchEntity(org.opendaylight.restconf.common.patch.PatchEntity) JsonReader(com.google.gson.stream.JsonReader) AtomicReference(java.util.concurrent.atomic.AtomicReference)

Example 2 with PatchEntity

use of org.opendaylight.restconf.common.patch.PatchEntity in project netconf by opendaylight.

the class XmlToPatchBodyReader method parse.

private static PatchContext parse(final InstanceIdentifierContext<?> pathContext, final Document doc) throws XMLStreamException, IOException, ParserConfigurationException, SAXException, URISyntaxException {
    final List<PatchEntity> resultCollection = new ArrayList<>();
    final String patchId = doc.getElementsByTagName("patch-id").item(0).getFirstChild().getNodeValue();
    final NodeList editNodes = doc.getElementsByTagName("edit");
    for (int i = 0; i < editNodes.getLength(); i++) {
        DataSchemaNode schemaNode = (DataSchemaNode) pathContext.getSchemaNode();
        final Element element = (Element) editNodes.item(i);
        final String operation = element.getElementsByTagName("operation").item(0).getFirstChild().getNodeValue();
        final PatchEditOperation oper = PatchEditOperation.valueOf(operation.toUpperCase(Locale.ROOT));
        final String editId = element.getElementsByTagName("edit-id").item(0).getFirstChild().getNodeValue();
        final String target = element.getElementsByTagName("target").item(0).getFirstChild().getNodeValue();
        final List<Element> values = readValueNodes(element, oper);
        final Element firstValueElement = values != null ? values.get(0) : null;
        // get namespace according to schema node from path context or value
        final String namespace = firstValueElement == null ? schemaNode.getQName().getNamespace().toString() : firstValueElement.getNamespaceURI();
        // find module according to namespace
        final Module module = pathContext.getSchemaContext().findModules(XMLNamespace.of(namespace)).iterator().next();
        // initialize codec + set default prefix derived from module name
        final StringModuleInstanceIdentifierCodec codec = new StringModuleInstanceIdentifierCodec(pathContext.getSchemaContext(), module.getName());
        // find complete path to target and target schema node
        // target can be also empty (only slash)
        YangInstanceIdentifier targetII;
        final SchemaNode targetNode;
        final Inference inference;
        if (target.equals("/")) {
            targetII = pathContext.getInstanceIdentifier();
            targetNode = pathContext.getSchemaContext();
            inference = Inference.ofDataTreePath(pathContext.getSchemaContext(), schemaNode.getQName());
        } else {
            targetII = codec.deserialize(codec.serialize(pathContext.getInstanceIdentifier()).concat(prepareNonCondXpath(schemaNode, target.replaceFirst("/", ""), firstValueElement, namespace, module.getQNameModule().getRevision().map(Revision::toString).orElse(null))));
            // move schema node
            schemaNode = verifyNotNull(codec.getDataContextTree().findChild(targetII).orElseThrow().getDataSchemaNode());
            final SchemaInferenceStack stack = SchemaInferenceStack.of(pathContext.getSchemaContext());
            targetII.getPathArguments().stream().filter(arg -> !(arg instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates)).filter(arg -> !(arg instanceof YangInstanceIdentifier.AugmentationIdentifier)).forEach(p -> stack.enterSchemaTree(p.getNodeType()));
            final EffectiveStatement<?, ?> parentStmt = stack.exit();
            verify(parentStmt instanceof SchemaNode, "Unexpected parent %s", parentStmt);
            targetNode = (SchemaNode) parentStmt;
            inference = stack.toInference();
        }
        if (targetNode == null) {
            LOG.debug("Target node {} not found in path {} ", target, pathContext.getSchemaNode());
            throw new RestconfDocumentedException("Error parsing input", ErrorType.PROTOCOL, ErrorTag.MALFORMED_MESSAGE);
        }
        if (oper.isWithValue()) {
            final NormalizedNode parsed;
            if (schemaNode instanceof ContainerSchemaNode || schemaNode instanceof ListSchemaNode) {
                final NormalizedNodeResult resultHolder = new NormalizedNodeResult();
                final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
                final XmlParserStream xmlParser = XmlParserStream.create(writer, inference);
                xmlParser.traverse(new DOMSource(firstValueElement));
                parsed = resultHolder.getResult();
            } else {
                parsed = null;
            }
            // for lists allow to manipulate with list items through their parent
            if (targetII.getLastPathArgument() instanceof NodeIdentifierWithPredicates) {
                targetII = targetII.getParent();
            }
            resultCollection.add(new PatchEntity(editId, oper, targetII, parsed));
        } else {
            resultCollection.add(new PatchEntity(editId, oper, targetII));
        }
    }
    return new PatchContext(pathContext, ImmutableList.copyOf(resultCollection), patchId);
}
Also used : SchemaInferenceStack(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack) Provider(javax.ws.rs.ext.Provider) ImmutableNormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter) URISyntaxException(java.net.URISyntaxException) Draft02(org.opendaylight.netconf.sal.rest.api.Draft02) LoggerFactory(org.slf4j.LoggerFactory) UntrustedXML(org.opendaylight.yangtools.util.xml.UntrustedXML) XMLNamespace(org.opendaylight.yangtools.yang.common.XMLNamespace) MediaType(javax.ws.rs.core.MediaType) Consumes(javax.ws.rs.Consumes) PatchContext(org.opendaylight.restconf.common.patch.PatchContext) NormalizedNodeResult(org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult) Locale(java.util.Locale) Document(org.w3c.dom.Document) XMLStreamException(javax.xml.stream.XMLStreamException) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) RestconfService(org.opendaylight.netconf.sal.rest.api.RestconfService) Splitter(com.google.common.base.Splitter) ListSchemaNode(org.opendaylight.yangtools.yang.model.api.ListSchemaNode) Module(org.opendaylight.yangtools.yang.model.api.Module) ContainerSchemaNode(org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode) Inference(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference) List(java.util.List) Revision(org.opendaylight.yangtools.yang.common.Revision) Type(java.lang.reflect.Type) SAXException(org.xml.sax.SAXException) Annotation(java.lang.annotation.Annotation) Optional(java.util.Optional) WebApplicationException(javax.ws.rs.WebApplicationException) NonNull(org.eclipse.jdt.annotation.NonNull) Verify.verifyNotNull(com.google.common.base.Verify.verifyNotNull) DOMSource(javax.xml.transform.dom.DOMSource) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) PatchEntity(org.opendaylight.restconf.common.patch.PatchEntity) ArrayList(java.util.ArrayList) ErrorType(org.opendaylight.yangtools.yang.common.ErrorType) ImmutableList(com.google.common.collect.ImmutableList) Verify.verify(com.google.common.base.Verify.verify) XmlParserStream(org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream) Node(org.w3c.dom.Node) EffectiveStatement(org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement) RestUtil(org.opendaylight.restconf.common.util.RestUtil) Logger(org.slf4j.Logger) NodeList(org.w3c.dom.NodeList) Iterator(java.util.Iterator) SchemaInferenceStack(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack) ErrorTag(org.opendaylight.yangtools.yang.common.ErrorTag) IOException(java.io.IOException) NodeIdentifierWithPredicates(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates) QName(org.opendaylight.yangtools.yang.common.QName) SchemaNode(org.opendaylight.yangtools.yang.model.api.SchemaNode) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) Element(org.w3c.dom.Element) DataNodeContainer(org.opendaylight.yangtools.yang.model.api.DataNodeContainer) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) NormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter) DataSchemaNode(org.opendaylight.yangtools.yang.model.api.DataSchemaNode) ControllerContext(org.opendaylight.netconf.sal.restconf.impl.ControllerContext) RestconfDocumentedException(org.opendaylight.restconf.common.errors.RestconfDocumentedException) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) InputStream(java.io.InputStream) MessageBodyReader(javax.ws.rs.ext.MessageBodyReader) PatchEditOperation(org.opendaylight.restconf.common.patch.PatchEditOperation) XmlParserStream(org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream) RestconfDocumentedException(org.opendaylight.restconf.common.errors.RestconfDocumentedException) DOMSource(javax.xml.transform.dom.DOMSource) PatchEntity(org.opendaylight.restconf.common.patch.PatchEntity) Element(org.w3c.dom.Element) ArrayList(java.util.ArrayList) ContainerSchemaNode(org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode) NormalizedNodeResult(org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) PatchEditOperation(org.opendaylight.restconf.common.patch.PatchEditOperation) DataSchemaNode(org.opendaylight.yangtools.yang.model.api.DataSchemaNode) NodeList(org.w3c.dom.NodeList) Inference(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.Inference) ImmutableNormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter) NormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter) NodeIdentifierWithPredicates(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) ListSchemaNode(org.opendaylight.yangtools.yang.model.api.ListSchemaNode) ContainerSchemaNode(org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode) SchemaNode(org.opendaylight.yangtools.yang.model.api.SchemaNode) DataSchemaNode(org.opendaylight.yangtools.yang.model.api.DataSchemaNode) PatchContext(org.opendaylight.restconf.common.patch.PatchContext) ListSchemaNode(org.opendaylight.yangtools.yang.model.api.ListSchemaNode) Module(org.opendaylight.yangtools.yang.model.api.Module) NodeIdentifierWithPredicates(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates)

Example 3 with PatchEntity

use of org.opendaylight.restconf.common.patch.PatchEntity in project netconf by opendaylight.

the class BrokerFacade method patchConfigurationDataWithinTransaction.

public PatchStatusContext patchConfigurationDataWithinTransaction(final PatchContext patchContext) throws Exception {
    final DOMMountPoint mountPoint = patchContext.getInstanceIdentifierContext().getMountPoint();
    // get new transaction and schema context on server or on mounted device
    final EffectiveModelContext schemaContext;
    final DOMDataTreeReadWriteTransaction patchTransaction;
    if (mountPoint == null) {
        schemaContext = patchContext.getInstanceIdentifierContext().getSchemaContext();
        patchTransaction = this.domDataBroker.newReadWriteTransaction();
    } else {
        schemaContext = modelContext(mountPoint);
        final Optional<DOMDataBroker> optional = mountPoint.getService(DOMDataBroker.class);
        if (optional.isPresent()) {
            patchTransaction = optional.get().newReadWriteTransaction();
        } else {
            // if mount point does not have broker it is not possible to continue and global error is reported
            LOG.error("Http Patch {} has failed - device {} does not support broker service", patchContext.getPatchId(), mountPoint.getIdentifier());
            return new PatchStatusContext(patchContext.getPatchId(), null, false, ImmutableList.of(new RestconfError(ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED, "DOM data broker service isn't available for mount point " + mountPoint.getIdentifier())));
        }
    }
    final List<PatchStatusEntity> editCollection = new ArrayList<>();
    List<RestconfError> editErrors;
    boolean withoutError = true;
    for (final PatchEntity patchEntity : patchContext.getData()) {
        final PatchEditOperation operation = patchEntity.getOperation();
        switch(operation) {
            case CREATE:
                if (withoutError) {
                    try {
                        postDataWithinTransaction(patchTransaction, CONFIGURATION, patchEntity.getTargetNode(), patchEntity.getNode(), schemaContext);
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), true, null));
                    } catch (final RestconfDocumentedException e) {
                        LOG.error("Error call http Patch operation {} on target {}", operation, patchEntity.getTargetNode().toString());
                        editErrors = new ArrayList<>();
                        editErrors.addAll(e.getErrors());
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), false, editErrors));
                        withoutError = false;
                    }
                }
                break;
            case REPLACE:
                if (withoutError) {
                    try {
                        putDataWithinTransaction(patchTransaction, CONFIGURATION, patchEntity.getTargetNode(), patchEntity.getNode(), schemaContext);
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), true, null));
                    } catch (final RestconfDocumentedException e) {
                        LOG.error("Error call http Patch operation {} on target {}", operation, patchEntity.getTargetNode().toString());
                        editErrors = new ArrayList<>();
                        editErrors.addAll(e.getErrors());
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), false, editErrors));
                        withoutError = false;
                    }
                }
                break;
            case DELETE:
            case REMOVE:
                if (withoutError) {
                    try {
                        deleteDataWithinTransaction(patchTransaction, CONFIGURATION, patchEntity.getTargetNode());
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), true, null));
                    } catch (final RestconfDocumentedException e) {
                        LOG.error("Error call http Patch operation {} on target {}", operation, patchEntity.getTargetNode().toString());
                        editErrors = new ArrayList<>();
                        editErrors.addAll(e.getErrors());
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), false, editErrors));
                        withoutError = false;
                    }
                }
                break;
            case MERGE:
                if (withoutError) {
                    try {
                        mergeDataWithinTransaction(patchTransaction, CONFIGURATION, patchEntity.getTargetNode(), patchEntity.getNode(), schemaContext);
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), true, null));
                    } catch (final RestconfDocumentedException e) {
                        LOG.error("Error call http Patch operation {} on target {}", operation, patchEntity.getTargetNode().toString());
                        editErrors = new ArrayList<>();
                        editErrors.addAll(e.getErrors());
                        editCollection.add(new PatchStatusEntity(patchEntity.getEditId(), false, editErrors));
                        withoutError = false;
                    }
                }
                break;
            default:
                LOG.error("Unsupported http Patch operation {} on target {}", operation, patchEntity.getTargetNode().toString());
                break;
        }
    }
    // if errors then cancel transaction and return error status
    if (!withoutError) {
        patchTransaction.cancel();
        return new PatchStatusContext(patchContext.getPatchId(), ImmutableList.copyOf(editCollection), false, null);
    }
    // if no errors commit transaction
    final CountDownLatch waiter = new CountDownLatch(1);
    final FluentFuture<? extends CommitInfo> future = patchTransaction.commit();
    final PatchStatusContextHelper status = new PatchStatusContextHelper();
    future.addCallback(new FutureCallback<CommitInfo>() {

        @Override
        public void onSuccess(final CommitInfo result) {
            status.setStatus(new PatchStatusContext(patchContext.getPatchId(), ImmutableList.copyOf(editCollection), true, null));
            waiter.countDown();
        }

        @Override
        public void onFailure(final Throwable throwable) {
            // if commit failed it is global error
            LOG.error("Http Patch {} transaction commit has failed", patchContext.getPatchId());
            status.setStatus(new PatchStatusContext(patchContext.getPatchId(), ImmutableList.copyOf(editCollection), false, ImmutableList.of(new RestconfError(ErrorType.APPLICATION, ErrorTag.OPERATION_FAILED, throwable.getMessage()))));
            waiter.countDown();
        }
    }, MoreExecutors.directExecutor());
    waiter.await();
    return status.getStatus();
}
Also used : PatchEditOperation(org.opendaylight.restconf.common.patch.PatchEditOperation) RestconfDocumentedException(org.opendaylight.restconf.common.errors.RestconfDocumentedException) PatchEntity(org.opendaylight.restconf.common.patch.PatchEntity) DOMMountPoint(org.opendaylight.mdsal.dom.api.DOMMountPoint) ArrayList(java.util.ArrayList) CountDownLatch(java.util.concurrent.CountDownLatch) DOMDataTreeReadWriteTransaction(org.opendaylight.mdsal.dom.api.DOMDataTreeReadWriteTransaction) PatchStatusContext(org.opendaylight.restconf.common.patch.PatchStatusContext) PatchStatusEntity(org.opendaylight.restconf.common.patch.PatchStatusEntity) RestconfError(org.opendaylight.restconf.common.errors.RestconfError) CommitInfo(org.opendaylight.mdsal.common.api.CommitInfo) DOMDataBroker(org.opendaylight.mdsal.dom.api.DOMDataBroker) EffectiveModelContext(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext)

Example 4 with PatchEntity

use of org.opendaylight.restconf.common.patch.PatchEntity in project netconf by opendaylight.

the class PatchDataTransactionUtilTest method testPatchDataCreateAndDelete.

@Test
public void testPatchDataCreateAndDelete() {
    doReturn(immediateFalseFluentFuture()).when(this.rwTransaction).exists(LogicalDatastoreType.CONFIGURATION, this.instanceIdContainer);
    doReturn(immediateTrueFluentFuture()).when(this.rwTransaction).exists(LogicalDatastoreType.CONFIGURATION, this.targetNodeForCreateAndDelete);
    doReturn(Futures.immediateFuture(new DefaultDOMRpcResult())).when(this.netconfService).create(LogicalDatastoreType.CONFIGURATION, this.instanceIdContainer, this.buildBaseContainerForTests, Optional.empty());
    doReturn(Futures.immediateFuture(new DefaultDOMRpcResult())).when(this.netconfService).delete(LogicalDatastoreType.CONFIGURATION, this.targetNodeForCreateAndDelete);
    final PatchEntity entityCreate = new PatchEntity("edit1", CREATE, this.instanceIdContainer, this.buildBaseContainerForTests);
    final PatchEntity entityDelete = new PatchEntity("edit2", DELETE, this.targetNodeForCreateAndDelete);
    final List<PatchEntity> entities = new ArrayList<>();
    entities.add(entityCreate);
    entities.add(entityDelete);
    final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(this.instanceIdCreateAndDelete, null, null, this.refSchemaCtx);
    final PatchContext patchContext = new PatchContext(iidContext, entities, "patchCD");
    patch(patchContext, new MdsalRestconfStrategy(mockDataBroker), true);
    patch(patchContext, new NetconfRestconfStrategy(netconfService), true);
}
Also used : DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) PatchContext(org.opendaylight.restconf.common.patch.PatchContext) MdsalRestconfStrategy(org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy) PatchEntity(org.opendaylight.restconf.common.patch.PatchEntity) ArrayList(java.util.ArrayList) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) NetconfRestconfStrategy(org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy) Test(org.junit.Test)

Example 5 with PatchEntity

use of org.opendaylight.restconf.common.patch.PatchEntity in project netconf by opendaylight.

the class PatchDataTransactionUtilTest method deleteNonexistentDataTest.

@Test
public void deleteNonexistentDataTest() {
    doReturn(immediateFalseFluentFuture()).when(this.rwTransaction).exists(LogicalDatastoreType.CONFIGURATION, this.targetNodeForCreateAndDelete);
    final NetconfDocumentedException exception = new NetconfDocumentedException("id", ErrorType.RPC, ErrorTag.DATA_MISSING, ErrorSeverity.ERROR);
    final SettableFuture<? extends DOMRpcResult> ret = SettableFuture.create();
    ret.setException(new TransactionCommitFailedException(String.format("Commit of transaction %s failed", this), exception));
    doReturn(ret).when(this.netconfService).commit();
    doReturn(Futures.immediateFuture(new DefaultDOMRpcResult())).when(this.netconfService).delete(LogicalDatastoreType.CONFIGURATION, this.targetNodeForCreateAndDelete);
    final PatchEntity entityDelete = new PatchEntity("edit", DELETE, this.targetNodeForCreateAndDelete);
    final List<PatchEntity> entities = new ArrayList<>();
    entities.add(entityDelete);
    final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(this.instanceIdCreateAndDelete, null, null, this.refSchemaCtx);
    final PatchContext patchContext = new PatchContext(iidContext, entities, "patchD");
    deleteMdsal(patchContext, new MdsalRestconfStrategy(mockDataBroker));
    deleteNetconf(patchContext, new NetconfRestconfStrategy(netconfService));
}
Also used : TransactionCommitFailedException(org.opendaylight.mdsal.common.api.TransactionCommitFailedException) DefaultDOMRpcResult(org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult) PatchContext(org.opendaylight.restconf.common.patch.PatchContext) MdsalRestconfStrategy(org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy) PatchEntity(org.opendaylight.restconf.common.patch.PatchEntity) NetconfDocumentedException(org.opendaylight.netconf.api.NetconfDocumentedException) ArrayList(java.util.ArrayList) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) NetconfRestconfStrategy(org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy) Test(org.junit.Test)

Aggregations

PatchEntity (org.opendaylight.restconf.common.patch.PatchEntity)13 ArrayList (java.util.ArrayList)11 PatchContext (org.opendaylight.restconf.common.patch.PatchContext)11 InstanceIdentifierContext (org.opendaylight.restconf.common.context.InstanceIdentifierContext)9 Test (org.junit.Test)7 PatchStatusContext (org.opendaylight.restconf.common.patch.PatchStatusContext)5 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)5 RestconfDocumentedException (org.opendaylight.restconf.common.errors.RestconfDocumentedException)4 MdsalRestconfStrategy (org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy)4 NetconfRestconfStrategy (org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy)4 InputStream (java.io.InputStream)3 DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)3 PatchEditOperation (org.opendaylight.restconf.common.patch.PatchEditOperation)3 Verify.verify (com.google.common.base.Verify.verify)2 Verify.verifyNotNull (com.google.common.base.Verify.verifyNotNull)2 ImmutableList (com.google.common.collect.ImmutableList)2 JsonReader (com.google.gson.stream.JsonReader)2 IOException (java.io.IOException)2 InputStreamReader (java.io.InputStreamReader)2 URISyntaxException (java.net.URISyntaxException)2