netconf.git
13 months agoClean up NotificationMessage 82/105682/7
Robert Varga [Tue, 25 Apr 2023 20:13:01 +0000 (22:13 +0200)]
Clean up NotificationMessage

Use java.time.Instant to carry an immutable event time -- addressing two
SpotBugs warnings and making integration with DOMEvent/EventInstantAware
much mode sealmess.

JIRA: NETCONF-1000
Change-Id: I043c21abf7eb96368acfd73a6fddbc036e3ed7d3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMigrate netconf-api's use of xmlunit 86/105686/3
Robert Varga [Tue, 25 Apr 2023 22:48:11 +0000 (00:48 +0200)]
Migrate netconf-api's use of xmlunit

This is a rather straighforward migration, pretty much exactly as
documented in the migration guide.

Change-Id: I18f2dce0bf2855af2f7ade48eb449ee9fc9125cc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMigrate NotificationsTransformUtilTest's use of xmlunit 85/105685/4
Robert Varga [Tue, 25 Apr 2023 22:38:20 +0000 (00:38 +0200)]
Migrate NotificationsTransformUtilTest's use of xmlunit

Migration of xmlunit is rather straighforward here, ditch the dependency
on xmlunit-legacy. Since we have accurate whitespace, we ditch that
particular leniency off. We still needs to ignore element order because
these are inherently unpredictable at NormalizedNode layer.

Change-Id: I090ae73dbc5fcb3f5d66c9fa6f066ba30c751beb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoCleanup NotificationsTransformUtilTest 84/105684/1
Robert Varga [Tue, 25 Apr 2023 22:11:30 +0000 (00:11 +0200)]
Cleanup NotificationsTransformUtilTest

Improve string format to closely match expectations.

Change-Id: Ie1740f52c1a21bcae66ee4aad0b9140b2ad6b305
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove NotificationRegistration 81/105681/2
Robert Varga [Tue, 25 Apr 2023 20:04:46 +0000 (22:04 +0200)]
Remove NotificationRegistration

Migrate the final two users of NotificationRegistration to plain
Registration and remove NotificationRegistration. On the implementation
side we also unify notification handling, so that the underlying
contract is implemented by a base class and individual specializations
just pass down required inputs.

Change-Id: I677ced2b1553de6fdc7ffe59646e2c220fbd27b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDisconnect NotificationPublisherRegistration 80/105680/2
Robert Varga [Tue, 25 Apr 2023 19:43:41 +0000 (21:43 +0200)]
Disconnect NotificationPublisherRegistration

Use a play yangtools.concepts.Registration as the baseline, which allows
us to use AbstractRegistration to manage the tie to the manager -- and
allows for a better thread-safety around concurrent close().

Change-Id: I33871bd59894d4ff95315dddeedcdd7b4e68f962
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove NotificationListenerRegistration 76/105676/4
Robert Varga [Tue, 25 Apr 2023 19:09:17 +0000 (21:09 +0200)]
Remove NotificationListenerRegistration

Replace final user of this specialization with
Registration/AbstractObjectRegistration. This eliminates a bit of
custom code and improves thread safety around concurrent shutdown
and un-registration.

Change-Id: I6ef8bb5e47124c795762e7bba27d73c88651fd64
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDisconnect NetconfNotificationCollector registration 75/105675/5
Robert Varga [Tue, 25 Apr 2023 18:42:49 +0000 (20:42 +0200)]
Disconnect NetconfNotificationCollector registration

NotificationRegistration does is actually the same thing as
Registration, except it does not enforce idempotence. Replace its use in
NetconfNotificationCollector with Registration and use an explicit
AbstractObjectRegistration subclass.

This fixes potential problems with multiple (un)registrations of the
same object and opens up the possibility for future removal of locking,
as AbstractObjectRegistration knows whether it is closed or not.

Change-Id: I1ed8e1f74ee755d344815c511499a8dbfc9cce8d
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoPropagate eventTime during notification transformation 83/105683/3
Robert Varga [Tue, 25 Apr 2023 21:13:16 +0000 (23:13 +0200)]
Propagate eventTime during notification transformation

Binding Notification objects expose the time when the event was
generated through an optional EventInstantAware interface. Recognize
when a Notification carries this annotation and propagate it correctly.

JIRA: NETCONF-1001
Change-Id: I06ce94ffbe11bafeedb60aaa28765e151de53b3f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoClean up netconf-notifications-api 74/105674/2
Robert Varga [Tue, 25 Apr 2023 18:32:18 +0000 (20:32 +0200)]
Clean up netconf-notifications-api

Pass through the documentation and fixup whitespace and Javadocs a bit.

Change-Id: I0bcbf720d54e1f5a682f923b4cbfb99e13108366
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoHide DeserializerExceptionHandler 73/105673/2
Robert Varga [Tue, 25 Apr 2023 17:56:13 +0000 (19:56 +0200)]
Hide DeserializerExceptionHandler

This is an implementation-internal class and the only occupant of
netconf.server.util package. Move it to netconf.server and hide it.

JIRA: NETCONF-945
Change-Id: I2569e5343ac2e303101dd07cd73ce9cfb5e18ec3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRename NetconfHelloMessage to HelloMessage 68/105668/3
Robert Varga [Tue, 25 Apr 2023 16:19:05 +0000 (18:19 +0200)]
Rename NetconfHelloMessage to HelloMessage

Let's keep things consistent by renaming NetconfHelloMessage to
HelloMessage -- similar to how we have NotificationMessage.

