netconf.git
8 months agoSSH keep-alive mechanism to use IGNORE messages 13/108113/1
Ruslan Kashapov [Mon, 2 Oct 2023 08:44:59 +0000 (11:44 +0300)]
SSH keep-alive mechanism to use IGNORE messages

Initial setting of HeartbeatType.RESERVED requires
custom implementation of heartbeat message handler.
Otherwise, the exception is thrown.

JIRA: NETCONF-590
Change-Id: I4752718a5bc9ac18910fa4c141e0fc53155e5ce8
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
8 months agoFix frame encoder for netconf server 01/108001/3
Ruslan Kashapov [Thu, 28 Sep 2023 09:33:22 +0000 (12:33 +0300)]
Fix frame encoder for netconf server

Using first appearance of ByteBuf output as a final
message caused frame encoder being skipped and
message returned without expected EOM bytes. Message
extraction from inner channel re-implemented as an
outbound message handler.

JIRA: NETCONF-1106
Change-Id: Icb7fc6eca070c75910a35c8f117e6b1fa4295c0c
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
8 months agoClean up XmlElementTest 07/108107/1
Robert Varga [Sun, 1 Oct 2023 22:48:39 +0000 (00:48 +0200)]
Clean up XmlElementTest

Use local variable type inference and text blocks.

Change-Id: I471d99d11a493c46aba9a2e6fe868172edfc6a24
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up XmlElement methods 90/108090/4
Robert Varga [Sun, 1 Oct 2023 13:36:34 +0000 (15:36 +0200)]
Clean up XmlElement methods

XmlElement has a number of methods which are better hosted in XmlUtil,
without the need for encapsulation.

Change-Id: I5e47719ce3c31b3e41976f0e1955ac097b4a1485
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix netconf-client's dependencies 89/108089/3
Robert Varga [Sun, 1 Oct 2023 13:22:45 +0000 (15:22 +0200)]
Fix netconf-client's dependencies

We have two warnings about dependencies we are using, fix that up.

Change-Id: I69ee5f9b629621edc74e1022bd9eda0bde3fcb67
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMove XmlUtil.evaluateXPath() 88/108088/3
Robert Varga [Sun, 1 Oct 2023 13:20:41 +0000 (15:20 +0200)]
Move XmlUtil.evaluateXPath()

The only caller is NetconfClientSessionNegotiator, move the method
there.

Change-Id: I36e0d6cc98bc2881787eb16a380c67f6564ef8c0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoUse ContainerNode in RuntimeRpc 02/108102/1
Robert Varga [Sun, 1 Oct 2023 21:23:30 +0000 (23:23 +0200)]
Use ContainerNode in RuntimeRpc

We are guaranteed to have a ContainerNode, do not drop down to
NormalizedNode and re-cast.

Change-Id: I857be04823c927d96913a6b18a6cd37c079a6bc7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoImprove assertion 98/108098/1
Robert Varga [Sun, 1 Oct 2023 21:02:35 +0000 (23:02 +0200)]
Improve assertion

Print diff contents when it does not match.

Change-Id: I7f08cd1965f56d913600d487008b96cf6346221a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate XmlUtil.createElement() et al. 87/108087/3
Robert Varga [Sun, 1 Oct 2023 12:33:11 +0000 (14:33 +0200)]
Eliminate XmlUtil.createElement() et al.

These users are just shortcuts to Document.createElementNS(). Migrate
them over for clarity.

Change-Id: I9f2ec11bc0c7b5f8df86c15a0a0ca4a55c16ed54
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up NetconfMessageTransformerTest 86/108086/2
Robert Varga [Sun, 1 Oct 2023 11:38:59 +0000 (13:38 +0200)]
Clean up NetconfMessageTransformerTest

Improve assertions, use local variable type inference and text blocks.

Change-Id: I212f3a3554978b4dd785eccdf8591f49fd4021fe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix filter type namespace 85/108085/2
Robert Varga [Sun, 1 Oct 2023 11:06:53 +0000 (13:06 +0200)]
Fix filter type namespace

We are emitting "type" with the NETCONF base namespace.

This is wrong, as attributes are not subject to default namespace, hence
we should be emitting it as a plain attribute -- it is interpreted in
the context of its defining element, which already is in NETCONF base
namespace.

JIRA: NETCONF-1170
Change-Id: I9cf63ca52297cd45ea062ec7ddfb1ff4a9e853f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up BaseRpcSchemalessTransformerTest 79/108079/1
Robert Varga [Fri, 29 Sep 2023 23:29:49 +0000 (01:29 +0200)]
Clean up BaseRpcSchemalessTransformerTest

Switch to using xmlunit-core and clean up.

Change-Id: I5ddd5316939859b131f28949d3de462c9b1929aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate netconf-server to xmlunit-core 78/108078/3
Robert Varga [Fri, 29 Sep 2023 22:05:15 +0000 (00:05 +0200)]
Migrate netconf-server to xmlunit-core

Migrate to xmlunit-core and perform usual modernization.

Change-Id: Iaaad8749718e0705be5b47b4828b4f59f6cdb3e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoMigrate netconf-netty-util to xmlunit-core 76/108076/2
Robert Varga [Fri, 29 Sep 2023 21:35:29 +0000 (23:35 +0200)]
Migrate netconf-netty-util to xmlunit-core

Use xmlunit-core instead of xmlunit-legacy and modernize the code.

Change-Id: Ia9f9fba4e9458b9a6465c2f3fe2ab0d304e47bbc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix netconf-netty-util dependencies 77/108077/2
Robert Varga [Fri, 29 Sep 2023 21:38:06 +0000 (23:38 +0200)]
Fix netconf-netty-util dependencies

We have two warnings here, fix them up.

