netconf.git
9 days agoUse a switch expression with DataPostResult 96/113496/2
Robert Varga [Tue, 10 Sep 2024 14:14:58 +0000 (16:14 +0200)]
Use a switch expression with DataPostResult

We have a sealed hierarchy, hence using a switch expression is
exhaustive and we can eliminate an impossible case. The same thing
applies to both RESTCONF endpoints.

Change-Id: Ia06223bbccb7fda2a33c67cc129c04cd1cc4a335
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
9 days agoUse OPTIONS * for upgrade 75/113475/2
Robert Varga [Mon, 9 Sep 2024 15:09:50 +0000 (17:09 +0200)]
Use OPTIONS * for upgrade

GET / is a resource operation, which may result a ton of data, be
subject to access control, or actually be unimplemented.

Use OPTIONS *, which is well-documented to be a 'no-op' kind of HTTP
request.

Change-Id: I9e112ffa1817d09b77109171a3a221ed34c9bf6b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoAdvertize "defaults" RESTCONF capability 74/113474/3
Robert Varga [Mon, 9 Sep 2024 14:21:13 +0000 (16:21 +0200)]
Advertize "defaults" RESTCONF capability

Advertizement of "defaults" RESTCONF capability is mandatory, yet we do
not do that.

Advertize it with basic-mode=explicit, which most closely matches the
semantics of the MD-SAL datastore.

JIRA: NETCONF-1380
Change-Id: I48577e606383fc7413a3cd2e95a5c8cbb52fb49f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDo not use karaf-services-maven-plugin 94/113494/1
Robert Varga [Tue, 10 Sep 2024 11:31:26 +0000 (13:31 +0200)]
Do not use karaf-services-maven-plugin

We are not really using services -- just publishing Karaf commands.

Add the MANIFEST header and ditch use of karaf-services-maven-plugin --
fixing a build-time warnings and eliminating the unnecessary code it
packages in the bundle.

Change-Id: Ia9dc9cf8f837ac77f0f9998a2943dc1bd73f5712
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoFix truststore-api dependencies 93/113493/1
Robert Varga [Tue, 10 Sep 2024 11:24:05 +0000 (13:24 +0200)]
Fix truststore-api dependencies

We are using nullness annotations, declare them to fix a warning.

