Search in sources :

Example 41 with InstanceIdentifierContext

use of org.opendaylight.restconf.common.context.InstanceIdentifierContext in project netconf by opendaylight.

the class Netconf799Test method testInvokeAction.

@Test
public void testInvokeAction() throws FileNotFoundException {
    final EffectiveModelContext contextRef = YangParserTestUtils.parseYangFiles(TestRestconfUtils.loadFiles("/instanceidentifier/yang"));
    final DOMDataBroker mockDataBroker = mock(DOMDataBroker.class);
    final SchemaContextHandler schemaContextHandler = new SchemaContextHandler(mockDataBroker, mock(DOMSchemaService.class));
    schemaContextHandler.onModelContextUpdated(contextRef);
    final DOMActionService actionService = mock(DOMActionService.class);
    doReturn(Futures.immediateFuture(new SimpleDOMActionResult(Builders.containerBuilder().withNodeIdentifier(NodeIdentifier.create(OUTPUT_QNAME)).build()))).when(actionService).invokeAction(eq(Absolute.of(CONT_QNAME, CONT1_QNAME, RESET_QNAME)), any(), any());
    final RestconfDataServiceImpl dataService = new RestconfDataServiceImpl(schemaContextHandler, mockDataBroker, mock(DOMMountPointService.class), mock(RestconfStreamsSubscriptionService.class), actionService, mock(Configuration.class));
    final var schemaNode = loadAction(contextRef, RESET_QNAME, ACTION_YII).orElseThrow();
    final var response = dataService.invokeAction(NormalizedNodePayload.of(new InstanceIdentifierContext<>(ACTION_YII, schemaNode, null, contextRef), Builders.containerBuilder().withNodeIdentifier(NodeIdentifier.create(INPUT_QNAME)).withChild(ImmutableNodes.leafNode(DELAY_QNAME, Uint32.TEN)).build()));
    assertEquals(204, response.getStatus());
    assertNull(response.getEntity());
}
Also used : DOMActionService(org.opendaylight.mdsal.dom.api.DOMActionService) SchemaContextHandler(org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler) SimpleDOMActionResult(org.opendaylight.mdsal.dom.spi.SimpleDOMActionResult) Configuration(org.opendaylight.restconf.nb.rfc8040.streams.Configuration) RestconfStreamsSubscriptionService(org.opendaylight.restconf.nb.rfc8040.rests.services.api.RestconfStreamsSubscriptionService) DOMMountPointService(org.opendaylight.mdsal.dom.api.DOMMountPointService) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) DOMDataBroker(org.opendaylight.mdsal.dom.api.DOMDataBroker) DOMSchemaService(org.opendaylight.mdsal.dom.api.DOMSchemaService) EffectiveModelContext(org.opendaylight.yangtools.yang.model.api.EffectiveModelContext) Test(org.junit.Test)

Example 42 with InstanceIdentifierContext

use of org.opendaylight.restconf.common.context.InstanceIdentifierContext in project netconf by opendaylight.

the class RestconfDataServiceImplTest method testPostData.