Change-Id: I54d7bc23e75569702cbd0b56c4db26530eb219df
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove XmlUnitUtil 75/108075/1
Robert Varga [Fri, 29 Sep 2023 21:24:02 +0000 (23:24 +0200)]
Remove XmlUnitUtil

This class is not used anywhere, as it was only used in config-connector
tests.

Change-Id: I2069ff892311b7434ddd3c0269753f2d764f4326
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoCreate MdsalRestconfServer 93/107893/10
Robert Varga [Sat, 16 Sep 2023 09:24:35 +0000 (11:24 +0200)]
Create MdsalRestconfServer

The actual binding to MD-SAL services is independent of other
concerns, just as JAX-RS binding.

Introduce MdsalRestconfServer to act as an intermediary. This allows us
to centralize data binding operations and later act as the central
implementation dispatch.

This reduces the number of callers to
InstanceIdentifierParser.toInstanceIdentifier(), as we have a proper
indirection to bind either the root or a non-empty identifier and can
provide the first cut of differentiated binding.

In RestconfOperationsServiceImpl this has the nice effect of bringing
together the two distinct invocation paths, leading to
OperationsContent.bodyFor(EffectiveModelContext) being redundant.

In RestconfDataServiceImpl we lose getRestconfStrategy(), which is now
invoked on the server. We also clarify variable names, so they have a
semantic meaning.

RestconfInvokeOperationsServiceImpl integration sees RestconfStrategy
grow awareness of DOMRpcService, providing a clean invocation interface
centered around RestconfFuture<Optional<ContainerNode>>. That
co-location of concerns also allow us to perform only a single error
mapping, we any DOMRpcResult's errors into a
RestconfDocumentedException.

JIRA: NETCONF-1157
Change-Id: I9ecefb2e065b4ad6ed8e4226713da851a1050619
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoCleanup RestconfDataServiceImplTest 96/107996/2
Ivan Hrasko [Wed, 27 Sep 2023 11:54:44 +0000 (13:54 +0200)]
Cleanup RestconfDataServiceImplTest

Remove unused fields from RestconfDataServiceImplTest.

Change-Id: I3b299db3b283ea61116f54cd1bd5024a6f81de42
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoClean up artifacts 93/107993/2
Robert Varga [Tue, 26 Sep 2023 20:18:06 +0000 (22:18 +0200)]
Clean up artifacts

netconf-netty-util does not produce a test-jar, hence we should not be
declaring it.

netconf-client's test-jar should be declared with scope=test to prevent
it from accidentally leaking to runtime.

Change-Id: I71de23653ac300c3ddb3d2c978b7fcf84d220333
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoTurn NetconfTopologyRPCProvider into a resource 90/107990/3
Robert Varga [Tue, 26 Sep 2023 13:41:26 +0000 (15:41 +0200)]
Turn NetconfTopologyRPCProvider into a resource

Rether than exposing ClassToInstanceMap and have users repeat the same
thing, turn the provider into a properly-managed resource which needs
to be cleaned up with close().

JIRA: NETCONF-1116
Change-Id: I77ab5020627ae3ed5632e919d2866b17c46878aa
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not leak ClassToInstanceMap from NetconfSalKeystoreRpcs 89/107989/1
Robert Varga [Tue, 26 Sep 2023 12:36:39 +0000 (14:36 +0200)]
Do not leak ClassToInstanceMap from NetconfSalKeystoreRpcs

A public method here is completely superfluous, do not leak it.

JIRA: NETCONF-1116
Change-Id: Ib2789ba44fd1ac00ace1d857a92f859c10b11e0f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not use RpcService in NETCONF components 51/107751/8
Oleksandr Zharov [Thu, 7 Sep 2023 10:32:36 +0000 (12:32 +0200)]
Do not use RpcService in NETCONF components

Migrated usage of RpcService to Rpc<?,?> for NETCONF components.

JIRA: NETCONF-1116
Change-Id: I5a7fa47c961c7eb41cb71dcf08da58399d7011b5
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
8 months agoUse Guava's Escaper for percent-encoding 57/107957/1
Robert Varga [Sat, 23 Sep 2023 00:32:58 +0000 (02:32 +0200)]
Use Guava's Escaper for percent-encoding

We have a chunk of hand-written code which does essentially the same
thing. Trade a bit of memory for the lookup tables to simplify our code.

Change-Id: Ida137aaaa002c7c5c257c586f96fd9723b22e463
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoAdd test for union type 05/106505/24
tobias.pobocik [Fri, 16 Jun 2023 10:29:33 +0000 (12:29 +0200)]
Add test for union type

Previously, a test was missing to make sure that the proper
type was registered in union type.

JIRA: NETCONF-1058
Change-Id: Ifd6ea086014e13de88ffd50bfb6b2fd1eeb05530
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
8 months agoClean up SSHTransportStack 43/107943/5
Robert Varga [Thu, 21 Sep 2023 15:40:54 +0000 (17:40 +0200)]
Clean up SSHTransportStack

Now that both client and server are initializing their SessionFactory,
we can simply pass down the arguments required for SshIoService down,
so that the stack can handle the dispatch itself.

While we are at it, rename SshIo{Service,Session} to
TransportIo{Service,Session}.

JIRA: NETCONF-590
Change-Id: I3e1b9f638e0fc441b9d68648cd63344caeb72378
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoAdd CompatChannelGroup 44/107944/4
Robert Varga [Thu, 21 Sep 2023 16:38:52 +0000 (18:38 +0200)]
Add CompatChannelGroup

All we really need is the add() operation, which can do absolutely
nothing, everything else is just unused.