Change-Id: I6ed2b81420fecb2023038b773cfaf3db2683ece8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoFix dependency issues in keystore/* 92/113492/1
Robert Varga [Tue, 10 Sep 2024 11:23:11 +0000 (13:23 +0200)]
Fix dependency issues in keystore/*

We have two dependency issues reported here, fix them up.

Change-Id: I9bdcc0ae7c7ca4289276e2d445ea6b34e20877bc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoFix create-notification-stream implementation 87/113487/2
Robert Varga [Mon, 9 Sep 2024 23:13:17 +0000 (01:13 +0200)]
Fix create-notification-stream implementation

We have a mismatch in the output leaf name, as sal-remote.yang has a
day-0 modeling bug: what was supposed to be 'stream-name' is named
'notification-stream-identifier' instead.

Fix the implementation to use the correct container.

JIRA: NETCONF-1295
Change-Id: I9ea3d4b3bb6c70b4c087e597f67456a9a095f789
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoEliminate ResponseUtils.allowHeaderValue() 60/113460/4
Robert Varga [Sat, 7 Sep 2024 20:46:20 +0000 (22:46 +0200)]
Eliminate ResponseUtils.allowHeaderValue()

This creates a static string, from a set of methods. Rather than
performing magic, let's use hand-crafted equivalents.

Also do not share these strings with tests, but rather have tests assert
them separately.

JIRA: NETCONF-1379
Change-Id: Id241430ac633f3bb8c1166dea3e65c34c9266975
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoEliminate restconf.server.Method 59/113459/4
Robert Varga [Sat, 7 Sep 2024 20:33:05 +0000 (22:33 +0200)]
Eliminate restconf.server.Method

This enum might look like it is useful until, but it really is not: we
can equally well use HttpMethod and switch on HttpMethod.name().

JIRA: NETCONF-1379
Change-Id: I30db6a5dca57270f9a774298906d10a327816c3a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoSplit out WellKnownResources 57/113457/12
Robert Varga [Sat, 7 Sep 2024 11:28:57 +0000 (13:28 +0200)]
Split out WellKnownResources

Well-known resources are extremely simple to service, as they take only
a few inputs and produce an immediate response.

Split them out into their own class and execute them immediately from
RestconfSession. This allows us to report '501 Not Implemented' for
unimplemented methods, along with 'Allow' header hinting at what is
implemented.

JIRA: NETCONF-1379
Change-Id: I91af1aee99e2ffb2bf05d6833d64dd8471a40765
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoTake ownership of request message 49/113449/7
Robert Varga [Fri, 6 Sep 2024 08:39:24 +0000 (10:39 +0200)]
Take ownership of request message

We have asynchronous processing here, hence
SimpleChannelInboundHandler's defaults are working against us.

Switch off autoRelease, hence we do not need to issue retain().

JIRA: NETCONF-1379
Change-Id: If4d86111c97122638f17bed52805468d2c3de240
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoExpose ServerSseHandler 43/113443/9
Robert Varga [Thu, 5 Sep 2024 15:33:35 +0000 (17:33 +0200)]
Expose ServerSseHandler

Rather than hiding this handler behind a simple SseUtils method, expose
it to the outside world, so it can be used directly by NettyRestconf's
initialization code.

JIRA: NETCONF-1379
Change-Id: Ia3d2a19525115323b7d613053f561dd169a1c760
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
10 days agoDisconnect HTTPServer from RequestDispatcher 36/113436/18
Robert Varga [Wed, 4 Sep 2024 23:52:57 +0000 (01:52 +0200)]
Disconnect HTTPServer from RequestDispatcher

RequestDispatcher is useless layering violation sitting between Netty
pipeline and RESTCONF protocol implementation.

Do not use RequestDispatcher in HTTPServer and instead use
onTransportChannelEstablished() to wire a RestconfSession into the
pipeline.

This means we have centralized protocol-level initialization at the
correct layer and a proper class interfacing between a particular Netty
channel and the RestconfServer.

RestconfRequestDispatcher now becomes a private implementation detail,
acting as a the common router between RestconfSession and
RestconfServer (et al.).

A follow-up patch will deal with exposing RestconfSession from
NettyServerRequest.

JIRA: NETCONF-1379
Change-Id: Ie24e440dbf24a850428902076175fb569981d0d9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoRename CreateNotificationStreamRpcTest 84/113484/1
Robert Varga [Mon, 9 Sep 2024 22:24:17 +0000 (00:24 +0200)]
Rename CreateNotificationStreamRpcTest

This is really testing CreateDataChangeEventSubscriptionRpc, rename it
accordingly.

Change-Id: Icb0a151c8d2d9b2c5397f5426529a170638e178a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoClean up CreateNotificationStreamRpc 83/113483/1
Robert Varga [Mon, 9 Sep 2024 22:19:53 +0000 (00:19 +0200)]
Clean up CreateNotificationStreamRpc

Use CreateNotificationStreamOutput instead of
CreateDataChangeEventSubscriptionOutput, just for consistency's sake.

Change-Id: Ia5f4734a2763848592a16bb407f1898a3f272014
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoFix ietf-restconf.yang reference 80/113480/2
Robert Varga [Mon, 9 Sep 2024 15:50:12 +0000 (17:50 +0200)]
Fix ietf-restconf.yang reference

We have a typo in Javadoc, fix that.

Change-Id: I464c854bda2e5a11b986d85979775e234050996f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoAdvertize :yang-patch capability 73/113473/2
Robert Varga [Mon, 9 Sep 2024 13:32:11 +0000 (15:32 +0200)]
Advertize :yang-patch capability

We support yang-patch media type, hence we should be advertizing that
capability.

JIRA: NETCONF-1365
Change-Id: I0aec76d5e1558b1116d72e8ba60ead34e3b46e75
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoDeprecate capabilityUri() methods 72/113472/2
Robert Varga [Mon, 9 Sep 2024 13:29:25 +0000 (15:29 +0200)]
Deprecate capabilityUri() methods

We have the capability strings centralized in CapabilityURI class, hence
we do not need them in individual parameters. Deprecate them for
removal.

Change-Id: I4ec07a2109ed3967079e140a02c1f92c6f2fd453
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoAdd restconf.api.CapabilityURN 71/113471/3
Robert Varga [Mon, 9 Sep 2024 13:01:18 +0000 (15:01 +0200)]
Add restconf.api.CapabilityURN

We are missing a few key capabilities, simply because we are exposing
only capabilities tied to query parameters.

This patch adds restconf.api.CapabilityURN with current contents of the
corresponding IANA registry, along with ODL-specific capabilities --
mirroring what we have in netconf.api.CapabilityURN.

Change-Id: I418feb6784c732b14f9e2b1c2c91dcfec87699ec
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoFactor out RestconfTransportChannelListener 35/113435/10
Robert Varga [Wed, 4 Sep 2024 22:51:11 +0000 (00:51 +0200)]
Factor out RestconfTransportChannelListener

Pipeline initialization for transport channels sits in an anonymous
class, make it non-obvious as to what its actual role should be.

Split it out into RestconfTransportChannelListener, making it
independent of NettyEndpoint.

JIRA: NETCONF-1379
Change-Id: Ia1a45dfa957f737923aca5e0da3b99004fe727c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
11 days agoFixup restconf-server-mdsal module definition 70/113470/1
Robert Varga [Mon, 9 Sep 2024 13:04:53 +0000 (15:04 +0200)]
Fixup restconf-server-mdsal module definition

We require the ietf-restconf-monitoring module, make sure we advertize
that.

Change-Id: I6c3dd01c14ba92001bbcd59d2f68e9f6bcff8cd5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix host meta template constants 53/113453/1
Robert Varga [Fri, 6 Sep 2024 12:55:14 +0000 (14:55 +0200)]
Fix host meta template constants

The strings should be proper constants, so they can be inlined.

Change-Id: I7ab918b7f7863c70d6f8bb6f286bd2a5934af5c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRefactor HTTPServer pipeline initialization 39/113439/4
Robert Varga [Thu, 5 Sep 2024 12:48:36 +0000 (14:48 +0200)]
Refactor HTTPServer pipeline initialization

The pipeline should be initialized immediately when the channel is
brought up, so that we do not require additional client-side operations
before it is visible the the server side.

This necessitates smarter operations on the pipeline, so that we keep
RequestDispatcher at the last position.

Change-Id: If0f0b0456407ab2b6457c1a34565c87f61c433d5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix heartbeat overflow 34/113434/4
Robert Varga [Wed, 4 Sep 2024 22:24:43 +0000 (00:24 +0200)]
Fix heartbeat overflow

sseHeartbeatIntervalMillis is an Uint32, hence it is wrong to assume its
value can safely fit in an int.

Use .toJava() instead, which returns a proper long, exposing the fact
that ServerSseHandler is using the wrong type.

Change-Id: I309bc441c56d1052c3ea013dd8e33db4c80490cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up OSGINorthbound.newNettyEndpointProps() 32/113432/5
Robert Varga [Wed, 4 Sep 2024 19:16:39 +0000 (21:16 +0200)]
Clean up OSGINorthbound.newNettyEndpointProps()

We have a magic check for URI scheme -- i.e. if we grow a different
transport, we might happily be using 'http' without ever realizing it.

Refactor logic to make it absolutely clear which cases we handle, so
that there can be no mistakes.

Also clean up obvious gaps in semantics of objects we create and add
FIXMEs/TODOs for follow-ups.

Change-Id: I5a5b812d137fc4d665cfa457a1df1d5bbe4968e6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse simple concatenation in SseUtils.chunkOf() 42/113442/2
Robert Varga [Thu, 5 Sep 2024 14:55:54 +0000 (16:55 +0200)]
Use simple concatenation in SseUtils.chunkOf()

Using a simple concatenation improves performance. It also eliminates
the need for @SuppressFBWarnings and making transport-http independent
of spotbugs-annotations.

Change-Id: I2ab11adc679f01b217b21ab847c3e3a96fbdc99b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoEnforce strict stubbing in transport-tcp 37/113437/1
Robert Varga [Thu, 5 Sep 2024 09:04:24 +0000 (11:04 +0200)]
Enforce strict stubbing in transport-tcp

Make sure our mocks are throughly stubbed by pulling in
mockito-configuration.

Change-Id: I2ee6f13fa9adeab187a24698ed313f9f733b733f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSeparate out Http2SettingsFilter 30/113430/1
Robert Varga [Wed, 4 Sep 2024 17:43:50 +0000 (19:43 +0200)]
Separate out Http2SettingsFilter

Http2Utils.clientSettingsHandler() is a stateless thing. Separate it out
into a dedicated class, which has a singleton instance shared across all
channels that need it.

Change-Id: I5136b43286c01ad6caa4a3ec11a814e239217dcd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoSplit up HTTPServer 29/113429/1
Robert Varga [Wed, 4 Sep 2024 17:27:48 +0000 (19:27 +0200)]
Split up HTTPServer

HTTPServer is either backed by TCP or TLS, each of which has a different
flow setup. Specialize the two so we do not need to muck around with
SslHandler.

Change-Id: I91563aad1c3c924a5cb63a47c76df8e706e11a1c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up HTTPTransportStack, part two 24/113424/3
Robert Varga [Wed, 4 Sep 2024 12:09:44 +0000 (14:09 +0200)]
Clean up HTTPTransportStack, part two

Eliminate HttpChannelInitializer, as both implementations can easily be
integrated into HTTP{Client,Server}.

This also eliminates needless juggling of channel pipeline, as the
channel is always functional by the time we are initializing.

Change-Id: I228de5c6e5bbb301b2984c62a465900e3ecb3a22
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up HTTPTransportStack, part one 23/113423/2
Robert Varga [Wed, 4 Sep 2024 11:30:25 +0000 (13:30 +0200)]
Clean up HTTPTransportStack, part one

A number of cleanups:
- channelInitializer should be private
- naming should be consistent
- superfluous annotations should not be present

Change-Id: I2843f9967ad85c30df366cbc81adc5dcbbb1f89d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoExpose {SSH,TLS}TransportChannel 26/113426/1
Robert Varga [Wed, 4 Sep 2024 13:00:43 +0000 (15:00 +0200)]
Expose {SSH,TLS}TransportChannel

Knowing the identity of underlying TransportChannel is needed to
accurately report their type. Expose the two implementations, as
{TCP,HTTP}TransportChannel are already exposed.

Change-Id: Iaaca2b92b1df9bedbb278f8c0f0e9d48c617e3d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoClean up HTTPTransportChannel 22/113422/1
Robert Varga [Wed, 4 Sep 2024 11:29:33 +0000 (13:29 +0200)]
Clean up HTTPTransportChannel

This class should be final and should only be instantiated from the same
package.

Change-Id: I3261f983b8db52b5405f31b41a3adb69e4c352d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoUse enhanced switch for transport dispatch 19/113419/1
Robert Varga [Wed, 4 Sep 2024 09:13:02 +0000 (11:13 +0200)]
Use enhanced switch for transport dispatch

We have two supported possibilities, use a switch to discern them.

Change-Id: Ica6c7529aad0366caf8c413bc58a5ddc63481e5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoOpenAPI: add metadata endpoint 52/111452/35
lubos-cicut [Thu, 8 Aug 2024 08:57:25 +0000 (10:57 +0200)]
OpenAPI: add metadata endpoint

Added endpoints for pagination metadata.

/single/meta(?offset=0&limit=5)
/mounts/{instance}/meta(?offset=0&limit=5)

Created MetadataStream and MetadataEntity to provide metadata
which would be valuable for end users.

JIRA: NETCONF-1344
Change-Id: I14e476ac4266e48953e9faaca80782fa891d03d3
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
2 weeks agoBump versions to 8.0.2-SNAPSHOT 01/113401/1
Robert Varga [Tue, 3 Sep 2024 17:56:36 +0000 (19:56 +0200)]
Bump versions to 8.0.2-SNAPSHOT

This starts the next development iteration.

Change-Id: Ie0a8f46a47852bb05891a6ff422feb7360a110e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRelease netconf v8.0.1
jenkins-releng [Tue, 3 Sep 2024 16:36:25 +0000 (16:36 +0000)]
Release netconf

2 weeks agoBump upstreams 92/113392/1
Robert Varga [Tue, 3 Sep 2024 12:35:08 +0000 (14:35 +0200)]
Bump upstreams

Adopt:
- odlparent-14.0.3
- infrautils-7.0.3
- yangtools-14.0.4
- mdsal-14.0.2
- controller-10.0.2
- aaa-0.20.1

Change-Id: I035b5e0002f01a54b0ec6971c33aa021aa757ee4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoFix superfluous nullness annoutations 85/113385/2
Robert Varga [Tue, 3 Sep 2024 08:29:06 +0000 (10:29 +0200)]
Fix superfluous nullness annoutations

We have @NonNullByDefault -- there's no point in @NonNulls.

JIRA: NETCONF-1366
Change-Id: Ib579eddd14dba2ab2f05fdfac61fcb224730a4e2
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdd missing return 84/113384/2
Robert Varga [Tue, 3 Sep 2024 08:26:10 +0000 (10:26 +0200)]
Add missing return

We should not be invoking callbacks twice -- make sure to return.

JIRA: NETCONF-1366
Change-Id: If7d5e4c2791187e23b13ae0270e98a44faba5746
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoAdvertize :interleave capability 83/113383/2
Robert Varga [Tue, 3 Sep 2024 08:13:08 +0000 (10:13 +0200)]
Advertize :interleave capability

We support interleave, i.e. concurrent use of RPCs and notifications.
Advertize this fact.

JIRA: NETCONF-1374
Change-Id: I9028814398a8355d8f4a970ab5e7731d7983d78b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoRevert "Check for netconf interleave capability" 82/113382/2
Robert Varga [Tue, 3 Sep 2024 07:23:30 +0000 (09:23 +0200)]
Revert "Check for netconf interleave capability"

This reverts commit c2cfd0608b41775f9e71904de14b453ad9d2ca59, as it does
not present a complete solution.

JIRA: NETCONF-1375
Change-Id: If7052257472a72f44f0e39401e630c691f13c64c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
2 weeks agoDo not copy constant bytebufs 23/113323/2
Robert Varga [Thu, 29 Aug 2024 08:08:25 +0000 (10:08 +0200)]
Do not copy constant bytebufs

Three things:
- use plain byte[] to make it clear we are using US_ASCII
- ensure the constant is a read-only buffer
- use .retainedSlice() instead of .copy()

JIRA: NETCONF-1366
Change-Id: I08c56ccdbe47db1e2e07e4bbf20607c9ab678681
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoConvert restconf-server to bnd-parent 20/113320/4
Robert Varga [Thu, 29 Aug 2024 03:54:28 +0000 (05:54 +0200)]
Convert restconf-server to bnd-parent

This is a simple artifact, make sure we use bnd-parent substrate to keep
it modern.

JIRA: NETCONF-873
Change-Id: Iadf313ec6affc426dd8270a9dff8ec04ffaaa401
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoFix Date import slopiness 21/113321/3
Robert Varga [Thu, 29 Aug 2024 04:21:03 +0000 (06:21 +0200)]
Fix Date import slopiness

We are using java.util.Date, not java.sql.Date.

JIRA: NETCONF-873
Change-Id: I793da328fcd4625a39db640f18ba4d1cb5afb028
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoClean up restconf-server dependencies 19/113319/3
Robert Varga [Thu, 29 Aug 2024 03:53:18 +0000 (05:53 +0200)]
Clean up restconf-server dependencies

We have a ton of unused dependencies here, clean them up.

JIRA: NETCONF-873
Change-Id: Ic602b052ba9cb68ee851942fa73d667c29186234
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoRevert "Fix jira link" 29/113329/1
Robert Varga [Fri, 30 Aug 2024 06:09:53 +0000 (08:09 +0200)]
Revert "Fix jira link"

This reverts commit c5f2790eed5c7989d74191e0b2b92474c897849c, as the
underlying problem has been resolved.

Change-Id: I9c6511645057adf3e35ac0da738821f064d4fb7d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoSplit out JavaCommonCounters 93/113093/13
Robert Varga [Sun, 11 Aug 2024 07:45:27 +0000 (09:45 +0200)]
Split out JavaCommonCounters

We are maintaining a native view of CommonCounters, which are defined to
be wrapping unsigned 32bit counters.

Our intermal use does not correctly truncate these, as the original code
got confused by 'Long' representing 'uint32' in Binding long time ago.

There is no need to store these counters in long form -- we can convert
that on demand via a newly-introduced JavaCommonCounters -- which extend
CommonCounters, i.e. the Binding interface generated for the grouping.

Add two implementations, mutable and immutable, and expose the ability
to increment as MutableJavaCommonCounters.

This allows us to to expose the read-only view from NetconfServerSession
without giving users access to directly modify them -- making the class
more convenient.

One side effect of us implementing CommonCounters is that we can use
SessionBuilder(CommonCounters) constructor, which performs an automatic
initialization to current state.

Change-Id: I9287fb1a8d552f236f649c84cfefdf9433c09a5b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoDerive SourceHost from Channel.remoteAddress() 92/113092/10
Robert Varga [Sun, 11 Aug 2024 04:35:10 +0000 (06:35 +0200)]
Derive SourceHost from Channel.remoteAddress()

This removes reliance on hello backchannel for source host information.
It ends up removing a chunk of code.

Change-Id: I7c2897ce3b506af7fdc19123de5e94b0e8f22959
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoDeprecate NetconfHelloMessageAdditionalHeader 90/113090/11
Robert Varga [Sun, 11 Aug 2024 02:17:38 +0000 (04:17 +0200)]
Deprecate NetconfHelloMessageAdditionalHeader

This class should not exist, but getting rid of it requires us to do
quite some work, which in turn has impacts in netconf-{codec,netty-util}
and perhaps somewhere else as well.

Deprecate this class for removal to drive its replacements. Also provide
a lot of FIXMEs explaining the various changes to
netconf-{api,codec,client,server} that need to happen to solidify the
pipeline layout, the fool-proof the end user APIs and provide reliable
operation.

Change-Id: I8ec055dc6f032df3171cd0dddc78f33498956fde
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoRefactor ThreadLocalTransformers 95/113095/9
Robert Varga [Sun, 11 Aug 2024 08:59:55 +0000 (10:59 +0200)]
Refactor ThreadLocalTransformers

Rather than being a plain holder class with duplicated code for each
constant, rename the class ThreadLocalTransformer so that it extends
ThreadLocal<Transformer>, being abstract and requiring instances to
provide configure() method.

The instances themselves have a nice place in MessageWriter, as that
is where they are used.

Since we have a dedicated class and constants, these replace the boolean
-- instead we store the reference to the ThreadLocalTransformer instance
which produces corresponding transformers.

The equivalent of getters is provided by ThreadLocalTransformer.get(),
i.e. getPrettyTransformer() becomes PRETTY_TRANSFORMER.get() without any
intermediates.

Since we are in the area, let's not access the thread local immediately
-- expose threadLocalTransformer(), which just does ThreadLocal.get(),
so that subclasses defer access to when they actually need it.

Change-Id: I3e641e2f8fd3406052e04e15af9a6a74247d9777
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoMove {Hello,XML}XMLMessageWriter 94/113094/6
Robert Varga [Sun, 11 Aug 2024 08:27:12 +0000 (10:27 +0200)]
Move {Hello,XML}XMLMessageWriter

XMLMessageWriter is a well-defined writer, independent of anything else
in netconf.nettyutil. Move it to netconf.codec, whence it can be freely
used without bringing in nettyutil baggage.

Change-Id: Id2d2ed69db2b01d053b723df41d0a99c392aa06b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoRefactor delayed MessageWriter replacement 89/113089/4
Robert Varga [Sat, 10 Aug 2024 20:10:38 +0000 (22:10 +0200)]
Refactor delayed MessageWriter replacement

AbstractNetconfSession has a Runnable extension to allow for replacing
the MessageWriter after the next message is processed.

This is really related to DefaultStartExi, which is driving this change
-- but the change can only happen *after* the RPC response is encoded
using current writer.

Make this transition more explicit by moving the mechanics to
MessageEncoder.

This improves message send, as we do not need to hook to every write
just to update it. It also makes it more accurate: the writer needs to
be switched just after the message is *encoded*, not when is written to
wire.

Change-Id: I992e8f0ea11bf5507dbed966cea1fe608ccb6f04
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoRefactor FrameEncoder 83/113083/6
Robert Varga [Sat, 10 Aug 2024 01:11:10 +0000 (03:11 +0200)]
Refactor FrameEncoder

We have MessageEncoder and FrameEncoder working in tandem in the
pipeline. While this is fine and dandy from design perspective, it
leaves a bit left to be desired.

The problem is that we end up buffering the raw content of the message
into one ByteBuf (in MessageEncoder) and then copy it to another ByteBuf
(in FrameEncoder).

This is wasteful for FramingMechanism.EOM, which just wants to write the
message out and then append a fre more bytes.

Refactor FrameEncoder into FramingSupport class, which exposes a
writeMessage(), which takes a MessageWriter and a NetconfMessage and
encodes/frames it according to its rules as an atomic operation.

This removes double buffering from EOM framing, but keeps things as they
are for CHUNK framing -- with a note to improve it later.

Change-Id: Ied01af2d6dd106a8d2b98198bde911a5ea09ae08
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoSplit MessageEncoder up 88/113088/10
Robert Varga [Sat, 10 Aug 2024 13:40:08 +0000 (15:40 +0200)]
Split MessageEncoder up

MessageEncoder has currently two functions:
- it receives a NetconfMessage from the pipeline
- it encodes it into a ByteBuf
- it passes the ByteBuf down the pipeline

Refactor MessageEncoder.encodeTo() to a separate class, MessageWriter,
which handles the details of how to write a NetconfMessage into an
OutputStream.

This makes MessageEncoder a final class, which has the notion of which
MessageWriter it is currently using -- and that can be switched from the
pipeline context.

This completely eliminates the need for modifying the pipeline when
switch XML/EXI and provides for nice integration surface for further
consolidation.

This entire exercise means we have only four objects dealing with
default XML encoding -- be it pretty-printing or otherwise.

Change-Id: I8bb4e75465da26e655226c5c83853adc9c47b670
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoImprove OpenAPI parameters validation 27/113027/10
Matej Sramcik [Wed, 7 Aug 2024 10:16:07 +0000 (12:16 +0200)]
Improve OpenAPI parameters validation

Check nullability of width, depth, offset and limit at beginning
and pass them further like int instead of Integer.

JIRA: NETCONF-1346
Change-Id: I22388eff543d25b404736d45c2ca554a61e0b497
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
3 weeks agoFix YangErrorsBody propagation 61/113261/3
Robert Varga [Mon, 26 Aug 2024 22:04:28 +0000 (00:04 +0200)]
Fix YangErrorsBody propagation

YangErrorsBody needs to be wrapped with JaxRsFormattableBody to
correctly match the writer, which needs pretty-print information.

JIRA: NETCONF-1369
Change-Id: Iefb4b58b63eacc571c0bb7b76b3d595903009408
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoFix jira link 48/113248/4
lubos-cicut [Mon, 26 Aug 2024 13:28:45 +0000 (15:28 +0200)]
Fix jira link

jira.opendaylight.org indirection does not work correctly, hence our tox
verify is broken. Fix it by explicitly linking to
lf-opendaylight.atlassian.net.

Change-Id: I98f0e60814f8699145d3dcb1aa4e566c3f438c96
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAcquire JAX-RS Principal eagerly 53/113253/2
Robert Varga [Mon, 26 Aug 2024 17:04:20 +0000 (19:04 +0200)]
Acquire JAX-RS Principal eagerly

SecurityContext's methods only work while we are executing in the JAX-RS
framework thread. This means we need to extract the principal (and any
permission-related info) before the request execution enters its
asynchronous phase.

Change-Id: If520a0bae478b92f9a03a5be143fdf8637980850
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoWrap YangPatchStatusBody with JaxRsFormattableBody 52/113252/1
Robert Varga [Mon, 26 Aug 2024 16:40:02 +0000 (18:40 +0200)]
Wrap YangPatchStatusBody with JaxRsFormattableBody

JAX-RS handling of FormattableBody requires use of JaxRsFormattableBody,
as we need the pretty-print parameter. Previous conversion has missed
the case of YANG patch.

JIRA: NETCONF-1368
Change-Id: I298ff44267a1716d5f4f2d1dd9d22de053bcf320
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
3 weeks agoAdapt user guide to Netty changes 70/113170/2
lubos-cicut [Wed, 21 Aug 2024 06:33:11 +0000 (08:33 +0200)]
Adapt user guide to Netty changes

Update netconf user guide to Netty based endpoint settings.

JIRA: NETCONF-1363
Change-Id: Id7c2712d37e3a7dad919e4acbfa1ae6876e30a43
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
3 weeks agoNetty based Restconf server 52/111752/61
Ruslan Kashapov [Mon, 11 Mar 2024 09:57:14 +0000 (10:57 +0100)]
Netty based Restconf server

- Init via restconf-nb OSGi service, TLS supported
- AAA Shiro integration for Basic Auth and Principal delivery
- SSE overlay adapter integrating RestconfStream.Registry
- Request dispatcher processing for restconf resource URIs
  plus /modules and resource discovery URIs
- error responses using restconf model

JIRA: NETCONF-873
Change-Id: I18b73302973631914f402997f0bf588b3bea7676
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Oleksandr Zharov <oleksandr.zharov@pantheon.tech>
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
3 weeks agoUse empty line as message separator in SSE stream 07/113107/3
Ruslan Kashapov [Tue, 13 Aug 2024 08:47:16 +0000 (11:47 +0300)]
Use empty line as message separator in SSE stream

The double end-line as a message separator wasn't clearly described
in a spec, so it was missed initially (NETCONF-1339).

The external clients like postman rely on this separator
and it makes it consistent with jaxrs implementation.

Also:
- fixed javadoc reference
- lowered log level for every connection message
- using proper ping message wrapper

JIRA: NETCONF-1366
Change-Id: I0cf9cac5cf707315928e0e739f3ad5776271fbc6
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
3 weeks agoFix top level element insert failure 96/113096/3
Ruslan Kashapov [Mon, 12 Aug 2024 11:32:49 +0000 (14:32 +0300)]
Fix top level element insert failure

Non-null empty path identifier points to abstract root,
using it as data node identifier results validation error.

JIRA: NETCONF-1359
Change-Id: I2a66700ac5578990ed956de10f23155cf4f3c675
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
4 weeks agoUse simple WebContext.name() 75/113075/3
Robert Varga [Fri, 9 Aug 2024 15:54:54 +0000 (17:54 +0200)]
Use simple WebContext.name()

OSGi HTTP Whiteboard requires symbolic-name for names, otherwise we can
wreck a ton of things. Simplify the names.

JIRA: NETCONF-1358
Change-Id: Ia6c22dfe098e77717a5a8914237b078f1fc121fd
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 weeks agoSimplify NetconfOperationChainedExecution 87/113087/2
Robert Varga [Sat, 10 Aug 2024 10:42:11 +0000 (12:42 +0200)]
Simplify NetconfOperationChainedExecution

There is only a single implementation that reports being a termination
point. Rather than having these checks, just use 'null' to indicate
there is no subsequent operation.

Change-Id: I0c46ea596aec4d18ed8afa0bd39d461a4ae64c52
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 weeks agoEliminate cliendId from XMLMessageEncoder 86/113086/1
Robert Varga [Sat, 10 Aug 2024 09:21:27 +0000 (11:21 +0200)]
Eliminate cliendId from XMLMessageEncoder

This is old baggage coming from the initial implementation. Let's not
modify the message being sent, as the clientId field is never
initialized to anything but null.

Change-Id: If7006647abd33a4bc8257082261bf8e1ac6cafb5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
5 weeks agoCentralize MessageEncoder dispatch 85/113085/2
Robert Varga [Sat, 10 Aug 2024 01:53:16 +0000 (03:53 +0200)]
Centralize MessageEncoder dispatch

Both EXI and XML MessageEncoders end up needing an OutputStream,
containing mostly copy&pasted code around this aspect.

Pull the common bits down, focusing encoders on their actual job --
eliminating dependencies and making it clear we can disconnect the
actual encoder from the pipeline.

Change-Id: I6b239f9e83959c26a06e993b86336471c0e79b63
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoImprove {Frame,Message}Encoder constructor 82/113082/1
Robert Varga [Fri, 9 Aug 2024 20:31:22 +0000 (22:31 +0200)]
Improve {Frame,Message}Encoder constructor

We are operating on ByteBuf.class and NetconfMessage.class. Pass that
information down to MessageToByteEncoder, bypassing some reflective work
therein.

Change-Id: I418c5c9fe72a642092d3af5b820d17e5780f91c1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoAllocate AbstractServerRequest.uuid lazily 79/113079/1
Robert Varga [Fri, 9 Aug 2024 18:53:41 +0000 (20:53 +0200)]
Allocate AbstractServerRequest.uuid lazily

Rather than paying the cost of generating the UIID for all requests,
allocate the UUID only when it is first accessed.

Change-Id: I8383d61fc8fe455ceb62ed7b1c4315a7e605a551
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoBump mina-sshd to 2.13.2 77/113077/1
Robert Varga [Fri, 9 Aug 2024 16:51:46 +0000 (18:51 +0200)]
Bump mina-sshd to 2.13.2

https://github.com/apache/mina-sshd/blob/master/docs/changes/2.13.2.md

Change-Id: I52a5d769763a4e59722f0859ce7523b1e442c2d0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoAdd ServerRequest.uuid() 54/113054/3
Robert Varga [Fri, 9 Aug 2024 02:02:17 +0000 (04:02 +0200)]
Add ServerRequest.uuid()

We will be exposing more information about request processing, for which
we need something we can correlate on.

UUID.randomUUID() provides a reasonably secure identifier for these
purposes -- and this patch exposes it as ServerRequest.uuid().

Change-Id: Id8bcad37651cf82f6e8457c9ed156d19472e5337
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoBump versions to 8.0.1-SNAPSHOT 56/113056/1
Robert Varga [Fri, 9 Aug 2024 02:39:15 +0000 (04:39 +0200)]
Bump versions to 8.0.1-SNAPSHOT

This starts the next development iteration.

Change-Id: I92e694e125460dfae9a04d570d0f52742da0439e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRelease netconf v8.0.0
jenkins-releng [Fri, 9 Aug 2024 00:44:09 +0000 (00:44 +0000)]
Release netconf

6 weeks agoAdd a gitlint profile and tox configuration 09/102209/4
guillaume.lambert [Tue, 23 Aug 2022 13:18:38 +0000 (15:18 +0200)]
Add a gitlint profile and tox configuration

Signed-off-by: guillaume.lambert <guillaume.lambert@orange.com>
Change-Id: I8704f9199768ed76b064c438c0b2f9e1578a4241

6 weeks agoUnify certificates and keys payload 79/112579/17
lubos-cicut [Tue, 16 Jul 2024 11:37:47 +0000 (13:37 +0200)]
Unify certificates and keys payload

Use PEM format in payloads for rpcs input. Now for keystore rpcs
requires the use of BEGIN and END prefixes. Input is validated in
rpc, so we can no longer store an invalid key or certificate in the
keystore.

JIRA: NETCONF-1304
Change-Id: I3e2608c895046136da816d7c1c714f00558f0c98
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoAdd keystore documentation 47/112647/7
lubos-cicut [Fri, 19 Jul 2024 11:04:16 +0000 (13:04 +0200)]
Add keystore documentation

Improved guide how to add keys and certificates to netconf-keystore.

JIRA: NETCONF-596
Change-Id: I39a62305ea368c2bbd42fd649903b4fe10881c3d
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
6 weeks agoUpdate de-serialization 26/112526/9
lubos-cicut [Tue, 16 Jul 2024 06:37:56 +0000 (08:37 +0200)]
Update de-serialization

Keys de-serialization is ow universal with no limitation on algorithm
used.

JIRA: NETCONF-1334
Change-Id: I99b68637972cc33703c520abd438dc3dc39ab04a
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
6 weeks agoUpdate netconf-keystore model 25/112525/8
lubos-cicut [Tue, 16 Jul 2024 06:21:43 +0000 (08:21 +0200)]
Update netconf-keystore model

Under keystore-entry/key-credential added 'algorithm' (string) and
'public-key' (binary) leafs, 'password' leaf status set to deprecate,
and under private-keys/private-key added 'algorithm' (string) leaf.

JIRA: NETCONF-1334
Change-Id: I46e0f6da4f1f60343c0aa9a24aba4505d7edcec5
Signed-off-by: lubos-cicut <lubos.cicut@pantheon.tech>
6 weeks agoFix documentation 41/109741/3
Samuel Schneider [Thu, 11 Jan 2024 11:45:40 +0000 (12:45 +0100)]
Fix documentation

Fix minor mistake in documentation.
For Literal Blocks to work there need to be empty line after "::".

Change-Id: Ib43ec01b5fae6f5c6ce2469e380a8f15714d3435
Signed-off-by: Samuel Schneider <samuel.schneider@pantheon.tech>
6 weeks agoImprove AbstractNetconfSession.replace() type safety 01/113001/8
Robert Varga [Tue, 6 Aug 2024 18:36:25 +0000 (20:36 +0200)]
Improve AbstractNetconfSession.replace() type safety

This requires that we replace like-for-like, ensuring we can look up
handlers by their function.

JIRA: NETCONF-944
Change-Id: If86c638a76df7311c8e597780f66901e80088d80
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoUpdate restconf northbound guide 78/112978/4
Matej Sramcik [Mon, 5 Aug 2024 13:02:50 +0000 (15:02 +0200)]
Update restconf northbound guide

Update restconf northbound configuration to correspond
with OSGiNorthbound.Configuration.

JIRA: NETCONF-1354
Change-Id: Ie370a4e02bfbfe5d9db084f122f7cf58c256e2b3
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
6 weeks agoReturn restconf-nb configuration file 77/112977/3
Matej Sramcik [Mon, 5 Aug 2024 13:02:50 +0000 (15:02 +0200)]
Return restconf-nb configuration file

Bring back restconf-nb default configuration file
that was removed in NETCONF-1219.

Configuration file contain all actual parameters
defined in OSGiNorthbound.Configuration.

JIRA: NETCONF-1354
Change-Id: Ibffdf43217f145fe287271ec5b96d4172aac3478
Signed-off-by: Matej Sramcik <matej.sramcik@pantheon.tech>
6 weeks agoAllow URL provider to be updated dynamically 02/113002/5
Robert Varga [Tue, 6 Aug 2024 20:51:14 +0000 (22:51 +0200)]
Allow URL provider to be updated dynamically

Constructor injection is causing a restart, which in turn leads to CSS
provider restart (as it is briefly unused).

Make the URL provider ReferencePolicy.DYNAMIC, allowing it to be updated
without further churn.

JIRA: NETCONF-1356
Change-Id: I2ec8123ae5d6d1cc588491338b4e637e4ccad7bf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRequire SessionListener in session and negotiator 99/112999/3
Robert Varga [Tue, 6 Aug 2024 16:39:44 +0000 (18:39 +0200)]
Require SessionListener in session and negotiator

The negotiator is forwarding lifecycle events to the listener, hence we
are risking NPEs if we allow it to be null.

Make require check for it being null.

Change-Id: Ib6577f7404b5e3f89ff9377331e93199f786fc3c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoHide EXIMessage{Decoder,Encoder} 00/113000/4
Robert Varga [Tue, 6 Aug 2024 18:03:28 +0000 (20:03 +0200)]
Hide EXIMessage{Decoder,Encoder}

There is no need to expose these classes, as we have a common interface
for both.

JIRA: NETCONF-944
Change-Id: I9e5b4cda75431ab584f193818af3a9a475b7c193
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRename Netconf(Hello)MessageToXmlEncoder 91/112991/7
Robert Varga [Tue, 6 Aug 2024 15:25:00 +0000 (17:25 +0200)]
Rename Netconf(Hello)MessageToXmlEncoder

(Hello)XMLMessageEncoder is a better, shorter name, use that instead.
Also use EXIMessageEncoder for the EXI counterpart.

JIRA: NETCONF-944
Change-Id: Iceee4ed0500b841892bf924fc77efae8d6bb338e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRemove netconf.api.NetconfSessionListenerFactory 98/112998/3
Robert Varga [Tue, 6 Aug 2024 15:47:01 +0000 (17:47 +0200)]
Remove netconf.api.NetconfSessionListenerFactory

This interface is only used in netconf-client and there it acts just as
indirection. Remove it in favor of passing NetconfClientSessionListener
directly.

Change-Id: I3ca378a098308231f794d18efdb80e792d64ba8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRename NetconfEXIToMessageDecoder to EXIMessageDecoder 90/112990/10
Robert Varga [Mon, 5 Aug 2024 23:00:01 +0000 (01:00 +0200)]
Rename NetconfEXIToMessageDecoder to EXIMessageDecoder

EXIToMessageDecoder to EXUNessageDecoder. This mirrors the baseline
XMLMessageDecoder naming.

JIRA: NETCONF-1191
Change-Id: I7e8e1b077d082a1472dc63f4e90fc564b5688a1e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRename NetconfXMLToHelloMessageDecoder 89/112989/7
Robert Varga [Mon, 5 Aug 2024 22:53:51 +0000 (00:53 +0200)]
Rename NetconfXMLToHelloMessageDecoder

A better name is HelloXMLMessageDecoder, being shorter overall while
retaining all of 'HelloMessage', 'XML' and 'MessageDecoder' implications.

JIRA: NETCONF-1191
Change-Id: I10eb5ade1fc2ccf7cc58cedc42e174a7198e6359
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRemove sal-restconf-broker 95/112995/2
Robert Varga [Tue, 6 Aug 2024 14:25:34 +0000 (16:25 +0200)]
Remove sal-restconf-broker

This directory is not being built and is completely unused, remove it to
prevent confusion.

JIRA: NETCONF-944
Change-Id: Id344a3220d8c0dc825bfb0b6b764b5df338d5aa7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRemove sal-rest-connector-config 94/112994/2
Robert Varga [Tue, 6 Aug 2024 14:23:21 +0000 (16:23 +0200)]
Remove sal-rest-connector-config

This artifact is hosting an outdated configuration file and is otherwise
unreferenced. Remove it.

JIRA: NETCONF-944
Change-Id: I2bd1e10e0d644beea0bc83d3938059cfb8e60520
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoRemove sal-rest-connector 93/112993/2
Robert Varga [Tue, 6 Aug 2024 14:20:57 +0000 (16:20 +0200)]
Remove sal-rest-connector

We have only defunct tests here, remove the entire directory.

JIRA: NETCONF-944
Change-Id: I4d13b1cd1e37bf0ebc2d6b057010e6031c9ca7eb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoMove NetconfXMLToMessageDecoder(Test) 88/112988/3
Robert Varga [Mon, 5 Aug 2024 22:33:47 +0000 (00:33 +0200)]
Move NetconfXMLToMessageDecoder(Test)

NetconfXMLToMessageDecoder is a common baseline MessageDecoder, move it
to netconf.coded.XMLMessageDecoder along with its test.

JIRA: NETCONF-1191
Change-Id: Ia3729b632f1c9f88541f57a4d078b89dec73b96f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoFix an eclipse error in netconf-codec 92/112992/2
Robert Varga [Tue, 6 Aug 2024 13:40:01 +0000 (15:40 +0200)]
Fix an eclipse error in netconf-codec

Eclipse does not like the fact we do not require netty.common, fix that
up.

JIRA: NETCONF-1191
Change-Id: I1c5b9b5b30dd8b87c158f34d24d4fe82e187271d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoAdd Message{Decoder,Encoder} 87/112987/4
Robert Varga [Mon, 5 Aug 2024 21:51:13 +0000 (23:51 +0200)]
Add Message{Decoder,Encoder}

We have known encoder/decoders, capture them these traits in
netconf.codec.Message{Decoder,Encoder} interfaces. This provides a
natural place for
AbstractChannelInitializer.NETCONF_MESSAGE_{DECODER,ENCODER} constants,
which are rehosted.

JIRA: NETCONF-1191
Change-Id: I6a45216352816b840cb8f3392e40ba07b30744a8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoSplit out framing handlers to netconf-codec 85/112985/7
Robert Varga [Mon, 5 Aug 2024 20:05:31 +0000 (22:05 +0200)]
Split out framing handlers to netconf-codec

These are baseline coding services, split them out, making them more
widely available.

JIRA: NETCONF-1191
Change-Id: I7c76acc8979be928d40e2f23e740df355c12baea
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoMove AbstractChannelInitializer.NETCONF_MESSAGE_FRAME_* 84/112984/3
Robert Varga [Mon, 5 Aug 2024 19:48:29 +0000 (21:48 +0200)]
Move AbstractChannelInitializer.NETCONF_MESSAGE_FRAME_*

AbstractChannelInitializer is the common place for defining frame
codecs. Move framing codec constants to
FramingMechanism{Decoder,Encoder} as HANDLER_NAME, which is more
descriptive.

JIRA: NETCONF-1191
Change-Id: I7dc8bbe4264a5d636aed06326a1bc6a93958036d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoAdd FramingMechanismDecoder 83/112983/5
Robert Varga [Mon, 5 Aug 2024 18:56:58 +0000 (20:56 +0200)]
Add FramingMechanismDecoder

This is a companion class to FramingMechanismEncoder. This also makes it
clear that what is called 'aggregator' is really a 'frame decoder'.

Also remove FramingMechanismEncoder.of(), as it is only called from
tests.

JIRA: NETCONF-1191
Change-Id: I3332c15801c4d2d663efdb9ee943183a08d15dcf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
6 weeks agoEnforce netconf-common dependencies 86/112986/1
Robert Varga [Mon, 5 Aug 2024 20:35:06 +0000 (22:35 +0200)]
Enforce netconf-common dependencies

We have a warning here, fix it and enforce dependency declarations.

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