JIRA: NETCONF-1000
Change-Id: I50bfb9200dc6c7624a76eeac2b13f5324bedd7cb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix odl-netconf-connector packaging 72/105672/2
Robert Varga [Tue, 25 Apr 2023 17:23:26 +0000 (19:23 +0200)]
Fix odl-netconf-connector packaging

sal-netconf-connector no longer requires netconf-topology, fix that
packaging leak -- and moving it down to the three users we have.

Change-Id: Ib93804a81f63af89768e7b175a63feaa66dad6e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix odl-netconf-test-tools packaging 71/105671/2
Robert Varga [Tue, 25 Apr 2023 17:19:57 +0000 (19:19 +0200)]
Fix odl-netconf-test-tools packaging

This feature should depend on odl-netconf-connector for the southbound
plugin. Fix that, eliminating packaging leaks of:
- mdsal.model/ietf-topology
- netconf/sal-netconf-connector
- netconf/sal-netconf-connector

Change-Id: Iac1951254c31df968d0c9b456ca5adb0edb71a23
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agosal-netconf-connector should not depend on notifications-api 70/105670/2
Robert Varga [Tue, 25 Apr 2023 16:48:57 +0000 (18:48 +0200)]
sal-netconf-connector should not depend on notifications-api

netconf-notifications-api is now a server-side plugin thing, do not
depend on it in the southbound plugin.

JIRA: NETCONF-1000
Change-Id: I30ff686b448ddcb3cefd2f7e3f816d27c68fdad4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRename NetconfNotification to NotificationMessage 66/105666/4
Robert Varga [Tue, 25 Apr 2023 15:47:28 +0000 (17:47 +0200)]
Rename NetconfNotification to NotificationMessage

We want to keep the 'Message' tie to 'NetconfMessage' explicit, let's
rename the class.

JIRA: NETCONF-1000
Change-Id: I2dd345f42f4ed5bea4cddc2f151d120e78dfab6a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove console output 67/105667/1
Robert Varga [Tue, 25 Apr 2023 16:03:38 +0000 (18:03 +0200)]
Remove console output

Tests should not output things directly to console, remove this output
and the corresponding suppression.

Change-Id: I69a1687cbf4cdb2e0772605f9c121cb74c2318a5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoClean up NetconfNotification constants 65/105665/1
Robert Varga [Tue, 25 Apr 2023 15:45:37 +0000 (17:45 +0200)]
Clean up NetconfNotification constants

NOTIFICATION_NAMESPACE is something we already publish in
XmlNetconfConstants, so reuse that field. Also hide tag names,
explicitly naming them *_TAG -- and tests assert hard-coded values, so
the implementation and validation is disconnected.

JIRA: NETCONF-1000
Change-Id: I621cf05fd679b995eeed8ee9d08376eab6b1098b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoHide NetconfHelloMessage.HELLO_TAG 64/105664/1
Robert Varga [Tue, 25 Apr 2023 15:40:05 +0000 (17:40 +0200)]
Hide NetconfHelloMessage.HELLO_TAG

This constant is only used internally, hide it.

JIRA: NETCONF-1000
Change-Id: I676408145962dc2299e0dd8534170eef4e320feb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMove NetconfNotification to netconf-api 63/105663/1
Robert Varga [Tue, 25 Apr 2023 15:29:42 +0000 (17:29 +0200)]
Move NetconfNotification to netconf-api

Notification is a well-known message, keep it in netconf-api itself.

JIRA: NETCONF-1000
Change-Id: I07a15d8d21143d540fe2c43d1e4a84f147623a0e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove FailedNetconfMessage 20/105220/4
Robert Varga [Tue, 4 Apr 2023 13:42:23 +0000 (15:42 +0200)]
Remove FailedNetconfMessage

FailedNetconfMessage does not have a document, which breaks our mojo.
Separate out exception handling to keep things sane.

JIRA: NETCONF-1000
Change-Id: Ib855ffb0415669734b5da27dc5cbcfd50434dbac
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMove NetconfMessageUtil 60/105660/2
Robert Varga [Tue, 25 Apr 2023 14:30:41 +0000 (16:30 +0200)]
Move NetconfMessageUtil

These utilities are only used on client-side, move them to
netconf-client.

JIRA: NETCONF-945
Change-Id: Icc96e6afba710c635f770d5a6e6deaf1d80158c8
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRename netconf-impl to netconf-server 51/105651/6
Robert Varga [Tue, 25 Apr 2023 09:37:06 +0000 (11:37 +0200)]
Rename netconf-impl to netconf-server

This artifact contains only server-side things. Make sure to rename it
to reflect that.

JIRA: NETCONF-945
Change-Id: I13322553c4bdd8979fe564ce1337dfb9e43c7e7a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove CloseableUtil 59/105659/2
Robert Varga [Tue, 25 Apr 2023 14:16:36 +0000 (16:16 +0200)]
Remove CloseableUtil

This class is only used by netconf-server, where the closed services
cannot legally thrown an exception -- rendering the use superfluous.

Replace the use of closeAll() with a simple iteration and remove
CloseableUtil along with its test.

Change-Id: I990bfc189bec85e4aa6784f8c82411ce59031b19
JIRA: NETCONF-945
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove NetconfDocumentedException throws 56/105656/3
Robert Varga [Tue, 25 Apr 2023 13:43:29 +0000 (15:43 +0200)]
Remove NetconfDocumentedException throws