Change-Id: Ib105d3486707d56c40fb084b2d5c6e8214d13ba5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoInitialize TransportSshClient.sessionFactory 42/107942/2
Robert Varga [Thu, 21 Sep 2023 15:20:23 +0000 (17:20 +0200)]
Initialize TransportSshClient.sessionFactory

We have a nice field for initializing a reference to the factory. Move
username validation and SessionFactory creation to the Builder.

JIRA: NETCONF-590
Change-Id: I327259e9d94a8bb7ac04a6664eb6133f25d1396d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoAcquire NettyIoServiceFactory from factoryManager 41/107941/2
Robert Varga [Thu, 21 Sep 2023 14:45:24 +0000 (16:45 +0200)]
Acquire NettyIoServiceFactory from factoryManager

Now that we are pushing down IoServiceFactoryFactory, we can rely on
FactoryManager.getIoServiceFactory() to correctly instantiate and cache
the factory.

This also improves things quite a bit, as we are dodging the creation of
a NioEventLoopGroup.

JIRA: NETCONF-590
Change-Id: I15f4a9dd11957b5e54c9a3f5f0c3c9d41bd24146
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoInitialize TransportSshServer.sessionFactory 40/107940/2
Robert Varga [Thu, 21 Sep 2023 14:19:39 +0000 (16:19 +0200)]
Initialize TransportSshServer.sessionFactory

SshServer has a field to hold the associated SessionFactory, which is
normally initialized when the server is started.

We are not starting the server, but we should initialize the session
factory, so that it can be used in other places.

JIRA: NETCONF-590
Change-Id: Ie574c7934c154f069fbc2d6ee48509bff770b481
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoSSH client requires a username 39/107939/2
Robert Varga [Thu, 21 Sep 2023 13:57:05 +0000 (15:57 +0200)]
SSH client requires a username

Leaving the username is not valid configuration. Enforce that.

JIRA: NETCONF-590
Change-Id: I5dcdec4462893771efde81364ac601e964b236d4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoImprove DefinitionGenerator testing 31/106131/37
tobias.pobocik [Thu, 25 May 2023 15:17:13 +0000 (17:17 +0200)]
Improve DefinitionGenerator testing

This commit addresses the lack of test coverage for various sections
within the DefinitionGenerator class. By adding more tests, we
significantly enhance the overall coverage of this class.
This improvement ensures a more robust and reliable testing environment.

JIRA: NETCONF-999
Change-Id: Iac703199c62f56b40dc02ff992e001a7b56554bf
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoEliminate ObjectNode(s) from Operation class 07/107707/11
Oleksandr Zharov [Tue, 5 Sep 2023 11:12:50 +0000 (13:12 +0200)]
Eliminate ObjectNode(s) from Operation class

Removed usage of ObjectNode and ArrayNode in Operation class
and replaced them with proper objects.

JIRA: NETCONF-938
Change-Id: I15d8f64d004141f40f5beebaa21690d32a25b14f
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoEliminate server from Path class 95/107495/14
Šimon Ukuš [Fri, 25 Aug 2023 11:44:00 +0000 (13:44 +0200)]
Eliminate server from Path class

Remove server from Path. It is unused, and we want to
get rid of ObjectNode(s) and ArrayNode(s).

JIRA: NETCONF-938
Change-Id: I7b8141c38db18c49585a05e427ef64922db4bf6b
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
8 months agoFix incorrect schema reference in root POST link 19/107419/15
Šimon Ukuš [Thu, 24 Aug 2023 09:36:09 +0000 (11:36 +0200)]
Fix incorrect schema reference in root POST link

We are creating a root POST link, when requesting swagger document
for single module. We were passing empty string as module name
when building the POST operation, which resulted in our schema ref
beginning with underscore (like this: "_toaster_module").
The schema is created, but without the leading underscore.

This patch fixes it by passing null value and adding logic
that performs the null checking to construct correct schema reference.

JIRA: NETCONF-1133
Change-Id: I9019dea1874133706f8825b0159e6c571d7b9558
Signed-off-by: Šimon Ukuš <simon.ukus@pantheon.tech>
8 months agoBind SshClient/SshServer to NettyIoServiceFactoryFactory 35/107935/3
Robert Varga [Thu, 21 Sep 2023 02:53:52 +0000 (04:53 +0200)]
Bind SshClient/SshServer to NettyIoServiceFactoryFactory

Our implementation are captives of SSHTransportStackFactory and
therefore should be bound to a particular EventLoopGroup and not delve
into DefaultIoServiceFactoryFactory's
getDefaultIoServiceFactoryFactoryInstance(), which works with
ServiceLoader.

Pass down NettyIoServiceFactoryFactory to make sure the configuration
does not stray from the path we have set for it.

JIRA: NETCONF-590
Change-Id: I32fc9115a28cb60cae1960293416a62a96529aec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoNorthbound Netconf servers moved to new transport implementation 89/106789/33
Ruslan Kashapov [Mon, 3 Jul 2023 14:51:49 +0000 (17:51 +0300)]
Northbound Netconf servers moved to new transport implementation

Deprecated NetconfServerDispatcher is replaced with usage of new
NetconfServerFactory. Netty thread group provider was added as fix
for incompatible netty-threadgroup-config (nio only, fails with epoll)
from controller project.

JIRA: NETCONF-1106
Change-Id: I076020565b844ac7ddc4dfecc4b23154b825e4bf
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRequire SubsystemFactory for SSHServer 38/107938/1
Robert Varga [Thu, 21 Sep 2023 12:19:22 +0000 (14:19 +0200)]
Require SubsystemFactory for SSHServer

Creating SSH servers without any subsystem is quite pointless. Require a
SubsystemFactory to be present and configure it directly in
TransportSshServer.

This improves safety and has the added benefit of reducing
ServerFactoryManagerConfigurator.

