yangtools.git
5 years agoCreate YangInstanceIdentifier serialized form 65/81265/2
Robert Varga [Thu, 28 Mar 2019 16:21:53 +0000 (17:21 +0100)]
Create YangInstanceIdentifier serialized form

We will need to evolve YangInstanceIdentifier and PathArgument, but
they are bound to their serialized form. Add Externalizable proxies
so we can move them in the future somewhere else.

JIRA: YANGTOOLS-979
Change-Id: I6823c55c2cbd1abe9e05945a4fbb2de411fe0792
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate QueuedNotificationManager.BatchedInvoker 27/81227/1
Robert Varga [Wed, 27 Mar 2019 16:26:00 +0000 (17:26 +0100)]
Update QueuedNotificationManager.BatchedInvoker

Since QueuedNotificationManager is a final class, there is no
point in hiding the fact the listener is invoked with
ImmutableList<N>, which is a much friendlier proposition than
an opaque Collection<? extends N>. Fix that up.

Change-Id: Iebd233ba250487710d726406890899b73133ecff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AnydataNode 20/81220/1
Robert Varga [Wed, 27 Mar 2019 12:32:24 +0000 (13:32 +0100)]
Add AnydataNode

This is the counterpart to AnyxmlNode and to AnyDataSchemaNode:
it semantically binds ForeignDataNode to anydata statement, but
leaves out the object model.

JIRA: YANGTOOLS-977
Change-Id: I0095c6f6b274c9d6fef3d66b1bc4086a72f17899
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate NormalizedNodeStreamWriter 19/81219/1
Robert Varga [Wed, 27 Mar 2019 11:02:35 +0000 (12:02 +0100)]
Update NormalizedNodeStreamWriter

This updates the NormalizedNodeStreamWriter to separate out scalar
values and DOMSource values. This separation makes it clear that
anyxml (and anydata) support needs to be separated out into
extensions, so the sender and receiver can agree how to handle them.

JIRA: YANGTOOLS-960
Change-Id: I3dd27d6c8b17dd1996a0f88052658e8f220695fa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine AnyxmlNode and ForeignDataNode 17/81217/1
Robert Varga [Wed, 27 Mar 2019 09:25:41 +0000 (10:25 +0100)]
Define AnyxmlNode and ForeignDataNode

ForeignDataNode is a NormalizedNode anchor pointing towards values
in foreign object models. A prime example is AnyXmlNode, which holds
a value in DOMSource object model.

Since anyxml data can potentially be held in multitude of formats,
define AnyxmlNode which binds ForeignDataNode as a holder of anyxml
value, but does not further specify object model in use.

Finally AnyXmlNode is refactored to be a DOMSource specialization
of AnyxmlNode.

JIRA: YANGTOOLS-975
Change-Id: I1a5476525d711e3e782ed5f8a0691a9fa51f827f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate ClassLoaderUtils methods 11/80611/5
Robert Varga [Tue, 26 Feb 2019 12:57:42 +0000 (13:57 +0100)]
Update ClassLoaderUtils methods

This documents some of the methods and ensures they do not return
a nullable reference.

Change-Id: I37bb42602b2ff48ac0c55f6517f3cf4d87eea32e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoYangNamespaceContext should not have a default namespace 60/81160/4
Robert Varga [Tue, 26 Mar 2019 09:00:52 +0000 (10:00 +0100)]
YangNamespaceContext should not have a default namespace

Default namespace is usually bound separately from prefix, hence
YangNamespaceContext should not contain it.

Change-Id: I14543635dd33997f5cbc7d0f23405a59446de24c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPrepare RevisionAwareXPath for XPath integration 01/81201/3
Robert Varga [Tue, 26 Mar 2019 17:07:10 +0000 (18:07 +0100)]
Prepare RevisionAwareXPath for XPath integration

This fixes up the mistake of using toString() to expose the original
XPath and defines a WithExpression extension, which allows exposing
the parsed expression.

Change-Id: Iac0c36f6bde106f92b91a4bef768de55ad9e6d41
JIRA: YANGTOOLS-966
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework yang-model-validator packaging 37/80937/2
Robert Varga [Sat, 16 Mar 2019 15:13:55 +0000 (16:13 +0100)]
Rework yang-model-validator packaging

There is no point making this a bundle, keep it a simple jar.

Change-Id: Icdffcdc27bd7238314af4a989d8dda825ac9d91f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove SchemaNodeIdentifierBuildNamespace 94/81194/5
Robert Varga [Tue, 26 Mar 2019 14:37:23 +0000 (15:37 +0100)]
Remove SchemaNodeIdentifierBuildNamespace

This namespace has been superseded by ChildSchemaNodeNamespace
and its utility methods. Remove it.

Change-Id: I60c0a936fe76c23a0265d4d900a23d71faa94f50
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove CursorAwareDataTreeSnapshot.createCursor() 93/81193/4
Robert Varga [Tue, 26 Mar 2019 14:31:27 +0000 (15:31 +0100)]
Remove CursorAwareDataTreeSnapshot.createCursor()

This method has been superseded by openCursor(), which has
a slightly better contract. Remove the old method.

Change-Id: I4d7f1befeb20f00a7f67c4eb37e33ddcc8bbd380
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated {Cached,Fast}ThreadPoolExecutor constructors 88/81188/3
Robert Varga [Tue, 26 Mar 2019 14:04:57 +0000 (15:04 +0100)]
Remove deprecated {Cached,Fast}ThreadPoolExecutor constructors

We now require identity of the user to acquire logger.

Change-Id: I8d92583d5ca8fcdae2b32b0d22a77559d2dac83d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove deprecated QueuedNotificationManager interface/constructor 87/81187/3
Robert Varga [Tue, 26 Mar 2019 14:02:56 +0000 (15:02 +0100)]
Remove deprecated QueuedNotificationManager interface/constructor