NetconfMessageUtil methods do not throw this exception, remove the
declaration.

Change-Id: Ib0ab7993cbe66c62508e3b95f7dff040a1ca8e8b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoOptimize NetconfMessageUtil.isErrorMessage() 55/105655/1
Robert Varga [Tue, 25 Apr 2023 13:39:58 +0000 (15:39 +0200)]
Optimize NetconfMessageUtil.isErrorMessage()

We are acquiring children twice -- which is expensive. The logic is
actually shared between size == 1 and size != 1, so just examine the
children to see if there is a matching element.

Change-Id: Ib79fd5a08c485e3e9849c5f925d200ba4db34ecc
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoOptimize NetconfMessageUtil.isOKMessage() 54/105654/1
Robert Varga [Tue, 25 Apr 2023 13:32:45 +0000 (15:32 +0200)]
Optimize NetconfMessageUtil.isOKMessage()

We are acquiring child elements twice, which is rather suboptimal.
Retain the list in local variable, which means we do not need to worry
about exceptions being thrown.

Change-Id: Iee2fbd9ea169ef9ab209643ef3a07518af7f04b0
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoAdapt new UI for ODL 19/105219/7
Ivan Hrasko [Tue, 4 Apr 2023 12:54:33 +0000 (14:54 +0200)]
Adapt new UI for ODL

After updating to the latest swagger UI we have to bring back
some ODL adjustments: to load ODL APIs by default, etc.

JIRA: NETCONF-987
Change-Id: I878640bb12825da2a03a1c57ce19723c1ddc9f4d
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
13 months agoUpdate to Swagger UI v4.18.1 11/105111/10
OleksandrZharov [Thu, 30 Mar 2023 09:49:06 +0000 (11:49 +0200)]
Update to Swagger UI v4.18.1

Our Swagger UI is looking old fashioned.
Update Swager UI to newer version.

JIRA: NETCONF-987
Change-Id: I50d6896b0971f6528c6a504bba5cfe600681c533
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
13 months agoEliminate operational concept 82/105482/3
tobias.pobocik [Tue, 18 Apr 2023 08:53:44 +0000 (10:53 +0200)]
Eliminate operational concept

In sal-rest-docgen package there still resist some
remnants of bierman-02 operational data concept.

Now, we have just "data" for both "config" and "nonconfig" data.
By eliminating "config" and "operational" split we can get rid
of some unnecessary logic.

JIRA: NETCONF-992
Change-Id: I6b03e8ce43d75cb53ed14862b783d84fe03e542c
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
13 months agoRemove XmlUtil.loadSchema() 04/105604/1
Robert Varga [Sat, 22 Apr 2023 15:39:48 +0000 (17:39 +0200)]
Remove XmlUtil.loadSchema()

This method is not used anywhere, remove it.

Change-Id: I671542122608d52428421da72fe263ef5c121fad
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove netconf.api.util.NetconfConstants 03/105603/1
Robert Varga [Sat, 22 Apr 2023 15:37:02 +0000 (17:37 +0200)]
Remove netconf.api.util.NetconfConstants

These constants are no longer used anywhere, remove them.

Change-Id: I1218cc05d94f930ea326b84ed0835a0151e7ffa3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoClean up findNamespaceOfTextContent() 01/105601/2
Robert Varga [Sat, 22 Apr 2023 15:26:58 +0000 (17:26 +0200)]
Clean up findNamespaceOfTextContent()

Use local variable type inference and co-locate extractNamespaces() next
to it, so they can be co-evolved.

Change-Id: If3d19679c40dd8d303e3143f6505502484310eb9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove XmlElement.checkUnrecognisedElements() 00/105600/2
Robert Varga [Sat, 22 Apr 2023 15:04:37 +0000 (17:04 +0200)]
Remove XmlElement.checkUnrecognisedElements()

These methods are only used in unit tests, remove them.

Change-Id: I14708977516d161f9bab11790cd8cac5a456293a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove XmlElement.getChildElementsWithSameNamespace() 99/105599/1
Robert Varga [Sat, 22 Apr 2023 15:02:57 +0000 (17:02 +0200)]
Remove XmlElement.getChildElementsWithSameNamespace()

This method is used only in unit tests. Remove it.

Change-Id: I5b864a152ba059fcfe247a6eb573fdf96a4fb9f9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove deprecated XmlElement methods 98/105598/1
Robert Varga [Sat, 22 Apr 2023 15:01:03 +0000 (17:01 +0200)]
Remove deprecated XmlElement methods

These methods have been deprecated for removal, remove them, as they
have replacements with better names.

Change-Id: Ifa25b6672937c0afd043bb435a77a91b72b35d4e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoSpeed up XmlElement text content methods 97/105597/1
Robert Varga [Sat, 22 Apr 2023 14:59:33 +0000 (16:59 +0200)]
Speed up XmlElement text content methods

getTextContent() should cache the length of children.
getOnlyTextContentOptionally() should cache the children.

Change-Id: Ib1e6eb43c156dbf3149d8478fc5825659588999f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDo not use Collections2.filter() in XmlElement 96/105596/1
Robert Varga [Sat, 22 Apr 2023 14:54:13 +0000 (16:54 +0200)]
Do not use Collections2.filter() in XmlElement

We end up collectiing the filtered collection: perform the same
operation with stream().filter().collect().