JIRA: NETCONF-1106
Change-Id: I70d37dbfa71bf13740d1c314b91777368fcf837c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoAdd SSHTransportStackFactory 34/107934/6
Robert Varga [Wed, 20 Sep 2023 21:56:34 +0000 (23:56 +0200)]
Add SSHTransportStackFactory

TransportStack integration with Apache SSHD requires non-trivial
interaction with Netty, as we need to integrate on both I/O and
threadpool/executor levels.

At the end of the day, anything from SSHD needs to run on worker event
loop (group). This in turn requires having control over the worker
EventLoopGroup.

SSHTransportStackFactory is a resource (e.g. it needs to be
lifecycle-managed), which captures the lifecycle of EventLoopGroups
compatible with NettyTransportSupport, i.e. using the best available
technology stack.

This is the new primary entrypoint into this component, with users
expected to create a SSHTransportStackFactory, manage its lifecycle
and create SSH client/servers from it.

JIRA: NETCONF-590
Change-Id: I80622f1595344a83d439717e243295cb4683383c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoIntroduce TransportSsh{Client,Server} 33/107933/6
Robert Varga [Wed, 20 Sep 2023 15:42:26 +0000 (17:42 +0200)]
Introduce TransportSsh{Client,Server}

We are using both SshClient and SshServer, configuring them extensively,
but we never start them.

Introduce proper specializations of SshClient and SshServer, which do
not allow themselves to be start or stopped. Strictly instantiate them
through provided builders, which also serve as hosts for configuration
adaptation.

This reduces clutter in SSH{Client,Server}, making them single-page
classes. Another benefit is that the consistency of SshClient/SshServer
is now checked, with defaults being correctly applied.

JIRA: NETCONF-590
Change-Id: If68714c21fe06de84cdff743c59c08f0f96f884c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoEliminate ObjectNode(s) from Schema class 52/107552/12
Yaroslav Lastivka [Tue, 29 Aug 2023 07:18:50 +0000 (10:18 +0300)]
Eliminate ObjectNode(s) from Schema class

Introduced Property, Xml, Discriminator, ExternalDocumentation records.
All JsonNode fields inside Schema class has been replaced by
corresponding classes or collections. Affected logic has been adapted
to use models instead of JsonNode.

JIRA: NETCONF-938
Change-Id: If3a653b742f977c15a3056675d028a8bdfbd092a
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
8 months agoRemove ChannelInitializerListener 22/107922/3
Robert Varga [Wed, 20 Sep 2023 00:50:45 +0000 (02:50 +0200)]
Remove ChannelInitializerListener

We really have two specializations here, and these will come handy for
our users. Expose BaseTransportServer, which does all the right things.

We ditch the use of the GlobalEventExecutor and use the channel's
EventLoop to allocate Promises.

JIRA: NETCONF-1106
Change-Id: I6a45cdd50a61b31605963cccd75e0da8e10c3333
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoFix ServerFactoryManagerConfigurator-less createSshServer() 21/107921/3
Robert Varga [Wed, 20 Sep 2023 00:14:17 +0000 (02:14 +0200)]
Fix ServerFactoryManagerConfigurator-less createSshServer()

We need to tell the server that we support the NETCONF subsystem,
achieve that through sharing codepaths.

JIRA: NETCONF-1106
Change-Id: I94ff50ea1963a40b9fd4eae9afdc3f45f8e20564
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRemove FactoryManagerConfigurator 20/107920/2
Robert Varga [Wed, 20 Sep 2023 00:05:56 +0000 (02:05 +0200)]
Remove FactoryManagerConfigurator

This record is really just a simple lambda within its sole user.

JIRA: NETCONF-1106
Change-Id: I8a743b80a57a5f5dffa265276878cba7b1673cdc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoHide SshIoSession 27/107927/1
Robert Varga [Wed, 20 Sep 2023 11:48:25 +0000 (13:48 +0200)]
Hide SshIoSession

This is an implementation detail, hide it from the outside world.

JIRA: NETCONF-590
Change-Id: I7f6c869d73d1024f44693bae7a34596d44bd8389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoHide SshIoService 26/107926/1
Robert Varga [Wed, 20 Sep 2023 11:20:49 +0000 (13:20 +0200)]
Hide SshIoService

This is just an internal utility, hide it.

Change-Id: I9debd4390b8e57089850c63a6e119e44cb1d0298
JIRA: NETCONF-590
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up onUnderlayChannelEstablished 25/107925/1
Robert Varga [Wed, 20 Sep 2023 10:50:23 +0000 (12:50 +0200)]
Clean up onUnderlayChannelEstablished

Drop unneeded annotation and clean up method implementation.

JIRA: NETCONF-590
Change-Id: Ib0cd36c0a41b32e380dd0e1484d0fec58895020f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoUse HexFormat to percent-encode 09/107909/3
Robert Varga [Mon, 18 Sep 2023 16:30:12 +0000 (18:30 +0200)]
Use HexFormat to percent-encode

We can improve performance of encoding by not going through
String.format()/toUpperCase(), but rather talk directly to HexFormat.

Change-Id: I404673da66693beee6cb853c625cc08fe8f35615
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoDo not use WebApplicationException to report 204 13/107913/4
Robert Varga [Mon, 18 Sep 2023 19:13:57 +0000 (21:13 +0200)]
Do not use WebApplicationException to report 204

Use plain Responses to complete the AsyncResponse here, bypassing the
need to create an exception.

Change-Id: I73457c0a2147035445dd5e5252038c8d6021088a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoRestconf schema source URL provider for yanglib-mdsal-writer 58/107458/9
Ruslan Kashapov [Tue, 29 Aug 2023 11:35:50 +0000 (14:35 +0300)]
Restconf schema source URL provider for yanglib-mdsal-writer

