diff --git a/kontekst/pom.xml b/kontekst/pom.xml
index 4a0ba8e..0df23c6 100644
--- a/kontekst/pom.xml
+++ b/kontekst/pom.xml
@@ -6,7 +6,7 @@
prosesstask-root
no.nav.vedtak.prosesstask
- 0.0.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
prosesstask-kontekst
diff --git a/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstCdiProsessTaskDispatcher.java b/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstCdiProsessTaskDispatcher.java
index fcb83a6..3c3955f 100644
--- a/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstCdiProsessTaskDispatcher.java
+++ b/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstCdiProsessTaskDispatcher.java
@@ -2,7 +2,7 @@
import java.util.Set;
-import javax.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.context.ApplicationScoped;
import no.nav.vedtak.exception.IntegrasjonException;
import no.nav.vedtak.exception.TekniskException;
@@ -21,7 +21,7 @@
*/
@ApplicationScoped
public class KontekstCdiProsessTaskDispatcher extends BasicCdiProsessTaskDispatcher {
- private static final MdcExtendedLogContext LOG_CONTEXT = MdcExtendedLogContext.getContext("prosess");
+ private static final MdcExtendedLogContext LOG_CONTEXT = MdcExtendedLogContext.getContext("prosess");
public KontekstCdiProsessTaskDispatcher() {
super(Set.of(TekniskException.class, IntegrasjonException.class));
@@ -31,14 +31,14 @@ public KontekstCdiProsessTaskDispatcher() {
public void dispatch(ProsessTaskData task) {
try (ProsessTaskHandlerRef taskHandler = taskHandler(task.taskType())) {
if (task.getSaksnummer() != null) {
- LOG_CONTEXT.add("fagsak", task.getSaksnummer());
+ LOG_CONTEXT.add("fagsak", task.getSaksnummer());
} else if (task.getFagsakId() != null) { // NOSONAR
LOG_CONTEXT.add("fagsak", task.getFagsakId()); // NOSONAR
}
if (task.getBehandlingId() != null) {
- LOG_CONTEXT.add("behandling", task.getBehandlingId());
+ LOG_CONTEXT.add("behandling", task.getBehandlingId());
} else if (task.getBehandlingUuid() != null) {
- LOG_CONTEXT.add("behandling", task.getBehandlingUuid());
+ LOG_CONTEXT.add("behandling", task.getBehandlingUuid());
}
taskHandler.doTask(task);
diff --git a/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstSubjectProvider.java b/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstSubjectProvider.java
index 95518f1..8b2860b 100644
--- a/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstSubjectProvider.java
+++ b/kontekst/src/main/java/no/nav/vedtak/prosesstask/kontekst/KontekstSubjectProvider.java
@@ -2,7 +2,7 @@
import java.util.Optional;
-import javax.enterprise.context.Dependent;
+import jakarta.enterprise.context.Dependent;
import no.nav.foreldrepenger.konfig.Environment;
import no.nav.vedtak.felles.prosesstask.impl.SubjectProvider;
diff --git a/kontekst/src/main/resources/META-INF/beans.xml b/kontekst/src/main/resources/META-INF/beans.xml
index 847ce7d..8c5870f 100644
--- a/kontekst/src/main/resources/META-INF/beans.xml
+++ b/kontekst/src/main/resources/META-INF/beans.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/pom.xml b/pom.xml
index a74dc1c..1130bce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
no.nav.vedtak.prosesstask
prosesstask-root
- 0.0.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
pom
Prosesstask :: Root
@@ -53,11 +53,10 @@
fp-prosesstask
navikt_fp-prosesstask
- 4.4.4
+ 5.0.0
- 8.0.0
- 2.2.3
- 5.6.15.Final
+ 9.1.0
+ 6.1.7.Final
@@ -78,12 +77,6 @@
import
pom
-
-
- jakarta.persistence
- jakarta.persistence-api
- ${jakarta.persistence.version}
-
no.nav.vedtak.prosesstask
@@ -131,23 +124,28 @@
felles-abac
${felles.version}
+
+ no.nav.foreldrepenger.felles
+ felles-testutilities
+ ${felles.version}
+
org.jboss.weld
weld-core-bom
- 3.1.9.Final
+ 4.0.3.Final
import
pom
- org.hibernate
+ org.hibernate.orm
hibernate-core
${hibernate-core.version}
- org.hibernate
+ org.hibernate.orm
hibernate-micrometer
${hibernate-core.version}
@@ -156,7 +154,7 @@
org.glassfish.jaxb
jaxb-bom
- 2.3.6
+ 3.0.1
import
pom
@@ -165,7 +163,7 @@
org.eclipse.jetty
jetty-bom
- 10.0.15
+ 11.0.15
import
pom
@@ -199,7 +197,7 @@
io.swagger.core.v3
- swagger-annotations
+ swagger-annotations-jakarta
2.2.15
@@ -225,12 +223,6 @@
postgresql
42.6.0
-
-
- no.nav.foreldrepenger.felles
- felles-testutilities
- ${felles.version}
-
org.assertj
assertj-core
@@ -239,7 +231,7 @@
ch.qos.logback
logback-classic
- 1.3.11
+ 1.4.11
diff --git a/rest/pom.xml b/rest/pom.xml
index 7b14d44..269962f 100644
--- a/rest/pom.xml
+++ b/rest/pom.xml
@@ -6,7 +6,7 @@
no.nav.vedtak.prosesstask
prosesstask-root
- 0.0.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
prosesstask-rest-api
@@ -42,7 +42,7 @@
io.swagger.core.v3
- swagger-annotations
+ swagger-annotations-jakarta
provided
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/ProsessTaskRestTjeneste.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/ProsessTaskRestTjeneste.java
index 48f5056..35a1d7c 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/ProsessTaskRestTjeneste.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/ProsessTaskRestTjeneste.java
@@ -3,17 +3,17 @@
import java.net.HttpURLConnection;
import java.util.List;
-import javax.enterprise.context.RequestScoped;
-import javax.inject.Inject;
-import javax.transaction.Transactional;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.ws.rs.Consumes;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
+import jakarta.enterprise.context.RequestScoped;
+import jakarta.inject.Inject;
+import jakarta.transaction.Transactional;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import jakarta.ws.rs.Consumes;
+import jakarta.ws.rs.POST;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.Produces;
+import jakarta.ws.rs.core.MediaType;
+import jakarta.ws.rs.core.Response;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/app/ProsessTaskApplikasjonTjeneste.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/app/ProsessTaskApplikasjonTjeneste.java
index 30317a5..3117eb2 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/app/ProsessTaskApplikasjonTjeneste.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/app/ProsessTaskApplikasjonTjeneste.java
@@ -4,8 +4,8 @@
import java.util.List;
import java.util.Optional;
-import javax.enterprise.context.Dependent;
-import javax.inject.Inject;
+import jakarta.enterprise.context.Dependent;
+import jakarta.inject.Inject;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskData;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskStatus;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/FeiletProsessTaskDataDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/FeiletProsessTaskDataDto.java
index ec34da5..0903248 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/FeiletProsessTaskDataDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/FeiletProsessTaskDataDto.java
@@ -1,7 +1,7 @@
package no.nav.vedtak.felles.prosesstask.rest.dto;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
@@ -22,12 +22,12 @@ public class FeiletProsessTaskDataDto {
@Size(max=100)
@Pattern(regexp = "^[\\p{Alnum}_.\\-]*$")
private String sisteKjøringServerProsess;
-
+
@JsonProperty(value="sisteFeilTekst")
@Size(max=100_000)
@Pattern(regexp = "^[\\p{Alnum}_.\\-]*$")
private String sisteFeilTekst;
-
+
@JsonProperty(value="feiledeForsøk")
private Integer feiledeForsøk;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskDataDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskDataDto.java
index 2b7833f..2e5294a 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskDataDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskDataDto.java
@@ -3,9 +3,9 @@
import java.time.LocalDateTime;
import java.util.Properties;
-import javax.validation.Valid;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskIdDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskIdDto.java
index 1d92e52..4f5aa0a 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskIdDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskIdDto.java
@@ -1,8 +1,8 @@
package no.nav.vedtak.felles.prosesstask.rest.dto;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskOpprettInputDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskOpprettInputDto.java
index b1e5ad6..5066fe0 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskOpprettInputDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskOpprettInputDto.java
@@ -2,10 +2,10 @@
import java.util.Properties;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartInputDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartInputDto.java
index 56de431..ae84e69 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartInputDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartInputDto.java
@@ -1,10 +1,10 @@
package no.nav.vedtak.felles.prosesstask.rest.dto;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartResultatDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartResultatDto.java
index d3202cb..210b126 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartResultatDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRestartResultatDto.java
@@ -2,8 +2,8 @@
import java.time.LocalDateTime;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRetryAllResultatDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRetryAllResultatDto.java
index 6fb6042..7b8de1e 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRetryAllResultatDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskRetryAllResultatDto.java
@@ -3,8 +3,8 @@
import java.util.ArrayList;
import java.util.List;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskSetFerdigInputDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskSetFerdigInputDto.java
index c066941..71ba95b 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskSetFerdigInputDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskSetFerdigInputDto.java
@@ -1,10 +1,10 @@
package no.nav.vedtak.felles.prosesstask.rest.dto;
-import javax.validation.constraints.Max;
-import javax.validation.constraints.Min;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.Max;
+import jakarta.validation.constraints.Min;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskStatusDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskStatusDto.java
index 1a779cb..9830779 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskStatusDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/ProsessTaskStatusDto.java
@@ -1,8 +1,8 @@
package no.nav.vedtak.felles.prosesstask.rest.dto;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/SokeFilterDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/SokeFilterDto.java
index 392dd37..88e0ab7 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/SokeFilterDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/SokeFilterDto.java
@@ -2,10 +2,10 @@
import java.time.LocalDate;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Pattern;
-import javax.validation.constraints.Size;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Pattern;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
@@ -27,11 +27,11 @@ public class SokeFilterDto {
@Size(min = 5, max=200)
@Pattern(regexp = "^[\\p{Alnum}_.=\\-]*$")
private String tekst;
-
+
@JsonProperty(value = "sisteKjoeretidspunktFraOgMed")
@Valid
private LocalDate opprettetFraOgMed = LocalDate.now().minusMonths(12);
-
+
@JsonProperty(value = "sisteKjoeretidspunktTilOgMed")
@Valid
private LocalDate opprettetTilOgMed = LocalDate.now();
diff --git a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/StatusFilterDto.java b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/StatusFilterDto.java
index f4d85b6..2453707 100644
--- a/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/StatusFilterDto.java
+++ b/rest/src/main/java/no/nav/vedtak/felles/prosesstask/rest/dto/StatusFilterDto.java
@@ -3,9 +3,9 @@
import java.util.ArrayList;
import java.util.List;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/rest/src/main/resources/META-INF/beans.xml b/rest/src/main/resources/META-INF/beans.xml
index 847ce7d..8c5870f 100644
--- a/rest/src/main/resources/META-INF/beans.xml
+++ b/rest/src/main/resources/META-INF/beans.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/task/pom.xml b/task/pom.xml
index 6dc31fb..123877a 100644
--- a/task/pom.xml
+++ b/task/pom.xml
@@ -6,7 +6,7 @@
no.nav.vedtak.prosesstask
prosesstask-root
- 0.0.0-SNAPSHOT
+ 0.5.0-SNAPSHOT
prosesstask
@@ -14,7 +14,11 @@
jar
-
+
+ jakarta.transaction
+ jakarta.transaction-api
+
+
no.nav.foreldrepenger.felles
felles-log
provided
@@ -37,12 +41,12 @@
- org.hibernate
+ org.hibernate.orm
hibernate-core
provided
- org.hibernate
+ org.hibernate.orm
hibernate-micrometer
provided
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTask.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTask.java
index 442f9ee..b960b88 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTask.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTask.java
@@ -7,9 +7,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
-import javax.enterprise.inject.Stereotype;
-import javax.enterprise.util.Nonbinding;
-import javax.inject.Qualifier;
+import jakarta.enterprise.inject.Stereotype;
+import jakarta.enterprise.util.Nonbinding;
+import jakarta.inject.Qualifier;
/**
* Marker type som implementerer interface {@link ProsessTaskHandler}.
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTaskFeil.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTaskFeil.java
index 97008aa..8239b68 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTaskFeil.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/api/ProsessTaskFeil.java
@@ -4,7 +4,7 @@
import java.io.PrintWriter;
import java.io.StringWriter;
-import javax.persistence.Embeddable;
+import jakarta.persistence.Embeddable;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BasicCdiProsessTaskDispatcher.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BasicCdiProsessTaskDispatcher.java
index e4151dc..eaf6637 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BasicCdiProsessTaskDispatcher.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BasicCdiProsessTaskDispatcher.java
@@ -6,7 +6,7 @@
import java.util.LinkedHashSet;
import java.util.Set;
-import javax.persistence.QueryTimeoutException;
+import jakarta.persistence.QueryTimeoutException;
import org.hibernate.exception.JDBCConnectionException;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BatchTaskScheduler.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BatchTaskScheduler.java
index 4c3c0dd..59a6416 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BatchTaskScheduler.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/BatchTaskScheduler.java
@@ -2,10 +2,10 @@
import java.time.LocalDateTime;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.context.control.ActivateRequestContext;
-import javax.inject.Inject;
-import javax.transaction.Transactional;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.context.control.ActivateRequestContext;
+import jakarta.inject.Inject;
+import jakarta.transaction.Transactional;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/DefaultProsessTaskDispatcher.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/DefaultProsessTaskDispatcher.java
index ad2a8a8..9cc2064 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/DefaultProsessTaskDispatcher.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/DefaultProsessTaskDispatcher.java
@@ -1,6 +1,6 @@
package no.nav.vedtak.felles.prosesstask.impl;
-import javax.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.context.ApplicationScoped;
/** Default dispatcher - benyttes dersom ingen andre er definert. */
@ApplicationScoped
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/FatalErrorTask.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/FatalErrorTask.java
index aceadc9..9ab0ee8 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/FatalErrorTask.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/FatalErrorTask.java
@@ -5,11 +5,11 @@
import java.util.Objects;
import java.util.Optional;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.control.ActivateRequestContext;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.transaction.Transactional;
+import jakarta.enterprise.context.Dependent;
+import jakarta.enterprise.context.control.ActivateRequestContext;
+import jakarta.inject.Inject;
+import jakarta.persistence.EntityManager;
+import jakarta.transaction.Transactional;
import org.hibernate.Session;
import org.hibernate.jdbc.Work;
@@ -37,7 +37,7 @@ public class FatalErrorTask {
@Inject
public FatalErrorTask(TaskManagerRepositoryImpl taskManagerRepo) {
- Objects.requireNonNull(taskManagerRepo, "taskManagerRepo");
+ Objects.requireNonNull(taskManagerRepo, "taskManagerRepo");
this.taskManagerRepository = taskManagerRepo;
}
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/HandleProsessTaskLifecycleObserver.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/HandleProsessTaskLifecycleObserver.java
index 770c861..5c76021 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/HandleProsessTaskLifecycleObserver.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/HandleProsessTaskLifecycleObserver.java
@@ -5,8 +5,8 @@
import java.util.List;
import java.util.Optional;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.spi.CDI;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.spi.CDI;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskData;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskGruppe;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEntitet.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEntitet.java
index db26920..9cc7203 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEntitet.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEntitet.java
@@ -7,20 +7,21 @@
import java.util.Objects;
import java.util.Properties;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Column;
-import javax.persistence.Convert;
-import javax.persistence.Converter;
-import javax.persistence.Entity;
-import javax.persistence.GeneratedValue;
-import javax.persistence.GenerationType;
-import javax.persistence.Id;
-import javax.persistence.Lob;
-import javax.persistence.Table;
-import javax.persistence.Version;
-
+import org.hibernate.annotations.Parameter;
import org.hibernate.annotations.Type;
-
+import org.hibernate.usertype.UserTypeLegacyBridge;
+
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
+import jakarta.persistence.Converter;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+import jakarta.persistence.Lob;
+import jakarta.persistence.Table;
+import jakarta.persistence.Version;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskData;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskDataBuilder;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskInfo;
@@ -51,7 +52,10 @@ public class ProsessTaskEntitet {
private LocalDateTime nesteKjøringEtter;
@Lob
- @Type(type = "org.hibernate.type.TextType")
+ @Type(
+ value = UserTypeLegacyBridge.class,
+ parameters = @Parameter(name = UserTypeLegacyBridge.TYPE_NAME_PARAM_KEY, value = "org.hibernate.type.TextType")
+ )
@Column(name = "task_payload")
private String payload;
@@ -69,7 +73,10 @@ public class ProsessTaskEntitet {
private String sisteFeilKode;
@Lob
- @Type(type = "org.hibernate.type.TextType")
+ @Type(
+ value = UserTypeLegacyBridge.class,
+ parameters = @Parameter(name = UserTypeLegacyBridge.TYPE_NAME_PARAM_KEY, value = "org.hibernate.type.TextType")
+ )
@Column(name = "siste_kjoering_feil_tekst")
private String sisteFeilTekst;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEventPubliserer.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEventPubliserer.java
index 7a2d539..9ec3da5 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEventPubliserer.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskEventPubliserer.java
@@ -1,8 +1,8 @@
package no.nav.vedtak.felles.prosesstask.impl;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.event.Event;
-import javax.inject.Inject;
+import jakarta.enterprise.context.Dependent;
+import jakarta.enterprise.event.Event;
+import jakarta.inject.Inject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -36,7 +36,7 @@ public void fireEvent(ProsessTaskData data, ProsessTaskStatus gammelStatus, Pros
// observere uten å la tasken endre status.
try {
publiserer.fire(new ProsessTaskEvent(data, gammelStatus, nyStatus, feil, orgException));
- } catch (RuntimeException e) {
+ } catch (RuntimeException e) {
// logger og svelger exception her. Feil oppstått i event observer
String orgExceptionMessage = orgException == null ? null : String.valueOf(orgException);
LOG.warn("PT-314162 Pollet task for kjøring: id={}, type={}, originalException={}", data.getId(), data.getTaskType(), orgExceptionMessage,
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskHandlerRef.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskHandlerRef.java
index 38e7d21..038808a 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskHandlerRef.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskHandlerRef.java
@@ -3,9 +3,9 @@
import java.lang.annotation.Annotation;
import java.util.Set;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.inject.spi.CDI;
-import javax.enterprise.util.AnnotationLiteral;
+import jakarta.enterprise.context.Dependent;
+import jakarta.enterprise.inject.spi.CDI;
+import jakarta.enterprise.util.AnnotationLiteral;
import org.jboss.weld.interceptor.util.proxy.TargetInstanceProxy;
import org.slf4j.Logger;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskRepository.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskRepository.java
index 59037f8..b2a5ef2 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskRepository.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskRepository.java
@@ -7,18 +7,16 @@
import java.util.List;
import java.util.Objects;
import java.util.Set;
-import java.util.stream.Collectors;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-
-import org.hibernate.jpa.QueryHints;
+import org.hibernate.jpa.HibernateHints;
import org.hibernate.query.NativeQuery;
import org.slf4j.MDC;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Instance;
+import jakarta.inject.Inject;
+import jakarta.persistence.EntityManager;
import no.nav.vedtak.exception.TekniskException;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskData;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskGruppe;
@@ -170,9 +168,9 @@ protected Long doLagreTask(ProsessTaskData task) {
}
public ProsessTaskData finn(Long id) {
- var prosessTaskEntitet = this.entityManager.createQuery("from ProsessTaskEntitet pt where pt.id=:id", ProsessTaskEntitet.class)
+ var prosessTaskEntitet = this.entityManager.createQuery("select pt from ProsessTaskEntitet pt where pt.id=:id", ProsessTaskEntitet.class)
.setParameter("id", id)
- .setHint(QueryHints.HINT_CACHE_MODE, "IGNORE")
+ .setHint(HibernateHints.HINT_CACHE_MODE, "IGNORE")
.getSingleResult();
return prosessTaskEntitet == null ? null : prosessTaskEntitet.tilProsessTask();
}
@@ -183,7 +181,7 @@ public List finnAlle(List statuses) {
}
var statusNames = statuses.stream().map(ProsessTaskStatus::getDbKode).toList();
var query = entityManager
- .createQuery("from ProsessTaskEntitet pt where pt.status in(:statuses)", ProsessTaskEntitet.class)
+ .createQuery("select pt from ProsessTaskEntitet pt where pt.status in(:statuses)", ProsessTaskEntitet.class)
.setParameter("statuses", statusNames);
return tilProsessTask(query.getResultList());
}
@@ -193,14 +191,14 @@ public List finnGruppeIkkeFerdig(String gruppe) {
throw new IllegalArgumentException("Ugyldig søk etter tasks");
}
var ikkeFerdigStatusNames = Arrays.stream(ProsessTaskStatus.values())
- .filter(ProsessTaskStatus::erIkkeFerdig)
- .map(ProsessTaskStatus::getDbKode)
- .toList();
+ .filter(ProsessTaskStatus::erIkkeFerdig)
+ .map(ProsessTaskStatus::getDbKode)
+ .toList();
var query = entityManager
- .createQuery("from ProsessTaskEntitet pt where pt pt.status in(:statuses) and pt.task_gruppe = :gruppe",
- ProsessTaskEntitet.class)
- .setParameter("statuses", ikkeFerdigStatusNames)
- .setParameter("gruppe", gruppe);
+ .createQuery("select pt from ProsessTaskEntitet pt where pt.status in(:statuses) and pt.gruppe = :gruppe",
+ ProsessTaskEntitet.class)
+ .setParameter("statuses", ikkeFerdigStatusNames)
+ .setParameter("gruppe", gruppe);
return tilProsessTask(query.getResultList());
}
@@ -221,7 +219,7 @@ public List finnGruppeIkkeFerdig(String gruppe) {
.setParameter("opprettetFraOgMed", opprettetFraOgMed.minusDays(1))
.setParameter("opprettetTilOgMed", opprettetTilOgMed.plusDays(1))
.setParameter("likeSearch", "%"+paramSearchText+"%")
- .setHint(QueryHints.HINT_READONLY, "true");
+ .setHint(HibernateHints.HINT_READ_ONLY, "true");
var resultList = query.getResultList();
return tilProsessTask(resultList);
@@ -229,9 +227,9 @@ public List finnGruppeIkkeFerdig(String gruppe) {
public List hentIdForAlleFeilet() {
var query = entityManager
- .createQuery("from ProsessTaskEntitet pt where pt.status = :feilet", ProsessTaskEntitet.class)
- .setParameter("feilet", ProsessTaskStatus.FEILET.getDbKode());
- return query.getResultList().stream().map(ProsessTaskEntitet::getId).collect(Collectors.toList());
+ .createQuery("select pt from ProsessTaskEntitet pt where pt.status = :feilet", ProsessTaskEntitet.class)
+ .setParameter("feilet", ProsessTaskStatus.FEILET.getDbKode());
+ return query.getResultList().stream().map(ProsessTaskEntitet::getId).toList();
}
public int settAlleFeiledeTasksKlar() {
@@ -278,7 +276,7 @@ static String utledPartisjonsNr(LocalDate date) {
}
private List tilProsessTask(List resultList) {
- return resultList.stream().map(ProsessTaskEntitet::tilProsessTask).collect(Collectors.toList());
+ return resultList.stream().map(ProsessTaskEntitet::tilProsessTask).toList();
}
void flushAndClear() {
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskTjenesteImpl.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskTjenesteImpl.java
index dbbfb72..9d66a41 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskTjenesteImpl.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/ProsessTaskTjenesteImpl.java
@@ -6,9 +6,9 @@
import java.util.Objects;
import java.util.Properties;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.InjectionException;
-import javax.inject.Inject;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.InjectionException;
+import jakarta.inject.Inject;
import no.nav.vedtak.exception.TekniskException;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskData;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RequestContextHandler.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RequestContextHandler.java
index 399b132..67d3d74 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RequestContextHandler.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RequestContextHandler.java
@@ -2,7 +2,7 @@
import java.util.function.Supplier;
-import javax.enterprise.inject.spi.CDI;
+import jakarta.enterprise.inject.spi.CDI;
import org.jboss.weld.context.RequestContext;
import org.jboss.weld.context.unbound.UnboundLiteral;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTask.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTask.java
index b1026fc..b89c659 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTask.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTask.java
@@ -10,15 +10,15 @@
import java.util.Objects;
import java.util.Optional;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.control.ActivateRequestContext;
-import javax.enterprise.inject.InjectionException;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityNotFoundException;
-import javax.persistence.LockTimeoutException;
-import javax.persistence.PersistenceException;
-import javax.transaction.Transactional;
+import jakarta.enterprise.context.Dependent;
+import jakarta.enterprise.context.control.ActivateRequestContext;
+import jakarta.enterprise.inject.InjectionException;
+import jakarta.inject.Inject;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityNotFoundException;
+import jakarta.persistence.LockTimeoutException;
+import jakarta.persistence.PersistenceException;
+import jakarta.transaction.Transactional;
import org.hibernate.Session;
import org.hibernate.exception.JDBCConnectionException;
diff --git "a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTaskVetoH\303\245ndterer.java" "b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTaskVetoH\303\245ndterer.java"
index 3de7916..3138130 100644
--- "a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTaskVetoH\303\245ndterer.java"
+++ "b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/RunTaskVetoH\303\245ndterer.java"
@@ -4,7 +4,7 @@
import java.util.AbstractMap.SimpleEntry;
import java.util.Optional;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/StartupData.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/StartupData.java
index b2bd71b..4848d48 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/StartupData.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/StartupData.java
@@ -2,9 +2,9 @@
import java.time.LocalDateTime;
-import javax.persistence.Column;
-import javax.persistence.Entity;
-import javax.persistence.Id;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.Id;
@Entity(name = "StartupData")
class StartupData {
@@ -12,17 +12,17 @@ class StartupData {
@Id
@Column(name = "dbtz")
String dbtz;
-
+
@Column(name = "dbtid")
String dbtid;
-
+
@Column(name = "inputtid")
String inputtid;
-
+
@Column(name="inputtid2")
LocalDateTime inputtid2;
-
+
@Column(name="drift")
String drift;
-}
\ No newline at end of file
+}
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManager.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManager.java
index 8c36f70..2d17dcd 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManager.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManager.java
@@ -23,12 +23,12 @@
import java.util.function.Function;
import java.util.stream.Collectors;
-import javax.enterprise.context.ApplicationScoped;
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.enterprise.inject.spi.CDI;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Instance;
+import jakarta.enterprise.inject.spi.CDI;
+import jakarta.inject.Inject;
+import jakarta.persistence.EntityManager;
import org.hibernate.exception.JDBCConnectionException;
import org.slf4j.Logger;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerGenerateRunnableTasks.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerGenerateRunnableTasks.java
index baae9d1..b57edcd 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerGenerateRunnableTasks.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerGenerateRunnableTasks.java
@@ -5,7 +5,7 @@
import java.util.function.BiFunction;
import java.util.function.Consumer;
-import javax.enterprise.inject.spi.CDI;
+import jakarta.enterprise.inject.spi.CDI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerRepositoryImpl.java b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerRepositoryImpl.java
index 912a85b..fe45f88 100644
--- a/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerRepositoryImpl.java
+++ b/task/src/main/java/no/nav/vedtak/felles/prosesstask/impl/TaskManagerRepositoryImpl.java
@@ -19,26 +19,24 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.control.ActivateRequestContext;
-import javax.enterprise.inject.Any;
-import javax.enterprise.inject.Instance;
-import javax.inject.Inject;
-import javax.persistence.EntityManager;
-import javax.persistence.LockTimeoutException;
-import javax.persistence.Query;
-import javax.persistence.TemporalType;
-import javax.transaction.Transactional;
-
-import org.hibernate.FlushMode;
import org.hibernate.ScrollMode;
import org.hibernate.Session;
-import org.hibernate.jpa.QueryHints;
+import org.hibernate.jpa.HibernateHints;
import org.hibernate.query.NativeQuery;
import org.jboss.weld.interceptor.util.proxy.TargetInstanceProxy;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import jakarta.enterprise.context.Dependent;
+import jakarta.enterprise.context.control.ActivateRequestContext;
+import jakarta.enterprise.inject.Any;
+import jakarta.enterprise.inject.Instance;
+import jakarta.inject.Inject;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.FlushModeType;
+import jakarta.persistence.LockTimeoutException;
+import jakarta.persistence.Query;
+import jakarta.transaction.Transactional;
import no.nav.vedtak.exception.TekniskException;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskData;
import no.nav.vedtak.felles.prosesstask.api.ProsessTaskStatus;
@@ -55,7 +53,7 @@ public class TaskManagerRepositoryImpl {
private static final String NESTE_KJØRING = "neste_kjoering";
private static final Logger LOG = LoggerFactory.getLogger(TaskManagerRepositoryImpl.class);
- private static final String JAVAX_PERSISTENCE_CACHE_STORE_MODE = "javax.persistence.cache.storeMode";
+ private static final String JAVAX_PERSISTENCE_CACHE_STORE_MODE = "jakarta.persistence.cache.storeMode";
private static final String REFRESH = "REFRESH";
private final String jvmUniqueProcessName = getJvmUniqueProcessName();
@@ -111,9 +109,9 @@ List pollNeste(LocalDateTime etterTid) {
var resultList = getEntityManagerAsSession()
.createNativeQuery(sqlForPolling, ProsessTaskEntitet.class) // NOSONAR - statisk SQL
- .setParameter(NESTE_KJØRING, etterTid, TemporalType.TIMESTAMP)
+ .setParameter(NESTE_KJØRING, etterTid)
.setParameter("skip_ids", Set.of(-1))
- .setHint(QueryHints.HINT_CACHE_MODE, "IGNORE")
+ .setHint(HibernateHints.HINT_CACHE_MODE, "IGNORE")
.getResultList();
return tilProsessTask(resultList);
}
@@ -146,12 +144,11 @@ private Session getEntityManagerAsSession() {
var now = LocalDateTime.now();
var status = taskStatus.getDbKode();
- @SuppressWarnings("resource")
var tasks = getEntityManagerAsSession().createNativeQuery(updateSql)
.setParameter("id", prosessTaskId)
.setParameter(STATUS, status)
- .setParameter("status_ts", now, TemporalType.TIMESTAMP)
- .setParameter("neste", nesteKjøringEtter, TemporalType.TIMESTAMP)
+ .setParameter("status_ts", now)
+ .setParameter("neste", nesteKjøringEtter)
.setParameter("feilkode", feilkode)
.setParameter("feiltekst", feiltekst)
.setParameter("forsoek", feilforsøk)
@@ -180,7 +177,7 @@ void oppdaterStatus(Long prosessTaskId, ProsessTaskStatus taskStatus) {
var tasks = getEntityManagerAsSession().createNativeQuery(updateSql)
.setParameter("id", prosessTaskId)
.setParameter(STATUS, status)
- .setParameter("status_ts", now, TemporalType.TIMESTAMP)
+ .setParameter("status_ts", now)
.executeUpdate();
}
@@ -196,7 +193,7 @@ void oppdaterTaskUnderArbeid(Long prosessTaskId, LocalDateTime now) {
@SuppressWarnings("unused")
var tasks = getEntityManagerAsSession().createNativeQuery(updateSql)
.setParameter("id", prosessTaskId)
- .setParameter("naa", now, TemporalType.TIMESTAMP)
+ .setParameter("naa", now)
.executeUpdate();
}
@@ -251,10 +248,10 @@ List pollNesteScrollingUpdate(int numberOfTasks, long waitTi
var timestamp = LocalDateTime.now();
try (var results = getEntityManagerAsSession()
.createNativeQuery(getSqlForPolling(), ProsessTaskEntitet.class)
- .setFlushMode(FlushMode.MANUAL)
+ .setFlushMode(FlushModeType.COMMIT)
// hent kun 1 av gangen for å la andre pollere slippe til
- .setHint(QueryHints.HINT_FETCH_SIZE, 1)
- .setParameter(NESTE_KJØRING, timestamp, TemporalType.TIMESTAMP)
+ .setHint(HibernateHints.HINT_FETCH_SIZE, 1)
+ .setParameter(NESTE_KJØRING, timestamp)
.setParameter("skip_ids", skipIds.isEmpty() ? Set.of(-1) : skipIds)
.scroll(ScrollMode.FORWARD_ONLY);) {
@@ -262,9 +259,8 @@ List pollNesteScrollingUpdate(int numberOfTasks, long waitTi
var nyNesteTid = now.plusSeconds(waitTimeBeforeNextPollingAttemptSecs);
while (results.next() && --numberOfTasksStillToGo >= 0) {
- var resultObjects = results.get();
- if (resultObjects.length > 0) {
- var pte = (ProsessTaskEntitet) resultObjects[0];
+ var pte = results.get();
+ if (pte != null) {
tasksToRun.add(pte);
oppdaterTaskPlukket(pte.getId(), nyNesteTid, now);
logTaskPollet(pte);
@@ -291,7 +287,7 @@ void logTaskPollet(ProsessTaskEntitet pte) {
}
List tilProsessTask(List resultList) {
- return resultList.stream().map(ProsessTaskEntitet::tilProsessTask).collect(Collectors.toList());
+ return resultList.stream().map(ProsessTaskEntitet::tilProsessTask).toList();
}
Optional finnOgLås(RunTaskInfo taskInfo) {
@@ -317,12 +313,12 @@ List tilProsessTask(List resultList) {
@SuppressWarnings("resource")
Query query = getEntityManagerAsSession().createNativeQuery(sql, ProsessTaskEntitet.class)
- .setHint(org.hibernate.annotations.QueryHints.FETCH_SIZE, 1)
+ .setHint(HibernateHints.HINT_FETCH_SIZE, 1)
.setHint(JAVAX_PERSISTENCE_CACHE_STORE_MODE, REFRESH)
.setParameter("id", taskId)
.setParameter("taskType", taskType.value())
.setParameter(STATUS, status)
- .setParameter("sisteTs", sistKjørtLowWatermark, TemporalType.TIMESTAMP);
+ .setParameter("sisteTs", sistKjørtLowWatermark);
return query.getResultList().stream().findFirst();
}
@@ -339,7 +335,7 @@ List tilProsessTask(List resultList) {
@SuppressWarnings("resource")
Query query = getEntityManagerAsSession().createNativeQuery(sql, ProsessTaskEntitet.class)
- .setHint(org.hibernate.annotations.QueryHints.FETCH_SIZE, 1)
+ .setHint(HibernateHints.HINT_FETCH_SIZE, 1)
.setHint(JAVAX_PERSISTENCE_CACHE_STORE_MODE, REFRESH)
.setParameter("id", blokkerendeTaskId)
.setParameter("statuser", ikkeKjørtStatuser);
@@ -384,7 +380,7 @@ private void logDatabaseDetaljer() {
var now = LocalDateTime.now();
@SuppressWarnings({ "resource", "cast" })
var result = getEntityManagerAsSession().createNativeQuery(sql, StartupData.class)
- .setParameter("inputTid", now, TemporalType.TIMESTAMP)
+ .setParameter("inputTid", now)
.getSingleResult();
var hibernateTz = entityManager.getEntityManagerFactory().getProperties().get("hibernate.jdbc.time_zone");
@@ -430,7 +426,7 @@ Map countTasksForStatus(Set statu
Map resultat = new EnumMap<>(ProsessTaskStatus.class);
var query = entityManager
.createNativeQuery("select status, count(1) from prosess_task where status in (:statuses) group by status")
- .setHint(QueryHints.HINT_READONLY, "true")
+ .setHint(HibernateHints.HINT_READ_ONLY, "true")
.setParameter("statuses", monitorer);
@SuppressWarnings("unchecked")
List