Change-Id: Ib016b9f2deb500e23616e12e4aa0d4f4b4e1eb6c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoClean up XmlElement namespace handing 88/105588/2
Robert Varga [Sat, 22 Apr 2023 12:20:56 +0000 (14:20 +0200)]
Clean up XmlElement namespace handing

Use foo()/findFoo()/getFoo() to simplify naming of methods, cutting down
on ceremony around namespace/namespaceAttribute accesses. This allows us
to forgo Optional wrapping and reduce code duplication.

Change-Id: Ib3a9393b78c406dcbee85d3d91f338295fac0d11
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoImprove XmlElement.getAttributes() 87/105587/3
Robert Varga [Sat, 22 Apr 2023 11:54:59 +0000 (13:54 +0200)]
Improve XmlElement.getAttributes()

Use local variable type inference, cache the size and make sure we
validate node being an Attr.

Change-Id: Id75b7cac90b4cd801c81a1c33ba10bed7efef558
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove XmlElement.ElementFilteringStrategy 86/105586/3
Robert Varga [Sat, 22 Apr 2023 11:48:08 +0000 (13:48 +0200)]
Remove XmlElement.ElementFilteringStrategy

This really is just a Predicate<Element>, so just inline the semantics.

Change-Id: I475c5e95694d1ff90f68a6f70b7d94356cb7950f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoSpeed up XmlElement.getChildElementsInternal() 85/105585/2
Robert Varga [Sat, 22 Apr 2023 11:46:34 +0000 (13:46 +0200)]
Speed up XmlElement.getChildElementsInternal()

Compute size of childList only once and keep it as a loop-invariant.
Also use local variable type inference.

Change-Id: If3dbc9ff1cbd038a15140fe1297c5dc17e4d1311
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFixup accidental push 79/105579/3
Robert Varga [Fri, 21 Apr 2023 09:28:42 +0000 (11:28 +0200)]
Fixup accidental push

7bb5a9a41b90dae65ee238c7a58ccfe9eb5d8387 was pushed directly by accident
and it requires a fixup. This patch provides that fixup.

Change-Id: I85c9a2cf322139cf2a84fe98bc7ba8e9e648d2a1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoBump upstreams 69/105569/6
Robert Varga [Fri, 21 Apr 2023 09:28:42 +0000 (11:28 +0200)]
Bump upstreams

Adopt:
- odlparent-12.0.5
- infrautils-5.0.4
- yangtools-10.0.6
- mdsal-11.0.9
- controller-7.0.6
- aaa-0.17.8

Change-Id: I04ec184ebcfc1464f335835de528a8724bce1c8a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoClean up XmlElement a bit 77/105577/1
Robert Varga [Sat, 22 Apr 2023 10:07:35 +0000 (12:07 +0200)]
Clean up XmlElement a bit

Use Optional facilities to reduce orElseThrows() calls. Also improve
equals() by using instanceof pattern.

Change-Id: I932f4feb38c1f77c637c0844cd8f39bef5b47841
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoImprove XmlBodyReaderMountPointTest 76/105576/1
Robert Varga [Sat, 22 Apr 2023 10:06:41 +0000 (12:06 +0200)]
Improve XmlBodyReaderMountPointTest

Use getDataChildByArg() to simplify our asssertions, making the flow a
bit more obvious.

Change-Id: I2f19ad6b8f2dfecd58f97046290b711d97792b74
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoSimplify getSchemaFromRpc() a bit 75/105575/1
Robert Varga [Sat, 22 Apr 2023 10:05:14 +0000 (12:05 +0200)]
Simplify getSchemaFromRpc() a bit

We know the input is always ContainerNode and we have childByArg()
method which skips the Optional ceremony.

Change-Id: I451b93ec9a851b173bbb63097ed2886a48121670
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoTransactionProvider should be final 74/105574/1
Robert Varga [Sat, 22 Apr 2023 10:03:41 +0000 (12:03 +0200)]
TransactionProvider should be final

We have a bit of dancing around with Optional through methods which
might be subclassed by downstreams. Prevent that by making the class
final and drop back to talking to the internal field only.

Change-Id: Idfd7e3f9a9bd8368f59aff0441789078c0c4e875
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUse List.isEmpty() in AbstractGet 73/105573/1
Robert Varga [Sat, 22 Apr 2023 10:02:49 +0000 (12:02 +0200)]
Use List.isEmpty() in AbstractGet

Checking the size is superfluous, just use isEmpty().

Change-Id: Iebe590ddb8f3fde13e2222f334325162a2df96e3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoMigrate users of Optional.get() 71/105571/4
Robert Varga [Fri, 21 Apr 2023 12:29:56 +0000 (14:29 +0200)]
Migrate users of Optional.get()

Upgraded modernizer points out callers of Optional.get(), which has a
better-named replacement in Optional.orElseThrow(). Migrate callers to
orElseThrow() or alternative facilities.

Change-Id: Ic36876b32443d341b3e838a9bb1dd079ea141b42
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoRemove OpenAPI v2 76/104776/17
Yaroslav Lastivka [Fri, 3 Mar 2023 14:32:47 +0000 (16:32 +0200)]
Remove OpenAPI v2

Remove support for OpenAPI version 2, from now on we just support
OpenAPI version 3.

Remove OpenAPI v2 URLs, configuration and constants.

JIRA: NETCONF-981
Change-Id: Idd06ffd2f02b1f42bd9f52c889af7df8aa22853c
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
13 months agoFix parent reference 68/105568/1
Robert Varga [Fri, 21 Apr 2023 09:25:25 +0000 (11:25 +0200)]
Fix parent reference