@Test
public void testPostData() {
    final QName listQname = QName.create(baseQName, "playlist");
    final QName listKeyQname = QName.create(baseQName, "name");
    final NodeIdentifierWithPredicates nodeWithKey = NodeIdentifierWithPredicates.of(listQname, listKeyQname, "name of band");
    doReturn(new MultivaluedHashMap<String, String>()).when(uriInfo).getQueryParameters();
    final InstanceIdentifierContext<? extends SchemaNode> iidContext = new InstanceIdentifierContext<>(iidBase, null, null, contextRef);
    final NormalizedNodePayload payload = NormalizedNodePayload.of(iidContext, Builders.mapBuilder().withNodeIdentifier(new NodeIdentifier(listQname)).withChild(Builders.mapEntryBuilder().withNodeIdentifier(nodeWithKey).withChild(ImmutableNodes.leafNode(QName.create(baseQName, "name"), "name of band")).withChild(ImmutableNodes.leafNode(QName.create(baseQName, "description"), "band description")).build()).build());
    final MapNode data = (MapNode) payload.getData();
    final MapEntryNode entryNode = data.body().iterator().next();
    final NodeIdentifierWithPredicates identifier = entryNode.getIdentifier();
    final YangInstanceIdentifier node = payload.getInstanceIdentifierContext().getInstanceIdentifier().node(identifier);
    doReturn(immediateFalseFluentFuture()).when(readWrite).exists(LogicalDatastoreType.CONFIGURATION, node);
    doNothing().when(readWrite).put(LogicalDatastoreType.CONFIGURATION, node, entryNode);
    doReturn(UriBuilder.fromUri("http://localhost:8181/restconf/15/")).when(uriInfo).getBaseUriBuilder();
    final Response response = dataService.postData(null, payload, uriInfo);
    assertEquals(201, response.getStatus());
}
Also used : Response(javax.ws.rs.core.Response) QName(org.opendaylight.yangtools.yang.common.QName) NodeIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) NormalizedNodePayload(org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload) MapNode(org.opendaylight.yangtools.yang.data.api.schema.MapNode) NodeIdentifierWithPredicates(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifierWithPredicates) MapEntryNode(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) Test(org.junit.Test)

Example 43 with InstanceIdentifierContext

use of org.opendaylight.restconf.common.context.InstanceIdentifierContext in project netconf by opendaylight.

the class JsonNormalizedNodeBodyReader method readFrom.

