Robert Varga [Wed, 21 Jun 2023 18:01:17 +0000 (20:01 +0200)]
Update get{ModifiedChild,DataAfter,DataBefore}
It is customary to require dataBefore/dataAfter. Repurpose the methods
to return a non-null-verified NormalizedNode. While we are at it, also
modify getModifiedChild().
JIRA: YANGTOOLS-1513
Change-Id: I90a3f1f2961b41d62c6d23afb434b40a45d75ccc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Ruslan Kashapov [Mon, 19 Jun 2023 10:44:53 +0000 (13:44 +0300)]
Make warnings for unkeyed lists disabled by default
Making warnings for unkeyed list with config=true disabled
by default.
JIRA: YANGTOOLS-1423
Change-Id: I2b8e9a0abef8531d3b7853b029604a515e7196b8
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Robert Varga [Wed, 21 Jun 2023 07:57:12 +0000 (09:57 +0200)]
Promote util contracts
Remove @Beta for sufficiently-stabilized classes.
Change-Id: Ie7bd239affcf1af1449413da9c69da0fc1a46a73
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 21 Jun 2023 07:52:13 +0000 (09:52 +0200)]
Deprecate EvenMoreObjects
This class is not used anywhere, deprecate it for removal.
Change-Id: I211d0fbec1791316335f52e57d5e3ff120250e4d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 21 Jun 2023 01:16:25 +0000 (03:16 +0200)]
Deprecate EffectiveAugmentationSchema
With AugmentatioNode gone from yang-data-api, we do not interact with
effective children anymore. Deprecate EffectiveAugmentationSchema for
removal.
JIRA: YANGTOOLS-1403
Change-Id: Iaca0f5e119d66f654361c6b08b01839626667d29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 20 Jun 2023 12:30:36 +0000 (14:30 +0200)]
Fix yang-data-codec-xml dependencies
We are using rfc8040-model-api, make sure we declare it.
Change-Id: Idfe10dfe4cd441404a42eaaac39ad199a8763bf8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 19 Jun 2023 17:57:38 +0000 (19:57 +0200)]
Add DataSchemaContext.of(DataSchemaNode)
This factory method is still needed by downstreams, reintroduce it with
stricter semantics.
JIRA: YANGTOOLS-1413
Change-Id: I9d1c0908b1d02f5b2575999ab290b65266bfa8f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 18 Jun 2023 19:51:44 +0000 (21:51 +0200)]
Allow NormalizationResultHolder to report no data
We have normalization pruning going on in controller, which can result
in no data being emitted. Relax the requirements so that a null value
can be reported.
Change-Id: Id065c0e813341416ca18e7b16ef5051a9f2dd0d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 18:34:48 +0000 (20:34 +0200)]
Add support for parsing XML NormalizedYangData
This adds the basic tools and a simple test for parsing yang-data when
the inference stack points to its proper child.
JIRA: YANGTOOLS-1472
Change-Id: I81bf41327e0bb7a20da236bc730049db21dd964d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 8 Jun 2023 14:49:49 +0000 (16:49 +0200)]
Split out NormalizedContainer
In order to support a consistent surface between ContainerNode and
NormalizedYangData (which really serve a similar purpose), we need to
make sure we have a common concept capturing NormalizedNodeContainer
without implying addressability by PathArgument.
This introduces DataContainer as a superclass of DataContainerNode,
along with NormalizedContainer, DistinctContainer and OrderedContainer
to support the attributes.
JIRA: YANGTOOLS-1472
Change-Id: Ida94334c0e8b7a776befffce62096a659ff3110b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Jun 2023 08:42:58 +0000 (10:42 +0200)]
Clean up yang-repo-fs dependencies
Update module requires and pom.xml to spell out things we actually use.
Change-Id: I717af547c00014449a3ec4f5a6d0b64b61034114
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 13 Jun 2023 08:31:52 +0000 (10:31 +0200)]
Remove unneeded SB suppressions
The false positive has been fixed up to a sufficient degree, hence we
can remove the suppression.
Change-Id: Idd7634891e9680f6e42e4b34227e3540435e98e8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Wed, 3 May 2023 01:04:35 +0000 (03:04 +0200)]
YangTextSchemaSource is a CharSource
YANG text is inherently a plain text, without the ability to detect the
actual encoding. This patch makes the baseline interface a CharSource,
pushing the control to users and defaulting to UTF_8.
This does not extend to YinTextSchemaSource, as XML provides for
explicit control over the character set that governs the document.
JIRA: YANGTOOLS-1508
Change-Id: I2875bb5850def25a0e9e4c9ce1921f5be3a5c77f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 16:08:41 +0000 (18:08 +0200)]
Check Notification name match
When we are faking the root Notification node, we should also be making
sure we actually match on QName.
Change-Id: Ifbe289b7326dae6a522659d7c6378785dd2ae0ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 16:04:05 +0000 (18:04 +0200)]
Clean up startContainerNode()
Returning a raw SchemaNode is not nice. Expose a ContainerLike, taking
advantage of Notification's tranformation capability. Also improve
internal tracking to guarantee a DataSchemaNode in schemaStack, which
is much more friendly than WithStatus.
Change-Id: Ie1a0989e0e7c54f93e4c6263f1240c5d664be900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 15:48:36 +0000 (17:48 +0200)]
Clean up NormalizedNodeStreamWriterStack.enterDataTree()
We have a lot of shared codepaths, let's centralize them in a more
useful enterDataTree() method, which also checks the return type
and updates schemaStack.
Change-Id: Ide1b196bda3003c7abc5be9e25d788759c8cef6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 11:42:00 +0000 (13:42 +0200)]
Expose delegate from ContainerLikeCompat
Users playing tricks actually would like to get access to the delegate
schema so they can undo the tricks. Expose the delegate.
JIRA: YANGTOOLS-1472
Change-Id: I3093dab2dbfe6a3557725d848ffff80dd28a2572
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 15:40:09 +0000 (17:40 +0200)]
Do not leak schema from startChoiceNode()
This is an outlier not used anywhere -- just change the return type to
void. We may revisit it at some point down the line.
Change-Id: I4944ebb0781c82e664b1f45b113194f4f31fc8b9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 15:35:39 +0000 (17:35 +0200)]
Do not leak schema from startLeafSet()
This is one outlier in our API, whic is not used. Just change the return
type to void. We may revisit this at a later point.
Change-Id: Idc156b99391b6b6bba4f14ea8967b9d2ad389ef5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 15:20:19 +0000 (17:20 +0200)]
Hide leafSetEntryNode()
This is an internal utility method, annotate its return, hide it and
ditch its use of checkArgument() to streamline returns.
Change-Id: I5dff82831f67b5754806db8418afe12c3b774188
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 15:13:44 +0000 (17:13 +0200)]
Simplify getParent()
Use local variable type inference to reduce dependency on
DocumentedNode.WithStatus.
Change-Id: Ic6ea6f31ad358df34e16be72cdf741dbe9813e86
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 15:13:04 +0000 (17:13 +0200)]
Use instanceof pattern in constructor
Take advantage of an instanceof pattern, so we eliminate an explicit
cast.
Change-Id: I5bf63332ec2021c79c27b3e8746b42aeb6f66376
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 14:56:28 +0000 (16:56 +0200)]
Modernize ChoiceSchemaNode a bit
Fixup Javadoc to point to correct class (CaseSchemaNode) and improve
findDataSchemaChild().
Change-Id: I6549d3fd5db008db0d843d3b94d6a5856198d763
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 12:48:19 +0000 (14:48 +0200)]
Sharpen {mandatory,optional}VerifyValueChildren()
We know the data needs to be a DistinctNodeContainer, codify that into
the contract, instead of a plain NormalizedNode.
Change-Id: I53a1b77500b6cf52795262906285025a6253f474
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 12:42:20 +0000 (14:42 +0200)]
Modernize ChoiceModificationStrategy
Use local variable type inference to simplify declarations/imports. Also
use streams and ImmutableList.toImmutableList() to create exclusions.
Change-Id: I082c538b396d03a05485945f6b27e3737fe7c620
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 12:32:46 +0000 (14:32 +0200)]
Clean up CaseEnforcer.enforceOnTreeNode()
This method is misnamed, as it does not operate on TreeNode, but rather
(always!) on a ChoiceNode. Rename it to enforceOnChoice() and make sure
it takes ChoiceNode as the argument..
Change-Id: Id00176e3f26d2925b9fdcdf75b5c0cd257baa585
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 12 Jun 2023 12:22:01 +0000 (14:22 +0200)]
Sharpen SchemaAwareApplyOperation.getSchema()
Since we do not have AugmentationNode, we have lost the only strategy
which did not rely on DataSchemaNode (and necessitated
DocumentedNode.WithStatus as the base schema). Sharpen the contract so
we can rely on DataSchemaNode's interface.
Change-Id: Ia9dda657be1ad61ff818203430424819cab7a20c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
matus.matok [Thu, 18 May 2023 13:14:38 +0000 (15:14 +0200)]
Migrate YANG inputs for yang-data-codec-xml
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: Ibe3772d09e651a0f29751075d3b62b5bf128ba7e
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Robert Varga [Mon, 5 Jun 2023 10:10:31 +0000 (12:10 +0200)]
Bump odlparent to 13.0.1
Fixup feature generation.
Change-Id: I425514a330d1a65cbcd2a1cbaa66ac396fb52fd4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
matus.matok [Thu, 18 May 2023 12:56:57 +0000 (14:56 +0200)]
Migrate YANG inputs for yang-data-codec-gson
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: I2ed3beef91692cd93c5bb8f81e5798d2d6557803
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
matus.matok [Thu, 18 May 2023 13:57:18 +0000 (15:57 +0200)]
Migrate YANG inputs for yang-data-impl
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: I0081dd4517f38e59d449170ff9135c8645265be4
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
matus.matok [Thu, 18 May 2023 14:07:04 +0000 (16:07 +0200)]
Migrate YANG inputs for yang-data-util
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: If319c2397d546ddfaa2e2fff3f3ff79124982e0e
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
matus.matok [Thu, 18 May 2023 14:02:00 +0000 (16:02 +0200)]
Migrate YANG inputs for yang-data-tree-ri
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: I0751e51387291aab9afc3c2963e1b7302e180316
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
matus.matok [Thu, 18 May 2023 14:11:22 +0000 (16:11 +0200)]
Migrate YANG inputs for yang-model-export
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: I90dc5abe72315090df3047a68cb83fee90224ef8
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
matus.matok [Thu, 18 May 2023 14:14:41 +0000 (16:14 +0200)]
Migrate YANG inputs for yang-model-util
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: Id4af3be83783c38236b2f11dff99b0e9f6f5b2ca
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Robert Varga [Sat, 3 Jun 2023 22:47:19 +0000 (00:47 +0200)]
Fix UsesNode.getRefines() return
We are really interested in exposing the paths to refined nodes, letting
users to deal with locating them. This allows us to simplify
support for refine -- moving the EffectiveStatement implementation to
yang-model-ri and RefineStatementSupport to rfc7950.stmt.meta.
JIRA: YANGTOOLS-1518
Change-Id: Iad387335038bd5686e67e32873e78925ea1646c5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 3 Jun 2023 21:56:43 +0000 (23:56 +0200)]
Split out refine/if-feature handling
UsesStatementSupport takes over a lot of what RefineStatementSupport
should be doing. As a first step in untangling these statements, move
evaluation of if-feature expressions and rely on simple
isSupportedToBuildEffective().
Also make performRefine() more integrated by improving variable naming
and inlining addOrReplaceNodes().
Change-Id: I3c9e704e856646115a53fb456b73e2a10367511b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 3 Jun 2023 20:28:26 +0000 (22:28 +0200)]
Clean up dependency declarations
We have a number of modules which are using spotbugs annotations, where
they no longer need those. Also fixup pom.xmls to explicitly pull in JDT
annotations.
Change-Id: I801dd332896b03e38b66a29a468322765bccb55f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 13 Mar 2023 18:58:15 +0000 (19:58 +0100)]
Populate namespace before completing
Completing a statement can trigger further actions, make sure the
statement is reachable before we run completions.
JIRA: YANGTOOLS-1516
Change-Id: I81d56bd67ea27a0eb72564c569acecbea57aa61a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Mon, 13 Mar 2023 15:32:33 +0000 (16:32 +0100)]
Require full declaration during path traversal
Establishing whether a particular statement is supported by features
requires it to be fully declared. Add an explicit an intermediate
OnPhaseCompleted in which we evaluate things.
JIRA: YANGTOOLS-1515
Change-Id: Iaeb3d138f0cb6769869b562bf7b388364bffb8ba
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Thu, 1 Jun 2023 14:24:45 +0000 (16:24 +0200)]
Fix InferredStatementContext.isSupportedByFeatures()
StmtContextUtils.checkFeatureSupport() does not work for
InferredStatementContext, as it does not have any declared
substatements -- that only works for OriginalStmtCtx and its subclasses.
Split out computation of this statement's contribution to
isSupportedByFeatures() into a separate method -- allowing
{Inferred,Replica}StatementContext to forward to their prototype or
source.
This also flushes out a bad assertion in YT1393Test, as the second
augment now get correctly disabled.
JIRA: YANGTOOLS-1514
Change-Id: Icf9740cd828bd337b76f38cf33ee29d607f680aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 2 Jun 2023 10:32:03 +0000 (12:32 +0200)]
Fix incorrect-list-keys-test5.yang
This model refers to a non-existent feature, which is not what we want
to test for.
JIRA: YANGTOOLS-1514
Change-Id: I5ef42d9586d07c54b69dada8663667b4d512c0a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 21:56:42 +0000 (23:56 +0200)]
Do not leak SuppressFBWarnings from UnresolvedQName
Encapsulate SpotBugs-sensitive operations in a non-public class so that
we do not leak that annotation to the outside world.
Change-Id: I82b3b2795c68416fe7e4c4e1eae707358daefae3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 21:09:36 +0000 (23:09 +0200)]
Promote YangNamespaceContext
This is a stable interface, update its API and promote it to non-@Beta.
Change-Id: I236e3b4bf4343362e32e0c291f5ef87d07b45713
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:53:54 +0000 (22:53 +0200)]
Promote YangNames
This class has been around the block, it no longer is @Beta.
Change-Id: I6bb8ecd1630203a6e53d338e7d8c4699be7657a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:52:53 +0000 (22:52 +0200)]
Promote YangVersion
Clean up method names and promote the class from @Beta to production
status.
Change-Id: I48ee0f74ae5a14151abfe7a00618182480e22eae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:44:03 +0000 (22:44 +0200)]
Promote dedicated YANG types
Uint{8,16,32,64} and Decimal64 are widely used an work, they are no
longer @Beta.
Change-Id: Ifbd67dfa9a017ffd7255046f32e22c6ef859b3b4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:40:52 +0000 (22:40 +0200)]
Promote rfc6536-model-api
The interfaces here are stable, not @Beta.
Change-Id: I877dc8bfe328989034512522eb77217ae7e31499
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:38:28 +0000 (22:38 +0200)]
Promote YangParserTestUtils
These utilities are widely used, not deserving of @Beta anymore.
Change-Id: I57fb39ec7f976b432d0a97d9cc360eaa27a2f527
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:37:20 +0000 (22:37 +0200)]
Promote rfc6241-parser-support
The interfaces here are no longer @Beta.
Change-Id: I41a133a7cd8e9489556beaf4e6962f64d7c60d52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:35:22 +0000 (22:35 +0200)]
Promote rfc6241-model-api
The interfaces are long past @Beta state, promote them.
Change-Id: Ib08c564dc06970665d3d8379a659f774f39c54eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:27:56 +0000 (22:27 +0200)]
Promote ByteBufUtils
This class is stable enough to not be @Beta, drop the annotation.
Change-Id: I72ac661ae6a1c4c106f60516af4394e778e32604
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 20:26:26 +0000 (22:26 +0200)]
Remove @Beta from yang-data-codec-gson
The interfaces here are stable enough, drop @Beta annotations.
Change-Id: I11e5479c49af2911790b1f4913ea65dada3d6789
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 11:25:15 +0000 (13:25 +0200)]
Bump odlparent to 13.0.0
Adopt latest odlparent, adjusting dependencies to explicitly pull in
annotations we are using, as they are no longer provided.
Change-Id: I0cfec9a9e79590d9d3e3fff84afdb6f4bb457c69
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 09:49:02 +0000 (11:49 +0200)]
Promote SemVer to non-Beta
Convert the class into a record and drop the @Beta annotation.
Change-Id: I7dd23a22e34bf5484a4463814f50f7a13cea935f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 18:02:42 +0000 (20:02 +0200)]
Expand SemVerTest
Add explicit tests for serialization.
Change-Id: I20b9388f1c9ee17597fd954f694651b20427804b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 15:02:48 +0000 (17:02 +0200)]
Remove unneeded FutureCallback type
We do not need to specify EffectiveModelContext, which also fixes an
Eclipse warning.
Change-Id: I3033abf79b70182f767a8672efff6a2c53bee37c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 10:00:15 +0000 (12:00 +0200)]
Promote ClassLoaderUtils
Drop @Beta annotations and eliminate all the loadClass() methods, as
they are no longer used.
Change-Id: I87b20a27990656651a16646539f7471ee7581544
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 09:53:10 +0000 (11:53 +0200)]
Drop @Beta from ItemOrder
Promote this interface to production status.
Change-Id: Ic51ab79b10cf73f40bf9cf3d072a100092b65cc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Tue, 30 May 2023 09:50:57 +0000 (11:50 +0200)]
Drop @Beta from NoOp{Listener,Object}Registration
These classes are designed okay, drop @Beta annotation.
Change-Id: Iaebd7956ba6d10ff30f0bebe1cf73270c692949e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 28 May 2023 20:54:25 +0000 (22:54 +0200)]
Modernize DataTreeCandidateNode API
Use @Nullable/@NonNull properties aligned with record naming and
deprecate all the get*() methods.
JIRA: YANGTOOLS-1513
Change-Id: If7179fcc025d351ad339f3570495d41c524ce994
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Fri, 26 May 2023 14:54:14 +0000 (16:54 +0200)]
Bump odlparent to 12.0.6
Pick up latest upgrades from upstream.
Change-Id: I5f8ccbd6769a3ef3a550cd5aab435fd9ec93f8b5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
matus.matok [Thu, 18 May 2023 13:54:12 +0000 (15:54 +0200)]
Migrate YANG inputs for yang-data-api
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: Ib274b98ff58e79f2c3a84d222c17c9b2f21b3d99
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
matus.matok [Thu, 18 May 2023 12:46:00 +0000 (14:46 +0200)]
Migrate YANG inputs for yang-data-codec-binfmt
Migrated all YANG testfiles counting 50 lines or less.
JIRA: YANGTOOLS-1506
Change-Id: I2cb5778ccdc7edc1ae7eece1a79c716928a0655c
Signed-off-by: matus.matok <matus.matok@pantheon.tech>
Robert Varga [Sun, 21 May 2023 18:51:17 +0000 (20:51 +0200)]
Simplify Bug5396Test
Read the entire directory, not just one yang file. Fixes Eclipse in some
setups.
Change-Id: I5ccdaf1e5c1ab54a8fd6bb9dc1c2de6338f94897
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 14:43:07 +0000 (16:43 +0200)]
Add support for parsing JSON NormalizedYangData
This adds the basic tools and a simple test for parsing yang-data when
the inference stack points to it.
JIRA: YANGTOOLS-1472
Change-Id: If27ec5c36f3686324f5ec66c9ea5a920a3c0a509
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 15:12:24 +0000 (17:12 +0200)]
Disconnect MountPointData from Identifiable
We use the label just as a property -- rather than promulgating
getIdentifier(), use a simple label() method.
Change-Id: Ib0bdee0322808e9a91515cc208a05288dc044096
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 15:04:04 +0000 (17:04 +0200)]
Clean up and deprecate ContainerSchemaNodes
We have a internal class defined here in two parts. Merge them together.
Also removing indexing of notification's children --
NotificationDefinition already provides that functionality.
Finally deprecate the entire class, as OperationDefinition and
NotificationDefinition already provide the contracts here -- but make a
note on compatibility.
Change-Id: Ia8164a8900a827bb07a47b4899551e343cddc48b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 14:41:05 +0000 (16:41 +0200)]
Bridge {Notification,Operation}Definition to ContainerLike
We have overlapping interfaces dealing with the same thing --
{Notification,Operation}AsContainer and ContainerSchemaNodes. Hide the
former and unify the RPC operation provider.
Also increase visibility of these utilities by integrating them directly
into base interfaces.
Change-Id: Ib5c45785b2886a4c5f9c7b0393abe52259beefab
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 14:26:58 +0000 (16:26 +0200)]
Do not be fancy with OperationAsContainer
There is no point to also implement OperationDefition, users always
should choose either this class or delegate (they are supplying) to talk
to the appropriate aspect.
Change-Id: Ibe695a7c7df8c16b4565a0b2e522d786958449dc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 14:19:41 +0000 (16:19 +0200)]
Clean up OperationAsContainer
input/output are always present, use an ImmutableList with two entries.
Change-Id: If7ae9a5f2f8335b68934b58156f072897067db96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 14:11:01 +0000 (16:11 +0200)]
Clean up ContainerSchemaNodes
The classes here overlap with AbstractAsContainer. Move common methods
to base class and reorder to make comparing them easier.
Change-Id: I517f76b9284381b10386a1e205da8d922ed051a9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 13:50:58 +0000 (15:50 +0200)]
Add AbstractNodeDataWithSchema.of(DataSchemaNode)
Centralize allocation of schema in a static factory method, allowing
us to hide individual constructors.
Change-Id: Idbb4b1d1712b2f048457cfcc31f8641fdc64bc6d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 13:16:39 +0000 (15:16 +0200)]
Remove NormalizedNodeWriter.childSizeHint()
Individual nodes are exposing a direct size() method, use that instead
of examining the body.
Change-Id: I0328dbefede85c2f5cd72b6e112f6ab07a14be29
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 11:42:47 +0000 (13:42 +0200)]
Modernize BinaryValue/UniqueValues
Use instanceof patterns to reduce explicit casts.
Change-Id: Icb287b18c62839f5e94951befffb2d20ac038bae
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 11:31:50 +0000 (13:31 +0200)]
Add DataSchemaContextTree.childByPath()
Going through Optional is nice, but the structure of users lends itself
to using @Nullable as well.
JIRA: YANGTOOLS-1413
Change-Id: I49e217a4c66a29093a94dc1eab45b788b834c79b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 10:52:56 +0000 (12:52 +0200)]
Rename DataSchemaContextNode to DataSchemaContext
Drop the 'Node' suffix, as it quite overloaded.
JIRA: YANGTOOLS-1413
Change-Id: I68931049b215239bca1a3382c879200a3e801c4b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 10:22:56 +0000 (12:22 +0200)]
Clean up DataSchemaContextNode.Composite
Fix naming of methods to be consistent with the rest our codebase. Also
document behaviour and eliminate duplicate code.
JIRA: YANGTOOLS-1413
Change-Id: I31bdd01a8bcb2ab8046bdbe7880a422c1e2e8dc0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 00:51:29 +0000 (02:51 +0200)]
Clean up DataSchemaContextNode naming
Rename package to data.util.impl.model and shorten class names (now that
there are fewer of them and there is less confusion).
JIRA: YANGTOOLS-1413
Change-Id: I64491af21ae559a2b59606801cbe8bf964c50ba2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 00:19:12 +0000 (02:19 +0200)]
Remove AbstractListItemContextNode
We can unify ListItemContextNode and MapItemContextNode by pushing path
argument instantiation down to callers.
JIRA: YANGTOOLS-1413
Change-Id: Ic1d39c4775e4b4499984976f9faa1ad08faa5c92
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sun, 21 May 2023 00:03:58 +0000 (02:03 +0200)]
Split out DataSchemaContextNode.Composite
Reduce the number of possible implementations of getChild()/enterChild()
by encapsulating them in a specialized interface.
JIRA: YANGTOOLS-1413
Change-Id: Ib3817ee143c99a0f3ba30bea6c2a9aa3b961749c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 23:19:12 +0000 (01:19 +0200)]
Remove superfluous method overrides
Having getChild() in the abstract base is completely unnecessary -- we
already have sealed the hierarchy.
JIRA: YANGTOOLS-1413
Change-Id: I2acf6fd4bd1abba6caad5c104d3b3e4058753b8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 23:16:25 +0000 (01:16 +0200)]
Seal DataSchemaContextNode hierarchy
The individual implementations are limited to yang-data-util, make sure
we express that through sealing the class hierarchy.
JIRA: YANGTOOLS-1413
Change-Id: Ib7dc132718f8f246d9a2b9ae2d982974dc049295
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 23:06:18 +0000 (01:06 +0200)]
Reconcile pathArgument() and isKeyedEntry()
We have a tad of a mess here. isKeyedEntry() is really indicating
whether the pathArgument() is useable. Merge the logic to enable sane
operation:
- pathStep() returns @Nullable NodeIdentifier, effectively acting as
!isKeyedEntry()
- getPathStep() returns a @NonNull NodeIdentifier or throws.
Based on this, update PathMixin, which is now guaranteed to return a
NodeIdentifier (by deferring to getPathStep()).
JIRA: YANGTOOLS-1413
Change-Id: Ic7f566d37cf0867122a472e879b2665624d5bc74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 20:56:04 +0000 (22:56 +0200)]
Eliminate DataSchemaContextNode.isLeaf()
This method has a rather unfortunate name, as it covers LeafNode and
LeafSetEntryNode. Capture the property as a marker interface,
SimpleValue, reducing confusion and the number of methods.
JIRA: YANGTOOLS-1413
Change-Id: Ia21cc07226d3a64a27f4cb3b88d8817472b28b8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 20:36:23 +0000 (22:36 +0200)]
Eliminate Any{Xml,data}ContextNode
The two sublasses are not bringing anything to the table: merge them
into OpaqueContextNode.
JIRA: YANGTOOLS-1413
Change-Id: If6b2ec841ee96912d6f77cf24193a42c36db1658
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 20:31:49 +0000 (22:31 +0200)]
Simplify AbstractLeafContextNode
There is no point in requiring generics, squash them to simplify they
way this abstract class works.
JIRA: YANGTOOLS-1413
Change-Id: I1568ec703f5aa8620cff416b4aff8679046d171b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 20:18:19 +0000 (22:18 +0200)]
Reduce reliance on pathArgument()
PathArguments are computed from schema, hence we can derive the QName
from DataSchemaNode directly. Also expose the field to package, so that
we can differentiate internal and external accesses more easily.
JIRA: YANGTOOLS-1413
Change-Id: I3a5c20b2c50e32145daf97b177ae33d94b2e476d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 20:02:10 +0000 (22:02 +0200)]
Simplify *List* context nodes
Ordered/Unordered specializations do not make a difference at the end of
the day. Also we have a 'List'/'Map' parlance which is not exposed to
the outside world. Clean this up, eliminating two classes in the
process.
JIRA: YANGTOOLS-1413
Change-Id: Ief920ece71809c7d6134b73ed49bf532652dfdd5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 19:41:37 +0000 (21:41 +0200)]
Add DataSchemaContextNode.PathMixin
Remove isMixin() which provides a dummy boolean. We introduce PathMixin,
which guarantees a PathArgument without relying on
DataSchemaContextNode.pathArgument().
Partially seal the implementation hierarchy, making it clear that
PathMixin cannot be freely mixed in by random outsiders -- it really is
only provided by AbstractMixinContextNode.
This also makes it clear that all mixins are NodeIdentifiers, so we
centralize their creation in AbstractMixinContextNode.
JIRA: YANGTOOLS-1413
Change-Id: Ie834ac288658cebe3363ae051f004db4b0a7df75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 17:19:29 +0000 (19:19 +0200)]
Refactor DataSchemaContextNode
Turn the class into an interface, moving all implementation methods into
a new, hidden AbstractDataSchemaContextNode. The abstract class also
loses its generic argument, as we just do not care about the PathArgument
type.
JIRA: YANGTOOLS-1413
Change-Id: I1eb21b0f8991e58f64897547883ae67367408e4f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 18:46:00 +0000 (20:46 +0200)]
Disconnect DataSchemaContextNode from Identifiable
Split out getIdentifier() into an explicit pathArgument() method, so
that we can hunt down and migrate user.
JIRA: YANGTOOLS-1463
Change-Id: Ibf823e7a783b166fefa1607b0d82dd191978d9eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 18:38:43 +0000 (20:38 +0200)]
Use DataSchemaNode's QName
Now that we always have a DataSchemaNode in DataSchemaContextNode, we
can ditch indirection through PathArgument.getType().
Change-Id: Ibdccd7168ecdf4190a39c5ce14554beeafdd0d61
JIRA: YANGTOOLS-568
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 17:00:54 +0000 (19:00 +0200)]
Clean up DataSchemaContextNode a bit
Now that we do not have AugmentationContextNode, we know the
dataSchemaNode is non-null. Lock that down and also address a few other
FIXMEs.
JIRA: YANGTOOLS-568
Change-Id: Ie2fc089c971eb9a0f6830aa4657b2ff478731888
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 16:45:45 +0000 (18:45 +0200)]
Lock down AbstractNodeDataWithSchema
We are about to reign in NodeDataWithSchema. Lock down the hierarchy and
instantiation points.
Change-Id: Ia1f2b11b760293ff811ffd1657447f2d25f42dbf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 15:02:17 +0000 (17:02 +0200)]
Remove NormalizedNodeSchemaUtils.findCorrespondingAugment()
We do not have augmentations anymore, hence we should not care about the
placement of nodes in augmentations.
JIRA: YANGTOOLS-568
Change-Id: Idd36024255d7745d09983cbc15a25f7c08e27cac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 12:48:55 +0000 (14:48 +0200)]
Introduce AnnotationName
We have data-facing construct names captured in yang-common, do the same
for RFC7952 annotations, introducing AnnotationName.
Change-Id: Iaedd0a8c76edf5f3927bd5d4d56723dd47a84d1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 12:17:19 +0000 (14:17 +0200)]
Migrate RFC references to rfc-editor.org
Mass-migrate references to rfc-editor.org, which is the new place where
RFCs live.
Change-Id: Idd4288f3e6381dbcfaa7527de48c246ec5d55efb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 12:57:22 +0000 (14:57 +0200)]
Fix getDeclared() nullness warning
We are promising non-null, make sure we carry that annotation.
Change-Id: I48767119da236aee708f99fecf11de11a9632123
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Robert Varga [Sat, 20 May 2023 12:30:14 +0000 (14:30 +0200)]
Document MountPointLabel
Add a reference to the specification this class models.
Change-Id: Iae736e05c835c216d343c7e93809d186e698abf8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>