This now a properly-final class without extraneous API elements.

Change-Id: I96bb9c6a9ae276f5da38057a6eabfdf1225da358
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove DataSchemaContextNode.augmentationProxy() 92/81192/2
Robert Varga [Tue, 26 Mar 2019 14:24:28 +0000 (15:24 +0100)]
Remove DataSchemaContextNode.augmentationProxy()

This method is superseded by EffectiveAugmentationSchema#create(),
remove it.

Change-Id: Ifc30aa4f11ae79d8ed132a93f36c8330a8a77530
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove duplicate {Declared,Effective}Statement methods 91/81191/3
Robert Varga [Tue, 26 Mar 2019 14:15:03 +0000 (15:15 +0100)]
Remove duplicate {Declared,Effective}Statement methods

EffectiveStatementBase and AbstractDeclaredStatement pre-date
our use of Java 8 and provided methods to access substatements.

These methods are now part of interface contract, so we can safely
remove their old counterparts.

Change-Id: I10a3b0b3b280af1d41849f7f4f7ef97acb84da39
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove getNodeIdentifierForAugmentation() methods 90/81190/2
Robert Varga [Tue, 26 Mar 2019 14:13:48 +0000 (15:13 +0100)]
Remove getNodeIdentifierForAugmentation() methods

These are duplicates of the now-centralized method
DataSchemaContextNode#augmentationIdentifierFrom(), remove them.

Change-Id: I289b9b8cfdf808966ea822660088234e551e8c69
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove XMLStreamNormalizedNodeStreamWriter.toString() 89/81189/2
Robert Varga [Tue, 26 Mar 2019 14:10:16 +0000 (15:10 +0100)]
Remove XMLStreamNormalizedNodeStreamWriter.toString()

This method is not used anywhere, forces us to have a dependency
on transformers and does not allow control over output augmentation.

It has been deprecated in 2.1.x release train, remove it now.

Change-Id: I07b048e16efba657045c4f0ce10376672f0ddece
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEnforce namespace during input/output lookup 86/81186/1
Robert Varga [Tue, 26 Mar 2019 13:59:46 +0000 (14:59 +0100)]
Enforce namespace during input/output lookup

We do not tolerate mismatched RPC/action input/output lookups,
as we now check whether the QName matches before going to localName
dispatch.

Change-Id: Ideec2ab0189b085a8aa791edd0db3aa8def45b17
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPush out FIXMEs 70/81170/11
Robert Varga [Tue, 26 Mar 2019 10:47:58 +0000 (11:47 +0100)]
Push out FIXMEs

Push the FIXMEs out to 4.0.0, as we cannot fix them all in 3.0.0
release.

Change-Id: I7192a28569e5f9eaaa5c9693659e4996af99782c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse NPE to report null arguments 68/81168/10
Robert Varga [Tue, 26 Mar 2019 10:30:40 +0000 (11:30 +0100)]
Use NPE to report null arguments

Our system should not be tolerating nulls, remove use of IAE
in favor of NPE, so that users are forced to guard.

Change-Id: I35c6521c99f12257deb76ea6fe571faaffec7130
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAddress FIXMEs in StatementStreamSource 77/81177/4
Robert Varga [Tue, 26 Mar 2019 11:56:56 +0000 (12:56 +0100)]
Address FIXMEs in StatementStreamSource

We are promoting YangVersion-bearing methods to full contract,
remove the FIXMEs we have had and place a new one for 4.0.0.

Change-Id: I1d02fe5266d17c16b17acb93d78d4579ff43126a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake DataTreeSnapshot extend SchemaContextProvider 82/81182/2
Robert Varga [Tue, 26 Mar 2019 12:07:02 +0000 (13:07 +0100)]
Make DataTreeSnapshot extend SchemaContextProvider

SchemaContextProvider is the proper contract we want to expose
here. Most notably its @NonNull version.

Change-Id: Ib11c7985d8e1372b2993d17be6aa3a4d460ba574
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSplit out ReadOnlyDataTree interface 76/81176/2
Robert Varga [Tue, 26 Mar 2019 11:50:42 +0000 (12:50 +0100)]
Split out ReadOnlyDataTree interface

Having a read-only view of the DataTree operations allows us to
more safely express access rules, i.e. make it impossible for illegal
access to occur.

Change-Id: I67ae6c8423f63f0686cc7ba2286b0df4b44585ff
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoStrings Ending in Backslash are Improperly Lexed 50/81150/9
Danielle Mustillo [Mon, 25 Mar 2019 18:27:45 +0000 (14:27 -0400)]
Strings Ending in Backslash are Improperly Lexed

Using greedy match for SUB_STRING fragment's forward lookahead
is troublesome because it will consume all non-double-quotes
until the final one -- including any escapes present.

This patch fixes the lexer to use non-greedy subrule, so that
escapes are properly accounted for.

JIRA: YANGTOOLS-971
Change-Id: Ic93c5c2bfa807001735125bd0367c29a1a25ea99
Signed-off-by: Danielle Mustillo <danielle.mustillo@ericsson.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove a stray FIXME 75/81175/1
Robert Varga [Tue, 26 Mar 2019 11:43:00 +0000 (12:43 +0100)]
Remove a stray FIXME

This FIXME was addressed already, remove it.

Change-Id: I697fbf5dec237b6a1b726058d58abd6bf9862805
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake TreeNode @NonNullByDefault 71/81171/5
Robert Varga [Tue, 26 Mar 2019 10:52:18 +0000 (11:52 +0100)]
Make TreeNode @NonNullByDefault

This reflects our intent, so make sure we declare it.

