[NETCONF-1128] Eliminate AbstractIdentifierAwareJaxRsProvider Created: 08/Aug/23  Updated: 10/Sep/23  Resolved: 10/Sep/23

Status: Resolved
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Improvement Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETCONF-1118 Refactor restconf.common.patch Confirmed
Epic Link: Rewire restconf-nb

 Description   

We are using this as a base class for Json/XmlNormalizedNodeBodyReader and Xml/JsonPatchBodyReader.

In order to get the requisite information, we must rely on @Context-injected UriInfo and Request – which do not work on client-side anyway – and based on these and InstanceIdentifier's content we make a ton of assumptions about what context the NormalizedNodePayload is being read.

Those assumptions are easily eliminating by the actual users in RestconfDataServiceImpl and RestconfOperationsServiceImpl actually driving the parsing process.

This means that all users relying on NormalizedNodePayload being injected as an argument, like:

    public void invokeRpc(@Encoded @PathParam("identifier") final String identifier,
            final NormalizedNodePayload payload, @Context final UriInfo uriInfo, @Suspended final AsyncResponse ar) {
    // ...
    }

need to actually start with creating an InstanceIdentifierContext (from identifier) and pass the proper parameters to the appropriate parser.

For dealing with @Consumes variance, we only have two sets of input types (JSON, XML), so providing specialized methods for the two types.


Generated at Wed Feb 07 20:16:45 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.