Parent should be pointing to 6.0.0-SNAPSHOT, fix that.

Change-Id: I70403cac76ac32cba4aed01301aad4a1300c6bb9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 29fa68b1cb819fc1e2856832ad3bb53f26539cfe)

13 months agoBump versions to 6.0.0-SNAPSHOT 20/105520/2
Robert Varga [Wed, 19 Apr 2023 19:16:34 +0000 (21:16 +0200)]
Bump versions to 6.0.0-SNAPSHOT

This starts the next major development iteration.

Change-Id: I8f52ebdd1d7a90a4e3c445a52681530bd2d78c43
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoBump versions to 5.0.6-SNAPSHOT 19/105519/3
Robert Varga [Wed, 19 Apr 2023 19:15:57 +0000 (21:15 +0200)]
Bump versions to 5.0.6-SNAPSHOT

This starts the next development iteration.

Change-Id: Ib3c21cef2b3588b44fba33c3e7b242c46b32530b
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoFix choice cases usage 88/104988/10
Yaroslav Lastivka [Thu, 23 Mar 2023 10:11:58 +0000 (12:11 +0200)]
Fix choice cases usage

Currently we are generating all cases from choice into payload used
as example in apidoc.
This is incorrect because we can use only one case at the time.
Implemented using first case (or default if specified) node in
apidoc example.

JIRA: NETCONF-983
Change-Id: Ifc32ee00e0de265b4f7e612adb5b8d3783b696a2
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
13 months agoAdd yanglib API for non-revision model 73/104473/14
Peter Suna [Mon, 20 Feb 2023 08:43:58 +0000 (09:43 +0100)]
Add yanglib API for non-revision model

The Yanglib API previously used a single API for both
models with revisions and those without. As a result,
it was necessary to append a '/' at the end of the URL request
for non-revision models.

This issue has now been resolved by introducing a separate API
specifically for non-revision models.

Added tests to validate the handling of both revision
and non-revision models.

Additionally, the existing Yanglib tests have been reworked to
use YANG models stored in resources.

JIRA: NETCONF-968
Change-Id: I3a22de90457bd1b2dbb77f3228bcce83a97ba4e1
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
13 months agoClean up NetconfDeviceTest 06/105206/3
Robert Varga [Tue, 4 Apr 2023 07:16:49 +0000 (09:16 +0200)]
Clean up NetconfDeviceTest

Use anyCollection() consistently to reduce the number of warnings.

Change-Id: I4ac1362640d6989e301d776b139c94c14b5e9c20
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoAdd transport-ssh 99/102299/51
Robert Varga [Wed, 7 Sep 2022 09:48:51 +0000 (11:48 +0200)]
Add transport-ssh

Add NETCONF transport implementation based on Apache SSHD.

Due to connection is managed by underlying TCP component
both sshd client and server implementations are not used
for connection but as factory managers. These are providing
associated session builders with factories configured
and serving ssh sessions.

sshd-netty components were used as reference on establishing
ssh sessions on top of existing communication channel.

JIRA: NETCONF-590
Change-Id: I21245b2f8b932da0a57fa386ee62b05dfcf8cc18
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
13 months agoRemove unused methods 75/105475/4
tobias.pobocik [Mon, 17 Apr 2023 10:28:33 +0000 (12:28 +0200)]
Remove unused methods

BaseYangSwaggerGenerator contains unused methods getSchemaService
and getPathVersion. Remove them to simplify our code.

JIRA: NETCONF-993
Change-Id: If1aa5f9e476a61e167849b67c1a56071dda6bb40
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
13 months agoAdd OpenAPI 2 (swagger) authorization 81/105481/3
Ivan Hrasko [Tue, 18 Apr 2023 07:37:49 +0000 (09:37 +0200)]
Add OpenAPI 2 (swagger) authorization

After adding authorization feature into generated OpenAPI 3 docs
enhance OpenAPI 2 docs, too.

We can reuse SECURITY JSON node but the two specs diverge
in specifying which auth methods are used.

OpenAPI 2 uses global securityDefinitions object which we have
to create.

JIRA: NETCONF-990
Change-Id: I38df2414fa34fdf3297446428b31e8d113f1f636
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
13 months agoAdd OpenAPI 3 basic authorization 53/105253/8
Ivan Hrasko [Wed, 5 Apr 2023 13:11:33 +0000 (15:11 +0200)]
Add OpenAPI 3 basic authorization

Enhance JSON generated by ODL with basic authorization.
This way authorize button is shown on UI and user is allowed
to authorize all requests coming from swagger UI. It means
all requests when authorized contain basic auth header.

JIRA: NETCONF-990
Change-Id: If31d355b8a0211d871eda5b14ed6033bb0f1514c
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
13 months agoFix fields processing error for duplicate node names 92/105092/8
Sangwook Ha [Tue, 28 Mar 2023 07:05:55 +0000 (00:05 -0700)]
Fix fields processing error for duplicate node names

NetconfFieldsTranslator saves LinkedPathElement identified by the target
node identifier, hence does not allow keeping track of data nodes with
the same name failing to generate correct paths if such nodes are
included in the fields parameter.

Address the issue by replacing the list of sets to keep track of the
data nodes specified in the fields parameter with a tree of
LinkedPathElement objects keeping track of its parent path element.
This allows generation of all unique paths defined in the fields
parameter and also simplifies the processing.