Change-Id: I8023e161207aff6f230a651cf6e06dde8f478279
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake buildEffectiveModel() non-default 74/81174/1
Robert Varga [Tue, 26 Mar 2019 11:39:50 +0000 (12:39 +0100)]
Make buildEffectiveModel() non-default

This addresses a previous FIXME.

Change-Id: I2a112116ebca2a8fb375a2f812cbac1187003ac0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAddress DataTreeTip 3.0.0 FIXMEs 69/81169/3
Robert Varga [Tue, 26 Mar 2019 10:46:21 +0000 (11:46 +0100)]
Address DataTreeTip 3.0.0 FIXMEs

This documents exceptions being thrown and switches to
@NonNullByDefault.

Change-Id: Ibb8df7bb87fbf29888bc95dc978def3229bbcc06
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove impossible checkArgument()s 67/81167/3
Robert Varga [Tue, 26 Mar 2019 10:25:54 +0000 (11:25 +0100)]
Remove impossible checkArgument()s

Private methods' callers are ensuring these cannot trigger, remove
them.

Change-Id: I6783c348ef15866fc34173940fa8ad6d8346887e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAddress spotbugs warnings 66/81166/3
Robert Varga [Tue, 26 Mar 2019 10:23:41 +0000 (11:23 +0100)]
Address spotbugs warnings

StringIdentityrefCodecs seem to be unused, fix them up a bit
and note their Beta status.

Change-Id: Ia758c3211419411e5934bc66b804057ec4581535
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPartially address Codec/Serializer/Deserializer design note 64/81164/3
Robert Varga [Tue, 26 Mar 2019 10:10:50 +0000 (11:10 +0100)]
Partially address Codec/Serializer/Deserializer design note

Require non-null input and output, as we should not be encountering
nulls anywhere.

Change-Id: I62655886011d47d4d3495722ac284d055df1a986
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean up DataTreeCandidateNode contract 63/81163/4
Robert Varga [Tue, 26 Mar 2019 09:56:22 +0000 (10:56 +0100)]
Clean up DataTreeCandidateNode contract

Use Optional instead of nullable and clarify that the interface
may return a UNMODIFIED node.

JIRA: YANGTOOLS-954
Change-Id: I8e394e14522a9074d503484c5893d5d5a739e4e1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove illegal FIXME notes 65/81165/3
Robert Varga [Tue, 26 Mar 2019 10:13:39 +0000 (11:13 +0100)]
Remove illegal FIXME notes

FluentFuture has moved to be inconvenient to proxy and instantiate,
remove the FIXME which advised transitioning to it.

Change-Id: I85ee7b2cda71704c3df24139bc55ec2fe81b334c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd basic support for lenient path expression parsing 59/81159/2
Robert Varga [Tue, 26 Mar 2019 08:50:46 +0000 (09:50 +0100)]
Add basic support for lenient path expression parsing

This promotes getLocation() to full PathExpression member, allowing
implementations to throw na exception. It also splits path expression
support into lenient and strict, allowing reactor builders to choose
their implementation.

Change-Id: Ia32a22f3de1b3997795400499c7847e1d91ba59e
JIRA: YANGTOOLS-969
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd rename notes for Any{Data,Xml}SchemaNode 58/81158/1
Robert Varga [Tue, 26 Mar 2019 08:19:49 +0000 (09:19 +0100)]
Add rename notes for Any{Data,Xml}SchemaNode

These interfaces should be renamed to keep consistency with other
SchemaNodes.

Change-Id: Ia5543040817607effdc8f9bbc542c3bdb7e32fd8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC6241 parser support 48/81148/7
Robert Varga [Mon, 25 Mar 2019 17:21:26 +0000 (18:21 +0100)]
Add RFC6241 parser support

This adds extensions to identify get-config/get filter anyxml
nodes. While we provided an implicit support for the extension,
this adds proper extension capture as well as suppressions so
that the extension is not generated outside of its two allowed
places.

JIRA: YANGTOOLS-831
Change-Id: Ib38c31f1b2dd82793cebe72f0ba8e7300f1b6404
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntegrate leafref path argument parser 17/81017/21
Robert Varga [Tue, 19 Mar 2019 20:36:17 +0000 (21:36 +0100)]
Integrate leafref path argument parser

This teaches YANG parser to properly parse leaf-ref path expressions,
persing them as needed.

This ends up flushing out problems in test models, which are fixed up,
too. leafref-test.yang has one leaf removed, as that definition is not
valid as per RFC7950 (../ can only be leading the path).

JIRA: YANGTOOLS-969
Change-Id: I92c96945b0b630f4298e8753394db3f3db450863
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix YangXPathMathSupport serializability 52/81152/1
Robert Varga [Mon, 25 Mar 2019 20:27:52 +0000 (21:27 +0100)]
Fix YangXPathMathSupport serializability

Supports should always resolve to a singleton.

Change-Id: I9888465d7fe89fbf9c2e75aa4e7a807ea16ed0e0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AbstractVoidStatementSupport utility class 51/81151/2
Robert Varga [Mon, 25 Mar 2019 19:16:38 +0000 (20:16 +0100)]
Add AbstractVoidStatementSupport utility class

No-argument statements are common, add a utility class to handle
their StatementSupport.

Change-Id: Id4b5d49af63b9111de0545a8049cdadb0ecde170
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine the concept of unresolved QName 52/81052/8
Robert Varga [Wed, 20 Mar 2019 17:37:20 +0000 (18:37 +0100)]
Define the concept of unresolved QName

YANG Xpaths have dynamic namespace resolution for the default
namespace: during parse time we can only bind qualified node
identifiers.

Unqualified node identifiers require an explicit default namespace
binding step, which happens between when the XPath is parsed and
when it is evaluated, when the context node is determined.