Due to restconf-nb contains the service to download yang
resources it needs the component to provide valid URLs
when yang-library data is constructed.

JIRA: NETCONF-668
Change-Id: I948bc12dd4852ff25cc7a47007c4de8eaa7bc495
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
8 months agoFix PatchStatusBodyWriter's error reporting 77/107877/6
Robert Varga [Thu, 14 Sep 2023 18:06:34 +0000 (20:06 +0200)]
Fix PatchStatusBodyWriter's error reporting

We get errors-paths in YangInstanceIdentifier form, hence we need to go
through proper codec treatment.

JIRA: NETCONF-1130
Change-Id: I62d0173221f7906a6fd67eef1d1a03154e0925bb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoClean up YangInstanceIdentifierSerializer 08/107908/2
Robert Varga [Mon, 18 Sep 2023 16:15:50 +0000 (18:15 +0200)]
Clean up YangInstanceIdentifierSerializer

Eliminate appendQName() and inline it, as it is a common path in
dispatch. Also use local variable type inference and point out fishy
value encoding.

Change-Id: Ic5cc0962fe1a529bbd841b08cee4193d773393c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
8 months agoBump upstreams 12/107912/1
Robert Varga [Mon, 18 Sep 2023 17:16:27 +0000 (19:16 +0200)]
Bump upstreams

Adopt:
- yangtools-11.0.2
- mdsal-12.0.2
- controller-8.0.2
- aaa-0.18.2

Change-Id: Iadc1fd5265dbdd7348ac1c0c5abb8d30a9ace424
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoInline checkedGet() 92/107892/2
Robert Varga [Sat, 16 Sep 2023 11:36:31 +0000 (13:36 +0200)]
Inline checkedGet()

This method has only a single caller which we want to evolve further.
Inline it into invokeAction().

JIRA: NETCONF-718
Change-Id: I0c017955ab51ddebf54c8bd6a46495f434fe55b3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMake DatabindContext codecs lazily-loaded 85/107885/2
Robert Varga [Fri, 15 Sep 2023 14:29:33 +0000 (16:29 +0200)]
Make DatabindContext codecs lazily-loaded

We may use temporary DatabindContexts and also we do not necessarily
want to instantiate both XML and JSON codecs for each. Make codec
loading lazy instead, allocated on the first request.

JIRA: NETCONF-773
Change-Id: Ie739629c23457937e73cc2f703b5d3a91989867d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBind Insert point PathArgument earlier 76/107876/2
Robert Varga [Thu, 14 Sep 2023 17:31:10 +0000 (19:31 +0200)]
Bind Insert point PathArgument earlier

We have a bit of duplicate code in RestconfStrategy, which really should
not be present here. We should be receiving point's value as an
already-baked PathArgument instead.

JIRA: NETCONF-773
Change-Id: I0845ca34a41b0bfe82ada8598cc6a540451c34f0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoBind RestconfStrategy to EffectiveModelContext 72/107872/2
Robert Varga [Thu, 14 Sep 2023 14:59:31 +0000 (16:59 +0200)]
Bind RestconfStrategy to EffectiveModelContext

We are passing around EffectiveModelContext like there's no tomorrow.
Let us just bind it to a RestconfStrategy instance.

This allows us to simplify methods all over the place, reducing
cognitive load while navigating them.

JIRA: NETCONF-773
Change-Id: Ibaeb7b865c894c6eaadf65de11147b912534cf93
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoPass correct EffectiveModelContext to readData() 75/107875/1
Robert Varga [Thu, 14 Sep 2023 16:25:50 +0000 (18:25 +0200)]
Pass correct EffectiveModelContext to readData()

This is a mixup -- schemaContextRef is the localModelContext. Fix that
thinko by passing the context from InstanceIdentifierContext.

Change-Id: I67e24334182531c7cc77c0d3e75d68c3fd3f3a96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRefactor NormalizedNodePayload 69/107869/2
Robert Varga [Thu, 14 Sep 2023 11:42:49 +0000 (13:42 +0200)]
Refactor NormalizedNodePayload

Turn this class into a record, with complete non-null semantics.

JIRA: NETCONF-773
Change-Id: I73e35fe4bd55f8382a86de0052839efc7b98be81
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix action invocation response 70/107870/1
Robert Varga [Thu, 14 Sep 2023 12:01:29 +0000 (14:01 +0200)]
Fix action invocation response

We should be checking for null here as well, which eliminates the last
user of NormalizedNodePayload.ofNullable().

Change-Id: I1397a6e382f4e8d202e98c3d07e6fd3201d0959a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate NormalizedNodePayload.headers 67/107867/1
Robert Varga [Thu, 14 Sep 2023 10:20:01 +0000 (12:20 +0200)]
Eliminate NormalizedNodePayload.headers

Convert the only user working with this facility to return a Response,
where it can set the location header directly.

JIRA: NETCONF-1102
Change-Id: Ice969014cf5532ea2cb93d1939cad5edf8c76335
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDo not use InstanceIdentifierContext in postData() 63/107863/4
Robert Varga [Wed, 13 Sep 2023 20:00:37 +0000 (22:00 +0200)]
Do not use InstanceIdentifierContext in postData()

The variables being passed are trivial, refactor internal wiring to pass
appropriate variables instead.

JIRA: NETCONF-1157
Change-Id: I78de7bce3cd9aee231d8129e83dff54ee12a46f7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoReduce InstanceIdentifierContext proliferation 62/107862/4
Robert Varga [Wed, 13 Sep 2023 19:51:54 +0000 (21:51 +0200)]
Reduce InstanceIdentifierContext proliferation

Use local variable type inference to ease future migrations.

