diff --git a/app/common/build.gradle b/app/common/build.gradle index c8d362770a..e693657b03 100644 --- a/app/common/build.gradle +++ b/app/common/build.gradle @@ -38,6 +38,9 @@ dependencies { api 'io.quarkus:quarkus-undertow' // Bean Validation (was transitively in spring-boot-starter-webmvc). api 'io.quarkus:quarkus-hibernate-validator' + // @Scheduled support (was spring-context scheduling). quarkus-scheduler manages its own + // executor; the former SchedulingConfig TaskScheduler bean is no longer needed. + api 'io.quarkus:quarkus-scheduler' // Swagger/OpenAPI annotations (io.swagger.v3.oas.annotations.*) used by common's API marker // interfaces; was transitive via springdoc. Quarkus' SmallRye OpenAPI also understands these. api 'io.swagger.core.v3:swagger-core-jakarta:2.2.46' diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/AccountSecurityApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/AccountSecurityApi.java index 34680febf6..4063182c1d 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/AccountSecurityApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/AccountSecurityApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/account") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/account"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Account Security", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/AdminApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/AdminApi.java index 3469d1a205..53a3c76912 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/AdminApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/AdminApi.java @@ -5,19 +5,20 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - import io.swagger.v3.oas.annotations.tags.Tag; /** * Combined annotation for Admin Settings API controllers. - * Includes @RestController, @RequestMapping("/api/v1/admin/settings"), and OpenAPI @Tag. + * + *
MIGRATION (Spring -> JAX-RS): JAX-RS/RESTEasy does NOT process {@code @Path} via custom + * meta-annotations (Spring honoured composed {@code @RestController}/{@code @RequestMapping} through + * {@code @AliasFor}; JAX-RS has no equivalent). This annotation therefore now carries only the + * OpenAPI {@code @Tag}. Each controller annotated with {@code @AdminApi} MUST additionally declare + * its own {@code @jakarta.ws.rs.Path("/api/v1/admin/settings")} (the path the removed + * {@code @RequestMapping} used to supply). */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/admin/settings") @Tag( name = "Admin Settings", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/AdminServerCertificateApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/AdminServerCertificateApi.java index 34bbe5f42f..d4e2b371c7 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/AdminServerCertificateApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/AdminServerCertificateApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/admin/server-certificate") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/admin/server-certificate"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Admin - Server Certificate", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/AnalysisApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/AnalysisApi.java index d091c8e335..1e5beddfdb 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/AnalysisApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/AnalysisApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/analysis") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/analysis"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Analysis", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/ConfigApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/ConfigApi.java index 85175adc43..953d6a76c9 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/ConfigApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/ConfigApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/config") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/config"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Config", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/ConvertApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/ConvertApi.java index b3202ad3c7..443947cb0e 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/ConvertApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/ConvertApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/convert") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/convert"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Convert", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseApi.java index 23c1ff41f2..eebd6e0c91 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/database") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/database"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Database", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseManagementApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseManagementApi.java index 7da55c3bcf..8a22f0428f 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseManagementApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/DatabaseManagementApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/admin/database") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/admin/database"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Database Management", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/FilterApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/FilterApi.java index 27b3bfa80e..595b80daa5 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/FilterApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/FilterApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/filter") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/filter"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Filter", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/GeneralApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/GeneralApi.java index 4a3601732f..10090cb4a4 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/GeneralApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/GeneralApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/general") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/general"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "General", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/InfoApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/InfoApi.java index 9fb5022ce2..5347370ba9 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/InfoApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/InfoApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/info") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/info"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Info", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/InviteApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/InviteApi.java index 144d267e9d..17ddf946c5 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/InviteApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/InviteApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/invite") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/invite"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Invite", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/MiscApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/MiscApi.java index d58c71b1e6..fa98f3d65b 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/MiscApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/MiscApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/misc") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/misc"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Misc", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/PipelineApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/PipelineApi.java index f5ad92c99b..e25ad3bd47 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/PipelineApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/PipelineApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/pipeline") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/pipeline"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Pipeline", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/ProprietaryUiDataApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/ProprietaryUiDataApi.java index 06f03ccd44..2aa52698c7 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/ProprietaryUiDataApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/ProprietaryUiDataApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -17,8 +15,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/proprietary/ui-data") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/proprietary/ui-data"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Proprietary UI Data", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/SecurityApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/SecurityApi.java index fa34ede40b..3858b66a95 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/SecurityApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/SecurityApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/security") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/security"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Security", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/SettingsApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/SettingsApi.java index 614419aaa0..d2c6ab08b0 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/SettingsApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/SettingsApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/settings") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/settings"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Settings", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/TeamApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/TeamApi.java index 07e87a70e6..77ae332800 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/TeamApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/TeamApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/team") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/team"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "Team", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/UiDataApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/UiDataApi.java index 920946aed5..8e2cb0c9bd 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/UiDataApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/UiDataApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/ui-data") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/ui-data"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "UI Data", description = diff --git a/app/common/src/main/java/stirling/software/common/annotations/api/UserApi.java b/app/common/src/main/java/stirling/software/common/annotations/api/UserApi.java index d1bf070b67..8df95431e0 100644 --- a/app/common/src/main/java/stirling/software/common/annotations/api/UserApi.java +++ b/app/common/src/main/java/stirling/software/common/annotations/api/UserApi.java @@ -5,8 +5,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag; @@ -16,8 +14,8 @@ import io.swagger.v3.oas.annotations.tags.Tag; */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) -@RestController -@RequestMapping("/api/v1/user") +// MIGRATION (Spring->JAX-RS): controllers using this annotation must declare @jakarta.ws.rs.Path("/api/v1/user"). +// JAX-RS does not honour @Path via meta-annotations, so the path is not inherited from here. @Tag( name = "User", description = diff --git a/app/common/src/main/java/stirling/software/common/config/TempFileShutdownHook.java b/app/common/src/main/java/stirling/software/common/config/TempFileShutdownHook.java index 00719deaad..c66a9e46b3 100644 --- a/app/common/src/main/java/stirling/software/common/config/TempFileShutdownHook.java +++ b/app/common/src/main/java/stirling/software/common/config/TempFileShutdownHook.java @@ -5,8 +5,8 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.Set; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.stereotype.Component; +import jakarta.annotation.PreDestroy; +import jakarta.enterprise.context.ApplicationScoped; import lombok.extern.slf4j.Slf4j; @@ -14,12 +14,12 @@ import stirling.software.common.util.GeneralUtils; import stirling.software.common.util.TempFileRegistry; /** - * Handles cleanup of temporary files on application shutdown. Implements Spring's DisposableBean - * interface to ensure cleanup happens during normal application shutdown. + * Handles cleanup of temporary files on application shutdown. Uses a CDI {@code @PreDestroy} method + * (migrated from Spring's {@code DisposableBean}) to ensure cleanup happens during normal shutdown. */ @Slf4j -@Component -public class TempFileShutdownHook implements DisposableBean { +@ApplicationScoped +public class TempFileShutdownHook { private final TempFileRegistry registry; @@ -31,8 +31,8 @@ public class TempFileShutdownHook implements DisposableBean { Runtime.getRuntime().addShutdownHook(new Thread(this::cleanupTempFiles)); } - /** Spring's DisposableBean interface method. Called during normal application shutdown. */ - @Override + /** CDI pre-destroy callback (was DisposableBean#destroy). Called during normal shutdown. */ + @PreDestroy public void destroy() { log.info("Application shutting down, cleaning up temporary files"); cleanupTempFiles(); diff --git a/app/common/src/main/java/stirling/software/common/configuration/PostHogLoggerImpl.java b/app/common/src/main/java/stirling/software/common/configuration/PostHogLoggerImpl.java index 5fadfb3523..214ee1f39d 100644 --- a/app/common/src/main/java/stirling/software/common/configuration/PostHogLoggerImpl.java +++ b/app/common/src/main/java/stirling/software/common/configuration/PostHogLoggerImpl.java @@ -1,13 +1,13 @@ package stirling.software.common.configuration; -import org.springframework.stereotype.Component; +import jakarta.enterprise.context.ApplicationScoped; import com.posthog.java.PostHogLogger; import lombok.extern.slf4j.Slf4j; @Slf4j -@Component +@ApplicationScoped public class PostHogLoggerImpl implements PostHogLogger { @Override diff --git a/app/common/src/main/java/stirling/software/common/configuration/SchedulingConfig.java b/app/common/src/main/java/stirling/software/common/configuration/SchedulingConfig.java index 650f8d9473..aa866ce7a1 100644 --- a/app/common/src/main/java/stirling/software/common/configuration/SchedulingConfig.java +++ b/app/common/src/main/java/stirling/software/common/configuration/SchedulingConfig.java @@ -1,23 +1,19 @@ package stirling.software.common.configuration; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.scheduling.TaskScheduler; -import org.springframework.scheduling.concurrent.SimpleAsyncTaskScheduler; - /** * Configures the scheduler used by all {@code @Scheduled} methods. Uses virtual threads so that * long-running scheduled tasks (e.g. cleanup, license checks, file monitoring) never block each * other — each runs on its own lightweight virtual thread. + * + *
MIGRATION (Spring -> Quarkus): the custom Spring {@code TaskScheduler} bean has been removed. + * Quarkus' {@code quarkus-scheduler} extension owns the scheduling thread pool, so no application + * bean is required. To keep the "each scheduled task on its own virtual thread" behaviour, annotate + * the individual {@code @io.quarkus.scheduler.Scheduled} methods with + * {@code @io.smallrye.common.annotation.RunOnVirtualThread} (or configure + * {@code quarkus.scheduler.use-virtual-threads=true} where supported). + * + *
TODO: Migration required - any injection point that received the former Spring
+ * {@code TaskScheduler} bean must be rewritten to use the Quarkus scheduler API or a CDI-managed
+ * {@code java.util.concurrent.ScheduledExecutorService}.
*/
-@Configuration
-public class SchedulingConfig {
-
- @Bean
- public TaskScheduler taskScheduler() {
- SimpleAsyncTaskScheduler scheduler = new SimpleAsyncTaskScheduler();
- scheduler.setVirtualThreads(true);
- scheduler.setThreadNamePrefix("scheduled-vt-");
- return scheduler;
- }
-}
+public class SchedulingConfig {}
diff --git a/app/common/src/main/java/stirling/software/common/service/PdfAnnotationService.java b/app/common/src/main/java/stirling/software/common/service/PdfAnnotationService.java
index c5a69afbb0..d76d2126f2 100644
--- a/app/common/src/main/java/stirling/software/common/service/PdfAnnotationService.java
+++ b/app/common/src/main/java/stirling/software/common/service/PdfAnnotationService.java
@@ -9,7 +9,7 @@ import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.apache.pdfbox.pdmodel.graphics.color.PDColor;
import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB;
import org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationText;
-import org.springframework.stereotype.Service;
+import jakarta.enterprise.context.ApplicationScoped;
import lombok.extern.slf4j.Slf4j;
@@ -28,7 +28,7 @@ import stirling.software.common.model.api.comments.StickyNoteSpec;
*
*/
@Slf4j
-@Service
+@ApplicationScoped
public class PdfAnnotationService {
/** Yellow sticky-note fill colour (R, G, B in 0..1 range). */
diff --git a/app/common/src/main/java/stirling/software/common/service/PdfMetadataService.java b/app/common/src/main/java/stirling/software/common/service/PdfMetadataService.java
index 7b74111870..f66bfccb43 100644
--- a/app/common/src/main/java/stirling/software/common/service/PdfMetadataService.java
+++ b/app/common/src/main/java/stirling/software/common/service/PdfMetadataService.java
@@ -7,26 +7,31 @@ import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import org.apache.pdfbox.pdmodel.PDDocument;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.stereotype.Service;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Instance;
+import jakarta.inject.Inject;
+import jakarta.inject.Named;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.common.model.PdfMetadata;
-@Service
+@ApplicationScoped
public class PdfMetadataService {
private final ApplicationProperties applicationProperties;
private final String stirlingPDFLabel;
- private final UserServiceInterface userService;
+ // MIGRATION: Spring's @Autowired(required=false) optional bean -> CDI Instance<> (UserServiceInterface
+ // is only present in security-enabled flavors). Resolve via isResolvable()/get().
+ private final Instance TODO: Migration required - the Spring form used a SpEL expression
+ * ({@code fixedDelayString="#{applicationProperties.system.tempFileManagement.cleanupIntervalMinutes}"}).
+ * Quarkus {@code @Scheduled} cannot reference an arbitrary bean property; {@code every} only
+ * resolves a MicroProfile Config placeholder. The cleanup interval must therefore be exposed as a
+ * config key (e.g. {@code stirling.temp.cleanup-interval}) bound to the same value, and the
+ * minutes->duration mapping handled in config. Default below is 30m.
+ */
+ @Scheduled(every = "{stirling.temp.cleanup-interval:30m}")
public void scheduledCleanup() {
log.info("Running scheduled temporary file cleanup");
long maxAgeMillis = tempFileManager.getMaxAgeMillis();
diff --git a/app/common/src/main/java/stirling/software/common/util/AppArgsCapture.java b/app/common/src/main/java/stirling/software/common/util/AppArgsCapture.java
index 691785187f..d1bc1c5782 100644
--- a/app/common/src/main/java/stirling/software/common/util/AppArgsCapture.java
+++ b/app/common/src/main/java/stirling/software/common/util/AppArgsCapture.java
@@ -3,27 +3,33 @@ package stirling.software.common.util;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
-import org.springframework.boot.ApplicationArguments;
-import org.springframework.boot.ApplicationRunner;
-import org.springframework.stereotype.Component;
+import io.quarkus.runtime.StartupEvent;
+import io.quarkus.runtime.annotations.CommandLineArguments;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.event.Observes;
+import jakarta.inject.Inject;
import lombok.extern.slf4j.Slf4j;
/**
* Captures application command-line arguments at startup so they can be reused for restart
* operations. This allows the application to restart with the same configuration.
+ *
+ * MIGRATION (Spring -> Quarkus): replaced Spring's {@code ApplicationRunner}/{@code
+ * ApplicationArguments} with a CDI startup observer ({@code @Observes StartupEvent}) and Quarkus'
+ * {@code @CommandLineArguments String[]} injection.
*/
@Slf4j
-@Component
-public class AppArgsCapture implements ApplicationRunner {
+@ApplicationScoped
+public class AppArgsCapture {
public static final AtomicReference> APP_ARGS = new AtomicReference<>(List.of());
- @Override
- public void run(ApplicationArguments args) {
- APP_ARGS.set(List.of(args.getSourceArgs()));
- log.debug(
- "Captured {} application arguments for restart capability",
- args.getSourceArgs().length);
+ @Inject @CommandLineArguments String[] args;
+
+ void onStart(@Observes StartupEvent event) {
+ APP_ARGS.set(List.of(args));
+ log.debug("Captured {} application arguments for restart capability", args.length);
}
}
diff --git a/app/common/src/main/java/stirling/software/common/util/CustomHtmlSanitizer.java b/app/common/src/main/java/stirling/software/common/util/CustomHtmlSanitizer.java
index 05bb6e546a..8e9dac92c9 100644
--- a/app/common/src/main/java/stirling/software/common/util/CustomHtmlSanitizer.java
+++ b/app/common/src/main/java/stirling/software/common/util/CustomHtmlSanitizer.java
@@ -4,12 +4,12 @@ import org.owasp.html.AttributePolicy;
import org.owasp.html.HtmlPolicyBuilder;
import org.owasp.html.PolicyFactory;
import org.owasp.html.Sanitizers;
-import org.springframework.stereotype.Component;
+import jakarta.enterprise.context.ApplicationScoped;
import stirling.software.common.model.ApplicationProperties;
import stirling.software.common.service.SsrfProtectionService;
-@Component
+@ApplicationScoped
public class CustomHtmlSanitizer {
private final SsrfProtectionService ssrfProtectionService;
diff --git a/app/common/src/main/java/stirling/software/common/util/FileMonitor.java b/app/common/src/main/java/stirling/software/common/util/FileMonitor.java
index dc0362b356..22f9414562 100644
--- a/app/common/src/main/java/stirling/software/common/util/FileMonitor.java
+++ b/app/common/src/main/java/stirling/software/common/util/FileMonitor.java
@@ -12,15 +12,16 @@ import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Predicate;
import java.util.stream.Stream;
-import org.springframework.beans.factory.annotation.Qualifier;
-import org.springframework.scheduling.annotation.Scheduled;
-import org.springframework.stereotype.Component;
+import io.quarkus.scheduler.Scheduled;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.inject.Named;
import lombok.extern.slf4j.Slf4j;
import stirling.software.common.configuration.RuntimePathConfig;
-@Component
+@ApplicationScoped
@Slf4j
public class FileMonitor {
@@ -38,7 +39,7 @@ public class FileMonitor {
* monitored, false otherwise
*/
public FileMonitor(
- @Qualifier("directoryFilter") Predicate