This is quite visible in the context of leafref path expressions:
- typedef expressions are bound to the leaf/leafset referencing them
- leaf expressions in groupings are bound only after they have been
  completely instantiated (i.e. 'uses' outside of grouping context)

Change-Id: I65341793dc520bcc36c45dec76a303080be115a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDisconnect EffectiveStatements and SchemaNodes 47/81147/1
Robert Varga [Mon, 25 Mar 2019 17:59:51 +0000 (18:59 +0100)]
Disconnect EffectiveStatements and SchemaNodes

EffectiveStatements are a replacement for SchemaNodes, there should
not be any API-level binding between the two. The connection is made
strictly through implementation.

Change-Id: I2d2736079e41ca03870f2b203a728b3bd9acff56
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCorrect LeafrefTypeDefinition 43/81143/7
Robert Varga [Mon, 25 Mar 2019 10:54:22 +0000 (11:54 +0100)]
Correct LeafrefTypeDefinition

leaf-ref types do not carry a RevisionAwareXPath, but rather
a PathExpression, which is a subset of YangXPathExpression.

JIRA: YANGTOOLS-969
Change-Id: I5694567ea33a5677f653bded7c57887b60d94332
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded services inclusions 41/81141/1
Robert Varga [Mon, 25 Mar 2019 10:30:21 +0000 (11:30 +0100)]
Remove unneeded services inclusions

odlparent-5.0.0 contains the appropriate fix, we do not declare
the inclusion ourselves.

Change-Id: If3e6a76d2c1c0d37b93d81aa7f12d281638918bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove unneeded javax.annotation suppressions 40/81140/1
Robert Varga [Mon, 25 Mar 2019 08:52:26 +0000 (09:52 +0100)]
Remove unneeded javax.annotation suppressions

We are not pulling in JSR305 anymore, remove import suppressions.

Change-Id: Ibce8b30dab04e4c84d972e02f6b190ffd104a938
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoBump odlparent to 5.0.0 92/80892/23
Robert Varga [Fri, 15 Mar 2019 14:26:57 +0000 (15:26 +0100)]
Bump odlparent to 5.0.0

This integrates odlparent-5.0.0 and removes reliance on JSR305
annotations. Nullness annotations were migrated in previous patches,
this switches the remainder to Checker Framework annotations.

Change-Id: Ia59d13f424d68a0bd8e86c952db0f1926ad7efbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMigrate nullness annotations to JDT 39/81139/1
Robert Varga [Mon, 25 Mar 2019 08:20:44 +0000 (09:20 +0100)]
Migrate nullness annotations to JDT

This converts the remaining classes and interfaces to not use JSR305
nullness annotations.

JIRA: YANGTOOLS-907
Change-Id: I94ffa71649f45dac2b02dfb90b0524a39a897fd2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @NotThreadSafe annotations 38/81138/2
Robert Varga [Mon, 25 Mar 2019 08:18:05 +0000 (09:18 +0100)]
Remove @NotThreadSafe annotations

Document classes as not-thread-safe in javadoc rather than using
JSR305 to do that.

Change-Id: I088869591a8f7a1c5eb67fe7e83685cd7823ab81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoClean up StatementDefinition argument definition interface 43/81043/8
Robert Varga [Wed, 20 Mar 2019 15:08:28 +0000 (16:08 +0100)]
Clean up StatementDefinition argument definition interface

This makes it impossible for implementations to present a wrong
argument definition by encapsulating it in ArgumentDefinition.

To simplify implementations, an AbstractStatementDefinition class
is provided, which keeps the two components decomposed and creates
the definition on demand.

Change-Id: If941eb697ebfd53540da54074cba6018f4172452
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @ThreadSafe annotation from AbstractCodecFactory 03/81103/2
Robert Varga [Thu, 21 Mar 2019 16:50:20 +0000 (17:50 +0100)]
Remove @ThreadSafe annotation from AbstractCodecFactory

Rather than using JSR305, document thread-safety in Javadoc, as it
is nuanced.

Change-Id: Iab25ee3919d6515a2b3d1ad3f31f178a7552a23a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove YangXPathParserFactory @ThreadSafe annotation 02/81102/2
Robert Varga [Thu, 21 Mar 2019 16:46:28 +0000 (17:46 +0100)]
Remove YangXPathParserFactory @ThreadSafe annotation

Replace JSR305 with explicit documentation of the fact we expect
implementations to be thread-safe.

Change-Id: If04d9b930f731387c794731261e745064048db0c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @ThreadSafe annotations from CodecCaches 01/81101/2
Robert Varga [Thu, 21 Mar 2019 16:42:50 +0000 (17:42 +0100)]
Remove @ThreadSafe annotations from CodecCaches

The documentation mentions these are thread-safe, there is no
point to keep JSR305 around.

Change-Id: Ide63bd3923ee61539e93fe6b259b0c00e736de7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove RecursiveObjectLeaker @ThreadSafe annotation 00/81100/2
Robert Varga [Thu, 21 Mar 2019 16:35:00 +0000 (17:35 +0100)]
Remove RecursiveObjectLeaker @ThreadSafe annotation

This is a utility class, which exposes only static methods, it is
naturally expected to be thread-safe. Remove JSR305 annotation and
fix Javadoc a bit.

Change-Id: Ie7afcef7b2339e308c7d1958141b539230aa3d85
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove ListenerRegistry @ThreadSafe annotation 99/81099/2
Robert Varga [Thu, 21 Mar 2019 16:34:06 +0000 (17:34 +0100)]
Remove ListenerRegistry @ThreadSafe annotation

Rather than relying on JSR305, add a bit of javadocs and mention
the class is thread-safe.