Change-Id: If86fb19df9b64dbbbbdcc94ad99dfa19ac0e19ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDo not use InstanceIdentifierContext in NormalizedNodePayload 58/107858/5
Robert Varga [Wed, 13 Sep 2023 19:02:45 +0000 (21:02 +0200)]
Do not use InstanceIdentifierContext in NormalizedNodePayload

All writers have been proven to just need the Inference, ditch the
useless indirection through InstanceIdentifierContext.

JIRA: NETCONF-1157
Change-Id: I0f020b9a73198037dba51364b78ec3af7086b8d7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRefactor AbstractNormalizedNodeBodyWriter 57/107857/5
Robert Varga [Wed, 13 Sep 2023 17:27:02 +0000 (19:27 +0200)]
Refactor AbstractNormalizedNodeBodyWriter

AbstractNormalizedNodeBodyWriter so that the three common dispatches are
handled in common code. This also modernizes them and pulls common bits
together.

This allows us to also switch the dispatch logic, so it operates on
SchemaInferenceStack instead of on SchemaNode.

All of this ends up showing that there is a bug in operation output
code, which causes us to emit an unnecessary declaration.

JIRA: NETCONF-1157
Change-Id: Icc781e884cecf7a5d64de63dd65b97e963fd4abe
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDo not use InstanceIdentifierContext in OperationsContent 61/107861/5
Robert Varga [Wed, 13 Sep 2023 19:33:40 +0000 (21:33 +0200)]
Do not use InstanceIdentifierContext in OperationsContent

We are really operating on an Inference, remove the indirection.

JIRA: NETCONF-1157
Change-Id: I382716104f4bd66163b2031fe91f47ad96556612
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoOperationsContent requires a context 60/107860/3
Robert Varga [Wed, 13 Sep 2023 19:14:05 +0000 (21:14 +0200)]
OperationsContent requires a context

All callers are guaranteed to have a non-null context, just ditch the
check.

Change-Id: I23d3d1873a5008b5da8683b665df4bf7e9dd0def
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoShare common parts of AbstractNormalizedNodeBodyWriter 56/107856/3
Robert Varga [Wed, 13 Sep 2023 16:34:47 +0000 (18:34 +0200)]
Share common parts of AbstractNormalizedNodeBodyWriter

The two specializations are doing similar things, let's move them closer
together by sharing the common bits. This has a nice effect of reducing
JAX-RS exposure a tiny bit.

JIRA: NETCONF-1157
Change-Id: I4868a890d77f7a8863e85969f94bcb260cada6ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up XmlNormalizedNodeBodyWriter 55/107855/3
Robert Varga [Wed, 13 Sep 2023 16:28:22 +0000 (18:28 +0200)]
Clean up XmlNormalizedNodeBodyWriter

We are hunting down the actual state used from
InstanceIdentifierContext, this patch gets us a bit closer and it also
shows we have some oddities going on.

JIRA: NETCONF-1157
Change-Id: I0d623ddf11a00e93d45838ed9d316cee2eb9b715
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up JsonNormalizedNodeBodyWriter 54/107854/3
Robert Varga [Wed, 13 Sep 2023 16:08:56 +0000 (18:08 +0200)]
Clean up JsonNormalizedNodeBodyWriter

We are hunting down the actual state used from
InstanceIdentifierContext, this patch gets us a bit closer and it also
shows we have some oddities going on.

JIRA: NETCONF-1157
Change-Id: I2754cdf7396a16fffc5bc0aedb266bec019c28cd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix JsonPatchBody javadoc warnings 59/107859/1
Robert Varga [Wed, 13 Sep 2023 19:07:31 +0000 (21:07 +0200)]
Fix JsonPatchBody javadoc warnings

We are using javadoc for private methods. That is wasteful, as the only
real information is a single sentence. Turn that into an ordinary
comment.

Change-Id: I8bb9b0b41c3bb1e782887cb781bf16d2b85618e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove InstanceIdentifierContext from PatchBody parsing 53/107853/1
Robert Varga [Wed, 13 Sep 2023 14:18:50 +0000 (16:18 +0200)]
Remove InstanceIdentifierContext from PatchBody parsing

We only need the path encoded from URL and the EffectiveModelContext.
This also splits the parsing and dispatch to simplifying the code flow.

JIRA: NETCONF-1157
Change-Id: I57be40b5f42da169215987f6ffa29395600e2283
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMove InstanceIdentifierContext 52/107852/1
Robert Varga [Wed, 13 Sep 2023 12:21:19 +0000 (14:21 +0200)]
Move InstanceIdentifierContext

This is a legacy container, move it to restconf-nb, which is the only
place where it is being used.

JIRA: NETCONF-1157
Change-Id: I5d3690c598b860ea200437801ac00d715b8e8288
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoDisconnect PatchStatusContext from InstanceIdentifierContext 45/107845/4
Robert Varga [Tue, 12 Sep 2023 21:24:17 +0000 (23:24 +0200)]
Disconnect PatchStatusContext from InstanceIdentifierContext

All we need here is a reference to EffectiveModeContext, but later we
should be getting a DatabindContext.

Also highlight an encoding problem, where we are doing the wrong thing
based on YangInstanceIdentitier.toString().

JIRA: NETCONF-1157
Change-Id: I7213e3e02765822824d01139f4fbd590bc5f0e60
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMigrate Collections references 42/107842/3
Robert Varga [Tue, 12 Sep 2023 18:08:49 +0000 (20:08 +0200)]
Migrate Collections references

Use List.of() instead of Collections. Also be smarter about treating
arrays.

Change-Id: I1674e00e4003587b176df939e250ea81d802453d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoImprove NetconfDataTreeService documentation 41/107841/2
Robert Varga [Tue, 12 Sep 2023 17:35:40 +0000 (19:35 +0200)]
Improve NetconfDataTreeService documentation