public static NormalizedNodePayload readFrom(final InstanceIdentifierContext<?> path, final InputStream entityStream, final boolean isPost) {
    final NormalizedNodeResult resultHolder = new NormalizedNodeResult();
    final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
    final EffectiveStatementInference parentSchema;
    final SchemaInferenceStack stack;
    if (path.getSchemaNode() instanceof RpcEffectiveStatement) {
        stack = SchemaInferenceStack.of(path.getSchemaContext(), Absolute.of(path.getSchemaNode().getQName()));
    } else {
        stack = SchemaInferenceStack.of(path.getSchemaContext());
        path.getInstanceIdentifier().getPathArguments().stream().filter(arg -> !(arg instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates)).filter(arg -> !(arg instanceof YangInstanceIdentifier.AugmentationIdentifier)).forEach(p -> stack.enterSchemaTree(p.getNodeType()));
    }
    if (!isPost) {
        stack.exit();
    }
    parentSchema = stack.toInference();
    final JsonParserStream jsonParser = JsonParserStream.create(writer, JSONCodecFactorySupplier.RFC7951.getShared(path.getSchemaContext()), parentSchema);
    final JsonReader reader = new JsonReader(new InputStreamReader(entityStream, StandardCharsets.UTF_8));
    jsonParser.parse(reader);
    NormalizedNode result = resultHolder.getResult();
    final List<YangInstanceIdentifier.PathArgument> iiToDataList = new ArrayList<>();
    InstanceIdentifierContext<? extends SchemaNode> newIIContext;
    while (result instanceof AugmentationNode || result instanceof ChoiceNode) {
        final Object childNode = ((DataContainerNode) result).body().iterator().next();
        if (isPost) {
            iiToDataList.add(result.getIdentifier());
        }
        result = (NormalizedNode) childNode;
    }
    if (isPost) {
        if (result instanceof MapEntryNode) {
            iiToDataList.add(new YangInstanceIdentifier.NodeIdentifier(result.getIdentifier().getNodeType()));
            iiToDataList.add(result.getIdentifier());
        } else {
            final List<? extends @NonNull EffectiveStatement<?, ?>> parentPath = parentSchema.statementPath();
            if (parentPath.isEmpty() || !(parentPath.get(parentPath.size() - 1) instanceof OperationDefinition)) {
                iiToDataList.add(result.getIdentifier());
            }
        }
    } else {
        if (result instanceof MapNode) {
            result = Iterables.getOnlyElement(((MapNode) result).body());
        }
    }
    final YangInstanceIdentifier fullIIToData = YangInstanceIdentifier.create(Iterables.concat(path.getInstanceIdentifier().getPathArguments(), iiToDataList));
    newIIContext = new InstanceIdentifierContext<>(fullIIToData, path.getSchemaNode(), path.getMountPoint(), path.getSchemaContext());
    // FIXME: can result really be null?
    return NormalizedNodePayload.ofNullable(newIIContext, result);
}
Also used : SchemaInferenceStack(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack) OperationDefinition(org.opendaylight.yangtools.yang.model.api.OperationDefinition) JSONCodecFactorySupplier(org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier) Iterables(com.google.common.collect.Iterables) Provider(javax.ws.rs.ext.Provider) ImmutableNormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) EffectiveStatementInference(org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference) LoggerFactory(org.slf4j.LoggerFactory) DOMMountPointService(org.opendaylight.mdsal.dom.api.DOMMountPointService) NormalizedNodePayload(org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload) JsonReader(com.google.gson.stream.JsonReader) ArrayList(java.util.ArrayList) ErrorType(org.opendaylight.yangtools.yang.common.ErrorType) Absolute(org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute) MediaType(javax.ws.rs.core.MediaType) ResultAlreadySetException(org.opendaylight.yangtools.yang.data.impl.schema.ResultAlreadySetException) Consumes(javax.ws.rs.Consumes) NormalizedNodeResult(org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult) SchemaContextHandler(org.opendaylight.restconf.nb.rfc8040.handlers.SchemaContextHandler) MapNode(org.opendaylight.yangtools.yang.data.api.schema.MapNode) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) EffectiveStatement(org.opendaylight.yangtools.yang.model.api.meta.EffectiveStatement) DataContainerNode(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode) Logger(org.slf4j.Logger) SchemaInferenceStack(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack) ErrorTag(org.opendaylight.yangtools.yang.common.ErrorTag) Throwables(com.google.common.base.Throwables) RpcEffectiveStatement(org.opendaylight.yangtools.yang.model.api.stmt.RpcEffectiveStatement) InputStreamReader(java.io.InputStreamReader) StandardCharsets(java.nio.charset.StandardCharsets) MediaTypes(org.opendaylight.restconf.nb.rfc8040.MediaTypes) SchemaNode(org.opendaylight.yangtools.yang.model.api.SchemaNode) List(java.util.List) AugmentationNode(org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode) NormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter) JsonParserStream(org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream) WebApplicationException(javax.ws.rs.WebApplicationException) MapEntryNode(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode) NonNull(org.eclipse.jdt.annotation.NonNull) RestconfDocumentedException(org.opendaylight.restconf.common.errors.RestconfDocumentedException) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) InputStream(java.io.InputStream) ChoiceNode(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode) JsonParserStream(org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream) RpcEffectiveStatement(org.opendaylight.yangtools.yang.model.api.stmt.RpcEffectiveStatement) EffectiveStatementInference(org.opendaylight.yangtools.yang.model.api.EffectiveStatementInference) ArrayList(java.util.ArrayList) DataContainerNode(org.opendaylight.yangtools.yang.data.api.schema.DataContainerNode) MapNode(org.opendaylight.yangtools.yang.data.api.schema.MapNode) NonNull(org.eclipse.jdt.annotation.NonNull) NormalizedNodeResult(org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult) JsonReader(com.google.gson.stream.JsonReader) ChoiceNode(org.opendaylight.yangtools.yang.data.api.schema.ChoiceNode) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) OperationDefinition(org.opendaylight.yangtools.yang.model.api.OperationDefinition) InputStreamReader(java.io.InputStreamReader) ImmutableNormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter) NormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter) MapEntryNode(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) AugmentationNode(org.opendaylight.yangtools.yang.data.api.schema.AugmentationNode)

Example 44 with InstanceIdentifierContext

use of org.opendaylight.restconf.common.context.InstanceIdentifierContext in project netconf by opendaylight.

the class JsonNormalizedNodeBodyWriter method writeTo.