Change-Id: I157e6873246b865be7dc00b7efa71d2923a80437
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoIntroduce UnqualifiedQName and QualifiedQName 58/81058/8
Robert Varga [Wed, 20 Mar 2019 22:15:16 +0000 (23:15 +0100)]
Introduce UnqualifiedQName and QualifiedQName

For the purposes of XPath expressions we need the concept of a future
node-identifier which is not bound to a concrete namespace (which
is already covered by QName).

This node identifier comes in two forms, qualified and unqualified,
each of which undergoes different namespace binding lifecycle.

This patch introduces AbstractQName, which serves as the base class
for all QName constructs and two separate classes UnqualifiedQName
and QualifiedQName, which have the ability to be be converted to
a full QName.

Note that due to Serializable contract, QName cannot be made a
subclass of AbstractQName. This fact is marked up for a future
API change.

Change-Id: I87242dcab93ecdd1050630fd4b3c320419ae10d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake QNameModule use externalizable proxy pattern 61/81061/2
Robert Varga [Thu, 21 Mar 2019 09:00:07 +0000 (10:00 +0100)]
Make QNameModule use externalizable proxy pattern

This disconnects the serialized form from the object itself,
allowing the two of them to evolve independently.

Change-Id: I5688c2c930282307f2cf5bf9ebd23295fb314c63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake QName use externalizable proxy pattern 60/81060/2
Robert Varga [Thu, 21 Mar 2019 08:12:13 +0000 (09:12 +0100)]
Make QName use externalizable proxy pattern

This patch disconnects QName serialization layout from its class
hierarchy, allowing the two evolve separately.

Change-Id: I1be13e02ed4eec537cb86f86e009ba058687f153
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoShorten QName.toString() 63/81063/2
Robert Varga [Thu, 21 Mar 2019 09:11:35 +0000 (10:11 +0100)]
Shorten QName.toString()

Take advantage of fluent StringBuilder, removing a bit of bytecode.

Change-Id: I8d7c55b6118066529c2b62d8b48134affd58c1ea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoSpeed up QName.intern() a bit 57/81057/1
Robert Varga [Wed, 20 Mar 2019 22:17:37 +0000 (23:17 +0100)]
Speed up QName.intern() a bit

In case we end up interning the localName, we should use the private
constructor to side-step re-validating localName.

Change-Id: I54029d15c93ae32f5c857e890c8313a9f62f58f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExpose Relative/Absolute YangLocationPath 32/81032/2
Robert Varga [Wed, 20 Mar 2019 12:20:38 +0000 (13:20 +0100)]
Expose Relative/Absolute YangLocationPath

This patch exposes the two concretizations of YangLocationPath,
so they can be used for constructing type-safe APIs.

Change-Id: I9f0678141d7f6df668020531250a6a10fab67512
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix XPathExpr parsing 31/81031/2
Robert Varga [Wed, 20 Mar 2019 12:04:46 +0000 (13:04 +0100)]
Fix XPathExpr parsing

The parser mistakenly treated filter/path concatenation as a binary
expression, which lead to its inability to parse leafrefs, which
contain such a concatenation in predicates.

This fixes the parser to correctly use XPathExpr in this case.

Change-Id: Ica1ac3ee7d099273dccdf8565da2a69d9f11c046
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMerge location step shorthand handling 28/81028/1
Robert Varga [Wed, 20 Mar 2019 11:19:08 +0000 (12:19 +0100)]
Merge location step shorthand handling

This eliminates duplicate code by introducing parseStepShorthand()
and adjusting its two users to use it.

Change-Id: I0e4db3e9a7fd062e5085ce27f6ba6d21cf6cf668
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove descendant_schema_nodeid 24/81024/3
Robert Varga [Wed, 20 Mar 2019 09:22:59 +0000 (10:22 +0100)]
Remove descendant_schema_nodeid

This parser rule is never references and is unused in current
code base. Remove it.

JIRA: YANGTOOLS-969
Change-Id: I6c4bb47fed5d7081ddaf902208a19d9b924a5900
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoCleanup LeafRefPath{Lexer,Parser} 23/81023/3
Robert Varga [Wed, 20 Mar 2019 09:20:26 +0000 (10:20 +0100)]
Cleanup LeafRefPath{Lexer,Parser}

Drop CRLFs and remove a trailing space.

JIRA: YANGTOOLS-969
Change-Id: I24fabf164db72164e07bc3ea149e11e028ba91a2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine PathExpression is a separate concept 22/81022/3
Robert Varga [Wed, 20 Mar 2019 09:17:00 +0000 (10:17 +0100)]
Define PathExpression is a separate concept

RevisionAwareXPath is not what leafref types are referencing, define
PathExpression which captures the proper semantic concept, which
is based on YangLocationPath.

JIRA: YANGTOOLS-969
Change-Id: I1f4a670d13a39ca60cda4771bb7ff46a90449bfe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate unneeded YangLocationPath subclasses 20/81020/2
Robert Varga [Wed, 20 Mar 2019 07:59:22 +0000 (08:59 +0100)]
Eliminate unneeded YangLocationPath subclasses

*WithSteps subclasses are not that helpful, as we only have single
onjects which do not have steps. Integrate steps into YangLocationPath,
making it bimorphic (and its getSteps() method monomorphic).

Also clean up arguments/returns, so that we propagate only Immutable
collections.

Change-Id: Ie0cdd2fb558b0b51071fd49eded9bfa1f6e20b1b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YangXPathAxis.asStep() methods without predicates 19/81019/1
Robert Varga [Wed, 20 Mar 2019 07:40:02 +0000 (08:40 +0100)]
Add YangXPathAxis.asStep() methods without predicates