But this change in the data structure is incompatible with
AbstractFieldsTranslator, and NetconfFieldsTranslator does not inherit
the abstract class.

JIRA: NETCONF-985
Change-Id: I762714f8a25231c1394d75b47e269167b37660f8
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
13 months agoRe-enable IETF links 60/105460/2
Robert Varga [Thu, 13 Apr 2023 16:34:53 +0000 (18:34 +0200)]
Re-enable IETF links

Do not exclude links to IETF anymore.

Change-Id: Ic7faeb69803c1ddd5feacd77d6382643efe772a4
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoUpdate old links in user guide 94/105094/3
Sangwook Ha [Tue, 28 Mar 2023 20:51:32 +0000 (13:51 -0700)]
Update old links in user guide

There are several old links permanently redirected to new URLs in the
user guide. Update the links with new ones.

JIRA: NETCONF-986
Change-Id: Ib96f0c2918f1687822d42f4106a836e1a9245a8e
Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
13 months agoRefactor and enable linkcheck except for IETF URLs 32/105432/5
guillaume.lambert [Thu, 13 Apr 2023 12:38:19 +0000 (14:38 +0200)]
Refactor and enable linkcheck except for IETF URLs

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

13 months agoBump automaton to 1.12-4 17/105417/2
Robert Varga [Wed, 12 Apr 2023 11:51:27 +0000 (13:51 +0200)]
Bump automaton to 1.12-4

There's no functional change.

Change-Id: Iace65d05ef4634feb12084b6397c425fc530a24c
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoDisable linkcheck 24/105424/1
Robert Varga [Wed, 12 Apr 2023 15:02:00 +0000 (17:02 +0200)]
Disable linkcheck

Linkcheck is failing on rfc-editor, as noted in
https://jira.linuxfoundation.org/plugins/servlet/desk/portal/2/IT-25351,
disable it until that issue is fixed.

Change-Id: I30976060f43f5da6b3cc6c3ba0f0bc59f8388591
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
13 months agoAdd transport-tls 00/102300/63
Robert Varga [Wed, 7 Sep 2022 09:48:51 +0000 (11:48 +0200)]
Add transport-tls

Add NETCONF transport implementation based on TCP+TLS.

JIRA: NETCONF-590
Change-Id: I5e0d6ddce30971dd5f2b0918600b9410aa439c08
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
14 months agoRemove empty XML lines 12/105112/9
zw1127 [Thu, 30 Mar 2023 09:19:55 +0000 (17:19 +0800)]
Remove empty XML lines

Java 9+ has changed the way indentation works, which means that unlike
Java 8, we are emitting empty lines, quite similar to what has been
reported in https://bugs.openjdk.org/browse/JDK-8262285.

Use an XSL style sheet to ensure we filter out empty Text nodes during
indenting transform opereations.

JIRA: NETCONF-988
Change-Id: Ia9e614d2c77766126923b9e1af82bb177dfb0c05
Signed-off-by: zw1127 <zw1016@gmail.com>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoImprove XmlUtil.toString() 18/105218/2
Robert Varga [Tue, 4 Apr 2023 12:19:18 +0000 (14:19 +0200)]
Improve XmlUtil.toString()

Simplify the try-catch block to cover the minimum required scope.

Change-Id: I61b0bf2d104ff7f272ac335207993d432c11c8ed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoModernize XmlUtilTest 17/105217/2
Robert Varga [Tue, 4 Apr 2023 12:10:17 +0000 (14:10 +0200)]
Modernize XmlUtilTest

Use assertThrows() and text blocks to make it clearer as to what
we are doing.

Change-Id: I3ac89a14bc76d4427449aa9f24d820268b709d6e
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoFix yang-library.json 79/105079/5
Robert Varga [Tue, 28 Mar 2023 08:53:33 +0000 (10:53 +0200)]
Fix yang-library.json

The JSON file should match the XML file, but the assertions are being
made on the XML content twice. Fix that typo and make sure JSON has the
correct content.

Change-Id: I74f260d062a8129c6446d3a509f093909da87075
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoUse assertEquals() instead of Hamcrest 78/105078/5
Robert Varga [Tue, 28 Mar 2023 08:45:47 +0000 (10:45 +0200)]
Use assertEquals() instead of Hamcrest

We have very simple assertions, there is no need to use Hamcrest here.

Change-Id: Ie3ca9a7688c1746bc7e572406475c25dee8d6dc1
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoAdd (plain) PATCH method to OpenApi 60/104960/4
Yaroslav Lastivka [Thu, 16 Mar 2023 12:33:42 +0000 (14:33 +0200)]
Add (plain) PATCH method to OpenApi

ODL supports also plain PATCH method according to RFC.
PATCH method was added to apidocs.

JIRA: NETCONF-978
Change-Id: Ibaf22388585c4560e163bd5cda35c582135d7ad5
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
14 months agoActivate invalid block 77/105077/3
Robert Varga [Tue, 28 Mar 2023 08:39:33 +0000 (10:39 +0200)]
Activate invalid block

With the underlying improvement addressed we can enable the
commented-out block.

JIRA: NETCONF-381
Change-Id: I734214e0c3b26ab04f4cf2249b9eb582e055769a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoFix yang-library test root element 76/105076/2
Robert Varga [Tue, 28 Mar 2023 08:37:21 +0000 (10:37 +0200)]
Fix yang-library test root element

The 'modules' element is invalid, it should always be 'modules-state',
just as we have them in JSON. Fix the XML files.