@Override
public void writeTo(final NormalizedNodePayload context, final Class<?> type, final Type genericType, final Annotation[] annotations, final MediaType mediaType, final MultivaluedMap<String, Object> httpHeaders, final OutputStream entityStream) throws IOException, WebApplicationException {
    final NormalizedNode data = context.getData();
    if (data == null) {
        return;
    }
    @SuppressWarnings("unchecked") final InstanceIdentifierContext<SchemaNode> identifierCtx = (InstanceIdentifierContext<SchemaNode>) context.getInstanceIdentifierContext();
    final SchemaInferenceStack stack = SchemaInferenceStack.of(identifierCtx.getSchemaContext());
    identifierCtx.getInstanceIdentifier().getPathArguments().stream().filter(arg -> !(arg instanceof YangInstanceIdentifier.NodeIdentifierWithPredicates)).filter(arg -> !(arg instanceof YangInstanceIdentifier.AugmentationIdentifier)).forEach(p -> stack.enterSchemaTree(p.getNodeType()));
    final SchemaPath path = stack.toSchemaPath();
    final var pretty = context.getWriterParameters().prettyPrint();
    try (JsonWriter jsonWriter = createJsonWriter(entityStream, pretty == null ? false : pretty.value())) {
        jsonWriter.beginObject();
        writeNormalizedNode(jsonWriter, path, identifierCtx, data, context.getWriterParameters().depth(), context.getWriterParameters().fields());
        jsonWriter.endObject();
        jsonWriter.flush();
    }
    if (httpHeaders != null) {
        for (final Map.Entry<String, Object> entry : context.getNewHeaders().entrySet()) {
            httpHeaders.add(entry.getKey(), entry.getValue());
        }
    }
}
Also used : SchemaInferenceStack(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack) JSONNormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter) JSONCodecFactorySupplier(org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactorySupplier) SchemaPath(org.opendaylight.yangtools.yang.model.api.SchemaPath) Produces(javax.ws.rs.Produces) Provider(javax.ws.rs.ext.Provider) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) RpcDefinition(org.opendaylight.yangtools.yang.model.api.RpcDefinition) NormalizedNodePayload(org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload) XMLNamespace(org.opendaylight.yangtools.yang.common.XMLNamespace) JsonWriterFactory(org.opendaylight.yangtools.yang.data.codec.gson.JsonWriterFactory) Absolute(org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute) MediaType(javax.ws.rs.core.MediaType) Map(java.util.Map) OutputStreamWriter(java.io.OutputStreamWriter) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) JsonWriter(com.google.gson.stream.JsonWriter) ContainerNode(org.opendaylight.yangtools.yang.data.api.schema.ContainerNode) OutputStream(java.io.OutputStream) DepthParam(org.opendaylight.restconf.nb.rfc8040.DepthParam) Module(org.opendaylight.yangtools.yang.model.api.Module) SchemaInferenceStack(org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack) Set(java.util.Set) IOException(java.io.IOException) DataContainerChild(org.opendaylight.yangtools.yang.data.api.schema.DataContainerChild) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) QName(org.opendaylight.yangtools.yang.common.QName) MediaTypes(org.opendaylight.restconf.nb.rfc8040.MediaTypes) RestconfNormalizedNodeWriter(org.opendaylight.restconf.nb.rfc8040.jersey.providers.api.RestconfNormalizedNodeWriter) SchemaNode(org.opendaylight.yangtools.yang.model.api.SchemaNode) MultivaluedMap(javax.ws.rs.core.MultivaluedMap) List(java.util.List) PathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument) Type(java.lang.reflect.Type) NormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter) ImmutableNodes(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNodes) Annotation(java.lang.annotation.Annotation) JSONCodecFactory(org.opendaylight.yangtools.yang.data.codec.gson.JSONCodecFactory) WebApplicationException(javax.ws.rs.WebApplicationException) ActionDefinition(org.opendaylight.yangtools.yang.model.api.ActionDefinition) MapEntryNode(org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) JsonWriter(com.google.gson.stream.JsonWriter) SchemaNode(org.opendaylight.yangtools.yang.model.api.SchemaNode) SchemaPath(org.opendaylight.yangtools.yang.model.api.SchemaPath) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) Map(java.util.Map) MultivaluedMap(javax.ws.rs.core.MultivaluedMap)

