Robert Varga [Thu, 29 Dec 2022 20:11:15 +0000 (21:11 +0100)]
Migrate getResult()/getErrors() callers
These are deprecated, migrate their users.
Change-Id: I069d6e535ba1edcbd56f8ef2953db351c9837140
Signed-off-by: Robert Varga <[email protected]>
Ivan Hrasko [Mon, 12 Dec 2022 08:46:47 +0000 (09:46 +0100)]
Fix duplicate in error message
Fix duplicate occurrence of yang-ext:mount in error message
when operation is not found.
JIRA: NETCONF-926
Change-Id: I2d8f9f1e2f1c4257e3802f7e2df983597f34c6c4
Signed-off-by: Ivan Hrasko <[email protected]>
Robert Varga [Tue, 8 Nov 2022 21:12:45 +0000 (22:12 +0100)]
Bump upstreams
Adopt:
- odlparent-12.0.1
- infrautils-5.0.1
- yangtools-10.0.2
- mdsal-11.0.3
- controller-7.0.1
- aaa-0.17.1
Change-Id: I08a761ecedf214fa7cb451eb7e97b0c10a652753
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 26 Dec 2022 12:47:08 +0000 (13:47 +0100)]
Split up RESTCONF contexts
contextPath("/") is not valid and the only reason we need to use it that
we register two separate entities: /rests for RFC8040 endpoints and
/.well-known for resource discovery.
Split these into two registrations, so that we can form a proper prefix.
Also note that discovery is only started after RESTCONF is started.
Change-Id: I9cda36f86296399b78a19be36ea20fda38e35c79
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 20 Dec 2022 18:27:59 +0000 (19:27 +0100)]
Specialize SchemalessRpcService
SchemalessRpcService really operates on DOMSources, without the need to
explicitly encapsulate with DOMSourceAnyxmlNode. This forces us to
specialize RpcTransformer, which in turn flushes out the need to remove
default handling and actually pass down RpcResult<M> -- which only makes
sense.
JIRA: NETCONF-669
Change-Id: Id0764cf6c00d764168c3b42c83fdc7a3e41d5ae6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 20 Dec 2022 17:50:48 +0000 (18:50 +0100)]
Split up MessageTransformer
We have three groups of methods in one interface and we need to
correctly separate their implementations, as not everything can be a
DOMRpcResult.
JIRA: NETCONF-669
Change-Id: I39452c7050cd5c7da46910f708d37ef17caac279
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 18 Dec 2022 22:25:39 +0000 (23:25 +0100)]
Ditch use of SchemaAwareBuilders
We use the builders only for output validation and creating node
identifiers. Let's not to that and use simple builders.
Also change calling convention to use children, so that we can have some
code reuse independent of the parent, leading to a significant reduction
of duplicate code.
JIRA: NETCONF-917
Change-Id: I754213530ac5407a06dce5c3144d8a0a30a3ba1f
Signed-off-by: tobias.pobocik <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Sangwook Ha [Fri, 16 Dec 2022 01:06:05 +0000 (17:06 -0800)]
Do not send 'commit' to the devices without candidate
The 'commit' RPC should not be sent to the devices only with
'writable-running' and without 'candidate' capability.
Override the commit method for the 'Running' NetconfDataTreeService
to immediately return a DomRpcResult without any errors.
JIRA: NETCONF-933
Change-Id: Ic0e51135e3ae347213d8ef8dbc03deb282d47af3
Signed-off-by: Sangwook Ha <[email protected]>
Robert Varga [Fri, 11 Nov 2022 18:26:31 +0000 (19:26 +0100)]
Create RemoteDeviceServices.{Actions,Rpcs}
Provide proper encapsulation of action and RPC invocation strategies. We
do not define schema-less actions, as those cannot be supported, but
keep our options open for future.
This flushes out the need to have SchemalessRpcService to cover generic
schema-less use case, but also NetconfRpcService, which works on base
NETCONF rpcs -- and that is used by most of sal-netconf-connector.
Also update tests to use Futures instead of FluentFutures and simplify
any(Class) to any(), as we have accurate types already.
JIRA: NETCONF-930
Change-Id: I75f1cb67f50a295bbce6638009d663444a48ca9c
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 15 Dec 2022 18:58:05 +0000 (19:58 +0100)]
Rework KeepaliveTask lifecycle
We will need to specialize KeepaliveTask for particular device RPCs,
which makes its interplay with deviceServices problematic. Make sure
the RPCs are passed to the task and guard task access with null checks,
clearing them on disconnect.
JIRA: NETCONF-930
Change-Id: Ib376118a67c0d1688d5e6a6b1c1354911c734d5f
Signed-off-by: Robert Varga <[email protected]>
OleksandrZharov [Wed, 14 Dec 2022 16:18:23 +0000 (17:18 +0100)]
Simplify OperationsContext with yangtools 7.0.9+
Simplified the logic in OperationsContent class with usage of
features available in yangtools 7.0.9.
Now we use EffectiveModelContext#findModuleStatements to find module
statements already sorted by revision.
JIRA: NETCONF-927
Change-Id: I5f0d3e310ac6cf499cb93c6e47e7142cf8653962
Signed-off-by: OleksandrZharov <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 14 Dec 2022 22:33:04 +0000 (23:33 +0100)]
Do not pass SchemaContext to DeviceActionFactory
The transformer already holds a MountPointContext and we are not using
the SchemaContext anyway.
Change-Id: Ifa49153ad3e534854a6fcdde7997e080ff13962f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 14 Dec 2022 22:34:19 +0000 (23:34 +0100)]
Update Patterns.ask() interactions
User a direct OnComplete callback instead of declaring a local variable.
Makes for cleaner code.
Change-Id: I0b147a660d4e54c68eec3f7471251bfe40b989ab
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sat, 10 Dec 2022 14:52:08 +0000 (15:52 +0100)]
Add RemoteDeviceServices
Centralize services to allow their being partially implemented. Also
clean up device instantiation, so that we get some clarity as to what
is (mostly) going on.
JIRA: NETCONF-914
Change-Id: I4195ff5b94b2d4fb5f074ae86fd7b4e6b0ad7f9d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 14 Dec 2022 16:52:24 +0000 (17:52 +0100)]
Use NodeIdentifier to identify datastores
We can use pre-cached NodeIdentifiers to lower GC pressure when flinging
documents.
Change-Id: I2913c109677a3ffb40263bbadf69216a082e19b1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 14 Dec 2022 16:13:27 +0000 (17:13 +0100)]
Reuse rollback leaf
This is a constant document, reuse it across invocations.
Change-Id: I28b5e234aaba5c6c0e44bf42637ea8c4101c8185
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 14 Dec 2022 02:39:44 +0000 (03:39 +0100)]
Clean up NetconfBaseOps
Eliminate duplicated code and modernize dispatch.
Change-Id: I8c37057fb1993541df7ce772777cba891c42a097
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 14 Dec 2022 01:55:59 +0000 (02:55 +0100)]
Clean up ModifyAction
Document ModifyAction and modernize it. This allows a number of users to
rely on new interfaces, eliminating interactions with Locale.
Change-Id: If471c823e38c363e06a69cfd05923cdcb2f68a1a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 12 Dec 2022 13:51:39 +0000 (14:51 +0100)]
Use local deviceRpc
Do not access the field, use local variable instead.
Change-Id: Ie8cb80e346fea5efa28d16d6aaee1e4c4c0db53d
Signed-off-by: Robert Varga <[email protected]>
tobias.pobocik [Thu, 1 Dec 2022 08:19:17 +0000 (09:19 +0100)]
Add tests for ReadDataTransactionUtil WithDefaultParameters
The part of code where default parameter is used was entirely not tested.
Added model to create schema context and tests for testing the functionality.
Signed-off-by: tobias.pobocik <[email protected]>
Change-Id: I53493185c40748fa00bfc0c489df743b209fbf43
Robert Varga [Sat, 10 Dec 2022 08:55:59 +0000 (09:55 +0100)]
Fixup NetconfDeviceCommunicator
UserPreferences changed methods, fix that up.
JIRA: NETCONF-920
Change-Id: Ie1d15c8f4b1fcbd17f4ebe0a357416c38fb15af8
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 02:08:52 +0000 (03:08 +0100)]
Turn UserPreferences into a record
This is a pure DTO, turn it into a record.
JIRA: NETCONF-920
Change-Id: I413d6ae35d498f98774e3570588c777a5b605519
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 02:04:08 +0000 (03:04 +0100)]
NetconfSessionPreferences is a record
Make this class a record, as it is just a simple holder. Mutators are
still confusing, we will deal with that later.
JIRA: NETCONF-920
Change-Id: I72bea3729591b46167c025d62b0c6f91ef04c810
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 11:13:46 +0000 (12:13 +0100)]
Disconnect NetconfDeviceCapabilities and NetconfSessionPreferences
NetconfDeviceCapabilities are schema-dependent and dynamically derived
during schema match. Split these two, so that both can become
completely immutable.
This requires reworking NetconfDevice, so that it keeps the fields
needed for tracking internally.
JIRA: NETCONF-920
Change-Id: Iaed0452680a625b5bf62f5a4d617aad30d86c971
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 23:19:17 +0000 (00:19 +0100)]
Remove no-schema reconnect
AbstractNetconfTopology has all the tools it needs to react to device's
failure to establish context, yet we use bonkers routing to the config
datastore and tickle reconnect there.
Remove this code and issue a warning when an attempt to use is made. At
some point we will reimplement this correctly.
JIRA: NETCONF-925
Change-Id: Iaf52f268d7e12f60fd2300d345fbc8c9d30a4c21
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 19:52:27 +0000 (20:52 +0100)]
Create extractUserCapabilities()
We have a masked code duplication. Make sure we remove it, so that
we allocate UserPreferences in a unified way.
Change-Id: I0fd938ca4c54898c0c899fc92d114199c00bfa42
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 19:56:40 +0000 (20:56 +0100)]
Remove NetconfDeviceFacade.salRegistrations()
This field is unused, remove it.
Change-Id: If7ede429196a5136f8680cef2ba245a4c996cf65
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 18:32:19 +0000 (19:32 +0100)]
Do not store Optional in NetconfDeviceCommunicator
The instantiation pattern can be made significantly better without an
Optional, which leads to quite a bit of simplification.
Change-Id: I9e67ff28faa1d4ac4fc99c3632409ed77cdf381e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 18:13:13 +0000 (19:13 +0100)]
Remove AbstractNetconfTopology.createSalFacade()
This method is implemented twice in the same manner -- remove it
and clean up its sole user based on the newly-found type safety,
as we are always routing to a NetconfDeviceSalFacade.
Change-Id: Ia7173652241fc6f6f4cfbcea914f9611eebbe869
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 17:56:56 +0000 (18:56 +0100)]
Clean up NetconfTopologyContext
Do not import scala.Future, simplify OnComplete declaration and require
serviceGroupIdent.
Change-Id: I8d82f8482a4b0d3afc85aca0715c3ae95409a589
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 8 Dec 2022 17:00:00 +0000 (18:00 +0100)]
NotificationFilter should be a predicate
There is no point in passing back the notification through an optional,
just return filtering true/false.
Change-Id: I1275247cdfcf3c1c683b218ae4170263da54a3f5
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 23:07:14 +0000 (00:07 +0100)]
Improve failure message
When we are failing a future, make sure to include the name of the node.
Change-Id: If721b9dcef4b9fca23d087db6be3b73897008575
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 22:41:32 +0000 (23:41 +0100)]
Complete future outside of lock
We should not be completing futures while holding locks, as that can
lead to deadlocks. Move completion to once we have released to lock.
JIRA: NETCONF-924
Change-Id: Ic75e953bafa0b15372588a9f5c79c9436a876002
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 17:56:09 +0000 (18:56 +0100)]
Move DeviceSources registration
Minimize DeviceSources collection exposure by defining better APIs.
This improves isolation and potential clashes.
JIRA: NETCONF-920
Change-Id: I20132725b538f46680f2546d4c91c9960e3b367a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 23:21:37 +0000 (00:21 +0100)]
Clean up buildDataForNetconfNode()
This method does not use node or dsType, do not pass them in. Also
inline builders and use ImmutableList for capabilities. As it turns
out we have code duplication here, which we squash as well.
Change-Id: I9bc535ff968a1a017787a65b226f4fc8898cd652
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 10:46:30 +0000 (11:46 +0100)]
Make sure NetconfSessionPreferences are immutable
Make sure internal maps are immutable and juggle things around a bit for
clarity -- especially NetconfDeviceCapabilities which was hiding at the
very bottom of the file.
JIRA: NETCONF-920
Change-Id: Ice1224ad2291912221c321d74ac7e2e66439cb89
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 23:36:25 +0000 (00:36 +0100)]
Move transaction chain handling
NetconfDeviceTopologyAdapter is the only thing using DataBroker, push
the transaction chain lifecycle management into it.
JIRA: NETCONF-918
Change-Id: I137bd759204be283e09e98ae88dfc4d8484ce8be
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 21:29:56 +0000 (22:29 +0100)]
Simplify NetconfDeviceTopologyAdapter datastore interactions
RemoteDeviceId holds a reference to device topology, which should be
managed by the user before an adapter is ever instantiated for that
device.
Reduce implicit coupling to default topology by requiring the source of
RemoteDeviceId to properly initialize the operational datastore, such
that it ensures the referenced topology actually exists.
This reduces the overhead for each adapter by two fields, as they are
absolutely superfluous when proper lifecycle is present.
To ensure this happens for AbstractTopology-derived topologies,
initialize the datastore during instantiation.
JIRA: NETCONF-918
Change-Id: Ib641cc65861bf25fe34ea2ef313ff2a1843e0f97
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 20:06:50 +0000 (21:06 +0100)]
Do not touch config datastore during initiliazation
We should not be introducing configuration items in the datastore, as
that places onus on operator and/or the datastore to deal with this
magic occuring. This also removes a cross-datastore transtion -- which
is no longer supported in Argon.
This means the configuration datastore is empty on startup, hence tests
need to initialize it. This also provides a stepping stone towards
allowing multiple netconf-capable topologies to exist.
JIRA: NETCONF-919
Change-Id: I0218b19f37dbd9ccd3196040193f305d5d147a89
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 7 Dec 2022 11:31:18 +0000 (12:31 +0100)]
Fix a raw type warning
We have leafNode<Integer>, fix that up.
Change-Id: Icffa181cca4490ee9dad3cd90ac7da67a24dd956
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 11:25:27 +0000 (12:25 +0100)]
Modernize NetconfKeystoreAdapterTest
Use local variable type inference, assertThrows/assertThat and
List.of().
Change-Id: I1657becb2c030550de99f4246f81417b80eb5ae9
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 6 Dec 2022 22:32:55 +0000 (23:32 +0100)]
Clean up NetconfTopology methods
No caller cares about NetconfDeviceCapabilities and we should not be
using Void. Switch both futures to result in Empty, which is always
non-null.
This also removes one call site which assumes NetconfSessionPreferences
contain NetconfDeviceCapabilities -- which they will not.
JIRA: NETCONF-923
Change-Id: I934d8b1cd5915117500b1c0d6028838b727a2353
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 14 Oct 2022 16:44:55 +0000 (18:44 +0200)]
Remove AbstractNetconfDispatcher.customizeBootstrap()
This method is not used anywhere, remove it.
Change-Id: Ie4260315b09a4b1331289d928175587336daa6a7
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 20:03:13 +0000 (21:03 +0100)]
Simplify initTopology()
The topology container is not a presence container, so for a long time
datastore is handling its lifecycle -- we do not need to issue an
intermediate merge. Also add FIXMEs for follow up on initialization.
Change-Id: If9257b8f1c77ab1c2e2914948bc00767a3f01d84
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 13 Nov 2022 15:30:10 +0000 (16:30 +0100)]
Specialize RemoteDeviceHandler to NetconfSessionPreferences
The only specialization is NetconfSessionPreferences, codify that,
simplifying our code.
JIRA: NETCONF-912
Change-Id: I728d7b4a530adf2280719a3f7ee911a13a68477e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 17:18:28 +0000 (18:18 +0100)]
Clean up WebInitializers
Use local variable type inference to disconnect from WebContextBuilder,
which is going to be renamed. Implement AutoCloseable to make it clear
these should be closed at some point. Finally do not instantiate a
temporary list for adding URL patterns.
Change-Id: I5950e921ff500608ba2aa682fd6faf71bddaf429
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 17:22:58 +0000 (18:22 +0100)]
Do not use raw NormalizedNode
We usually have a ContainerNode, hence we should be using that instead
of a randon NormalizedNode.
Change-Id: I9f490cd0a04e94a6f9dcf54a6fc2736c8a357553
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 17:24:44 +0000 (18:24 +0100)]
Migrate UnresolvedQName.unqualified() callers
This method has a better replacement, migrate to using it.
Change-Id: Ie8b59777665af8312a4453cf1aa6c8e932e143c6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 5 Dec 2022 11:16:21 +0000 (12:16 +0100)]
Specialize RPC input/output
We can easily guarantee ContainerNodes, let's do that to make things
simpler to migrate later.
Change-Id: Ic3f41a9d3ad09fdea8baaddfa728584b341e4ee4
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 16 Nov 2022 22:30:08 +0000 (23:30 +0100)]
Bump SSHD to 2.9.2
https://github.com/apache/mina-sshd/blob/master/docs/changes/2.9.2.md
Change-Id: I7bc6d261e0666929abde410cad64cfaabf8506e8
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 8 Nov 2022 21:09:01 +0000 (22:09 +0100)]
Clean up instantiation a bit
Remove weird method names and use a simple constructor.
Change-Id: Ie569b82d7de7dcc3b4e1ce228843ea33bd25644c
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 15 Nov 2022 18:13:30 +0000 (19:13 +0100)]
Lookup schema nodes one item at a time
Our current code is using YangInstanceIdentifier to always lookup nodes
from root. This ends up being inefficient as we end up looking up things
we already crossed over (and have on-stack).
Change-Id: I4e8aa2d7a787843fe570ed75a46cc867d5efd28d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 13 Nov 2022 13:13:58 +0000 (14:13 +0100)]
Use EffectiveModelContext in NetconfDeviceRpc
Modernize the requirement here, as SchemaContext is considered
deprecated.
Change-Id: If43456dfb8652be71ff2d9b6952eeec67f3561a6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 13 Nov 2022 10:20:29 +0000 (11:20 +0100)]
Specialize RemoteDevice to NetconfSessionPreferences
This is the only specialization we are using, make sure to remove
generic argument.
JIRA: NETCONF-912
Change-Id: Ie82080f3654d41bbd69fd709ed77c5e66ae92d13
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 11 Nov 2022 23:46:39 +0000 (00:46 +0100)]
Drop documentation FIXMEs
For an API, sal.connect.api is sorely under-documented. Add FIXMEs to
rememediate this.
Change-Id: Icbd4ff44c276e471af2471f6c297e2a07e3befcd
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 11 Nov 2022 23:42:28 +0000 (00:42 +0100)]
Ditch NetconfNode from SchemaResourceManager
The tie-in to a network-topology is not appropriate: we are operating
on raw paths.
JIRA: NETCONF-916
Change-Id: I9b063cc09d5f7e2154e8b57838b788c0aa0b5b73
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 11 Nov 2022 23:15:20 +0000 (00:15 +0100)]
Specialize MessageTransformer to NetconfMessage
There is no use pretending we handle anything but NetconfMessage.
JIRA: NETCONF-912
Change-Id: I54127020da62f0b3c4d00be0b3a72a08db4aa916
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 11 Nov 2022 22:52:28 +0000 (23:52 +0100)]
Specialize RemoteDevice to NetconfMessage
The only specialization being used is NetconfMessage. Drop the generic
and instead require NetconfMessage. This pulls in
NetconfDeviceCommunicator in for the ride.
JIRA: NETCONF-912
Change-Id: Ie1859554477068b42f6d730744fabf9d199e195f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 11 Nov 2022 21:17:30 +0000 (22:17 +0100)]
Hide NetconfDevice.LOG
Remove suppression by making DeviceSourcesResolver use its own logger.
Change-Id: I6e5646ee6d69a3dc697b7feef3bd7a13ca929c01
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 22:37:11 +0000 (23:37 +0100)]
Turn SchemaContextHandler into a component
This is an independent component now, convert it to OSGi DS. We are now
free to further evolve it.
Change-Id: I98103e657461504b88c3dd3b09433a77baf7c351
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 18:43:28 +0000 (19:43 +0100)]
Add DatabindContext and its wiring
We are acquiring EffectiveModelContext and codecs left and right. Add
DatabindContext, which is an immutable view of these and a service to
maintain them in the global view.
This allows us to eliminate references to SchemaContextHandler, hence it
is no longer a central point.
Change-Id: Iab15f628832008b8a818a48746af9e76781958cb
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 22:05:17 +0000 (23:05 +0100)]
Use a switch expressions for enumeration dispatch
Using switch expressions allows us to be exhaustive and explicit about
the values handled.
Change-Id: I83c2ccc4c4def117c6f1c6d4d745e10595e59cba
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 20:09:56 +0000 (21:09 +0100)]
Disconnect RestconfSchemaServiceImpl from SchemaContextHandler
This implementation requires only a DOMSchemaService with appropriate
extension. Update it to not reference SchemaContextHandler.
Change-Id: Ie75a5ad16f0b031713d7d0e1a7dc31ff1b4276b1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 19:25:36 +0000 (20:25 +0100)]
Simplify RestconfInvokeOperationsServiceImpl
We are not touching SchemaContextHandler, hence there is no point
pushing it down nor mocking it.
Change-Id: Iadf44a51a1eb22fac36b2011711aba76376e4884
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 17:40:23 +0000 (18:40 +0100)]
Refactor StreamWriterWithDisabledValidation
We are unnecessarily passing things to each instance, where these
are static knowledge. Reduce the footprint of each instance by moving
these constants around and adjusting instantiation accordingly.
Change-Id: I72fe28699fdd55325126b5930b77e151293582eb
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 17:11:17 +0000 (18:11 +0100)]
Remove SchemaPath from DataTreeCandidateFormatter
XMLStreamNormalizedNodeStreamWriter has a convenience method to
construct an instance without having to perform wild (and invalid)
YangInstanceIdentifier -> SchemaPath transformations.
Change-Id: I0c8d647934f111326a654f25c7db0ecb9080dba0
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 17:07:21 +0000 (18:07 +0100)]
Elimiante SchemaPath from NetconfMessageTransformUtil
We can use SchemaInferenceStack to acquire the state we need instead
of going through SchemaPath.
Change-Id: If96b521112c898245b154e3f60233e24aa17b7cd
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 16:57:52 +0000 (17:57 +0100)]
Do not use SchemaPath for error-info writeout
We can use simple SchemaInferenceStack to acquire the state for being in
a grouping, thus eliminating this particular vestige.
Change-Id: I6e2642b56b17d013afa81500aac8e633e4f6d253
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 16:46:25 +0000 (17:46 +0100)]
Tighten up StreamWriterWithDisabledValidation
We provide couple of methods which are not overridden -- make sure they
are final.
Change-Id: Iffd7cc99c191d89261a74aaed4121c66151c3841
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 16:43:38 +0000 (17:43 +0100)]
Remove AbstractNotificationsData.writeNormalizedNode()
This method is not used anywhere, remove it.
Change-Id: I673edab4eb06115d1926586d40ab0877d6d38828
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 15:05:14 +0000 (16:05 +0100)]
Eliminate use of SchemaPath in netconf-util
We can easily replace SchemaPath with an optional
SchemaNodeIdentifier.Absolute.
Change-Id: Ibf36b7c5eedf59f0136ab6636d0ea06a5f9b97fa
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 15:31:40 +0000 (16:31 +0100)]
Use RFC7951 JSON format
We should be standards-compliant, switch to using RFC7951 JSON format
instead of the legacy one.
Change-Id: I8c79f6ba8d15720201be5bf338fe539cae5fdf66
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 15:30:06 +0000 (16:30 +0100)]
Do not use SchemaPath in PayloadCreator
A simple absolute SchemaNodeIdentifier does the same trick.
Change-Id: I78e7aba50afcbb95d51b2519c62dd4f3140f4d82
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 10 Nov 2022 15:26:59 +0000 (16:26 +0100)]
Do not use SchemaPath in CopyConfig
Just do not pass any path to writer -- it will operate on the model
context.
Change-Id: Ie4c8a180ca823e8a565d12005282d81af2920e8d
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 8 Nov 2022 20:21:37 +0000 (21:21 +0100)]
Clean up NetconfDeviceSimulator.addModuleCapability()
Use local variable type inference to shorten the code. Also use
different messages for acquire and read.
Change-Id: Ic429328469271419478e93e24bf02044d0ff6a8a
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Tue, 8 Nov 2022 20:16:48 +0000 (21:16 +0100)]
Fix FB suppression
Once we have a ByteSource, use it of a CharSource of UTF8 before
reading it. This is the proper way of getting a String.
Change-Id: Ifd92fe561b5864791b77342a3c9352ac23bd5048
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 7 Nov 2022 00:31:22 +0000 (01:31 +0100)]
Bump versions to 5.0.0-SNAPSHOT
This starts the next major version development.
Change-Id: Ie88d713d1b6e414e6363ae12f4f882df25fe1327
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 7 Nov 2022 00:30:38 +0000 (01:30 +0100)]
Bump versions to 4.0.3-SNAPSHOT
This starts the next development iteration.
Change-Id: I24622b3fecb76ca9471b5556a48435932f637082
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 6 Nov 2022 21:49:37 +0000 (22:49 +0100)]
Clean up XML interactions
We have a chunk of duplicated code, make sure we provide provide
utilities.
Change-Id: Ibb2b3e14f23c76aa101dcd3766d35aa6a15a5752
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 6 Nov 2022 21:29:33 +0000 (22:29 +0100)]
Clean up namespace handling
We should tie together namespaces and elements to the generated model,
so that these are kept consistent.
Change-Id: I2d1167e632b6695985bf93d4102794978d2811df
Signed-off-by: Robert Varga <[email protected]>
Peter Puškár [Thu, 20 Jan 2022 08:54:43 +0000 (09:54 +0100)]
Add missing identifier for list node in fields RESTCONF query
Fields filtering is currently completely failing for NETCONF nodes
when the fields query contains any list node, because we need both
NodeIdentifier (for the entire list) and NodeIdentifierWithPredicates
(for a concrete entry) to parse them correctly.
WriterFieldsTranslator provides both already and this is correctly
working on non-NETCONF nodes. Make this behaviour consistent for both.
JIRA: NETCONF-820
Change-Id: I24d6ec1752ba1a2f551fcd4149c6efde04f1a89c
Signed-off-by: Peter Puškár <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 6 Nov 2022 18:45:58 +0000 (19:45 +0100)]
Use switch expression for EventFormatterFactory selection
Useing a switch expression removes the unhandled case, promoting to a
compile-time error if things do not match up.
Change-Id: I8688e4bc76419194cb0d910105ff0733cd6d118f
Signed-off-by: Robert Varga <[email protected]>
Peter Puškár [Thu, 13 Oct 2022 13:25:41 +0000 (15:25 +0200)]
Add the concept of a netconf client name
Clients can be optionally named with a simple string, this is then
propagated to AsyncSshHandler and used for logging purposes.
JIRA: NETCONF-896
Change-Id: Iebb6c094c50ff4646b8ef3e9221cebd3dbebe5e3
Signed-off-by: Zdenko Filip <[email protected]>
Signed-off-by: Jaroslav Tóth <[email protected]>
Signed-off-by: Peter Puškár <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Sun, 6 Nov 2022 17:45:35 +0000 (18:45 +0100)]
Use try-with-resources in SSHTest
SshProxyServer is autocloseable, we should use try-with-resources to
manage it.
Change-Id: I797064a83b793767a7041d51fa1ab507b79b781f
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 4 Nov 2022 14:40:05 +0000 (15:40 +0100)]
Bump upstrems
Adopt:
- odlparent-11.0.2
- infrautils-4.0.2
- yangtools-9.0.2
- mdsal-10.0.3
- controller-6.0.3
- aaa-0.16.4
Change-Id: I58f8179456cb8f0b2adc300bb0397b2636612d57
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 3 Nov 2022 01:24:02 +0000 (02:24 +0100)]
Do not reference individual builders
We are about to hide individual builders, make sure we go through either
Builders or ImmutableNodes.
Change-Id: I9ece3328ffe148e09e5e232e79cc8db24214161b
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 29 Jul 2022 11:23:16 +0000 (13:23 +0200)]
Bump sshd to 2.9.1
https://github.com/apache/mina-sshd/blob/master/docs/changes/2.9.0.md
https://github.com/apache/mina-sshd/blob/master/docs/changes/2.9.1.md
JIRA: NETCONF-894
Change-Id: I54ecf8d02d4adfea742ce47ac6e164b1df2f6615
Signed-off-by: Samuel Schneider <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 2 Nov 2022 12:23:54 +0000 (13:23 +0100)]
Use property setters
SSHD configuration properties can be nicely set via a type-safe system,
make sure we use that instead of mucking with maps directly.
Change-Id: If1193c70d7057e16430ebf91e4dc78cc1d8f1745
Signed-off-by: Robert Varga <[email protected]>
Ivan Hrasko [Fri, 7 Oct 2022 18:32:15 +0000 (20:32 +0200)]
Fix mdsal-netconf-ssh shutdown
Initialize AsynchronousChannelGroup thread pool with
ForwardingExecutorService with NO-OP shutdown method
in order to prevent throwing UnsupportedOperationException
from OSGiGlobalEventExecutor.
JIRA: NETCONF-900
Change-Id: Ibedb95413bf5476f5d22ae899e71496951fb6ed7
Signed-off-by: Ivan Hrasko <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Fri, 28 Oct 2022 09:20:41 +0000 (11:20 +0200)]
Reorder dependencies
Make sure org.json is first, removing the need for exclusions.
Change-Id: I6243ba7663d62c76f34e483dba406c7ed45ddb60
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 27 Oct 2022 16:15:42 +0000 (18:15 +0200)]
Bump org.json/json to
20220924
This version is in public domain, resolving potential licensing issues
around "do no evil" restriction. Also update other testing frameworks.
Change-Id: I55c4ba72c53bad8a33ba42c712db84e8bfece57c
Signed-off-by: Robert Varga <[email protected]>
Ruslan Kashapov [Wed, 26 Oct 2022 07:38:35 +0000 (10:38 +0300)]
Fix docgen failure on multi-level choice definition
+ minor refactoring: duplicate code replaced with recursive function
JIRA: NETCONF-883
Change-Id: Ie577f930fe7fc104bc92a93286a2788b93c04ac6
Signed-off-by: Ruslan Kashapov <[email protected]>
Robert Varga [Tue, 25 Oct 2022 10:20:38 +0000 (12:20 +0200)]
Clean up *NormalizedNodeBody{Reader,Writer}
Use local variable type inference and instanceof patterns to clean up
casting and checks.
Change-Id: I410848132908f36dc5dd8a1b4ae309d872dd9b90
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 24 Oct 2022 19:55:19 +0000 (21:55 +0200)]
Use instanceof patterns in DefinitionGenerator
We can simplify a bit with using a check-and-assign patterns.
Change-Id: Ib301dfa2f80ab7ad598cae5efc891ebbad021d06
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Mon, 22 Aug 2022 13:08:15 +0000 (15:08 +0200)]
Add {keystore,truststore}-api and none implementations
The configuration bits for NETCONF/RESTCONF clients and server are part
of a large scale effort in NETCONF WG. In particular the concept of
crypto types and a keystore/truststore are shared between SSH and TLS
transports.
This patch adds the YANG models and an a 'none' implementation, which
the central keystore/truststore.
JIRA: NETCONF-590
Change-Id: I0827756df83aa9cfc83e98ee50b1e44f6310e82e
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 20 Oct 2022 15:01:20 +0000 (17:01 +0200)]
Fix TCPClientServerTest stability
Client's toString() changes when the connection completes. Move the
check to after we have waited for callbacks.
JIRA: NETCONF-590
Change-Id: I1ad7e375ca60d350affd1b226fa11ffc87106fe6
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Thu, 20 Oct 2022 15:00:50 +0000 (17:00 +0200)]
Fix transport-{api,tcp} dependencies
netty-common is used by api, not by tcp, fix that up.
Change-Id: I338e1113506217905f6c8a779ab90d0025ccf2f1
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 10 Aug 2022 18:23:21 +0000 (20:23 +0200)]
Add transport-{api,tcp}
NETCONF (and potentially RESTCONF) has rather well-defined concepts
how it works on the transport layer. Furthermore there are quite mature
YANG models covering the configuration of both NETCONF server and
NETCONF client.
This patch introduces the transport-level APIs to establish a transport
stack and its interactions with protocol negotiation and then the
messages layer. A baseline implementation based on plain TCP is also
provided.
JIRA: NETCONF-590
Change-Id: I29c207a2036e1c54ea1f6d7fe48f7eb42a3a4a7d
Signed-off-by: Robert Varga <[email protected]>
OleksandrZharov [Tue, 4 Oct 2022 09:56:19 +0000 (11:56 +0200)]
Fix netconf WebInitializer url patterns
Fixed url patterns in WebInitializer so they all correspond
to specification.
JIRA: AAA-233
Change-Id: I2cfdabc7243e2c2d94debc3e02f6875d8ad13293
Signed-off-by: OleksandrZharov <[email protected]>
Signed-off-by: Ivan Hrasko <[email protected]>
Signed-off-by: Robert Varga <[email protected]>
Robert Varga [Wed, 19 Oct 2022 11:47:15 +0000 (13:47 +0200)]
Remove OSGiBaseNetconfSchemas
We have constructor injection and therefore can easily reuse
DefaultBaseNetconfSchemas in OSGi environment as well.
Change-Id: I1677a9d208990eb60a74349f8b9fae921ac33096
Signed-off-by: Robert Varga <[email protected]>