Change-Id: Idd2955836f57528fbcf6863d20f6a1c0359a498f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoAcquire revision NodeList only once 75/105075/2
Robert Varga [Tue, 28 Mar 2023 08:29:14 +0000 (10:29 +0200)]
Acquire revision NodeList only once

There is absolutely no point in acquiring the node list twice, much less
executing getLength()'s internals multiple times.

Change-Id: Ibb98f05d067ce0c4b99df2f49968844dc82a0ac3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoFix LibraryModulesSchemas root 74/105074/2
Robert Varga [Tue, 28 Mar 2023 08:21:28 +0000 (10:21 +0200)]
Fix LibraryModulesSchemas root

Root element should refer to modules-state, as per the published module.

Change-Id: Iaa3d8ae6c765f836b2fe28e66501d8a28746b6e9
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoUse Map.entry() 73/105073/2
Robert Varga [Tue, 28 Mar 2023 07:42:55 +0000 (09:42 +0200)]
Use Map.entry()

We guarantee non-null values, use a well-known Map.entry() method
instead of SimpleImmutableEntry.

Change-Id: I026080a01f8cb39d12fc912cca0be1ecfdb775b7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoModernize LibraryModulesSchemas 72/105072/2
Robert Varga [Tue, 28 Mar 2023 07:40:25 +0000 (09:40 +0200)]
Modernize LibraryModulesSchemas

Use Optional.orElseThrow() instead of Optional.get() to improve clarity.

Change-Id: Ia4f65c793c58601f90cf756a5c864a558d75d4b6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoUse an instanceof pattern 71/105071/2
Robert Varga [Tue, 28 Mar 2023 07:28:45 +0000 (09:28 +0200)]
Use an instanceof pattern

Combine check and cast into an instanceof pattern.

Change-Id: I1638b2f53e164fa6d73fd50ad0ff62ffcd6eed5a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoUse javax.ws.rs.core.MediaType 28/104928/5
tobias.pobocik [Thu, 16 Mar 2023 14:07:15 +0000 (15:07 +0100)]
Use javax.ws.rs.core.MediaType

sal-rest-docgen depends on JAX-RS, hence we can use its constants for
the (constant) 'produces' field.

JIRA: NETCONF-979
Change-Id: I0ed1793cedcf0653e1d5b5cf4f1f6267ce144a46
Signed-off-by: tobias.pobocik <tobias.pobocik@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoBump versions to 5.0.5-SNAPSHOT 44/105044/1
Robert Varga [Mon, 27 Mar 2023 16:51:53 +0000 (18:51 +0200)]
Bump versions to 5.0.5-SNAPSHOT

This starts the next development iteration.

Change-Id: Ic016c2aac96bf03d06734f671769273da3abbaed
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoChange alignments in methods declaration 14/104914/6
Yaroslav Lastivka [Thu, 16 Mar 2023 08:49:03 +0000 (10:49 +0200)]
Change alignments in methods declaration

Apply commonly accepted code style to some sal-rest-docgen classes
to make further development easier.

JIRA: NETCONF-981
Change-Id: Icbd59e052bf1be767bd114425397671f0adf7865
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
14 months agoUpdate testtool documentation 02/104402/11
Peter Suna [Wed, 15 Feb 2023 13:58:24 +0000 (14:58 +0100)]
Update testtool documentation

Update URL in testtool documentation to RFC8040.
Fix the auto-connect section to use the correct parameters,
as the 'scale-util' parameters do not work in the way
described in the documentation.

JIRA: NETCONF-947
Change-Id: I6f3a97073936fa35fe667aae6ab52d1101e0a9a3
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
14 months agoDisplay default values in help section of testtool 01/104401/5
Peter Suna [Wed, 15 Feb 2023 13:53:15 +0000 (14:53 +0100)]
Display default values in help section of testtool

Not all of the default values are described
in the 'Default Parameters' documentation section. Updating it
may not be maintainable. Therefore, describing the default values
in the help output could be helpful.

JIRA: NETCONF-947
Change-Id: I4333b6f66e9c9b1067cbe012d1122748c72e5261
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
14 months agoRemove default controller values in testtol 00/104400/5
Peter Suna [Wed, 15 Feb 2023 13:51:48 +0000 (14:51 +0100)]
Remove default controller values in testtol

The default values cannot be removed from
netconf-testtool, which means that it is not possible
to turn off the auto-connect functionality.

JIRA: NETCONF-947
Change-Id: Ic8bf0730717e312ca6d7daee3a984f5b6a14419f
Signed-off-by: Peter Suna <peter.suna@pantheon.tech>
14 months agoBump aaa to 0.17.7 32/105032/1
Robert Varga [Mon, 27 Mar 2023 09:43:16 +0000 (11:43 +0200)]
Bump aaa to 0.17.7

This picks up latest updates.

Change-Id: I838f0598dc955f769fc78ba154971aeb740ab407
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
14 months agoFix schemas not shown for created devices 70/104970/2
OleksandrZharov [Mon, 20 Mar 2023 19:00:29 +0000 (20:00 +0100)]
Fix schemas not shown for created devices

Removed few lines from html template script that prevented
schemas from showing on web page.

JIRA: NETCONF-977
Change-Id: If739e6c331a45784bdd9bd00eb50b93a92a1bdb8
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
14 months agoAdd Change-event-notification-subscription-tutorial 05/104805/4
Yaroslav Lastivka [Thu, 9 Mar 2023 08:36:03 +0000 (10:36 +0200)]
Add Change-event-notification-subscription-tutorial