Example 45 with InstanceIdentifierContext

use of org.opendaylight.restconf.common.context.InstanceIdentifierContext in project netconf by opendaylight.

the class XmlNormalizedNodeBodyReader method parse.

private NormalizedNodePayload parse(final InstanceIdentifierContext<?> pathContext, final Document doc) throws XMLStreamException, IOException, ParserConfigurationException, SAXException, URISyntaxException {
    final SchemaNode schemaNodeContext = pathContext.getSchemaNode();
    DataSchemaNode schemaNode;
    final boolean isOperation;
    if (schemaNodeContext instanceof OperationDefinition) {
        schemaNode = ((OperationDefinition) schemaNodeContext).getInput();
        isOperation = true;
    } else if (schemaNodeContext instanceof DataSchemaNode) {
        schemaNode = (DataSchemaNode) schemaNodeContext;
        isOperation = false;
    } else {
        throw new IllegalStateException("Unknown SchemaNode " + schemaNodeContext);
    }
    final String docRootElm = doc.getDocumentElement().getLocalName();
    final String docRootNamespace = doc.getDocumentElement().getNamespaceURI();
    final List<YangInstanceIdentifier.PathArgument> iiToDataList = new ArrayList<>();
    if (isPost() && !isOperation) {
        final Deque<Object> foundSchemaNodes = findPathToSchemaNodeByName(schemaNode, docRootElm, docRootNamespace);
        if (foundSchemaNodes.isEmpty()) {
            throw new IllegalStateException(String.format("Child \"%s\" was not found in parent schema node \"%s\"", docRootElm, schemaNode.getQName()));
        }
        while (!foundSchemaNodes.isEmpty()) {
            final Object child = foundSchemaNodes.pop();
            if (child instanceof AugmentationSchemaNode) {
                final AugmentationSchemaNode augmentSchemaNode = (AugmentationSchemaNode) child;
                iiToDataList.add(DataSchemaContextNode.augmentationIdentifierFrom(augmentSchemaNode));
            } else if (child instanceof DataSchemaNode) {
                schemaNode = (DataSchemaNode) child;
                iiToDataList.add(new YangInstanceIdentifier.NodeIdentifier(schemaNode.getQName()));
            }
        }
    // PUT
    } else if (!isOperation) {
        final QName scQName = schemaNode.getQName();
        checkState(docRootElm.equals(scQName.getLocalName()) && docRootNamespace.equals(scQName.getNamespace().toString()), "Not correct message root element \"%s\", should be \"%s\"", docRootElm, scQName);
    }
    NormalizedNode parsed;
    final NormalizedNodeResult resultHolder = new NormalizedNodeResult();
    final NormalizedNodeStreamWriter writer = ImmutableNormalizedNodeStreamWriter.from(resultHolder);
    if (schemaNode instanceof ContainerLike || schemaNode instanceof ListSchemaNode || schemaNode instanceof LeafSchemaNode) {
        final XmlParserStream xmlParser = XmlParserStream.create(writer, SchemaInferenceStack.ofInstantiatedPath(pathContext.getSchemaContext(), schemaNode.getPath()).toInference());
        xmlParser.traverse(new DOMSource(doc.getDocumentElement()));
        parsed = resultHolder.getResult();
        // Therefore we now have to extract the MapEntryNode from the parsed MapNode.
        if (parsed instanceof MapNode) {
            final MapNode mapNode = (MapNode) parsed;
            // extracting the MapEntryNode
            parsed = mapNode.body().iterator().next();
        }
        if (schemaNode instanceof ListSchemaNode && isPost()) {
            iiToDataList.add(parsed.getIdentifier());
        }
    } else {
        LOG.warn("Unknown schema node extension {} was not parsed", schemaNode.getClass());
        parsed = null;
    }
    final YangInstanceIdentifier fullIIToData = YangInstanceIdentifier.create(Iterables.concat(pathContext.getInstanceIdentifier().getPathArguments(), iiToDataList));
    final InstanceIdentifierContext<? extends SchemaNode> outIIContext = new InstanceIdentifierContext<>(fullIIToData, pathContext.getSchemaNode(), pathContext.getMountPoint(), pathContext.getSchemaContext());
    // FIXME: can result really be null?
    return NormalizedNodePayload.ofNullable(outIIContext, parsed);
}
Also used : ContainerLike(org.opendaylight.yangtools.yang.model.api.ContainerLike) XmlParserStream(org.opendaylight.yangtools.yang.data.codec.xml.XmlParserStream) DOMSource(javax.xml.transform.dom.DOMSource) ArrayList(java.util.ArrayList) MapNode(org.opendaylight.yangtools.yang.data.api.schema.MapNode) NormalizedNodeResult(org.opendaylight.yangtools.yang.data.impl.schema.NormalizedNodeResult) NormalizedNode(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode) OperationDefinition(org.opendaylight.yangtools.yang.model.api.OperationDefinition) AugmentationSchemaNode(org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode) DataSchemaNode(org.opendaylight.yangtools.yang.model.api.DataSchemaNode) QName(org.opendaylight.yangtools.yang.common.QName) ImmutableNormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.impl.schema.ImmutableNormalizedNodeStreamWriter) NormalizedNodeStreamWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter) InstanceIdentifierContext(org.opendaylight.restconf.common.context.InstanceIdentifierContext) LeafSchemaNode(org.opendaylight.yangtools.yang.model.api.LeafSchemaNode) YangInstanceIdentifier(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier) AugmentationSchemaNode(org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode) ListSchemaNode(org.opendaylight.yangtools.yang.model.api.ListSchemaNode) CaseSchemaNode(org.opendaylight.yangtools.yang.model.api.CaseSchemaNode) ChoiceSchemaNode(org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode) SchemaNode(org.opendaylight.yangtools.yang.model.api.SchemaNode) DataSchemaNode(org.opendaylight.yangtools.yang.model.api.DataSchemaNode) LeafSchemaNode(org.opendaylight.yangtools.yang.model.api.LeafSchemaNode) ListSchemaNode(org.opendaylight.yangtools.yang.model.api.ListSchemaNode)