Remove XML escapes and spring {@code} elements.

Change-Id: I37f8a7b84bf9668feb56e9ea86d4452d7f7cfe83
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoAdd description to POST requests 67/107467/8
lubos-cicut [Tue, 22 Aug 2023 05:32:19 +0000 (07:32 +0200)]
Add description to POST requests

Add description to POST request (paths/…/post/description)
that states that user in example payload sees only the first
data node child of the resource to be created and that
this is in accordance with RFC 8040 which allows us to
create only one resource in POST request.

JIRA: NETCONF-1137
Change-Id: I8549cf860deb5e069a017c9e7247c0bce311e588
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoOpenApi: Remove incorrect list POST requests 86/107086/20
Yaroslav Lastivka [Wed, 26 Jul 2023 15:18:03 +0000 (18:18 +0300)]
OpenApi: Remove incorrect list POST requests

Our logic creates POST requests for lists with keys, containing
multiple resources in payload. This does not align with the expected
structure for creating child resources in the YANG model.

Added condition that prevents the creation of POST requests
that has list as a last element.

JIRA: NETCONF-1101
Change-Id: I46820f222c9c5ef8078ac8675d2adc12b06f1253
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoRefactor OpenApiTestUtils methods 35/107835/3
Ivan Hrasko [Tue, 12 Sep 2023 13:22:15 +0000 (15:22 +0200)]
Refactor OpenApiTestUtils methods

Change getPathParameters into getPathGetParameters and add
getPathPostParameters.

We assume that all paths present in OpenApi should have at least
GET example in the documentation.

Thus we can use GET operation as a base operation to get number of
parameters in path. We just need to drop 'content' parameter.

For actions and RPCs we can use getPathPostParameters method.

JIRA: NETCONF-1101
Change-Id: I2a0a24a5a567d7dd95b7adf6ec13dddb391fab51
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
9 months agoSkip structural nodes 83/107783/5
Robert Varga [Sun, 10 Sep 2023 15:37:24 +0000 (17:37 +0200)]
Skip structural nodes

We cannot just examine the content being changed, as this could lead
to us trying to report the entire MapNode disappearing -- which does not
have a instance-identifier representation.

JIRA: NETCONF-1152
Change-Id: Ie209b61a0ccd60b07c58ebb11edc518021c80092
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoImprove RestconfStrategy API surface 38/107838/4
Robert Varga [Tue, 12 Sep 2023 15:09:10 +0000 (17:09 +0200)]
Improve RestconfStrategy API surface

We have a number of methods which are only used internally, which formed
our (ugly) API surface. Hide them so we are free to evolve them.

Change-Id: I219d90e5f709c59e98739a73971a577f14659e9f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUse NormalizedNodeStreamWriter to emit XML data 53/107753/12
Robert Varga [Thu, 7 Sep 2023 11:59:11 +0000 (13:59 +0200)]
Use NormalizedNodeStreamWriter to emit XML data

We are already instantiating NormalizedNode-based writer, which means we
get help in terms for formatting things. This is especially true of
identityrefs and instance-identifiers, where the XML codec does
absolutely the right thing.

This also allows us to ditch namespace repairing from our
XMLWriterFactory, so we are in explicit control of our namespaces.

JIRA: NETCONF-1152
Change-Id: I030d25a8e0b23a78b6c6e952b36395bd461b4c70
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoUse NormalizedNodeStreamWriter to emit JSON data 49/107749/11
Robert Varga [Wed, 6 Sep 2023 23:35:20 +0000 (01:35 +0200)]
Use NormalizedNodeStreamWriter to emit JSON data

We are already instantiating NormalizedNode-based writer, which means we
get help in terms for formatting things.

JIRA: NETCONF-1152
Change-Id: Ie076ba571887c70a94cdd1baf7ea5e1ec6d8e91f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate (ReadData)TransactionUtil 32/107832/3
Robert Varga [Tue, 12 Sep 2023 11:30:22 +0000 (13:30 +0200)]
Eliminate (ReadData)TransactionUtil

Integrate these utilities directly into RestconfStrategy.

JIRA: NETCONF-1107
Change-Id: Ic0ff3bcc2a7df03c7aa9faf0ac6e94c5b7ef7e96
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoCross-relate WithDefaultsParam 27/107827/8
Robert Varga [Tue, 12 Sep 2023 02:52:07 +0000 (04:52 +0200)]
Cross-relate WithDefaultsParam

RFC6243 defines with-defaults-mode typedef, tie it together with
WithDefaultsParam. This improves interoperability with NETCONF.

JIRA: NETCONF-1107
Change-Id: Ia4823f60dcb5d8fc240b3c028a892f9bbe59fa43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoInline readAllData() 26/107826/4
Robert Varga [Tue, 12 Sep 2023 02:19:16 +0000 (04:19 +0200)]
Inline readAllData()

The two methods have simpler callers, remove an indirection by inlining
the code in the corresponding lambda.

JIRA: NETCONF-1107
Change-Id: Ic177e3d9016f3ed2dfc8edf880bad69c87695f80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRemove extractReadData() 15/107815/4
Robert Varga [Tue, 12 Sep 2023 02:11:32 +0000 (04:11 +0200)]
Remove extractReadData()

This utility function is tempting, but inlining will allow us to take on
the transaction callers separetely.

JIRA: NETCONF-1107
Change-Id: Idbf697bf1c4a641e8683c207dd22e710d31fc524
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate PatchDataTransactionUtil 08/107808/4
Robert Varga [Tue, 12 Sep 2023 01:27:34 +0000 (03:27 +0200)]
Eliminate PatchDataTransactionUtil

This class is hosting a single method, which is strongly related to
RestconfStrategy.

