Robert Varga [Fri, 28 Apr 2023 09:14:56 +0000 (11:14 +0200)]
Move FramingMechanism
This is well-known construct defined in RFC6241 at messages layer.
Move the enumeration into netconf.api.messages.
JIRA: NETCONF-945
Change-Id: Ifab96b8bb7c72307062f31b6ad02c0dfca05c6cf
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 28 Apr 2023 10:31:49 +0000 (12:31 +0200)]
Remove netconf-notifications-{api,impl} remnants
The previous patch did not clean up things completely, this patch
finishes the job.
JIRA: NETCONF-945
Change-Id: I39e64d830a45b118761f1deae76b5fe70e182dc7
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 27 Apr 2023 11:05:22 +0000 (13:05 +0200)]
Integrate netconf-notifications-api into netconf-server
netconf-notifications-api is decidedly server-side, integrate it into
netconf-server.
JIRA: NETCONF-945
Change-Id: I8c901429e054d4f3f29943118ec608293e24e5b3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 19:44:14 +0000 (21:44 +0200)]
Promote Ivan Hraško to a committer
Ivan has been contributing to various parts of the netconf project,
providing end-user support, patches and guiding others.
This patch grants him committer privileges.
Change-Id: I8a425c86f142249ab0970c204fb008cef09a9a6f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 27 Apr 2023 09:04:15 +0000 (11:04 +0200)]
Clean up DummyMonitoringService
Do not use Guava's Collections2 -- streams can do the same thing.
Change-Id: I40d783c772c7f62e05458611083c4e6307fd608b
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 17:55:44 +0000 (19:55 +0200)]
Move netconf.api.monitoring
This API is a server-side thing, rename it to
netconf.server.api.monitoring and document the package.
JIRA: NETCONF-945
Change-Id: I1cd390dcb3cfb6a75493485c8727c366c3f53e20
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 18:40:02 +0000 (20:40 +0200)]
Integrate netconf-mapping-api into netconf-server
All interfaces in netconf-mapping-api are a server-side thing. Rehost
them to netconf.server.api.operations. This in turn forces artifacts
to declare which side of netconf-api they reside on.
This effects the rename to netconf.server.api.operations, which is more
descriptive than 'mapping'.
JIRA: NETCONF-945
Change-Id: Ia6ce8e944569c2e2487a2b14f01046ff2a144f73
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 19:41:07 +0000 (21:41 +0200)]
Update Tomas's name
I18N is powerful, use the proper name.
Change-Id: Id3940c74789a69030afb63ec38ae5daa1b4aff5a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 19:39:20 +0000 (21:39 +0200)]
Update timezones for committers
Current committers all sit in Europe/Bratislava, adjust that detail.
Change-Id: I7af9fc4b73f7e587924a5bb96134b5fd3758e9ad
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 17:09:33 +0000 (19:09 +0200)]
Move NetconfServerDispatcher to netconf.server.api
There is no point in polluting netconf-api with server-side constructs,
this move takes the first step in sanitizing the dependency tree.
Unfortunately we cannot move NetconfServerDispatcherImpl, as it is tied
down by mdsal-netconf-impl's configuration compatibility constraints
(i.e. the configuration is tied to NetconfMonitoringServiceImpl).
JIRA: NETCONF-945
Change-Id: I0d1b3631d2af50ca7291bfca06a9ddd490c26a71
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 17:01:15 +0000 (19:01 +0200)]
Introduce netconf.server.{api,impl}
We have server-side constructs strewn across multiple components,
starting with netconf-api, which makes reasoning about what is what a
bit difficult.
Introduce netconf.server.api package to hold public APIs for consumption
and netconf.server.impl for default implementations of those constructs.
Populate them with SessionIdProvider (and its default implementation).
JIRA: NETCONF-945
Change-Id: Id4ea72c6155c6341f4dc37c78edabba90ec55e93
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 15:42:22 +0000 (17:42 +0200)]
NetconfOperationRouter should not expose close()
The close() method is a component contract, it should not be part of the
functional definition. This fixes a warning around the possibility of an
InterrupatedException.
JIRA: NETCONF-945
Change-Id: Ic26e9fe1d56b8aff6493ce6537196f525022a5f3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 16:12:21 +0000 (18:12 +0200)]
Clean up netconf-events-mdsal dependencies
We have a ton of warnings, fix them up by cleaning up the dependencies
section.
Change-Id: I3d06384f0177d7d666a78ca99f0e75fa58be6aa1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 15:56:49 +0000 (17:56 +0200)]
Simplify OperationNameAndNamespace constructor
There is no point in assigning a temporary null to the element.
Change-Id: Id5e860b19d006ad1cad8a9e847535ef88413927d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 15:39:38 +0000 (17:39 +0200)]
Sharpen netconf-server methods used in tests
We have a couple of warnings around nulls from get* methods. Switch to
nonnull*/require* to make the testing intent clearer.
Change-Id: Ie6a46cecdcbfbbb1a6a02014cf34b5aa7022d59c
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 01:10:57 +0000 (03:10 +0200)]
Move mdsal-netconf-notification
This is the core application supporting NETCONF notifications, as
defined by RFC5277. It provides services to the NETCONF server
component, as well as basic notification sources of RFC7895/RFC8255
YANG library.
Move it to apps/netconf-events-mdsal and document its purpose.
JIRA: NETCONF-944
Change-Id: Ie778218b6a302eb147391e46e649989477a892be
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 03:06:13 +0000 (05:06 +0200)]
Clean up mdsal.monitoring.GetSchema
Handle non-null prerequisites as such, not allowing being null.
Change-Id: I250d7e1a85c70dd85ec15a93873eec34f5941442
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 02:09:23 +0000 (04:09 +0200)]
Add repostory documentation
To ease navigation for users of GitHub, add README.rst to document where
things are in the repository. This includes a ton of stale links, which
will be filled in by future constributions.
Change-Id: I2d8945911aa91008ce4ca45b25dd8004eb6ed2c7
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 02:06:59 +0000 (04:06 +0200)]
Rename NetConf documentation
The headline is misleading: NetConf in this context really means
"netconf.git documentation", which in turn should be known as
"NETCONF/RESTCONF Documentation".
Change-Id: I9e4b68e8dd825f615fd486bad54ad431e6cc2b21
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 26 Apr 2023 00:01:53 +0000 (02:01 +0200)]
Remove SchemaContext references
SchemaContext is going away, improve passed argument to
EffectiveModelContext and add a FIXME for migration.
Change-Id: I20bbae6277b677f991709e756d8589b3d5d30436
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 23:59:39 +0000 (01:59 +0200)]
Clean up MdsalNetconfOperationService
This class is an implementation detail, do not leak it outside of the
package. Also eliminate OperationProvider, as it is an useless
indirection.
Change-Id: I0fce710493cfdf9aafea52b645dba3683043fbdf
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 23:53:06 +0000 (01:53 +0200)]
Clean up tests a bit
Reorder fields, fix raw type warnings, remove superfluous empty lines.
Change-Id: I5bc3b2ef61e76a5746eb6df9932224343a0c1414
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 20:13:01 +0000 (22:13 +0200)]
Clean up NotificationMessage
Use java.time.Instant to carry an immutable event time -- addressing two
SpotBugs warnings and making integration with DOMEvent/EventInstantAware
much mode sealmess.
JIRA: NETCONF-1000
Change-Id: I043c21abf7eb96368acfd73a6fddbc036e3ed7d3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 22:48:11 +0000 (00:48 +0200)]
Migrate netconf-api's use of xmlunit
This is a rather straighforward migration, pretty much exactly as
documented in the migration guide.
Change-Id: I18f2dce0bf2855af2f7ade48eb449ee9fc9125cc
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 22:38:20 +0000 (00:38 +0200)]
Migrate NotificationsTransformUtilTest's use of xmlunit
Migration of xmlunit is rather straighforward here, ditch the dependency
on xmlunit-legacy. Since we have accurate whitespace, we ditch that
particular leniency off. We still needs to ignore element order because
these are inherently unpredictable at NormalizedNode layer.
Change-Id: I090ae73dbc5fcb3f5d66c9fa6f066ba30c751beb
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 22:11:30 +0000 (00:11 +0200)]
Cleanup NotificationsTransformUtilTest
Improve string format to closely match expectations.
Change-Id: Ie1740f52c1a21bcae66ee4aad0b9140b2ad6b305
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 20:04:46 +0000 (22:04 +0200)]
Remove NotificationRegistration
Migrate the final two users of NotificationRegistration to plain
Registration and remove NotificationRegistration. On the implementation
side we also unify notification handling, so that the underlying
contract is implemented by a base class and individual specializations
just pass down required inputs.
Change-Id: I677ced2b1553de6fdc7ffe59646e2c220fbd27b6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 19:43:41 +0000 (21:43 +0200)]
Disconnect NotificationPublisherRegistration
Use a play yangtools.concepts.Registration as the baseline, which allows
us to use AbstractRegistration to manage the tie to the manager -- and
allows for a better thread-safety around concurrent close().
Change-Id: I33871bd59894d4ff95315dddeedcdd7b4e68f962
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 19:09:17 +0000 (21:09 +0200)]
Remove NotificationListenerRegistration
Replace final user of this specialization with
Registration/AbstractObjectRegistration. This eliminates a bit of
custom code and improves thread safety around concurrent shutdown
and un-registration.
Change-Id: I6ef8bb5e47124c795762e7bba27d73c88651fd64
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 18:42:49 +0000 (20:42 +0200)]
Disconnect NetconfNotificationCollector registration
NotificationRegistration does is actually the same thing as
Registration, except it does not enforce idempotence. Replace its use in
NetconfNotificationCollector with Registration and use an explicit
AbstractObjectRegistration subclass.
This fixes potential problems with multiple (un)registrations of the
same object and opens up the possibility for future removal of locking,
as AbstractObjectRegistration knows whether it is closed or not.
Change-Id: I1ed8e1f74ee755d344815c511499a8dbfc9cce8d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 21:13:16 +0000 (23:13 +0200)]
Propagate eventTime during notification transformation
Binding Notification objects expose the time when the event was
generated through an optional EventInstantAware interface. Recognize
when a Notification carries this annotation and propagate it correctly.
JIRA: NETCONF-1001
Change-Id: I06ce94ffbe11bafeedb60aaa28765e151de53b3f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 18:32:18 +0000 (20:32 +0200)]
Clean up netconf-notifications-api
Pass through the documentation and fixup whitespace and Javadocs a bit.
Change-Id: I0bcbf720d54e1f5a682f923b4cbfb99e13108366
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 17:56:13 +0000 (19:56 +0200)]
Hide DeserializerExceptionHandler
This is an implementation-internal class and the only occupant of
netconf.server.util package. Move it to netconf.server and hide it.
JIRA: NETCONF-945
Change-Id: I2569e5343ac2e303101dd07cd73ce9cfb5e18ec3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 16:19:05 +0000 (18:19 +0200)]
Rename NetconfHelloMessage to HelloMessage
Let's keep things consistent by renaming NetconfHelloMessage to
HelloMessage -- similar to how we have NotificationMessage.
JIRA: NETCONF-1000
Change-Id: I50bfb9200dc6c7624a76eeac2b13f5324bedd7cb
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 17:23:26 +0000 (19:23 +0200)]
Fix odl-netconf-connector packaging
sal-netconf-connector no longer requires netconf-topology, fix that
packaging leak -- and moving it down to the three users we have.
Change-Id: Ib93804a81f63af89768e7b175a63feaa66dad6e9
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 17:19:57 +0000 (19:19 +0200)]
Fix odl-netconf-test-tools packaging
This feature should depend on odl-netconf-connector for the southbound
plugin. Fix that, eliminating packaging leaks of:
- mdsal.model/ietf-topology
- netconf/sal-netconf-connector
- netconf/sal-netconf-connector
Change-Id: Iac1951254c31df968d0c9b456ca5adb0edb71a23
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 16:48:57 +0000 (18:48 +0200)]
sal-netconf-connector should not depend on notifications-api
netconf-notifications-api is now a server-side plugin thing, do not
depend on it in the southbound plugin.
JIRA: NETCONF-1000
Change-Id: I30ff686b448ddcb3cefd2f7e3f816d27c68fdad4
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 15:47:28 +0000 (17:47 +0200)]
Rename NetconfNotification to NotificationMessage
We want to keep the 'Message' tie to 'NetconfMessage' explicit, let's
rename the class.
JIRA: NETCONF-1000
Change-Id: I2dd345f42f4ed5bea4cddc2f151d120e78dfab6a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 16:03:38 +0000 (18:03 +0200)]
Remove console output
Tests should not output things directly to console, remove this output
and the corresponding suppression.
Change-Id: I69a1687cbf4cdb2e0772605f9c121cb74c2318a5
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 15:45:37 +0000 (17:45 +0200)]
Clean up NetconfNotification constants
NOTIFICATION_NAMESPACE is something we already publish in
XmlNetconfConstants, so reuse that field. Also hide tag names,
explicitly naming them *_TAG -- and tests assert hard-coded values, so
the implementation and validation is disconnected.
JIRA: NETCONF-1000
Change-Id: I621cf05fd679b995eeed8ee9d08376eab6b1098b
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 15:40:05 +0000 (17:40 +0200)]
Hide NetconfHelloMessage.HELLO_TAG
This constant is only used internally, hide it.
JIRA: NETCONF-1000
Change-Id: I676408145962dc2299e0dd8534170eef4e320feb
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 15:29:42 +0000 (17:29 +0200)]
Move NetconfNotification to netconf-api
Notification is a well-known message, keep it in netconf-api itself.
JIRA: NETCONF-1000
Change-Id: I07a15d8d21143d540fe2c43d1e4a84f147623a0e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 4 Apr 2023 13:42:23 +0000 (15:42 +0200)]
Remove FailedNetconfMessage
FailedNetconfMessage does not have a document, which breaks our mojo.
Separate out exception handling to keep things sane.
JIRA: NETCONF-1000
Change-Id: Ib855ffb0415669734b5da27dc5cbcfd50434dbac
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 14:30:41 +0000 (16:30 +0200)]
Move NetconfMessageUtil
These utilities are only used on client-side, move them to
netconf-client.
JIRA: NETCONF-945
Change-Id: Icc96e6afba710c635f770d5a6e6deaf1d80158c8
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 09:37:06 +0000 (11:37 +0200)]
Rename netconf-impl to netconf-server
This artifact contains only server-side things. Make sure to rename it
to reflect that.
JIRA: NETCONF-945
Change-Id: I13322553c4bdd8979fe564ce1337dfb9e43c7e7a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 14:16:36 +0000 (16:16 +0200)]
Remove CloseableUtil
This class is only used by netconf-server, where the closed services
cannot legally thrown an exception -- rendering the use superfluous.
Replace the use of closeAll() with a simple iteration and remove
CloseableUtil along with its test.
Change-Id: I990bfc189bec85e4aa6784f8c82411ce59031b19
JIRA: NETCONF-945
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 13:43:29 +0000 (15:43 +0200)]
Remove NetconfDocumentedException throws
NetconfMessageUtil methods do not throw this exception, remove the
declaration.
Change-Id: Ib0ab7993cbe66c62508e3b95f7dff040a1ca8e8b
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 13:39:58 +0000 (15:39 +0200)]
Optimize NetconfMessageUtil.isErrorMessage()
We are acquiring children twice -- which is expensive. The logic is
actually shared between size == 1 and size != 1, so just examine the
children to see if there is a matching element.
Change-Id: Ib79fd5a08c485e3e9849c5f925d200ba4db34ecc
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 25 Apr 2023 13:32:45 +0000 (15:32 +0200)]
Optimize NetconfMessageUtil.isOKMessage()
We are acquiring child elements twice, which is rather suboptimal.
Retain the list in local variable, which means we do not need to worry
about exceptions being thrown.
Change-Id: Iee2fbd9ea169ef9ab209643ef3a07518af7f04b0
Signed-off-by: Robert Varga <[email protected]>
Ivan Hrasko [Tue, 4 Apr 2023 12:54:33 +0000 (14:54 +0200)]
Adapt new UI for ODL
After updating to the latest swagger UI we have to bring back
some ODL adjustments: to load ODL APIs by default, etc.
JIRA: NETCONF-987
Change-Id: I878640bb12825da2a03a1c57ce19723c1ddc9f4d
Signed-off-by: Ivan Hrasko <[email protected]>
Signed-off-by: OleksandrZharov <[email protected]>
OleksandrZharov [Thu, 30 Mar 2023 09:49:06 +0000 (11:49 +0200)]
Update to Swagger UI v4.18.1
Our Swagger UI is looking old fashioned.
Update Swager UI to newer version.
JIRA: NETCONF-987
Change-Id: I50d6896b0971f6528c6a504bba5cfe600681c533
Signed-off-by: OleksandrZharov <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
tobias.pobocik [Tue, 18 Apr 2023 08:53:44 +0000 (10:53 +0200)]
Eliminate operational concept
In sal-rest-docgen package there still resist some
remnants of bierman-02 operational data concept.
Now, we have just "data" for both "config" and "nonconfig" data.
By eliminating "config" and "operational" split we can get rid
of some unnecessary logic.
JIRA: NETCONF-992
Change-Id: I6b03e8ce43d75cb53ed14862b783d84fe03e542c
Signed-off-by: tobias.pobocik <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
Robert Varga [Sat, 22 Apr 2023 15:39:48 +0000 (17:39 +0200)]
Remove XmlUtil.loadSchema()
This method is not used anywhere, remove it.
Change-Id: I671542122608d52428421da72fe263ef5c121fad
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 15:37:02 +0000 (17:37 +0200)]
Remove netconf.api.util.NetconfConstants
These constants are no longer used anywhere, remove them.
Change-Id: I1218cc05d94f930ea326b84ed0835a0151e7ffa3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 15:26:58 +0000 (17:26 +0200)]
Clean up findNamespaceOfTextContent()
Use local variable type inference and co-locate extractNamespaces() next
to it, so they can be co-evolved.
Change-Id: If3d19679c40dd8d303e3143f6505502484310eb9
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 15:04:37 +0000 (17:04 +0200)]
Remove XmlElement.checkUnrecognisedElements()
These methods are only used in unit tests, remove them.
Change-Id: I14708977516d161f9bab11790cd8cac5a456293a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 15:02:57 +0000 (17:02 +0200)]
Remove XmlElement.getChildElementsWithSameNamespace()
This method is used only in unit tests. Remove it.
Change-Id: I5b864a152ba059fcfe247a6eb573fdf96a4fb9f9
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 15:01:03 +0000 (17:01 +0200)]
Remove deprecated XmlElement methods
These methods have been deprecated for removal, remove them, as they
have replacements with better names.
Change-Id: Ifa25b6672937c0afd043bb435a77a91b72b35d4e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 14:59:33 +0000 (16:59 +0200)]
Speed up XmlElement text content methods
getTextContent() should cache the length of children.
getOnlyTextContentOptionally() should cache the children.
Change-Id: Ib1e6eb43c156dbf3149d8478fc5825659588999f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 14:54:13 +0000 (16:54 +0200)]
Do not use Collections2.filter() in XmlElement
We end up collectiing the filtered collection: perform the same
operation with stream().filter().collect().
Change-Id: Ib016b9f2deb500e23616e12e4aa0d4f4b4e1eb6c
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 12:20:56 +0000 (14:20 +0200)]
Clean up XmlElement namespace handing
Use foo()/findFoo()/getFoo() to simplify naming of methods, cutting down
on ceremony around namespace/namespaceAttribute accesses. This allows us
to forgo Optional wrapping and reduce code duplication.
Change-Id: Ib3a9393b78c406dcbee85d3d91f338295fac0d11
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 11:54:59 +0000 (13:54 +0200)]
Improve XmlElement.getAttributes()
Use local variable type inference, cache the size and make sure we
validate node being an Attr.
Change-Id: Id75b7cac90b4cd801c81a1c33ba10bed7efef558
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 11:48:08 +0000 (13:48 +0200)]
Remove XmlElement.ElementFilteringStrategy
This really is just a Predicate<Element>, so just inline the semantics.
Change-Id: I475c5e95694d1ff90f68a6f70b7d94356cb7950f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 11:46:34 +0000 (13:46 +0200)]
Speed up XmlElement.getChildElementsInternal()
Compute size of childList only once and keep it as a loop-invariant.
Also use local variable type inference.
Change-Id: If3dbc9ff1cbd038a15140fe1297c5dc17e4d1311
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 21 Apr 2023 09:28:42 +0000 (11:28 +0200)]
Fixup accidental push
7bb5a9a41b90dae65ee238c7a58ccfe9eb5d8387 was pushed directly by accident
and it requires a fixup. This patch provides that fixup.
Change-Id: I85c9a2cf322139cf2a84fe98bc7ba8e9e648d2a1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 21 Apr 2023 09:28:42 +0000 (11:28 +0200)]
Bump upstreams
Adopt:
- odlparent-12.0.5
- infrautils-5.0.4
- yangtools-10.0.6
- mdsal-11.0.9
- controller-7.0.6
- aaa-0.17.8
Change-Id: I04ec184ebcfc1464f335835de528a8724bce1c8a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 10:07:35 +0000 (12:07 +0200)]
Clean up XmlElement a bit
Use Optional facilities to reduce orElseThrows() calls. Also improve
equals() by using instanceof pattern.
Change-Id: I932f4feb38c1f77c637c0844cd8f39bef5b47841
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 10:06:41 +0000 (12:06 +0200)]
Improve XmlBodyReaderMountPointTest
Use getDataChildByArg() to simplify our asssertions, making the flow a
bit more obvious.
Change-Id: I2f19ad6b8f2dfecd58f97046290b711d97792b74
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 10:05:14 +0000 (12:05 +0200)]
Simplify getSchemaFromRpc() a bit
We know the input is always ContainerNode and we have childByArg()
method which skips the Optional ceremony.
Change-Id: I451b93ec9a851b173bbb63097ed2886a48121670
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 10:03:41 +0000 (12:03 +0200)]
TransactionProvider should be final
We have a bit of dancing around with Optional through methods which
might be subclassed by downstreams. Prevent that by making the class
final and drop back to talking to the internal field only.
Change-Id: Idfd7e3f9a9bd8368f59aff0441789078c0c4e875
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 22 Apr 2023 10:02:49 +0000 (12:02 +0200)]
Use List.isEmpty() in AbstractGet
Checking the size is superfluous, just use isEmpty().
Change-Id: Iebe590ddb8f3fde13e2222f334325162a2df96e3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 21 Apr 2023 12:29:56 +0000 (14:29 +0200)]
Migrate users of Optional.get()
Upgraded modernizer points out callers of Optional.get(), which has a
better-named replacement in Optional.orElseThrow(). Migrate callers to
orElseThrow() or alternative facilities.
Change-Id: Ic36876b32443d341b3e838a9bb1dd079ea141b42
Signed-off-by: Robert Varga <[email protected]>
Yaroslav Lastivka [Fri, 3 Mar 2023 14:32:47 +0000 (16:32 +0200)]
Remove OpenAPI v2
Remove support for OpenAPI version 2, from now on we just support
OpenAPI version 3.
Remove OpenAPI v2 URLs, configuration and constants.
JIRA: NETCONF-981
Change-Id: Idd06ffd2f02b1f42bd9f52c889af7df8aa22853c
Signed-off-by: Yaroslav Lastivka <[email protected]>
Robert Varga [Fri, 21 Apr 2023 09:25:25 +0000 (11:25 +0200)]
Fix parent reference
Parent should be pointing to 6.0.0-SNAPSHOT, fix that.
Change-Id: I70403cac76ac32cba4aed01301aad4a1300c6bb9
Signed-off-by: Robert Varga <[email protected]>
(cherry picked from commit
29fa68b1cb819fc1e2856832ad3bb53f26539cfe)
Robert Varga [Wed, 19 Apr 2023 19:16:34 +0000 (21:16 +0200)]
Bump versions to 6.0.0-SNAPSHOT
This starts the next major development iteration.
Change-Id: I8f52ebdd1d7a90a4e3c445a52681530bd2d78c43
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 19 Apr 2023 19:15:57 +0000 (21:15 +0200)]
Bump versions to 5.0.6-SNAPSHOT
This starts the next development iteration.
Change-Id: Ib3c21cef2b3588b44fba33c3e7b242c46b32530b
Signed-off-by: Robert Varga <[email protected]>
Yaroslav Lastivka [Thu, 23 Mar 2023 10:11:58 +0000 (12:11 +0200)]
Fix choice cases usage
Currently we are generating all cases from choice into payload used
as example in apidoc.
This is incorrect because we can use only one case at the time.
Implemented using first case (or default if specified) node in
apidoc example.
JIRA: NETCONF-983
Change-Id: Ifc32ee00e0de265b4f7e612adb5b8d3783b696a2
Signed-off-by: Yaroslav Lastivka <[email protected]>
Peter Suna [Mon, 20 Feb 2023 08:43:58 +0000 (09:43 +0100)]
Add yanglib API for non-revision model
The Yanglib API previously used a single API for both
models with revisions and those without. As a result,
it was necessary to append a '/' at the end of the URL request
for non-revision models.
This issue has now been resolved by introducing a separate API
specifically for non-revision models.
Added tests to validate the handling of both revision
and non-revision models.
Additionally, the existing Yanglib tests have been reworked to
use YANG models stored in resources.
JIRA: NETCONF-968
Change-Id: I3a22de90457bd1b2dbb77f3228bcce83a97ba4e1
Signed-off-by: Peter Suna <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
Robert Varga [Tue, 4 Apr 2023 07:16:49 +0000 (09:16 +0200)]
Clean up NetconfDeviceTest
Use anyCollection() consistently to reduce the number of warnings.
Change-Id: I4ac1362640d6989e301d776b139c94c14b5e9c20
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 7 Sep 2022 09:48:51 +0000 (11:48 +0200)]
Add transport-ssh
Add NETCONF transport implementation based on Apache SSHD.
Due to connection is managed by underlying TCP component
both sshd client and server implementations are not used
for connection but as factory managers. These are providing
associated session builders with factories configured
and serving ssh sessions.
sshd-netty components were used as reference on establishing
ssh sessions on top of existing communication channel.
JIRA: NETCONF-590
Change-Id: I21245b2f8b932da0a57fa386ee62b05dfcf8cc18
Signed-off-by: Robert Varga <[email protected]>
Signed-off-by: Ruslan Kashapov <[email protected]>
tobias.pobocik [Mon, 17 Apr 2023 10:28:33 +0000 (12:28 +0200)]
Remove unused methods
BaseYangSwaggerGenerator contains unused methods getSchemaService
and getPathVersion. Remove them to simplify our code.
JIRA: NETCONF-993
Change-Id: If1aa5f9e476a61e167849b67c1a56071dda6bb40
Signed-off-by: tobias.pobocik <[email protected]>
Ivan Hrasko [Tue, 18 Apr 2023 07:37:49 +0000 (09:37 +0200)]
Add OpenAPI 2 (swagger) authorization
After adding authorization feature into generated OpenAPI 3 docs
enhance OpenAPI 2 docs, too.
We can reuse SECURITY JSON node but the two specs diverge
in specifying which auth methods are used.
OpenAPI 2 uses global securityDefinitions object which we have
to create.
JIRA: NETCONF-990
Change-Id: I38df2414fa34fdf3297446428b31e8d113f1f636
Signed-off-by: Ivan Hrasko <[email protected]>
Ivan Hrasko [Wed, 5 Apr 2023 13:11:33 +0000 (15:11 +0200)]
Add OpenAPI 3 basic authorization
Enhance JSON generated by ODL with basic authorization.
This way authorize button is shown on UI and user is allowed
to authorize all requests coming from swagger UI. It means
all requests when authorized contain basic auth header.
JIRA: NETCONF-990
Change-Id: If31d355b8a0211d871eda5b14ed6033bb0f1514c
Signed-off-by: Ivan Hrasko <[email protected]>
Signed-off-by: Yaroslav Lastivka <[email protected]>
Sangwook Ha [Tue, 28 Mar 2023 07:05:55 +0000 (00:05 -0700)]
Fix fields processing error for duplicate node names
NetconfFieldsTranslator saves LinkedPathElement identified by the target
node identifier, hence does not allow keeping track of data nodes with
the same name failing to generate correct paths if such nodes are
included in the fields parameter.
Address the issue by replacing the list of sets to keep track of the
data nodes specified in the fields parameter with a tree of
LinkedPathElement objects keeping track of its parent path element.
This allows generation of all unique paths defined in the fields
parameter and also simplifies the processing.
But this change in the data structure is incompatible with
AbstractFieldsTranslator, and NetconfFieldsTranslator does not inherit
the abstract class.
JIRA: NETCONF-985
Change-Id: I762714f8a25231c1394d75b47e269167b37660f8
Signed-off-by: Sangwook Ha <[email protected]>
Robert Varga [Thu, 13 Apr 2023 16:34:53 +0000 (18:34 +0200)]
Re-enable IETF links
Do not exclude links to IETF anymore.
Change-Id: Ic7faeb69803c1ddd5feacd77d6382643efe772a4
Signed-off-by: Robert Varga <[email protected]>
Sangwook Ha [Tue, 28 Mar 2023 20:51:32 +0000 (13:51 -0700)]
Update old links in user guide
There are several old links permanently redirected to new URLs in the
user guide. Update the links with new ones.
JIRA: NETCONF-986
Change-Id: Ib96f0c2918f1687822d42f4106a836e1a9245a8e
Signed-off-by: Sangwook Ha <[email protected]>
guillaume.lambert [Thu, 13 Apr 2023 12:38:19 +0000 (14:38 +0200)]
Refactor and enable linkcheck except for IETF URLs
Signed-off-by: guillaume.lambert <[email protected]>
Change-Id: Ic92f8995e4e388644c951113066cdfbb575fcda3
Robert Varga [Wed, 12 Apr 2023 11:51:27 +0000 (13:51 +0200)]
Bump automaton to 1.12-4
There's no functional change.
Change-Id: Iace65d05ef4634feb12084b6397c425fc530a24c
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 12 Apr 2023 15:02:00 +0000 (17:02 +0200)]
Disable linkcheck
Linkcheck is failing on rfc-editor, as noted in
https://jira.linuxfoundation.org/plugins/servlet/desk/portal/2/IT-25351,
disable it until that issue is fixed.
Change-Id: I30976060f43f5da6b3cc6c3ba0f0bc59f8388591
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 7 Sep 2022 09:48:51 +0000 (11:48 +0200)]
Add transport-tls
Add NETCONF transport implementation based on TCP+TLS.
JIRA: NETCONF-590
Change-Id: I5e0d6ddce30971dd5f2b0918600b9410aa439c08
Signed-off-by: Robert Varga <[email protected]>
Signed-off-by: Ruslan Kashapov <[email protected]>
zw1127 [Thu, 30 Mar 2023 09:19:55 +0000 (17:19 +0800)]
Remove empty XML lines
Java 9+ has changed the way indentation works, which means that unlike
Java 8, we are emitting empty lines, quite similar to what has been
reported in https://bugs.openjdk.org/browse/JDK-
8262285.
Use an XSL style sheet to ensure we filter out empty Text nodes during
indenting transform opereations.
JIRA: NETCONF-988
Change-Id: Ia9e614d2c77766126923b9e1af82bb177dfb0c05
Signed-off-by: zw1127 <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 4 Apr 2023 12:19:18 +0000 (14:19 +0200)]
Improve XmlUtil.toString()
Simplify the try-catch block to cover the minimum required scope.
Change-Id: I61b0bf2d104ff7f272ac335207993d432c11c8ed
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 4 Apr 2023 12:10:17 +0000 (14:10 +0200)]
Modernize XmlUtilTest
Use assertThrows() and text blocks to make it clearer as to what
we are doing.
Change-Id: I3ac89a14bc76d4427449aa9f24d820268b709d6e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 28 Mar 2023 08:53:33 +0000 (10:53 +0200)]
Fix yang-library.json
The JSON file should match the XML file, but the assertions are being
made on the XML content twice. Fix that typo and make sure JSON has the
correct content.
Change-Id: I74f260d062a8129c6446d3a509f093909da87075
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 28 Mar 2023 08:45:47 +0000 (10:45 +0200)]
Use assertEquals() instead of Hamcrest
We have very simple assertions, there is no need to use Hamcrest here.
Change-Id: Ie3ca9a7688c1746bc7e572406475c25dee8d6dc1
Signed-off-by: Robert Varga <[email protected]>
Yaroslav Lastivka [Thu, 16 Mar 2023 12:33:42 +0000 (14:33 +0200)]
Add (plain) PATCH method to OpenApi
ODL supports also plain PATCH method according to RFC.
PATCH method was added to apidocs.
JIRA: NETCONF-978
Change-Id: Ibaf22388585c4560e163bd5cda35c582135d7ad5
Signed-off-by: Yaroslav Lastivka <[email protected]>
Robert Varga [Tue, 28 Mar 2023 08:39:33 +0000 (10:39 +0200)]
Activate invalid block
With the underlying improvement addressed we can enable the
commented-out block.
JIRA: NETCONF-381
Change-Id: I734214e0c3b26ab04f4cf2249b9eb582e055769a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 28 Mar 2023 08:37:21 +0000 (10:37 +0200)]
Fix yang-library test root element
The 'modules' element is invalid, it should always be 'modules-state',
just as we have them in JSON. Fix the XML files.
Change-Id: Idd2955836f57528fbcf6863d20f6a1c0359a498f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 28 Mar 2023 08:29:14 +0000 (10:29 +0200)]
Acquire revision NodeList only once
There is absolutely no point in acquiring the node list twice, much less
executing getLength()'s internals multiple times.
Change-Id: Ibb98f05d067ce0c4b99df2f49968844dc82a0ac3
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 28 Mar 2023 08:21:28 +0000 (10:21 +0200)]
Fix LibraryModulesSchemas root
Root element should refer to modules-state, as per the published module.
Change-Id: Iaa3d8ae6c765f836b2fe28e66501d8a28746b6e9
Signed-off-by: Robert Varga <[email protected]>