Aggregations

InstanceIdentifierContext (org.opendaylight.restconf.common.context.InstanceIdentifierContext)50 Test (org.junit.Test)29 DataSchemaNode (org.opendaylight.yangtools.yang.model.api.DataSchemaNode)28 NormalizedNodePayload (org.opendaylight.restconf.nb.rfc8040.legacy.NormalizedNodePayload)26 YangInstanceIdentifier (org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier)24 NormalizedNode (org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode)20 ArrayList (java.util.ArrayList)18 NetconfRestconfStrategy (org.opendaylight.restconf.nb.rfc8040.rests.transactions.NetconfRestconfStrategy)16 DefaultDOMRpcResult (org.opendaylight.mdsal.dom.spi.DefaultDOMRpcResult)15 List (java.util.List)14 MdsalRestconfStrategy (org.opendaylight.restconf.nb.rfc8040.rests.transactions.MdsalRestconfStrategy)14 QName (org.opendaylight.yangtools.yang.common.QName)14 NormalizedNodeStreamWriter (org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter)14 Provider (javax.ws.rs.ext.Provider)13 IOException (java.io.IOException)12 RestconfDocumentedException (org.opendaylight.restconf.common.errors.RestconfDocumentedException)12 PatchContext (org.opendaylight.restconf.common.patch.PatchContext)12 MapEntryNode (org.opendaylight.yangtools.yang.data.api.schema.MapEntryNode)12 StandardCharsets (java.nio.charset.StandardCharsets)11 WebApplicationException (javax.ws.rs.WebApplicationException)11