diff --git a/lighty-core/dependency-versions/pom.xml b/lighty-core/dependency-versions/pom.xml index 393021b23a..963b4e714b 100644 --- a/lighty-core/dependency-versions/pom.xml +++ b/lighty-core/dependency-versions/pom.xml @@ -25,7 +25,7 @@ org.opendaylight.odlparent odlparent - 14.0.3 + 14.0.4 pom import @@ -34,49 +34,49 @@ org.opendaylight.aaa aaa-artifacts - 0.20.1 + 0.20.3 pom import org.opendaylight.controller controller-artifacts - 10.0.2 + 10.0.4 pom import org.opendaylight.infrautils infrautils-artifacts - 7.0.3 + 7.0.4 pom import org.opendaylight.mdsal mdsal-artifacts - 14.0.2 + 14.0.4 pom import org.opendaylight.netconf netconf-artifacts - 8.0.2 + 8.0.3 pom import org.opendaylight.yangtools yangtools-artifacts - 14.0.4 + 14.0.5 pom import org.opendaylight.bgpcep bgpcep-artifacts - 0.22.4 + 0.22.6 pom import diff --git a/lighty-core/lighty-binding-parent/pom.xml b/lighty-core/lighty-binding-parent/pom.xml index d37581431b..b5d9b203e1 100644 --- a/lighty-core/lighty-binding-parent/pom.xml +++ b/lighty-core/lighty-binding-parent/pom.xml @@ -49,12 +49,12 @@ org.opendaylight.yangtools yang-maven-plugin - 14.0.4 + 14.0.5 org.opendaylight.yangtools binding-codegen - 14.0.4 + 14.0.5 diff --git a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java index a336a822f1..9d2bfe5a7c 100644 --- a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java +++ b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/ConverterUtils.java @@ -44,13 +44,11 @@ private ConverterUtils() { * Returns the {@link RpcDefinition} from the given {@link EffectiveModelContext} and given {@link QName}. * The {@link QName} of a rpc can be constructed via * - *

- * {@code + *

{@code * QName.create("http://netconfcentral.org/ns/toaster", "2009-11-20", "make-toast"); * } , where {@code "make-toast"} is the name of the RPC given in the yang model. * - *

- * If the given RPC was found in the {@link EffectiveModelContext} the {@link RpcDefinition} will be returned + *

If the given RPC was found in the {@link EffectiveModelContext} the {@link RpcDefinition} will be returned * * @param effectiveModelContext the effective model context used for the RPC resolution * @param rpcQName {@link QName} of the RPC @@ -175,8 +173,7 @@ public static XmlElement rpcAsOutput(final XmlElement inputXmlElement, final Str /** * Finds the {@link DataSchemaContext} for the given {@link QName} in {@link EffectiveModelContext}. * - *

- * Search is performed only on first level nodes of the modules, for recursive search, + *

Search is performed only on first level nodes of the modules, for recursive search, * the {@link YangInstanceIdentifier} is needed, thus consider using * {@link ConverterUtils#getSchemaNode(EffectiveModelContext, YangInstanceIdentifier)}. * @@ -206,8 +203,7 @@ public static XmlElement rpcAsOutput(final XmlElement inputXmlElement, final Str * Finds the {@link DataSchemaContext} for the given namespace, revision and local name * in {@link EffectiveModelContext}. * - *

- * Search is performed only on first level nodes of the modules, for recursive search, + *

Search is performed only on first level nodes of the modules, for recursive search, * the {@link YangInstanceIdentifier} is needed, thus consider using * {@link ConverterUtils#getSchemaNode(EffectiveModelContext, YangInstanceIdentifier)}. * diff --git a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java index 3bd0325526..76cdda6014 100644 --- a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java +++ b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/JsonNodeConverter.java @@ -52,11 +52,9 @@ public class JsonNodeConverter implements NodeConverter { * This constructor will create an instance of {@link JsonNodeConverter} with the given * {@link EffectiveModelContext}. * - *

- * The effective model context will be used for proper RPC and Node resolution. + *

The effective model context will be used for proper RPC and Node resolution. * - *

- * The {@code JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02} will be used for JSON + *

The {@code JSONCodecFactorySupplier.DRAFT_LHOTKA_NETMOD_YANG_JSON_02} will be used for JSON * serialization/deserialization of data. * * @param effectiveModelContext initial effective model context @@ -69,11 +67,9 @@ public JsonNodeConverter(final EffectiveModelContext effectiveModelContext) { * This constructor will create an instance of {@link JsonNodeConverter} with the given * {@link EffectiveModelContext} and customizable {@link JSONCodecFactorySupplier}. * - *

- * The effective model context will be used for proper RPC and Node resolution. + *

The effective model context will be used for proper RPC and Node resolution. * - *

- * The {@code JSONCodecFactorySupplier} instance will be used for JSON serialization/deserialization of data. + *

The {@code JSONCodecFactorySupplier} instance will be used for JSON serialization/deserialization of data. * * @param effectiveModelContext initial effective model context * @param jsonCodecFactorySupplier JSON codec factory supplier diff --git a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/XmlNodeConverter.java b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/XmlNodeConverter.java index 29c526cd8d..2b0a5acd9d 100644 --- a/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/XmlNodeConverter.java +++ b/lighty-core/lighty-codecs-util/src/main/java/io/lighty/codecs/util/XmlNodeConverter.java @@ -127,8 +127,7 @@ public Writer serializeRpc(final Inference inference, final NormalizedNode norma /** * Deserializes a given XML input data into {@link NormalizedNode}. * - *

- * In the case of deserializing multiple top level list entries, entries are expected to be wrapped in + *

In the case of deserializing multiple top level list entries, entries are expected to be wrapped in * {@code }. * * @param inference {@link Inference} pointing to a node we are trying to deserialize diff --git a/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java b/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java index cd3d957432..1d58a6fe3b 100644 --- a/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java +++ b/lighty-core/lighty-controller-spring-di/src/main/java/io/lighty/core/controller/spring/LightyCoreSpringConfiguration.java @@ -46,8 +46,7 @@ * {@link LightyController} shutdown process. This configuration initializes all core lighty.io services as spring * beans. * - *

- * Example: + *

Example: *

  * @Configuration
  * public class LightyConfiguration extends LightyCoreSprigConfiguration {
diff --git a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java
index 7162691e1e..7a21f6d79f 100644
--- a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java
+++ b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/api/AbstractLightyModule.java
@@ -35,8 +35,7 @@
  * {@link AbstractLightyModule#startBlocking()} and
  * {@link AbstractLightyModule#shutdown()} methods.
  *
- * 

- * Example usage: + *

Example usage: *

  * 
  *     public class MyLightyModule extends AbstractLightyModule {
@@ -212,8 +211,7 @@ public final boolean shutdown(final long duration, final TimeUnit unit) {
     /**
      * Invoke blocking shutdown after blocking start.
      *
-     * 

- * Release CountDownLatch locking this thread and shutdown. + *

Release CountDownLatch locking this thread and shutdown. * @param duration duration to wait for shutdown to complete * @param unit {@link TimeUnit} of {@code duration} * @return {@code boolean} indicating shutdown sucess diff --git a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/util/FileToDatastoreUtils.java b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/util/FileToDatastoreUtils.java index b70953a53d..070c29b43a 100644 --- a/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/util/FileToDatastoreUtils.java +++ b/lighty-core/lighty-controller/src/main/java/io/lighty/core/controller/impl/util/FileToDatastoreUtils.java @@ -83,11 +83,9 @@ public static void importConfigDataFile(final InputStream inputStream, /** * Writes/merges input stream containing serialized normalized node data into config datastore. * - *

- * Node is written at root node, that means only top level nodes are supported. + *

Node is written at root node, that means only top level nodes are supported. * - *

- * In the case of importing XML file, node needs to be wrapped in + *

In the case of importing XML file, node needs to be wrapped in * {@code } element. * * @param inputStream stream of serialized node to deserialize diff --git a/lighty-core/lighty-parent/pom.xml b/lighty-core/lighty-parent/pom.xml index fe07e24f8c..17aa5e493f 100644 --- a/lighty-core/lighty-parent/pom.xml +++ b/lighty-core/lighty-parent/pom.xml @@ -193,7 +193,7 @@ com.puppycrawl.tools checkstyle - 10.18.1 + 10.18.2 com.github.sevntu-checkstyle @@ -203,7 +203,7 @@ org.opendaylight.odlparent checkstyle - 14.0.3 + 14.0.4 @@ -220,7 +220,7 @@ org.opendaylight.odlparent spotbugs - 14.0.3 + 14.0.4 diff --git a/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/NetconfDeviceRestService.java b/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/NetconfDeviceRestService.java index 8ff93141d8..1e910f20f8 100644 --- a/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/NetconfDeviceRestService.java +++ b/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/NetconfDeviceRestService.java @@ -29,8 +29,8 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240611.credentials.credentials.LoginPwUnencryptedBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240611.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.credentials.credentials.LoginPwUnencryptedBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.NetconfNodeAugmentBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.netconf.node.augment.NetconfNodeBuilder; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology; diff --git a/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/dto/NetconfDeviceResponse.java b/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/dto/NetconfDeviceResponse.java index bf25fd4635..32f4b0a16c 100644 --- a/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/dto/NetconfDeviceResponse.java +++ b/lighty-examples/lighty-controller-springboot-netconf/src/main/java/io/lighty/core/controller/springboot/rest/dto/NetconfDeviceResponse.java @@ -10,7 +10,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240611.ConnectionOper.ConnectionStatus; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.ConnectionOper.ConnectionStatus; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.NetconfNodeAugment; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node; diff --git a/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/TopologyPluginsTest.java b/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/TopologyPluginsTest.java index 8d6955f8d4..f0f7056490 100644 --- a/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/TopologyPluginsTest.java +++ b/lighty-modules/integration-tests/src/test/java/io/lighty/modules/southbound/netconf/tests/TopologyPluginsTest.java @@ -33,9 +33,9 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240611.credentials.Credentials; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240611.credentials.credentials.LoginPwUnencryptedBuilder; -import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev240611.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.credentials.Credentials; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.credentials.credentials.LoginPwUnencryptedBuilder; +import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev241009.credentials.credentials.login.pw.unencrypted.LoginPasswordUnencryptedBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.NetconfNodeAugment; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.NetconfNodeAugmentBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev240911.netconf.node.augment.NetconfNode; diff --git a/lighty-modules/lighty-openapi/src/main/java/io/lighty/openapi/OpenApiLighty.java b/lighty-modules/lighty-openapi/src/main/java/io/lighty/openapi/OpenApiLighty.java index 0b1d2caac0..b1505821e9 100644 --- a/lighty-modules/lighty-openapi/src/main/java/io/lighty/openapi/OpenApiLighty.java +++ b/lighty-modules/lighty-openapi/src/main/java/io/lighty/openapi/OpenApiLighty.java @@ -7,7 +7,7 @@ */ package io.lighty.openapi; -import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider; +import com.fasterxml.jackson.core.JsonFactoryBuilder; import com.google.common.annotations.VisibleForTesting; import io.lighty.core.controller.api.AbstractLightyModule; import io.lighty.core.controller.api.LightyServices; @@ -21,8 +21,9 @@ import org.eclipse.jetty.servlet.ServletHolder; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletContainer; -import org.opendaylight.restconf.openapi.api.OpenApiService; import org.opendaylight.restconf.openapi.impl.OpenApiServiceImpl; +import org.opendaylight.restconf.openapi.jaxrs.JaxRsOpenApi; +import org.opendaylight.restconf.openapi.jaxrs.OpenApiBodyWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -40,7 +41,7 @@ public class OpenApiLighty extends AbstractLightyModule { private final LightyServerBuilder jettyServerBuilder; private final LightyServices lightyServices; - private OpenApiService apiDocService; + private JaxRsOpenApi jaxRsOpenApi; public OpenApiLighty(RestConfConfiguration restConfConfiguration, LightyServerBuilder jettyServerBuilder, LightyServices lightyServices) { @@ -57,14 +58,17 @@ protected boolean initProcedure() { String basePathString = restConfConfiguration.getRestconfServletContextPath().replaceAll("^/+", ""); LOG.info("basePath: {}", basePathString); - this.apiDocService = new OpenApiServiceImpl(lightyServices.getDOMSchemaService(), - lightyServices.getDOMMountPointService(), lightyServices.getJaxRsEndpoint()); + final var openApiService = new OpenApiServiceImpl(lightyServices.getDOMSchemaService(), + lightyServices.getDOMMountPointService(), lightyServices.getJaxRsEndpoint()); + + this.jaxRsOpenApi = new JaxRsOpenApi(openApiService); final ServletContainer restServletContainer = new ServletContainer(ResourceConfig .forApplication((new Application() { @Override public Set getSingletons() { - return Set.of(apiDocService, new JacksonJaxbJsonProvider()); + return Set.of(new JaxRsOpenApi(openApiService), + new OpenApiBodyWriter(new JsonFactoryBuilder().build())); } }))); @@ -100,7 +104,7 @@ private void addStaticResources(ServletContextHandler mainHandler, String path, } @VisibleForTesting - OpenApiService getApiDocService() { - return apiDocService; + JaxRsOpenApi getJaxRsOpenApi() { + return jaxRsOpenApi; } } diff --git a/lighty-modules/lighty-openapi/src/test/java/io/lighty/openapi/OpenApiLightyTest.java b/lighty-modules/lighty-openapi/src/test/java/io/lighty/openapi/OpenApiLightyTest.java index 098275a727..6e020cbbb5 100644 --- a/lighty-modules/lighty-openapi/src/test/java/io/lighty/openapi/OpenApiLightyTest.java +++ b/lighty-modules/lighty-openapi/src/test/java/io/lighty/openapi/OpenApiLightyTest.java @@ -28,20 +28,20 @@ public void simpleOpenApiModuleTest() { } public void testGetListOfMounts(UriInfo uriInfo) { - assertSuccessResponse(getOpenApiModule().getApiDocService().getListOfMounts(uriInfo)); + assertSuccessResponse(getOpenApiModule().getJaxRsOpenApi().getListOfMounts(uriInfo)); } public void testGetAllModulesDoc(UriInfo uriInfo) throws IOException { - assertSuccessResponse(getOpenApiModule().getApiDocService().getAllModulesDoc(uriInfo, 0, 0, 0, 0)); + assertSuccessResponse(getOpenApiModule().getJaxRsOpenApi().getAllModulesDoc(uriInfo, 0, 0, 0, 0)); } public void testGetDocByModule(UriInfo uriInfo, String modelName, String revisionDate) throws IOException { assertSuccessResponse( - getOpenApiModule().getApiDocService().getDocByModule(modelName, revisionDate, uriInfo, 0, 0)); + getOpenApiModule().getJaxRsOpenApi().getDocByModule(modelName, revisionDate, uriInfo, 0, 0)); } public void testGetApiExplorer(UriInfo uriInfo) { - final Response response = getOpenApiModule().getApiDocService().getApiExplorer(uriInfo); + final Response response = getOpenApiModule().getJaxRsOpenApi().getApiExplorer(uriInfo); final int redirectCode = 303; Assert.assertEquals(response.getStatus(), redirectCode); @@ -58,7 +58,7 @@ protected UriInfo mockUriInfo(String path) { Mockito.when(uriInfo.getAbsolutePath()).thenReturn(absolutePathUri); Mockito.when(uriInfo.getBaseUri()).thenReturn(URI.create(path)); Mockito.when(uriInfo.getBaseUriBuilder()).thenReturn(UriBuilder.fromPath(path)); - Mockito.when(uriInfo.getRequestUriBuilder()).thenReturn(UriBuilder.fromUri(absolutePathUri)); + Mockito.when(uriInfo.getRequestUri()).thenReturn(absolutePathUri); return uriInfo; }