Change-event-notification-subscription-tutorial was moved from
Controller dev-guide to Netconf user-guide.
Old bierman-02 paths were fixed according to RFC 8040.
SSE was mentioned as a default mechanism to get notifications.
Provided steps on how to configure to use WebSockets.

JIRA: NETCONF-962
Change-Id: I3ba50494f8f0ea60d4ab1f4ed7de746df87a5ecb
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
15 months agoFix YangLib media types 00/104800/5
Ivan Hrasko [Wed, 8 Mar 2023 09:22:03 +0000 (10:22 +0100)]
Fix YangLib media types

Fix YangLib media types to return "application/yang" with default
fallback to "text/plain".

JIRA: NETCONF-972
Change-Id: Ibd7a6939342cfbe4b525442d8606e4c27d3e8b65
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoRefactor YangLibProviderTest 85/104785/1
Ivan Hrasko [Tue, 7 Mar 2023 11:24:39 +0000 (12:24 +0100)]
Refactor YangLibProviderTest

Refactor mock usage: remove not needed doNothing constructs,
move mock setup to setUp method.

Split test cases for registering empty and non-YANG resources,
unregistering models with and without revision.

JIRA: NETCONF-968
Change-Id: I5195d794f2949c2343908281488d46d27bcf07bd
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoUpdate NETCONF user guide 73/104373/17
Yaroslav Lastivka [Wed, 8 Feb 2023 17:46:34 +0000 (19:46 +0200)]
Update NETCONF user guide

User guide still contains references to removed bierman-02 paths:
`/restconf/config`, `/restconf/operational` and `restconf/operations`.

Fix them according to RFC 8040.

Make other small changes in order to make documentation up-to-date
with current state: update RFC-7895 link, update requests, default
ports and the netopeer2 usage.

JIRA: NETCONF-946
Change-Id: I94cd1fdf53ff3038a691f43f615d96645df7f023
Signed-off-by: Yaroslav Lastivka <yaroslav.lastivka@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoBump versions to 5.0.4-SNAPSHOT 66/104666/1
Robert Varga [Wed, 1 Mar 2023 15:09:32 +0000 (16:09 +0100)]
Bump versions to 5.0.4-SNAPSHOT

This starts the next development iteration.

Change-Id: I67b99862d2dfd04fc8bea573b0ae6ac366a9ede6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoFix YANG patch request for augmented element 27/102227/47
OleksandrZharov [Fri, 26 Aug 2022 15:43:24 +0000 (17:43 +0200)]
Fix YANG patch request for augmented element

When writing JSON data using yangtool's NormalizedNodeStreamWriter
we have to check if the result is instance of Augmentation.

In that case we have to use its child as data. Similar process
is applied in JsonNormalizedNodeBodyReader.

JIRA: NETCONF-747
Change-Id: I2c1d1abcd3cbb483b414408c2c768bdc5731b8ce
Signed-off-by: OleksandrZharov <Oleksandr.Zharov@pantheon.tech>
Signed-off-by: Ivan Hrasko <ivan.hrasko@pantheon.tech>
15 months agoRemove WebSocketSessionHandler.getRemoteEndpointAddress() 59/104659/1
Robert Varga [Wed, 1 Mar 2023 13:02:38 +0000 (14:02 +0100)]
Remove WebSocketSessionHandler.getRemoteEndpointAddress()

This method is not used anywhere, remove it.

Change-Id: I19efb7e687099a3f54b2623156df77d705575676
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoReduce verbosity of websocket timeout logging 58/104658/1
Robert Varga [Wed, 1 Mar 2023 12:55:56 +0000 (13:55 +0100)]
Reduce verbosity of websocket timeout logging

A websocket timing out is not a big thing, do not log a complete stack
trace when it occurs.

JIRA: NETCONF-970
Change-Id: I04ec6da1957ba13a27561dfbff9c06a10f011083
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoFix web-socket timeout closure exceptions 23/104423/6
Ruslan Kashapov [Wed, 15 Feb 2023 13:58:40 +0000 (15:58 +0200)]
Fix web-socket timeout closure exceptions

As noted in WebSocketSessionHandler.onWebSocketClosed(), there is no
guarantee the session reports isOpen(). Performing the same check in
AbstractCommonSubscriber.removeSubscriber() (via isConnected()) can
therefore result in an ISE.

Fix this by removing the check.

JIRA: NETCONF-970
Change-Id: I6e437d9821e698e3faca121402a97b88ac486229
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
15 months agoSimplify WebSocketSessionHandler.isConnected() 57/104657/1
Robert Varga [Wed, 1 Mar 2023 12:45:15 +0000 (13:45 +0100)]
Simplify WebSocketSessionHandler.isConnected()

Use a simple expression instead of a if/else.

Change-Id: Ie1a2e26f1731c799fa6e9e1b027563702809eb7f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
15 months agoEnforce idleTimeout/heartbeatInterval consistency 56/104656/1
Robert Varga [Wed, 1 Mar 2023 12:40:22 +0000 (13:40 +0100)]
Enforce idleTimeout/heartbeatInterval consistency

We should not allow a configuration where we time out before we send a
heartbeat. Enforce this invariant.

JIRA: NETCONF-970
Change-Id: Ic26319d7a3da4db9b28fa0aa2e39cdfe439fd786
Signed-off-by: Ruslan Kashapov <ruslan.kashapov@pantheon.tech>
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>