JIRA: NETCONF-1107
Change-Id: I15b32b055a9be8787d32be5ede12e1d40a539a94
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRehost PatchDataTransactionUtil logging 07/107807/6
Robert Varga [Tue, 12 Sep 2023 01:07:29 +0000 (03:07 +0200)]
Rehost PatchDataTransactionUtil logging

We have simple wrappers that just log stuff and forward execution to
RestconfTransaction. Rehost these to final RestconfTransaction methods,
so we have greater traceability coverage.

JIRA: NETCONF-1107
Change-Id: I6548860a1d90daf06e5eb9077f803a4aae23fa91
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up PatchDataTransactionUtil 06/107806/2
Robert Varga [Tue, 12 Sep 2023 00:40:55 +0000 (02:40 +0200)]
Clean up PatchDataTransactionUtil

Clean up code dispatch to simplify rehosting these utilities.

JIRA: NETCONF-1107
Change-Id: I2f3ad941c34ab97f09abe91e398fd02a4b757389
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoHide RestconfTransaction.readList() 05/107805/1
Robert Varga [Tue, 12 Sep 2023 00:50:00 +0000 (02:50 +0200)]
Hide RestconfTransaction.readList()

We have completed migration of utility methods which refer to this tiny
bit. Hide it from outside world, as it is an implementation detail.

JIRA: NETCONF-1107
Change-Id: Id6f3f3ccb8645af43e71662daf3975e5deb30062
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRefactor WriteDataParams 04/107804/2
Robert Varga [Mon, 11 Sep 2023 23:41:33 +0000 (01:41 +0200)]
Refactor WriteDataParams

The empty holder is useless, as we can model the same thing with a
@Nullable parameter.

Rename WriteDataParams to Insert and make it nullable. This improves
dispatch in users and will allow us to further remodel this contract.

Change-Id: I33d4af49789cb2371170fc6489787b2e3b987fd9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoOptimize RestconfStrategy.postData() 03/107803/1
Robert Varga [Mon, 11 Sep 2023 23:03:48 +0000 (01:03 +0200)]
Optimize RestconfStrategy.postData()

The implementation is now tightly bound to a RestconfStrategy, which
allows us to check invariants before we embark on modifying the
datastore.

JIRA: NETCONF-1126
Change-Id: Iec2bec456e248a2d557ed6190719043226dfade2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoClean up documentation 02/107802/1
Robert Varga [Mon, 11 Sep 2023 22:39:30 +0000 (00:39 +0200)]
Clean up documentation

Do not reference DOMTransactionChain, we are not using it.

Change-Id: I3151a30bf1f7dd02cc66ffab157537e9cf2af5fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate PostDataTransactionUtil 01/107801/3
Robert Varga [Mon, 11 Sep 2023 22:22:13 +0000 (00:22 +0200)]
Eliminate PostDataTransactionUtil

These utilities are tightly coupled to RestconfStrategy, rehost them
there.

JIRA: NETCONF-1126
Change-Id: Ifacc3efa84c4dc91fdde181abe66c54291883941
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoRestructure putData() implementation 00/107800/3
Robert Varga [Mon, 11 Sep 2023 21:53:40 +0000 (23:53 +0200)]
Restructure putData() implementation

Our new how in RestconfStrategy allows us to restructure how we go about
executing this operation. The new layout checks the paramteres before
allocating a transaction and nicely differentiates the two distinct code
paths based on insert parameter.

JIRA: NETCONF-1125
Change-Id: I20bc640b0d14f24f508f664703cd1d85d21a50cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoEliminate PutDataTransactionUtil 99/107799/2
Robert Varga [Mon, 11 Sep 2023 21:18:38 +0000 (23:18 +0200)]
Eliminate PutDataTransactionUtil

The implementation here is inherently tied to RestconfStrategy. Rehost
methods to RestconfStrategy and PostDataTransactionUtil (for now).

JIRA: NETCONF-1125
Change-Id: I45ce8428ff08324bf2e97de6bde9e6f5ea896bb8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoMove CreateOrReplaceResult 97/107797/1
Robert Varga [Mon, 11 Sep 2023 19:38:35 +0000 (21:38 +0200)]
Move CreateOrReplaceResult

This is the result of a create-or-replace operation, which we will be
introducing in RestconfStrategy. Move the class there for co-location.

JIRA: NETCONF-1125
Change-Id: Id26574e2b567c769e54737316f8bd840cc4767af
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoSwitch netconf-server to transport-api 88/106788/14
Ruslan Kashapov [Mon, 3 Jul 2023 14:10:19 +0000 (17:10 +0300)]
Switch netconf-server to transport-api

New transport implementation makes NetconfServerDispatcher outdated.
NetconfServerFactory interface and implementation introduced
as replacement. Netconf subsystem factory added to serve netconf
over ssh.

JIRA: NETCONF-1106
Change-Id: Id74cf3511c1129710b231869c089b4339333d7e8
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoFix postData() definition 87/107787/1
Robert Varga [Mon, 11 Sep 2023 12:27:20 +0000 (14:27 +0200)]
Fix postData() definition

The version which posts to top-level of datastore should not take an
identifier. Fix that, preventing an error.

JIRA: NETCONF-1128
Change-Id: I6623c74bf58bfb507b7aabe094128113c62aded4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 months agoCapture ListenersBroker instances 82/107782/2
Robert Varga [Sun, 10 Sep 2023 14:21:08 +0000 (16:21 +0200)]
Capture ListenersBroker instances

Rather than having random code call out to
ListenersBroker.getInstance(), make sure we get the reference in outer
scope, mostly in a field.

JIRA: NETCONF-1104
Change-Id: I88b61e53ee36567d52fe297841e6910dea13d2ee
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>