In some contexts we know we do not not have any predicates, add
convenience functions for instantiating such steps.

Change-Id: I141053c041095add35590b6ff77440036450cb58
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove LeafRefValidatation 16/81016/1
Robert Varga [Tue, 19 Mar 2019 19:45:12 +0000 (20:45 +0100)]
Remove LeafRefValidatation

This is a misnomer, use LeafRefValidation instead.

Change-Id: I67f4d6b2226f7218aadbddc036e8205f47082105
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFixup xpath resolution 56/80956/2
Robert Varga [Mon, 18 Mar 2019 16:53:20 +0000 (17:53 +0100)]
Fixup xpath resolution

Add basic handling for method invocations, namely deref() and
interrupted '..' chains.

JIRA: YANGTOOLS-968
Change-Id: I9b99a5aa84039749fb04f1dca8420d41b24ba6e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd Automatic-Module-Name declarations 36/80936/1
Robert Varga [Sat, 16 Mar 2019 14:58:03 +0000 (15:58 +0100)]
Add Automatic-Module-Name declarations

Providing automatic module name allows downstreams to better
modularize their deployment with JDK9+. Provide this header
for all production artifacts.

Change-Id: I1dedaea93b7aea9df0ca17a9dad2bcc0ec7848af
JIRA: YANGTOOLS-933
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove checkstyle-logging 35/80935/1
Robert Varga [Sat, 16 Mar 2019 14:18:13 +0000 (15:18 +0100)]
Remove checkstyle-logging

Most of the checks performed by this plugin are covered by
jp.skypencil.findbugs.slf4j. Remove this plugin, as we are no
longer using it.

Change-Id: Id5f2ae3d8435fb987add358e042524a59313afbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDeprecate preliminary XPath/NormalizedNode interfaces 34/80934/7
Robert Varga [Sat, 16 Mar 2019 00:26:22 +0000 (01:26 +0100)]
Deprecate preliminary XPath/NormalizedNode interfaces

We have our own XPath parser implementation, which allows introspection
into the content and allows further transformations.

The APIs in yang.data.api.schema.xpath assume the XPath parser and
evaluator are kept in the same artifact, which does not work well
with the need to parse XPaths in yang-model-api context and then
evaluating them either in yang-model-api context or in yang-data-api
context.

This patch deprecates those APIs and creates a staging artifact for
APIs which integrate with yang-xpath-api.

yang-data-jaxen is relegated to an experimental feature, pending its
update to the newly-defined APIs.

JIRA: YANGTOOLS-967
Change-Id: I661d50e7024fad3e3bc1f06d8650e506bc061fb7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoPromote yang-xpath to stable features 19/80919/8
Robert Varga [Sat, 16 Mar 2019 00:26:22 +0000 (01:26 +0100)]
Promote yang-xpath to stable features

yang-xpath-* is ready to be promoted, this patch integrates
it into odl-yangtools-xpath and defined odl-yangtools-xpath-api

JIRA: YANGTOOLS-966
Change-Id: Iefc0343bbdd52892769422900465b7c6565fca47
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix HTML5 javadoc compliance 22/80922/8
Robert Varga [Sat, 16 Mar 2019 00:40:07 +0000 (01:40 +0100)]
Fix HTML5 javadoc compliance

We are using HTML4 tags for no good reason, migrate to better
concepts to improve compatibility.

Change-Id: I4f5bb01ed2bb163ba7775f36469c94f9b2cbfd89
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove @ThreadSafe annotations 21/80921/7
Robert Varga [Sat, 16 Mar 2019 00:36:24 +0000 (01:36 +0100)]
Remove @ThreadSafe annotations

This annotation is not needed in the following case:
- static methods are expected to be thread-safe
- package-private classes can be examined for safety
- Immutable interfaces imply thread safety

Change-Id: I0d27d061dc59149b606cd096e777d72361cd4aeb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoExtend Immutable contract 23/80923/6
Robert Varga [Sat, 16 Mar 2019 00:53:42 +0000 (01:53 +0100)]
Extend Immutable contract

Rather than using Immutable annotation, extend interface to implement
Immutable interface, which has equal connotations, but can be run-time
checked and implies thread-safety.

Change-Id: Ifc1cdbff50ba328eee7b2afbf85cee5bbe2623bd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove object cache declaration 18/80918/1
Robert Varga [Sat, 16 Mar 2019 00:26:55 +0000 (01:26 +0100)]
Remove object cache declaration

object-cache has been removed in 2.1.0, remove its declaration.

Change-Id: I3aaad19fd21a306f32d4f2b661564df40ab3fa36
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoHook if-feature statements onto FeatureNamespace 39/80739/7
Robert Varga [Fri, 8 Mar 2019 17:10:07 +0000 (18:10 +0100)]
Hook if-feature statements onto FeatureNamespace

IfFeatureStatementSupport should perform a check against FeatureNamespace,
so that invalid feature references are properly caught and reported.

JIRA: YANGTOOLS-964
Change-Id: If9fe8da3235533a702a34ceac26d62d91acc03c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRedefine if-feature statement in terms IfFeatureExpr 37/80737/4
Robert Varga [Fri, 8 Mar 2019 16:41:39 +0000 (17:41 +0100)]
Redefine if-feature statement in terms IfFeatureExpr

Rather than anonymizing the argument to a Predicate, use our custom
model of if-feature-expr.

JIRA: YANGTOOLS-964
Change-Id: Iaa3371691853a0f56216041314c8abbe88970669
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDefine IfFeature via a specialized class 36/80736/4
Robert Varga [Fri, 8 Mar 2019 14:04:34 +0000 (15:04 +0100)]
Define IfFeature via a specialized class

This reworks the grammar to use less recursion, as we can use
wildcards to eagerly combine expressions like "foo || bar || baz"
into any(foo, bar, baz) rather than or(foo, or(bar, baz)).

In order to properly support this contract, we define IfFeatureExpr,
which we specialize, so that we do not need to lug an opaque
predicate tree.

JIRA: YANGTOOLS-964
Change-Id: I048c3ced9c074e340031ac53c1117ce881b0a78b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake sure we populate features 38/80738/3
Robert Varga [Fri, 8 Mar 2019 17:38:04 +0000 (18:38 +0100)]
Make sure we populate features

The way features work with EffeciveModules means features are not
populated into FeatureNamespace. In fact that namespace is not
activated at all.

Fix this up, so features can be cross-referenced with if-feature.

Change-Id: I73cb4e8cf648e5f8ef72edce00556e4e69ee908c
JIRA: YANGTOOLS-964
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake getIfFeaturePredicate() a default method 35/80735/1
Robert Varga [Fri, 8 Mar 2019 16:38:03 +0000 (17:38 +0100)]
Make getIfFeaturePredicate() a default method

This is just a reference to the argument, there is no point in
forcing implementations to deal with this.

Change-Id: I40cb0c349694f9fe9e224e4458fea2b2c05fa870
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoDisconnect AnnotationEffectiveStatement and AnnotationSchemaNode 33/80733/2
Robert Varga [Fri, 8 Mar 2019 08:07:12 +0000 (09:07 +0100)]
Disconnect AnnotationEffectiveStatement and AnnotationSchemaNode

These interfaces should be independent, make sure this is the case.
Also update AnnotationStatement with common accessors.

Change-Id: Ib59c5f99a36ecb3cf30d5a77e4dd539bf6b92277
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YANG Schema Mount parser support 30/80730/4
Robert Varga [Thu, 7 Mar 2019 19:18:21 +0000 (20:18 +0100)]
Add YANG Schema Mount parser support

This adds the necessary bits and pieces to properly support
mount-point extension in the parser.

JIRA: YANGTOOLS-965
Change-Id: I7ca1b6c8c961e3033dc8023089d9169573dc3c4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix AnnotationStatement definition 31/80731/1
Robert Varga [Thu, 7 Mar 2019 20:37:13 +0000 (21:37 +0100)]
Fix AnnotationStatement definition

Annotation argument is required to be identifiers, which means their
argument really binds as a QName to the defining module. Change the
definition to reflect this fact.

This forces the argument to be validated properly as well as making
it easier to use.

Change-Id: Idca53d98517ab3627b4b555386bed6a740c3e66d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd YangInstanceIdentifier.createReverse(Deque) 97/80697/3
Robert Varga [Wed, 6 Mar 2019 10:39:13 +0000 (11:39 +0100)]
Add YangInstanceIdentifier.createReverse(Deque)

There are use cases when we need to instantiate a YangInstanceIdentifier
and we have the components available in a stack (i.e. deque). We can
provide an optimized instantiator which will walk the stack in reverse
order, reducing the need for one invert operation.

This patch adds two methods, one operating on a Deque<PathArgument>
and one operating on Deque<Object> with an extractor function.

Change-Id: If2b05d62dcbfb5d37415a2ecb241c8265ceb1be6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoEliminate ImmutableNormalizedNodeStreamWriter.getBuilders() 99/80699/2
Robert Varga [Wed, 6 Mar 2019 00:44:45 +0000 (01:44 +0100)]
Eliminate ImmutableNormalizedNodeStreamWriter.getBuilders()

The only caller is interested only in current container builder,
for which we already have a method.

Change-Id: I4ea7bc3d5dd6478b40ed1bd1c56b608650801a57
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUpdate NormalizedMetadata(StreamWriter) design 89/80689/2
Robert Varga [Tue, 5 Mar 2019 15:13:38 +0000 (16:13 +0100)]
Update NormalizedMetadata(StreamWriter) design

While having a complete decomposition of metadata blocks would be
a nice design, it is not efficient for our current use:

- NormalizedMetadata has the block readily-available
- Both JSON and XML parsers fully assemble attributes before
  emitting them. Even if the implementation changes, both parsers
  can very easily assemble the full block, as XML encodes it just
  after the element and JSON uses dedicated objects.
- NETCONF edit-config processing requires metadata to be visible
  before it can decide how to process the node

This patch changes NormalizedMetadataStreamWriter have a single
metadata() event, which takes an ImmutableMap. This communicates
the intent quite clearly and allows for optimizations on both ends.

JIRA: YANGTOOLS-961
Change-Id: I638c78d5ab1d3a8b544ab53a84b872420b49d637
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd RFC7952 data model extensions 43/80643/29
Robert Varga [Thu, 28 Feb 2019 12:48:56 +0000 (13:48 +0100)]
Add RFC7952 data model extensions

RFC7952 has implications on NormalizedNodeStreamWriter, namely
the ability to emit metadata attached to NormalizedNodes.

This patch introduces the concept of NormalizedMetadata, which
is the metadata counterpart to NormalizedNode. It also defines
NormalizedMetadataStreamWriter as an extension of
NormalizedNodeStreamWriter and implements NormalizedMetadataWriter,
which piggy-backs a NormalizedMetadata structure on top of a
NormalizedNode structure, so that the two are emitted as a single
event stream.

JIRA: YANGTOOLS-961
Change-Id: I8f1a69361d18cf5f9c14185778cca7c2d6ebc4f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd AnnotationSchemaNodeAware interface 81/80681/5
Robert Varga [Tue, 5 Mar 2019 09:32:15 +0000 (10:32 +0100)]
Add AnnotationSchemaNodeAware interface

It seems that having annotations indexed at the SchemaContext level.
To support that, add AnnotationSchemaNodeAware interface and make it
trivially implemented by SimpleSchemaContext.

Also retrofit AnnotationSchemaNode.find(SchemaContext) to recognize
AnnotationSchemaNodeAware and defer to the index if its available.

JIRA: YANGTOOLS-960
Change-Id: I1f3cd68a8356b20bceb2d0d620992ade10649e5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRevert "Add NETCONF/RFC7952 compatibility" 82/80682/2
Robert Varga [Tue, 5 Mar 2019 10:01:15 +0000 (11:01 +0100)]
Revert "Add NETCONF/RFC7952 compatibility"

This reverts commit 0b86189513b25601ba12a4a38230017315914344, as
the relevant support needs to be provided by netconf project and
can be retrofitted via either decorating a SchemaContext, or
overriding the ietf-netconf.yang model.

JIRA: YANGTOOLS-961
Change-Id: I81d5a760703461fcc55b83b6caa95b69049299c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoUse ForwardingNormalizedNodeStreamWriter for QName tranformation 67/80667/7
Robert Varga [Mon, 4 Mar 2019 12:56:05 +0000 (13:56 +0100)]
Use ForwardingNormalizedNodeStreamWriter for QName tranformation

We have a utility forwarder, which can be used as a baseline, reducing
transformation complexity a bit. Also make sure we reuse identifiers
when they are not transformed.

Change-Id: Ife4025cd47145b4501ff9f6186f47503cfb2aa45
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRework NormalizedNodeStreamWriter 62/80662/16
Robert Varga [Fri, 1 Mar 2019 13:05:52 +0000 (14:05 +0100)]
Rework NormalizedNodeStreamWriter

This patch reworks NormalizedNodeStreamWriter to issue start/end
events for even simple nodes, allowing attributes to be seamlessly
integrated into open nodes.

This necessitates some updates to serializers, which need to track
these simple nodes and properly handle endNode() events.

JIRA: YANGTOOLS-497
Change-Id: I9aa0979b778f54ce77be365b3ad8ba6690138df2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix ForwardingNormalizedNodeStreamWriter 66/80666/1
Robert Varga [Mon, 4 Mar 2019 12:34:56 +0000 (13:34 +0100)]
Fix ForwardingNormalizedNodeStreamWriter

Forwarding objects should allow all methods to be overridden, fix
that.

Change-Id: Ibb57fa99880914ffd2aff62b67e9e20ecadd4696
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoMake NormalizedNodeStreamWriter extensible 45/80645/9
Robert Varga [Thu, 28 Feb 2019 14:54:24 +0000 (15:54 +0100)]
Make NormalizedNodeStreamWriter extensible

NormalizedNodeStreamWriter needs to cater to at least one extension,
which is metadata emission. Introduce
NormalizedNodeStreamWriterExtension and add a getExtensions() method,
which returns no extensions by default.

JIRA: YANGTOOLS-497
Change-Id: Iebe11b80c3199f6b37b46c85bd7362a764de4ed6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd NETCONF/RFC7952 compatibility 48/80648/5
Robert Varga [Thu, 28 Feb 2019 15:52:40 +0000 (16:52 +0100)]
Add NETCONF/RFC7952 compatibility

RFC6241 pre-dates RFC7952 and defines an attribute which should
be modeled as a metadata annotation.

For legacy reasons, we are carrying support for this attribute
in yang-data-api, which does not quite fit the semantic model
and requires special-casing.

Since ietf-netconf.yang does not define the metadata annotation,
which would make RFC7952 work seamlessly, we need to hack this
around a bit and make the correspoding schema definition available.

JIRA: YANGTOOLS-961
Change-Id: Ib6c98e9bb8a7c9ae8351b61522c3fbfdd943393c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoFix YangParserImpl streaming use 47/80647/2
Robert Varga [Thu, 28 Feb 2019 18:48:44 +0000 (19:48 +0100)]
Fix YangParserImpl streaming use

We should not be returning null, but "this", fix that.

Change-Id: I0683da43a4c1d0b30f8f7d0680be2aa17f4e05ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoAdd ExtensibleObject interface 44/80644/3
Robert Varga [Thu, 28 Feb 2019 15:10:14 +0000 (16:10 +0100)]
Add ExtensibleObject interface

This adds the basic ExtensibleObject and ObjectExtension interfaces,
which can be reused to define extensible objects.

Unlike a full-blown implementation, these interfaces provide only
access interface, not a mechanism to perform actual state attachment.

The attachment mechanism will be defined in future, when the need
for it actually arises.

JIRA: YANGTOOLS-497
Change-Id: Ie390b6174b8909c87595dddc0d467858f36ef8bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove yang-model-immutable 33/80633/2
Robert Varga [Wed, 27 Feb 2019 15:47:52 +0000 (16:47 +0100)]
Remove yang-model-immutable

This is an unfinished component, remove it as it will need to be
reimplemented from scratch.

Change-Id: Ic55be7d3b66ea23d6a5363e1d6529542c394fb16
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRefactor yang-xpath-impl error handling 30/80630/3
Robert Varga [Wed, 27 Feb 2019 14:38:10 +0000 (15:38 +0100)]
Refactor yang-xpath-impl error handling

Separate out CapturingErrorListener and make sure we install it
in InstanceIdentifierParser.

Change-Id: I9313161708daa122854b423015bdbcffef369bda
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 years agoRemove generics from YangNumberExpr 26/80626/4
Robert Varga [Wed, 27 Feb 2019 14:22:23 +0000 (15:22 +0100)]
Remove generics from YangNumberExpr

Generics are only getting in the way with the class and its support,
remove them from interface classes and move them to
AbstractYangXPathMathSupport.

Change-Id: I81b69e88786db1ce014c4ee83b65c01da09fbdad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>