From 6c2eeaf80746a84855af8cf1212ed84c7a731f58 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Wed, 11 May 2022 12:01:00 +0100 Subject: [PATCH 01/15] Upgrade to Java 11 --- pom.xml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index dc2e84ac..ac2aff4b 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.icatproject icat.server - 5.0.2-SNAPSHOT + 6.0.0-SNAPSHOT war ICAT Server A metadata catalogue to support Large Facility experimental data, @@ -96,6 +96,12 @@ test + + com.sun.xml.ws + jaxws-rt + 2.3.0 + test + org.glassfish @@ -159,7 +165,7 @@ com.qmino miredot-plugin - 1.6.2 + 2.4.1-Java11 miredot @@ -270,11 +276,10 @@ org.apache.maven.plugins maven-compiler-plugin - 3.3 + 3.10.1 ${project.build.sourceEncoding} - 1.8 - 1.8 + 11 From 4584d2b17d657bf59917a8f8788eae7efafd8f95 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 10 May 2022 16:36:19 +0100 Subject: [PATCH 02/15] Upgrade to jakartaee-api 9.1.0 --- pom.xml | 14 ++-- .../icatproject/core/entity/Affiliation.java | 14 ++-- .../icatproject/core/entity/Application.java | 18 ++--- .../core/entity/DataCollection.java | 6 +- .../core/entity/DataCollectionDatafile.java | 12 +-- .../core/entity/DataCollectionDataset.java | 12 +-- .../entity/DataCollectionInvestigation.java | 12 +-- .../core/entity/DataCollectionParameter.java | 12 +-- .../core/entity/DataPublication.java | 22 +++--- .../core/entity/DataPublicationDate.java | 14 ++-- .../core/entity/DataPublicationFunding.java | 12 +-- .../core/entity/DataPublicationType.java | 18 ++--- .../core/entity/DataPublicationUser.java | 18 ++--- .../org/icatproject/core/entity/Datafile.java | 28 +++---- .../core/entity/DatafileFormat.java | 18 ++--- .../core/entity/DatafileParameter.java | 16 ++-- .../org/icatproject/core/entity/Dataset.java | 26 +++---- .../core/entity/DatasetInstrument.java | 12 +-- .../core/entity/DatasetParameter.java | 16 ++-- .../core/entity/DatasetTechnique.java | 12 +-- .../icatproject/core/entity/DatasetType.java | 18 ++--- .../core/entity/EntityBaseBean.java | 22 +++--- .../org/icatproject/core/entity/Facility.java | 12 +-- .../core/entity/FacilityCycle.java | 22 +++--- .../org/icatproject/core/entity/FieldSet.java | 4 +- .../core/entity/FundingReference.java | 12 +-- .../org/icatproject/core/entity/Grouping.java | 12 +-- .../icatproject/core/entity/Instrument.java | 18 ++--- .../core/entity/InstrumentScientist.java | 12 +-- .../core/entity/Investigation.java | 24 +++--- .../entity/InvestigationFacilityCycle.java | 10 +-- .../core/entity/InvestigationFunding.java | 12 +-- .../core/entity/InvestigationGroup.java | 12 +-- .../core/entity/InvestigationInstrument.java | 12 +-- .../core/entity/InvestigationParameter.java | 16 ++-- .../core/entity/InvestigationType.java | 18 ++--- .../core/entity/InvestigationUser.java | 14 ++-- .../java/org/icatproject/core/entity/Job.java | 8 +- .../org/icatproject/core/entity/Keyword.java | 12 +-- .../icatproject/core/entity/Parameter.java | 18 ++--- .../core/entity/ParameterType.java | 18 ++--- .../core/entity/PermissibleStringValue.java | 14 ++-- .../icatproject/core/entity/PublicStep.java | 16 ++-- .../icatproject/core/entity/Publication.java | 10 +-- .../core/entity/RelatedDatafile.java | 14 ++-- .../icatproject/core/entity/RelatedItem.java | 14 ++-- .../org/icatproject/core/entity/Rule.java | 26 +++---- .../org/icatproject/core/entity/Sample.java | 20 ++--- .../core/entity/SampleParameter.java | 14 ++-- .../icatproject/core/entity/SampleType.java | 18 ++--- .../org/icatproject/core/entity/Session.java | 14 ++-- .../org/icatproject/core/entity/Shift.java | 18 ++--- .../org/icatproject/core/entity/Study.java | 16 ++-- .../core/entity/StudyInvestigation.java | 10 +-- .../icatproject/core/entity/Technique.java | 12 +-- .../org/icatproject/core/entity/User.java | 12 +-- .../icatproject/core/entity/UserGroup.java | 12 +-- .../core/manager/AuthenticatorInfo.java | 8 +- .../core/manager/EntityBeanManager.java | 62 +++++++-------- .../core/manager/EntityInfoHandler.java | 22 +++--- .../icatproject/core/manager/GateKeeper.java | 22 +++--- .../icatproject/core/manager/LuceneApi.java | 10 +-- .../core/manager/LuceneManager.java | 20 ++--- .../core/manager/NotificationMessage.java | 2 +- .../core/manager/NotificationTransmitter.java | 22 +++--- .../org/icatproject/core/manager/Porter.java | 28 +++---- .../core/manager/PropertyHandler.java | 18 ++--- .../org/icatproject/core/manager/Rest.java | 8 +- .../core/manager/SessionManager.java | 8 +- .../icatproject/core/manager/Transmitter.java | 22 +++--- .../icatproject/core/parser/SearchQuery.java | 4 +- .../exposed/CORSResponseFilter.java | 10 +-- .../exposed/ContentTypeFilter.java | 12 +-- .../java/org/icatproject/exposed/ICAT.java | 34 ++++---- .../org/icatproject/exposed/ICATRest.java | 78 +++++++++---------- .../exposed/IcatExceptionMapper.java | 10 +-- .../exposed/NotFoundExceptionMapper.java | 12 +-- .../exposed/ThrowableExceptionMapper.java | 12 +-- src/main/scripts/setup | 4 +- .../icatproject/core/manager/TestLucene.java | 6 +- .../org/icatproject/exposed/TestICATRest.java | 4 +- .../org/icatproject/integration/TestRS.java | 12 +-- .../org/icatproject/integration/WSession.java | 6 +- 83 files changed, 657 insertions(+), 657 deletions(-) diff --git a/pom.xml b/pom.xml index ac2aff4b..695e2565 100644 --- a/pom.xml +++ b/pom.xml @@ -71,16 +71,16 @@ - javax - javaee-api - 7.0 + jakarta.platform + jakarta.jakartaee-api + 9.1.0 provided org.icatproject icat.authentication - 4.6.0 + 5.0.0-SNAPSHOT @@ -99,14 +99,14 @@ com.sun.xml.ws jaxws-rt - 2.3.0 + 3.0.2 test org.glassfish jakarta.json - 1.1.5 + 2.0.1 test @@ -125,7 +125,7 @@ org.icatproject icat.client - 5.0.0 + 6.0.0-SNAPSHOT test diff --git a/src/main/java/org/icatproject/core/entity/Affiliation.java b/src/main/java/org/icatproject/core/entity/Affiliation.java index a9ba2154..57dc3cc7 100644 --- a/src/main/java/org/icatproject/core/entity/Affiliation.java +++ b/src/main/java/org/icatproject/core/entity/Affiliation.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("The home institute or other affiliation of a user in the context of a data publication") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Application.java b/src/main/java/org/icatproject/core/entity/Application.java index 61cde4b3..88b20d95 100644 --- a/src/main/java/org/icatproject/core/entity/Application.java +++ b/src/main/java/org/icatproject/core/entity/Application.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Some piece of software") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataCollection.java b/src/main/java/org/icatproject/core/entity/DataCollection.java index 20732b18..d1158cb3 100644 --- a/src/main/java/org/icatproject/core/entity/DataCollection.java +++ b/src/main/java/org/icatproject/core/entity/DataCollection.java @@ -4,9 +4,9 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Entity; -import javax.persistence.OneToMany; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; @Comment("A set of Investigations, Datasets and Datafiles which can span Facilities. " + "Note that it has no constraint fields. " diff --git a/src/main/java/org/icatproject/core/entity/DataCollectionDatafile.java b/src/main/java/org/icatproject/core/entity/DataCollectionDatafile.java index 3b577032..a763f839 100644 --- a/src/main/java/org/icatproject/core/entity/DataCollectionDatafile.java +++ b/src/main/java/org/icatproject/core/entity/DataCollectionDatafile.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between a DataCollection and its Datafiles.") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataCollectionDataset.java b/src/main/java/org/icatproject/core/entity/DataCollectionDataset.java index 6ac6e934..17a28d54 100644 --- a/src/main/java/org/icatproject/core/entity/DataCollectionDataset.java +++ b/src/main/java/org/icatproject/core/entity/DataCollectionDataset.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between a DataCollection and its datasets.") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataCollectionInvestigation.java b/src/main/java/org/icatproject/core/entity/DataCollectionInvestigation.java index 72971456..08e763bb 100644 --- a/src/main/java/org/icatproject/core/entity/DataCollectionInvestigation.java +++ b/src/main/java/org/icatproject/core/entity/DataCollectionInvestigation.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between a DataCollection and its Investigations.") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataCollectionParameter.java b/src/main/java/org/icatproject/core/entity/DataCollectionParameter.java index baa264bf..c5de6b21 100644 --- a/src/main/java/org/icatproject/core/entity/DataCollectionParameter.java +++ b/src/main/java/org/icatproject/core/entity/DataCollectionParameter.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/DataPublication.java b/src/main/java/org/icatproject/core/entity/DataPublication.java index 9cc0607a..5d92b99c 100644 --- a/src/main/java/org/icatproject/core/entity/DataPublication.java +++ b/src/main/java/org/icatproject/core/entity/DataPublication.java @@ -5,17 +5,17 @@ import java.util.Date; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; @Comment("A curated data publication") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataPublicationDate.java b/src/main/java/org/icatproject/core/entity/DataPublicationDate.java index f76e2dab..75f6e834 100644 --- a/src/main/java/org/icatproject/core/entity/DataPublicationDate.java +++ b/src/main/java/org/icatproject/core/entity/DataPublicationDate.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A date relevant for the publication") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataPublicationFunding.java b/src/main/java/org/icatproject/core/entity/DataPublicationFunding.java index 54b1873d..bd0a2cfc 100644 --- a/src/main/java/org/icatproject/core/entity/DataPublicationFunding.java +++ b/src/main/java/org/icatproject/core/entity/DataPublicationFunding.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between a data publication and a funding reference") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DataPublicationType.java b/src/main/java/org/icatproject/core/entity/DataPublicationType.java index 4b8dd94c..bc8be0f5 100644 --- a/src/main/java/org/icatproject/core/entity/DataPublicationType.java +++ b/src/main/java/org/icatproject/core/entity/DataPublicationType.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A type of data publication, for example, whole investigation, user-selected datasets/files. " + "This is likely to be for facility internal purposes following their own classification " diff --git a/src/main/java/org/icatproject/core/entity/DataPublicationUser.java b/src/main/java/org/icatproject/core/entity/DataPublicationUser.java index a505e592..762b4c1a 100644 --- a/src/main/java/org/icatproject/core/entity/DataPublicationUser.java +++ b/src/main/java/org/icatproject/core/entity/DataPublicationUser.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Author, e.g. creator of or contributor to a data publication") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Datafile.java b/src/main/java/org/icatproject/core/entity/Datafile.java index dd9ffb92..a9755ded 100644 --- a/src/main/java/org/icatproject/core/entity/Datafile.java +++ b/src/main/java/org/icatproject/core/entity/Datafile.java @@ -5,20 +5,20 @@ import java.util.Date; import java.util.List; -import javax.json.stream.JsonGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.Index; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.Index; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlRootElement; import org.icatproject.core.manager.LuceneApi; diff --git a/src/main/java/org/icatproject/core/entity/DatafileFormat.java b/src/main/java/org/icatproject/core/entity/DatafileFormat.java index 71532678..2c38b891 100644 --- a/src/main/java/org/icatproject/core/entity/DatafileFormat.java +++ b/src/main/java/org/icatproject/core/entity/DatafileFormat.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A data file format") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DatafileParameter.java b/src/main/java/org/icatproject/core/entity/DatafileParameter.java index c781e4df..8b30ffa3 100644 --- a/src/main/java/org/icatproject/core/entity/DatafileParameter.java +++ b/src/main/java/org/icatproject/core/entity/DatafileParameter.java @@ -2,14 +2,14 @@ import java.io.Serializable; -import javax.json.stream.JsonGenerator; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlRootElement; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/Dataset.java b/src/main/java/org/icatproject/core/entity/Dataset.java index d1f9493b..0f0dae57 100644 --- a/src/main/java/org/icatproject/core/entity/Dataset.java +++ b/src/main/java/org/icatproject/core/entity/Dataset.java @@ -5,19 +5,19 @@ import java.util.Date; import java.util.List; -import javax.json.stream.JsonGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlRootElement; import org.icatproject.core.manager.LuceneApi; diff --git a/src/main/java/org/icatproject/core/entity/DatasetInstrument.java b/src/main/java/org/icatproject/core/entity/DatasetInstrument.java index 4d35cc81..5e138ea6 100644 --- a/src/main/java/org/icatproject/core/entity/DatasetInstrument.java +++ b/src/main/java/org/icatproject/core/entity/DatasetInstrument.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between an instrument and a dataset with data collected at that instrument") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DatasetParameter.java b/src/main/java/org/icatproject/core/entity/DatasetParameter.java index 656bf8af..69f9cc1b 100644 --- a/src/main/java/org/icatproject/core/entity/DatasetParameter.java +++ b/src/main/java/org/icatproject/core/entity/DatasetParameter.java @@ -2,14 +2,14 @@ import java.io.Serializable; -import javax.json.stream.JsonGenerator; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlRootElement; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/DatasetTechnique.java b/src/main/java/org/icatproject/core/entity/DatasetTechnique.java index 1b371414..2c5e0c30 100644 --- a/src/main/java/org/icatproject/core/entity/DatasetTechnique.java +++ b/src/main/java/org/icatproject/core/entity/DatasetTechnique.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between a dataset and the experimental technique being used to create that Dataset") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/DatasetType.java b/src/main/java/org/icatproject/core/entity/DatasetType.java index 192d0a76..7e85c4d4 100644 --- a/src/main/java/org/icatproject/core/entity/DatasetType.java +++ b/src/main/java/org/icatproject/core/entity/DatasetType.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A type of data set") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/EntityBaseBean.java b/src/main/java/org/icatproject/core/entity/EntityBaseBean.java index afcc54e0..bb3c8a2c 100644 --- a/src/main/java/org/icatproject/core/entity/EntityBaseBean.java +++ b/src/main/java/org/icatproject/core/entity/EntityBaseBean.java @@ -12,17 +12,17 @@ import java.util.Map; import java.util.Set; -import javax.json.stream.JsonGenerator; -import javax.persistence.Column; -import javax.persistence.EntityManager; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.MappedSuperclass; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlTransient; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.EntityManager; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.GenerationType; +import jakarta.persistence.Id; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.Transient; +import jakarta.xml.bind.annotation.XmlTransient; import org.icatproject.core.IcatException; import org.icatproject.core.IcatException.IcatExceptionType; diff --git a/src/main/java/org/icatproject/core/entity/Facility.java b/src/main/java/org/icatproject/core/entity/Facility.java index 7261146a..e5ebaa4b 100644 --- a/src/main/java/org/icatproject/core/entity/Facility.java +++ b/src/main/java/org/icatproject/core/entity/Facility.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("An experimental facility") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/FacilityCycle.java b/src/main/java/org/icatproject/core/entity/FacilityCycle.java index 05034132..6789f3be 100644 --- a/src/main/java/org/icatproject/core/entity/FacilityCycle.java +++ b/src/main/java/org/icatproject/core/entity/FacilityCycle.java @@ -5,17 +5,17 @@ import java.util.Date; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; @Comment("An operating cycle within a facility") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/FieldSet.java b/src/main/java/org/icatproject/core/entity/FieldSet.java index fe18954c..690307f5 100644 --- a/src/main/java/org/icatproject/core/entity/FieldSet.java +++ b/src/main/java/org/icatproject/core/entity/FieldSet.java @@ -1,7 +1,7 @@ package org.icatproject.core.entity; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlElement; +import jakarta.xml.bind.annotation.XmlRootElement; +import jakarta.xml.bind.annotation.XmlElement; import java.io.Serializable; @XmlRootElement diff --git a/src/main/java/org/icatproject/core/entity/FundingReference.java b/src/main/java/org/icatproject/core/entity/FundingReference.java index 0e42714a..1f18f23b 100644 --- a/src/main/java/org/icatproject/core/entity/FundingReference.java +++ b/src/main/java/org/icatproject/core/entity/FundingReference.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Information about financial support") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Grouping.java b/src/main/java/org/icatproject/core/entity/Grouping.java index 7af88e42..ce8a2cc4 100644 --- a/src/main/java/org/icatproject/core/entity/Grouping.java +++ b/src/main/java/org/icatproject/core/entity/Grouping.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A group of users") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Instrument.java b/src/main/java/org/icatproject/core/entity/Instrument.java index 623bbea7..9f5ea40d 100644 --- a/src/main/java/org/icatproject/core/entity/Instrument.java +++ b/src/main/java/org/icatproject/core/entity/Instrument.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Used by a user within an investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/InstrumentScientist.java b/src/main/java/org/icatproject/core/entity/InstrumentScientist.java index 0cc5c794..c7e72716 100644 --- a/src/main/java/org/icatproject/core/entity/InstrumentScientist.java +++ b/src/main/java/org/icatproject/core/entity/InstrumentScientist.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Relationship between an ICAT user as an instrument scientist and the instrument") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Investigation.java b/src/main/java/org/icatproject/core/entity/Investigation.java index f1be3aa7..adcc6340 100644 --- a/src/main/java/org/icatproject/core/entity/Investigation.java +++ b/src/main/java/org/icatproject/core/entity/Investigation.java @@ -5,18 +5,18 @@ import java.util.Date; import java.util.List; -import javax.json.stream.JsonGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; import org.icatproject.core.manager.LuceneApi; diff --git a/src/main/java/org/icatproject/core/entity/InvestigationFacilityCycle.java b/src/main/java/org/icatproject/core/entity/InvestigationFacilityCycle.java index edc75c94..f74cbbaa 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationFacilityCycle.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationFacilityCycle.java @@ -2,11 +2,11 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Many to many relationship between investigation and facilityCycle. " + "Allows investigations to belong to multiple cycles at once.") diff --git a/src/main/java/org/icatproject/core/entity/InvestigationFunding.java b/src/main/java/org/icatproject/core/entity/InvestigationFunding.java index c8e908fd..071c9fb4 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationFunding.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationFunding.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between an investigation and a funding reference") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/InvestigationGroup.java b/src/main/java/org/icatproject/core/entity/InvestigationGroup.java index b4b9872a..d248a12d 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationGroup.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationGroup.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Many to many relationship between investigation and group which might be used within authorization rules. " + "Please see InvestigationUser") diff --git a/src/main/java/org/icatproject/core/entity/InvestigationInstrument.java b/src/main/java/org/icatproject/core/entity/InvestigationInstrument.java index b8f751f4..5eb4356f 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationInstrument.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationInstrument.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents a many-to-many relationship between an investigation and the instruments assigned") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/InvestigationParameter.java b/src/main/java/org/icatproject/core/entity/InvestigationParameter.java index 9f5fe2e4..f5d0c0a1 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationParameter.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationParameter.java @@ -2,14 +2,14 @@ import java.io.Serializable; -import javax.json.stream.JsonGenerator; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlRootElement; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/InvestigationType.java b/src/main/java/org/icatproject/core/entity/InvestigationType.java index afaee464..50244904 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationType.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationType.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A type of investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/InvestigationUser.java b/src/main/java/org/icatproject/core/entity/InvestigationUser.java index 8d07901b..faa432ab 100644 --- a/src/main/java/org/icatproject/core/entity/InvestigationUser.java +++ b/src/main/java/org/icatproject/core/entity/InvestigationUser.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.json.stream.JsonGenerator; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import org.icatproject.core.manager.LuceneApi; diff --git a/src/main/java/org/icatproject/core/entity/Job.java b/src/main/java/org/icatproject/core/entity/Job.java index 00def592..8a28ddaf 100644 --- a/src/main/java/org/icatproject/core/entity/Job.java +++ b/src/main/java/org/icatproject/core/entity/Job.java @@ -2,10 +2,10 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Comment("A run of an application with its related inputs and outputs") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Keyword.java b/src/main/java/org/icatproject/core/entity/Keyword.java index ad661e7e..c813d4d1 100644 --- a/src/main/java/org/icatproject/core/entity/Keyword.java +++ b/src/main/java/org/icatproject/core/entity/Keyword.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Must be related to an investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Parameter.java b/src/main/java/org/icatproject/core/entity/Parameter.java index e043da96..ef6c5307 100644 --- a/src/main/java/org/icatproject/core/entity/Parameter.java +++ b/src/main/java/org/icatproject/core/entity/Parameter.java @@ -4,15 +4,15 @@ import java.util.Date; import java.util.List; -import javax.json.stream.JsonGenerator; -import javax.persistence.Column; -import javax.persistence.EntityManager; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.MappedSuperclass; -import javax.persistence.NamedQuery; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.Column; +import jakarta.persistence.EntityManager; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.MappedSuperclass; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/ParameterType.java b/src/main/java/org/icatproject/core/entity/ParameterType.java index bd67a1a3..cbd5f36d 100644 --- a/src/main/java/org/icatproject/core/entity/ParameterType.java +++ b/src/main/java/org/icatproject/core/entity/ParameterType.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A parameter type with unique name and units") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/PermissibleStringValue.java b/src/main/java/org/icatproject/core/entity/PermissibleStringValue.java index d640c35d..7bf17a15 100644 --- a/src/main/java/org/icatproject/core/entity/PermissibleStringValue.java +++ b/src/main/java/org/icatproject/core/entity/PermissibleStringValue.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Permissible value for string parameter types") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/PublicStep.java b/src/main/java/org/icatproject/core/entity/PublicStep.java index ad3e89be..581f11ae 100644 --- a/src/main/java/org/icatproject/core/entity/PublicStep.java +++ b/src/main/java/org/icatproject/core/entity/PublicStep.java @@ -3,14 +3,14 @@ import java.io.Serializable; import java.util.Set; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.NamedQuery; -import javax.persistence.PostPersist; -import javax.persistence.PostRemove; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.PostPersist; +import jakarta.persistence.PostRemove; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityInfoHandler; diff --git a/src/main/java/org/icatproject/core/entity/Publication.java b/src/main/java/org/icatproject/core/entity/Publication.java index 913b7f00..e29c52a3 100644 --- a/src/main/java/org/icatproject/core/entity/Publication.java +++ b/src/main/java/org/icatproject/core/entity/Publication.java @@ -2,11 +2,11 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; @Comment("A publication") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/RelatedDatafile.java b/src/main/java/org/icatproject/core/entity/RelatedDatafile.java index d60f01f1..90aaa7ea 100644 --- a/src/main/java/org/icatproject/core/entity/RelatedDatafile.java +++ b/src/main/java/org/icatproject/core/entity/RelatedDatafile.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Used to represent an arbitrary relationship between data files") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/RelatedItem.java b/src/main/java/org/icatproject/core/entity/RelatedItem.java index bfc14c50..3ceb0b68 100644 --- a/src/main/java/org/icatproject/core/entity/RelatedItem.java +++ b/src/main/java/org/icatproject/core/entity/RelatedItem.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A reference to an external resource or item that is related to a data publication, " + "such as a scientific article that is based on the data or the instrument " diff --git a/src/main/java/org/icatproject/core/entity/Rule.java b/src/main/java/org/icatproject/core/entity/Rule.java index 6e4853c3..8ccfa42a 100644 --- a/src/main/java/org/icatproject/core/entity/Rule.java +++ b/src/main/java/org/icatproject/core/entity/Rule.java @@ -2,19 +2,19 @@ import java.io.Serializable; -import javax.ejb.EJB; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.FetchType; -import javax.persistence.ManyToOne; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.PostPersist; -import javax.persistence.PostRemove; -import javax.persistence.Table; -import javax.persistence.Transient; -import javax.xml.bind.annotation.XmlTransient; +import jakarta.ejb.EJB; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.FetchType; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.PostPersist; +import jakarta.persistence.PostRemove; +import jakarta.persistence.Table; +import jakarta.persistence.Transient; +import jakarta.xml.bind.annotation.XmlTransient; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/Sample.java b/src/main/java/org/icatproject/core/entity/Sample.java index 9a36843e..06d79224 100644 --- a/src/main/java/org/icatproject/core/entity/Sample.java +++ b/src/main/java/org/icatproject/core/entity/Sample.java @@ -4,16 +4,16 @@ import java.util.ArrayList; import java.util.List; -import javax.json.stream.JsonGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; import org.icatproject.core.manager.LuceneApi; diff --git a/src/main/java/org/icatproject/core/entity/SampleParameter.java b/src/main/java/org/icatproject/core/entity/SampleParameter.java index 2af4d254..376123ac 100644 --- a/src/main/java/org/icatproject/core/entity/SampleParameter.java +++ b/src/main/java/org/icatproject/core/entity/SampleParameter.java @@ -2,13 +2,13 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.EntityManager; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlRootElement; +import jakarta.persistence.Entity; +import jakarta.persistence.EntityManager; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlRootElement; import org.icatproject.core.IcatException; import org.icatproject.core.manager.EntityBeanManager.PersistMode; diff --git a/src/main/java/org/icatproject/core/entity/SampleType.java b/src/main/java/org/icatproject/core/entity/SampleType.java index fa402d7a..dabab31f 100644 --- a/src/main/java/org/icatproject/core/entity/SampleType.java +++ b/src/main/java/org/icatproject/core/entity/SampleType.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A sample to be used in an investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Session.java b/src/main/java/org/icatproject/core/entity/Session.java index ab4da825..078275e0 100644 --- a/src/main/java/org/icatproject/core/entity/Session.java +++ b/src/main/java/org/icatproject/core/entity/Session.java @@ -5,13 +5,13 @@ import java.util.Date; import java.util.UUID; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import jakarta.persistence.Entity; +import jakarta.persistence.Id; +import jakarta.persistence.NamedQueries; +import jakarta.persistence.NamedQuery; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; import org.icatproject.core.IcatException; diff --git a/src/main/java/org/icatproject/core/entity/Shift.java b/src/main/java/org/icatproject/core/entity/Shift.java index ac812665..9f84d65c 100644 --- a/src/main/java/org/icatproject/core/entity/Shift.java +++ b/src/main/java/org/icatproject/core/entity/Shift.java @@ -3,15 +3,15 @@ import java.io.Serializable; import java.util.Date; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; +import jakarta.persistence.UniqueConstraint; @Comment("A period of time related to an investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Study.java b/src/main/java/org/icatproject/core/entity/Study.java index ab6c5486..cb8bb9b7 100644 --- a/src/main/java/org/icatproject/core/entity/Study.java +++ b/src/main/java/org/icatproject/core/entity/Study.java @@ -5,14 +5,14 @@ import java.util.Date; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Temporal; +import jakarta.persistence.TemporalType; @Comment("A study which may be related to an investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/StudyInvestigation.java b/src/main/java/org/icatproject/core/entity/StudyInvestigation.java index 403109db..836909e5 100644 --- a/src/main/java/org/icatproject/core/entity/StudyInvestigation.java +++ b/src/main/java/org/icatproject/core/entity/StudyInvestigation.java @@ -2,11 +2,11 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Many to many relationship between study and investigation") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/Technique.java b/src/main/java/org/icatproject/core/entity/Technique.java index 98a8a11c..3444b1af 100644 --- a/src/main/java/org/icatproject/core/entity/Technique.java +++ b/src/main/java/org/icatproject/core/entity/Technique.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Represents an experimental technique") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/User.java b/src/main/java/org/icatproject/core/entity/User.java index f3e360e7..521b29df 100644 --- a/src/main/java/org/icatproject/core/entity/User.java +++ b/src/main/java/org/icatproject/core/entity/User.java @@ -4,12 +4,12 @@ import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.Entity; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.Entity; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("A user of the facility") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/entity/UserGroup.java b/src/main/java/org/icatproject/core/entity/UserGroup.java index 1da3f96f..80952c2f 100644 --- a/src/main/java/org/icatproject/core/entity/UserGroup.java +++ b/src/main/java/org/icatproject/core/entity/UserGroup.java @@ -2,12 +2,12 @@ import java.io.Serializable; -import javax.persistence.Entity; -import javax.persistence.FetchType; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; +import jakarta.persistence.Entity; +import jakarta.persistence.FetchType; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; @Comment("Many to many relationship between user and group") @SuppressWarnings("serial") diff --git a/src/main/java/org/icatproject/core/manager/AuthenticatorInfo.java b/src/main/java/org/icatproject/core/manager/AuthenticatorInfo.java index d0c9af45..d54e9bc5 100644 --- a/src/main/java/org/icatproject/core/manager/AuthenticatorInfo.java +++ b/src/main/java/org/icatproject/core/manager/AuthenticatorInfo.java @@ -4,10 +4,10 @@ import java.util.ArrayList; import java.util.List; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonObject; -import javax.json.JsonReader; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonObject; +import jakarta.json.JsonReader; import org.icatproject.core.IcatException; import org.icatproject.core.manager.PropertyHandler.ExtendedAuthenticator; diff --git a/src/main/java/org/icatproject/core/manager/EntityBeanManager.java b/src/main/java/org/icatproject/core/manager/EntityBeanManager.java index 4654d681..1145be30 100644 --- a/src/main/java/org/icatproject/core/manager/EntityBeanManager.java +++ b/src/main/java/org/icatproject/core/manager/EntityBeanManager.java @@ -26,36 +26,36 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.PostConstruct; -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.jms.JMSException; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonException; -import javax.json.JsonNumber; -import javax.json.JsonObject; -import javax.json.JsonReader; -import javax.json.JsonString; -import javax.json.JsonStructure; -import javax.json.JsonValue; -import javax.json.JsonValue.ValueType; -import javax.json.stream.JsonGenerator; -import javax.persistence.EntityExistsException; -import javax.persistence.EntityManager; -import javax.persistence.Query; -import javax.persistence.TypedQuery; -import javax.transaction.HeuristicMixedException; -import javax.transaction.HeuristicRollbackException; -import javax.transaction.NotSupportedException; -import javax.transaction.RollbackException; -import javax.transaction.Status; -import javax.transaction.SystemException; -import javax.transaction.UserTransaction; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.StreamingOutput; +import jakarta.annotation.PostConstruct; +import jakarta.ejb.EJB; +import jakarta.ejb.Stateless; +import jakarta.ejb.TransactionManagement; +import jakarta.ejb.TransactionManagementType; +import jakarta.jms.JMSException; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonException; +import jakarta.json.JsonNumber; +import jakarta.json.JsonObject; +import jakarta.json.JsonReader; +import jakarta.json.JsonString; +import jakarta.json.JsonStructure; +import jakarta.json.JsonValue; +import jakarta.json.JsonValue.ValueType; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.EntityExistsException; +import jakarta.persistence.EntityManager; +import jakarta.persistence.Query; +import jakarta.persistence.TypedQuery; +import jakarta.transaction.HeuristicMixedException; +import jakarta.transaction.HeuristicRollbackException; +import jakarta.transaction.NotSupportedException; +import jakarta.transaction.RollbackException; +import jakarta.transaction.Status; +import jakarta.transaction.SystemException; +import jakarta.transaction.UserTransaction; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.StreamingOutput; import org.icatproject.core.Constants; import org.icatproject.core.IcatException; @@ -963,7 +963,7 @@ private EntitySetResult getEntitySet(String userId, String query, EntityManager } /* Create query - which may go wrong */ - javax.persistence.Query jpqlQuery; + Query jpqlQuery; try { jpqlQuery = manager.createQuery(jpql); } catch (IllegalArgumentException e) { diff --git a/src/main/java/org/icatproject/core/manager/EntityInfoHandler.java b/src/main/java/org/icatproject/core/manager/EntityInfoHandler.java index 1321db3f..0a44ed6d 100644 --- a/src/main/java/org/icatproject/core/manager/EntityInfoHandler.java +++ b/src/main/java/org/icatproject/core/manager/EntityInfoHandler.java @@ -19,17 +19,17 @@ import java.util.Map.Entry; import java.util.Set; -import javax.json.stream.JsonGenerator; -import javax.persistence.CascadeType; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; -import javax.persistence.Table; -import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlTransient; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.CascadeType; +import jakarta.persistence.Column; +import jakarta.persistence.GeneratedValue; +import jakarta.persistence.Id; +import jakarta.persistence.JoinColumn; +import jakarta.persistence.ManyToOne; +import jakarta.persistence.OneToMany; +import jakarta.persistence.Table; +import jakarta.persistence.UniqueConstraint; +import jakarta.xml.bind.annotation.XmlTransient; import org.icatproject.core.Constants; import org.icatproject.core.IcatException; diff --git a/src/main/java/org/icatproject/core/manager/GateKeeper.java b/src/main/java/org/icatproject/core/manager/GateKeeper.java index d01470f8..5629fa53 100644 --- a/src/main/java/org/icatproject/core/manager/GateKeeper.java +++ b/src/main/java/org/icatproject/core/manager/GateKeeper.java @@ -20,17 +20,17 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.EJB; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.jms.JMSException; -import javax.json.JsonObject; -import javax.json.JsonValue; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.persistence.TypedQuery; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.ejb.EJB; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; +import jakarta.jms.JMSException; +import jakarta.json.JsonObject; +import jakarta.json.JsonValue; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.persistence.TypedQuery; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; diff --git a/src/main/java/org/icatproject/core/manager/LuceneApi.java b/src/main/java/org/icatproject/core/manager/LuceneApi.java index 5f1b0d0d..6d8ca753 100644 --- a/src/main/java/org/icatproject/core/manager/LuceneApi.java +++ b/src/main/java/org/icatproject/core/manager/LuceneApi.java @@ -9,11 +9,11 @@ import java.util.List; import java.util.TimeZone; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.stream.JsonParser.Event; -import javax.ws.rs.core.MediaType; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.stream.JsonParser.Event; +import jakarta.ws.rs.core.MediaType; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpDelete; diff --git a/src/main/java/org/icatproject/core/manager/LuceneManager.java b/src/main/java/org/icatproject/core/manager/LuceneManager.java index 7c799882..adad614f 100644 --- a/src/main/java/org/icatproject/core/manager/LuceneManager.java +++ b/src/main/java/org/icatproject/core/manager/LuceneManager.java @@ -29,16 +29,16 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.EJB; -import javax.ejb.Singleton; -import javax.ejb.Startup; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.persistence.EntityManager; -import javax.persistence.EntityManagerFactory; -import javax.persistence.PersistenceUnit; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.ejb.EJB; +import jakarta.ejb.Singleton; +import jakarta.ejb.Startup; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.persistence.EntityManager; +import jakarta.persistence.EntityManagerFactory; +import jakarta.persistence.PersistenceUnit; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; diff --git a/src/main/java/org/icatproject/core/manager/NotificationMessage.java b/src/main/java/org/icatproject/core/manager/NotificationMessage.java index 95b9f10c..6f48f916 100644 --- a/src/main/java/org/icatproject/core/manager/NotificationMessage.java +++ b/src/main/java/org/icatproject/core/manager/NotificationMessage.java @@ -2,7 +2,7 @@ import java.util.Map; -import javax.persistence.EntityManager; +import jakarta.persistence.EntityManager; import org.icatproject.core.IcatException; import org.icatproject.core.entity.EntityBaseBean; diff --git a/src/main/java/org/icatproject/core/manager/NotificationTransmitter.java b/src/main/java/org/icatproject/core/manager/NotificationTransmitter.java index 8d46f124..f4b6b4e4 100644 --- a/src/main/java/org/icatproject/core/manager/NotificationTransmitter.java +++ b/src/main/java/org/icatproject/core/manager/NotificationTransmitter.java @@ -1,16 +1,16 @@ package org.icatproject.core.manager; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.EJB; -import javax.ejb.Singleton; -import javax.jms.JMSException; -import javax.jms.MessageProducer; -import javax.jms.ObjectMessage; -import javax.jms.Session; -import javax.jms.Topic; -import javax.jms.TopicConnection; -import javax.jms.TopicConnectionFactory; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.ejb.EJB; +import jakarta.ejb.Singleton; +import jakarta.jms.JMSException; +import jakarta.jms.MessageProducer; +import jakarta.jms.ObjectMessage; +import jakarta.jms.Session; +import jakarta.jms.Topic; +import jakarta.jms.TopicConnection; +import jakarta.jms.TopicConnectionFactory; import javax.naming.InitialContext; import javax.naming.NamingException; diff --git a/src/main/java/org/icatproject/core/manager/Porter.java b/src/main/java/org/icatproject/core/manager/Porter.java index 226121a2..55de8256 100644 --- a/src/main/java/org/icatproject/core/manager/Porter.java +++ b/src/main/java/org/icatproject/core/manager/Porter.java @@ -21,20 +21,20 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.PostConstruct; -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.json.Json; -import javax.json.stream.JsonParser; -import javax.json.stream.JsonParser.Event; -import javax.persistence.EntityManager; -import javax.persistence.NoResultException; -import javax.persistence.NonUniqueResultException; -import javax.persistence.TypedQuery; -import javax.transaction.UserTransaction; -import javax.ws.rs.core.Response; +import jakarta.annotation.PostConstruct; +import jakarta.ejb.EJB; +import jakarta.ejb.Stateless; +import jakarta.ejb.TransactionManagement; +import jakarta.ejb.TransactionManagementType; +import jakarta.json.Json; +import jakarta.json.stream.JsonParser; +import jakarta.json.stream.JsonParser.Event; +import jakarta.persistence.EntityManager; +import jakarta.persistence.NoResultException; +import jakarta.persistence.NonUniqueResultException; +import jakarta.persistence.TypedQuery; +import jakarta.transaction.UserTransaction; +import jakarta.ws.rs.core.Response; import org.icatproject.core.IcatException; import org.icatproject.core.IcatException.IcatExceptionType; diff --git a/src/main/java/org/icatproject/core/manager/PropertyHandler.java b/src/main/java/org/icatproject/core/manager/PropertyHandler.java index f316bb64..884b0092 100644 --- a/src/main/java/org/icatproject/core/manager/PropertyHandler.java +++ b/src/main/java/org/icatproject/core/manager/PropertyHandler.java @@ -22,15 +22,15 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.PostConstruct; -import javax.ejb.Singleton; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonReader; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.stream.JsonParser.Event; -import javax.json.stream.JsonParsingException; +import jakarta.annotation.PostConstruct; +import jakarta.ejb.Singleton; +import jakarta.json.Json; +import jakarta.json.JsonObject; +import jakarta.json.JsonReader; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.stream.JsonParser.Event; +import jakarta.json.stream.JsonParsingException; import javax.naming.InitialContext; import org.apache.http.HttpEntity; diff --git a/src/main/java/org/icatproject/core/manager/Rest.java b/src/main/java/org/icatproject/core/manager/Rest.java index c3b0fcfe..dbf75732 100644 --- a/src/main/java/org/icatproject/core/manager/Rest.java +++ b/src/main/java/org/icatproject/core/manager/Rest.java @@ -3,10 +3,10 @@ import java.io.ByteArrayInputStream; import java.io.IOException; -import javax.json.Json; -import javax.json.stream.JsonParser; -import javax.json.stream.JsonParsingException; -import javax.json.stream.JsonParser.Event; +import jakarta.json.Json; +import jakarta.json.stream.JsonParser; +import jakarta.json.stream.JsonParsingException; +import jakarta.json.stream.JsonParser.Event; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; diff --git a/src/main/java/org/icatproject/core/manager/SessionManager.java b/src/main/java/org/icatproject/core/manager/SessionManager.java index 521b0cb2..714dac81 100644 --- a/src/main/java/org/icatproject/core/manager/SessionManager.java +++ b/src/main/java/org/icatproject/core/manager/SessionManager.java @@ -1,9 +1,9 @@ package org.icatproject.core.manager; -import javax.ejb.Schedule; -import javax.ejb.Singleton; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; +import jakarta.ejb.Schedule; +import jakarta.ejb.Singleton; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; import org.icatproject.core.entity.Session; import org.slf4j.Logger; diff --git a/src/main/java/org/icatproject/core/manager/Transmitter.java b/src/main/java/org/icatproject/core/manager/Transmitter.java index 62744ce8..3537d830 100644 --- a/src/main/java/org/icatproject/core/manager/Transmitter.java +++ b/src/main/java/org/icatproject/core/manager/Transmitter.java @@ -1,16 +1,16 @@ package org.icatproject.core.manager; -import javax.annotation.PostConstruct; -import javax.annotation.PreDestroy; -import javax.ejb.EJB; -import javax.ejb.Singleton; -import javax.jms.JMSException; -import javax.jms.MessageProducer; -import javax.jms.Session; -import javax.jms.TextMessage; -import javax.jms.Topic; -import javax.jms.TopicConnection; -import javax.jms.TopicConnectionFactory; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; +import jakarta.ejb.EJB; +import jakarta.ejb.Singleton; +import jakarta.jms.JMSException; +import jakarta.jms.MessageProducer; +import jakarta.jms.Session; +import jakarta.jms.TextMessage; +import jakarta.jms.Topic; +import jakarta.jms.TopicConnection; +import jakarta.jms.TopicConnectionFactory; import javax.naming.InitialContext; import javax.naming.NamingException; diff --git a/src/main/java/org/icatproject/core/parser/SearchQuery.java b/src/main/java/org/icatproject/core/parser/SearchQuery.java index 426fd348..73e6af35 100644 --- a/src/main/java/org/icatproject/core/parser/SearchQuery.java +++ b/src/main/java/org/icatproject/core/parser/SearchQuery.java @@ -5,8 +5,8 @@ import java.util.Map.Entry; import java.util.regex.Pattern; -import javax.persistence.EntityManager; -import javax.persistence.TypedQuery; +import jakarta.persistence.EntityManager; +import jakarta.persistence.TypedQuery; import org.icatproject.core.IcatException; import org.icatproject.core.entity.EntityBaseBean; diff --git a/src/main/java/org/icatproject/exposed/CORSResponseFilter.java b/src/main/java/org/icatproject/exposed/CORSResponseFilter.java index 8088188f..7138a56e 100644 --- a/src/main/java/org/icatproject/exposed/CORSResponseFilter.java +++ b/src/main/java/org/icatproject/exposed/CORSResponseFilter.java @@ -2,11 +2,11 @@ import java.io.IOException; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerResponseContext; -import javax.ws.rs.container.ContainerResponseFilter; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerResponseContext; +import jakarta.ws.rs.container.ContainerResponseFilter; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; @Provider public class CORSResponseFilter implements ContainerResponseFilter { diff --git a/src/main/java/org/icatproject/exposed/ContentTypeFilter.java b/src/main/java/org/icatproject/exposed/ContentTypeFilter.java index 3eda4273..44595719 100644 --- a/src/main/java/org/icatproject/exposed/ContentTypeFilter.java +++ b/src/main/java/org/icatproject/exposed/ContentTypeFilter.java @@ -3,12 +3,12 @@ import java.io.IOException; import java.util.List; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.PreMatching; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MultivaluedMap; -import javax.ws.rs.ext.Provider; +import jakarta.ws.rs.container.ContainerRequestContext; +import jakarta.ws.rs.container.ContainerRequestFilter; +import jakarta.ws.rs.container.PreMatching; +import jakarta.ws.rs.core.HttpHeaders; +import jakarta.ws.rs.core.MultivaluedMap; +import jakarta.ws.rs.ext.Provider; /** * diff --git a/src/main/java/org/icatproject/exposed/ICAT.java b/src/main/java/org/icatproject/exposed/ICAT.java index bbffa7dd..3605d805 100644 --- a/src/main/java/org/icatproject/exposed/ICAT.java +++ b/src/main/java/org/icatproject/exposed/ICAT.java @@ -9,23 +9,23 @@ import java.util.Map.Entry; import java.util.Set; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.interceptor.AroundInvoke; -import javax.interceptor.InvocationContext; -import javax.jws.WebMethod; -import javax.jws.WebParam; -import javax.jws.WebService; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.servlet.http.HttpServletRequest; -import javax.transaction.UserTransaction; -import javax.xml.ws.WebServiceContext; -import javax.xml.ws.handler.MessageContext; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import jakarta.ejb.EJB; +import jakarta.ejb.Stateless; +import jakarta.ejb.TransactionManagement; +import jakarta.ejb.TransactionManagementType; +import jakarta.interceptor.AroundInvoke; +import jakarta.interceptor.InvocationContext; +import jakarta.jws.WebMethod; +import jakarta.jws.WebParam; +import jakarta.jws.WebService; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.transaction.UserTransaction; +import jakarta.xml.ws.WebServiceContext; +import jakarta.xml.ws.handler.MessageContext; import org.icatproject.authentication.Authenticator; import org.icatproject.core.Constants; diff --git a/src/main/java/org/icatproject/exposed/ICATRest.java b/src/main/java/org/icatproject/exposed/ICATRest.java index bd1a2b4a..261d410f 100644 --- a/src/main/java/org/icatproject/exposed/ICATRest.java +++ b/src/main/java/org/icatproject/exposed/ICATRest.java @@ -22,45 +22,45 @@ import java.util.Set; import java.util.TimeZone; -import javax.annotation.PostConstruct; -import javax.annotation.Resource; -import javax.ejb.EJB; -import javax.ejb.Stateless; -import javax.ejb.TransactionManagement; -import javax.ejb.TransactionManagementType; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonArrayBuilder; -import javax.json.JsonException; -import javax.json.JsonNumber; -import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; -import javax.json.JsonReader; -import javax.json.JsonString; -import javax.json.JsonStructure; -import javax.json.JsonValue; -import javax.json.JsonValue.ValueType; -import javax.json.JsonWriter; -import javax.json.stream.JsonGenerator; -import javax.json.stream.JsonParser; -import javax.json.stream.JsonParser.Event; -import javax.persistence.EntityManager; -import javax.persistence.PersistenceContext; -import javax.servlet.http.HttpServletRequest; -import javax.transaction.UserTransaction; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.FormParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.Resource; +import jakarta.ejb.EJB; +import jakarta.ejb.Stateless; +import jakarta.ejb.TransactionManagement; +import jakarta.ejb.TransactionManagementType; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonArrayBuilder; +import jakarta.json.JsonException; +import jakarta.json.JsonNumber; +import jakarta.json.JsonObject; +import jakarta.json.JsonObjectBuilder; +import jakarta.json.JsonReader; +import jakarta.json.JsonString; +import jakarta.json.JsonStructure; +import jakarta.json.JsonValue; +import jakarta.json.JsonValue.ValueType; +import jakarta.json.JsonWriter; +import jakarta.json.stream.JsonGenerator; +import jakarta.json.stream.JsonParser; +import jakarta.json.stream.JsonParser.Event; +import jakarta.persistence.EntityManager; +import jakarta.persistence.PersistenceContext; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.transaction.UserTransaction; +import jakarta.ws.rs.Consumes; +import jakarta.ws.rs.DELETE; +import jakarta.ws.rs.FormParam; +import jakarta.ws.rs.GET; +import jakarta.ws.rs.POST; +import jakarta.ws.rs.PUT; +import jakarta.ws.rs.Path; +import jakarta.ws.rs.PathParam; +import jakarta.ws.rs.Produces; +import jakarta.ws.rs.QueryParam; +import jakarta.ws.rs.core.Context; +import jakarta.ws.rs.core.MediaType; +import jakarta.ws.rs.core.Response; import org.apache.commons.fileupload.FileItemIterator; import org.apache.commons.fileupload.FileItemStream; diff --git a/src/main/java/org/icatproject/exposed/IcatExceptionMapper.java b/src/main/java/org/icatproject/exposed/IcatExceptionMapper.java index 775181d0..198310cd 100644 --- a/src/main/java/org/icatproject/exposed/IcatExceptionMapper.java +++ b/src/main/java/org/icatproject/exposed/IcatExceptionMapper.java @@ -2,11 +2,11 @@ import java.io.ByteArrayOutputStream; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.icatproject.core.IcatException; import org.icatproject.core.IcatException.IcatExceptionType; diff --git a/src/main/java/org/icatproject/exposed/NotFoundExceptionMapper.java b/src/main/java/org/icatproject/exposed/NotFoundExceptionMapper.java index 2640548c..f5d6e182 100644 --- a/src/main/java/org/icatproject/exposed/NotFoundExceptionMapper.java +++ b/src/main/java/org/icatproject/exposed/NotFoundExceptionMapper.java @@ -2,12 +2,12 @@ import java.io.ByteArrayOutputStream; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.ws.rs.NotFoundException; -import javax.ws.rs.core.Response; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.ws.rs.NotFoundException; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.icatproject.core.IcatException.IcatExceptionType; import org.slf4j.Logger; diff --git a/src/main/java/org/icatproject/exposed/ThrowableExceptionMapper.java b/src/main/java/org/icatproject/exposed/ThrowableExceptionMapper.java index 2ff6fc46..548ea613 100644 --- a/src/main/java/org/icatproject/exposed/ThrowableExceptionMapper.java +++ b/src/main/java/org/icatproject/exposed/ThrowableExceptionMapper.java @@ -2,12 +2,12 @@ import java.io.ByteArrayOutputStream; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; -import javax.ws.rs.ext.ExceptionMapper; -import javax.ws.rs.ext.Provider; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.ws.rs.core.Response; +import jakarta.ws.rs.core.Response.Status; +import jakarta.ws.rs.ext.ExceptionMapper; +import jakarta.ws.rs.ext.Provider; import org.icatproject.core.IcatException.IcatExceptionType; import org.slf4j.Logger; diff --git a/src/main/scripts/setup b/src/main/scripts/setup index 35e822cf..38bff31e 100755 --- a/src/main/scripts/setup +++ b/src/main/scripts/setup @@ -41,8 +41,8 @@ if arg == "INSTALL": try: uninstall() actions.registerDB("icat", props["db.driver"], props["db.url"], props["db.username"], props["db.password"]) - actions.createJMSResource("javax.jms.Topic", "jms/ICAT/Topic") - actions.createJMSResource("javax.jms.Topic", "jms/ICAT/log") + actions.createJMSResource("jakarta.jms.Topic", "jms/ICAT/Topic") + actions.createJMSResource("jakarta.jms.Topic", "jms/ICAT/log") ovfiles = [[prop_name, "WEB-INF/classes"]] if os.path.exists("logback.xml"): ovfiles.append(["logback.xml", "WEB-INF/classes"]) diff --git a/src/test/java/org/icatproject/core/manager/TestLucene.java b/src/test/java/org/icatproject/core/manager/TestLucene.java index a0242526..2d48db6c 100644 --- a/src/test/java/org/icatproject/core/manager/TestLucene.java +++ b/src/test/java/org/icatproject/core/manager/TestLucene.java @@ -18,9 +18,9 @@ import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; -import javax.json.Json; -import javax.json.stream.JsonGenerator; -import javax.ws.rs.core.MediaType; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; +import jakarta.ws.rs.core.MediaType; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; diff --git a/src/test/java/org/icatproject/exposed/TestICATRest.java b/src/test/java/org/icatproject/exposed/TestICATRest.java index bb642d27..6ab58e41 100644 --- a/src/test/java/org/icatproject/exposed/TestICATRest.java +++ b/src/test/java/org/icatproject/exposed/TestICATRest.java @@ -15,8 +15,8 @@ import java.math.BigDecimal; import java.math.BigInteger; -import javax.json.Json; -import javax.json.stream.JsonGenerator; +import jakarta.json.Json; +import jakarta.json.stream.JsonGenerator; import org.icatproject.exposed.ICATRest; import org.icatproject.core.entity.ParameterValueType; diff --git a/src/test/java/org/icatproject/integration/TestRS.java b/src/test/java/org/icatproject/integration/TestRS.java index c5fd4b7a..c6f4fe9a 100644 --- a/src/test/java/org/icatproject/integration/TestRS.java +++ b/src/test/java/org/icatproject/integration/TestRS.java @@ -39,12 +39,12 @@ import java.util.Set; import java.util.regex.Pattern; -import javax.json.Json; -import javax.json.JsonArray; -import javax.json.JsonNumber; -import javax.json.JsonObject; -import javax.json.JsonValue; -import javax.json.stream.JsonGenerator; +import jakarta.json.Json; +import jakarta.json.JsonArray; +import jakarta.json.JsonNumber; +import jakarta.json.JsonObject; +import jakarta.json.JsonValue; +import jakarta.json.stream.JsonGenerator; import org.icatproject.core.manager.LuceneApi; import org.icatproject.icat.client.ICAT; diff --git a/src/test/java/org/icatproject/integration/WSession.java b/src/test/java/org/icatproject/integration/WSession.java index 6483c46b..196fc112 100644 --- a/src/test/java/org/icatproject/integration/WSession.java +++ b/src/test/java/org/icatproject/integration/WSession.java @@ -6,11 +6,11 @@ import java.util.Arrays; import java.util.List; -import javax.json.Json; -import javax.json.JsonString; +import jakarta.json.Json; +import jakarta.json.JsonString; import javax.xml.datatype.XMLGregorianCalendar; import javax.xml.namespace.QName; -import javax.xml.ws.WebServiceException; +import jakarta.xml.ws.WebServiceException; import org.icatproject.AccessType; import org.icatproject.Application; From 73c1867e27fdc754801a68d2754b2c4add698536 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 10 May 2022 16:38:34 +0100 Subject: [PATCH 03/15] Remove use of ServletFileUpload which depends on javax.servlet.http.HttpServletRequest --- pom.xml | 6 ---- .../org/icatproject/exposed/ICATRest.java | 30 ++++++++----------- src/main/webapp/WEB-INF/web.xml | 2 ++ 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/pom.xml b/pom.xml index 695e2565..5f7946be 100644 --- a/pom.xml +++ b/pom.xml @@ -110,12 +110,6 @@ test - - commons-fileupload - commons-fileupload - 1.4 - - org.icatproject icat.utils diff --git a/src/main/java/org/icatproject/exposed/ICATRest.java b/src/main/java/org/icatproject/exposed/ICATRest.java index 261d410f..1852ef2b 100644 --- a/src/main/java/org/icatproject/exposed/ICATRest.java +++ b/src/main/java/org/icatproject/exposed/ICATRest.java @@ -10,6 +10,7 @@ import java.lang.reflect.Method; import java.math.BigDecimal; import java.math.BigInteger; +import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -46,7 +47,9 @@ import jakarta.json.stream.JsonParser.Event; import jakarta.persistence.EntityManager; import jakarta.persistence.PersistenceContext; +import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.Part; import jakarta.transaction.UserTransaction; import jakarta.ws.rs.Consumes; import jakarta.ws.rs.DELETE; @@ -62,11 +65,6 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; -import org.apache.commons.fileupload.FileItemIterator; -import org.apache.commons.fileupload.FileItemStream; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.commons.fileupload.servlet.ServletFileUpload; -import org.apache.commons.fileupload.util.Streams; import org.icatproject.authentication.Authenticator; import org.icatproject.core.Constants; import org.icatproject.core.IcatException; @@ -664,23 +662,17 @@ public String getVersion() { @Path("port") @Consumes(MediaType.MULTIPART_FORM_DATA) public void importData(@Context HttpServletRequest request) throws IcatException { - if (!ServletFileUpload.isMultipartContent(request)) { - throw new IcatException(IcatExceptionType.BAD_PARAMETER, "Multipart content expected"); - } - ServletFileUpload upload = new ServletFileUpload(); String jsonString = null; String name = null; // Parse the request try { - FileItemIterator iter = upload.getItemIterator(request); - while (iter.hasNext()) { - FileItemStream item = iter.next(); - String fieldName = item.getFieldName(); - InputStream stream = item.openStream(); - if (item.isFormField()) { - String value = Streams.asString(stream); + for (Part part : request.getParts()) { + String fieldName = part.getName(); + InputStream stream = part.getInputStream(); + if (part.getSubmittedFileName() == null) { + String value = new String(stream.readAllBytes(), StandardCharsets.UTF_8); if (fieldName.equals("json")) { jsonString = value; } else { @@ -689,13 +681,15 @@ public void importData(@Context HttpServletRequest request) throws IcatException } } else { if (name == null) { - name = item.getName(); + name = part.getSubmittedFileName(); } porter.importData(jsonString, stream, manager, userTransaction, request.getRemoteAddr()); } } - } catch (FileUploadException | IOException e) { + } catch (IOException e) { throw new IcatException(IcatExceptionType.INTERNAL, e.getClass() + " " + e.getMessage()); + } catch (ServletException e) { + throw new IcatException(IcatExceptionType.BAD_PARAMETER, "Multipart content expected"); } } diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 3440631e..4a4ca33d 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -12,6 +12,8 @@ 1 + + From e8c7547e9cd909faa7cdc3f072e465d002bd045f Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Wed, 11 May 2022 17:46:06 +0100 Subject: [PATCH 04/15] Update the expected version in tests --- src/test/java/org/icatproject/integration/TestRS.java | 2 +- src/test/java/org/icatproject/integration/TestWS.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/icatproject/integration/TestRS.java b/src/test/java/org/icatproject/integration/TestRS.java index c6f4fe9a..53e4875c 100644 --- a/src/test/java/org/icatproject/integration/TestRS.java +++ b/src/test/java/org/icatproject/integration/TestRS.java @@ -500,7 +500,7 @@ private JsonArray searchDatafiles(Session session, String user, String text, Dat @Test public void testVersion() throws Exception { ICAT icat = new ICAT(System.getProperty("serverUrl")); - assertTrue(icat.getVersion().startsWith("5.")); + assertTrue(icat.getVersion().startsWith("6.")); } @Test diff --git a/src/test/java/org/icatproject/integration/TestWS.java b/src/test/java/org/icatproject/integration/TestWS.java index 97cc7369..dde35597 100644 --- a/src/test/java/org/icatproject/integration/TestWS.java +++ b/src/test/java/org/icatproject/integration/TestWS.java @@ -71,7 +71,7 @@ */ public class TestWS { - private static final String version = "5.0."; + private static final String version = "6.0."; private static Random random; private static WSession session; From 9c04a1425ee0dc3009223295c001f32b6872de99 Mon Sep 17 00:00:00 2001 From: Matthew Richards Date: Tue, 24 May 2022 10:16:11 +0000 Subject: [PATCH 05/15] Change ICAT Ansible branch to payara6 --- .github/workflows/ci-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9e3c28b3..63568265 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -38,7 +38,7 @@ jobs: with: repository: icatproject-contrib/icat-ansible path: icat-ansible - ref: master + ref: payara6 - name: Install Ansible run: pip install -r icat-ansible/requirements.txt From a94d51af9f1909930deed09f96ad33b40d891809 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Thu, 29 Sep 2022 17:02:09 +0100 Subject: [PATCH 06/15] Upgrade to jakartaee-api 10.0.0 --- pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 5f7946be..f0ce326c 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ jakarta.platform jakarta.jakartaee-api - 9.1.0 + 10.0.0 provided @@ -99,14 +99,14 @@ com.sun.xml.ws jaxws-rt - 3.0.2 + 4.0.0 test - org.glassfish - jakarta.json - 2.0.1 + org.eclipse.parsson + parsson + 1.1.0 test From ccc79fd065e090b61ba1192d196bd90eafbaf0d7 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Wed, 17 May 2023 16:37:08 +0100 Subject: [PATCH 07/15] Update schemas in persistence.xml and web.xml --- src/main/resources/META-INF/persistence.xml | 7 ++++--- src/main/webapp/WEB-INF/web.xml | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/resources/META-INF/persistence.xml b/src/main/resources/META-INF/persistence.xml index bcdadd3c..e4e65274 100755 --- a/src/main/resources/META-INF/persistence.xml +++ b/src/main/resources/META-INF/persistence.xml @@ -1,8 +1,9 @@ - + xsi:schemaLocation="https://jakarta.ee/xml/ns/persistence https://jakarta.ee/xml/ns/persistence/persistence_3_0.xsd" + version="3.0"> org.eclipse.persistence.jpa.PersistenceProvider diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml index 4a4ca33d..03291af9 100644 --- a/src/main/webapp/WEB-INF/web.xml +++ b/src/main/webapp/WEB-INF/web.xml @@ -1,7 +1,9 @@ - + xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd" + version="6.0"> ServletAdaptor From 3d7c3d07b405e1877eb2e3aa735a96af177a4fe1 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 27 Jun 2023 09:55:09 +0100 Subject: [PATCH 08/15] Update release notes and installation instructions --- README.md | 4 ++-- src/site/xhtml/installation.xhtml.vm | 15 +++++---------- src/site/xhtml/release-notes.xhtml | 3 +++ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index a5a74588..b6d09178 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,6 @@ General installation instructions are at https://icatproject.org/installation/component -Specific installation instructions are at https://repo.icatproject.org/site/icat/server/5.0.0/installation.html +Specific installation instructions are at https://repo.icatproject.org/site/icat/server/6.0.0/installation.html -All documentation on the icat.server may be found at https://repo.icatproject.org/site/icat/server/5.0.0 +All documentation on the icat.server may be found at https://repo.icatproject.org/site/icat/server/6.0.0 diff --git a/src/site/xhtml/installation.xhtml.vm b/src/site/xhtml/installation.xhtml.vm index 358562ce..70912e5f 100644 --- a/src/site/xhtml/installation.xhtml.vm +++ b/src/site/xhtml/installation.xhtml.vm @@ -19,21 +19,16 @@
  • The icat distribution: icat.server-${project.version}-distro.zip
  • -
  • Java 8
  • -
  • A suitable deployed container. The installation scripts - support Glassfish/Payara and to a lesser extent WildFly. Testing has - been carried out with Payara 5.Glassfish/Payara - installation instructions are available. -
  • +
  • Java 11+
  • +
  • A suitable deployed application server that supports JakartaEE 10+. Testing has been carried out with Payara Server Community 6. Other applications servers such as GlassFish and WildFly may work but have not been tested. + Glassfish/Payara installation instructions are available.
  • A database as described in Database installation instructions installed on the server
  • Deployed ICAT authenticators.
  • -
  • A deployed icat.lucene server it you plan to use TopCAT
  • -
  • Python (version 2.4 to 2.7) and the python-suds package - installed on the server.
  • +
  • A deployed icat.lucene server it you plan to use free-text search.
  • +
  • Python 3.6+ and the suds-community package installed on the server.
  • Summary of steps

    diff --git a/src/site/xhtml/release-notes.xhtml b/src/site/xhtml/release-notes.xhtml index 21f524d3..b0113ef3 100644 --- a/src/site/xhtml/release-notes.xhtml +++ b/src/site/xhtml/release-notes.xhtml @@ -6,6 +6,9 @@

    ICAT Server Release Notes

    +

    6.0.0

    +

    Upgrade from JavaEE to JakartaEE 10. Requires Java 11+ and an application server that supports JakartaEE 10 such as Payara 6.

    +

    5.0.1

    Fix authorization of lists of ICAT entities and use Python3 for scripts

    From fd79090c35c04c8f84671ca58ffc9d2f146f3ebf Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 27 Jun 2023 10:40:56 +0100 Subject: [PATCH 09/15] Update dependencies to release versions --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index f0ce326c..e6fe5885 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ org.icatproject icat.authentication - 5.0.0-SNAPSHOT + 5.0.0 @@ -119,7 +119,7 @@ org.icatproject icat.client - 6.0.0-SNAPSHOT + 6.0.0 test From 3a677c26cbd2f29ba709f3be99917bee31b9d888 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 27 Jun 2023 10:48:49 +0100 Subject: [PATCH 10/15] [maven-release-plugin] prepare release v6.0.0 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e6fe5885..0fb5d3fb 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.icatproject icat.server - 6.0.0-SNAPSHOT + 6.0.0 war ICAT Server A metadata catalogue to support Large Facility experimental data, @@ -36,7 +36,7 @@ scm:git:${gitUrl}.git scm:git:${gitUrl}.git ${gitUrl} - HEAD + v6.0.0 From 2f057fb7066fe0525a2012e2b1d3ec91b36cbe49 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 27 Jun 2023 10:49:21 +0100 Subject: [PATCH 11/15] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 0fb5d3fb..01c0d6fe 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ org.icatproject icat.server - 6.0.0 + 6.0.1-SNAPSHOT war ICAT Server A metadata catalogue to support Large Facility experimental data, @@ -36,7 +36,7 @@ scm:git:${gitUrl}.git scm:git:${gitUrl}.git ${gitUrl} - v6.0.0 + HEAD From 753c9bb19ee9894d6fa3d2ba323415beb7c476ca Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 09:54:19 +0100 Subject: [PATCH 12/15] Install lxml via apt on GitHub Actions --- .github/workflows/ci-build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 63568265..43494c4a 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -64,6 +64,10 @@ jobs: sudo apt-get remove --purge "mysql*" sudo rm -rf /var/lib/mysql* /etc/mysql + # Needed for `maven_artifact` module on Ansible - lxml is in requirements.txt but doesn't seem to work on GitHub Actions + - name: Install lxml + run: sudo apt-get install python3-lxml + # Create local instance of ICAT - name: Run ICAT Ansible Playbook run: | From f1c5d5d16cb759a746882cfed18f8d635b822b7c Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 09:54:34 +0100 Subject: [PATCH 13/15] Update Java versions to 11 and 17 in GitHub Actions --- .github/workflows/ci-build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 43494c4a..6cf32458 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -14,9 +14,9 @@ jobs: fail-fast: false matrix: include: - - version: 8 - experimental: false - version: 11 + experimental: false + - version: 17 experimental: true steps: From 196f0f33d53bf67aac620b66d4c32e4c4fa37bb8 Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 10:07:55 +0100 Subject: [PATCH 14/15] Update maven-war-plugin for Java 17 compatibility Remove plugin configuration since they were set to the defaults and it works with the opposite values. --- pom.xml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 01c0d6fe..c46c4a68 100644 --- a/pom.xml +++ b/pom.xml @@ -260,11 +260,7 @@ org.apache.maven.plugins maven-war-plugin - 2.4 - - false - false - + 3.4.0 From 24a81d80955fb4ae1323f09e1f1189acaa108e6f Mon Sep 17 00:00:00 2001 From: Alan Kyffin Date: Tue, 8 Aug 2023 16:02:46 +0100 Subject: [PATCH 15/15] Changes to GitHub Actions - update OS to Ubuntu 22.04 - use OS python version - run apt-get update - remove installation of python3-lxml which is now done by icat-ansible --- .github/workflows/ci-build.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 6cf32458..2b38ac50 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -8,16 +8,10 @@ on: jobs: build_and_tests: - runs-on: ubuntu-20.04 - continue-on-error: ${{ matrix.experimental }} + runs-on: ubuntu-22.04 strategy: - fail-fast: false matrix: - include: - - version: 11 - experimental: false - - version: 17 - experimental: true + java_version: [11, 17] steps: # Setup Java & Python @@ -25,12 +19,10 @@ jobs: uses: actions/setup-java@v2 with: distribution: 'temurin' - java-version: ${{ matrix.version }} - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: "3.9.7" - architecture: x64 + java-version: ${{ matrix.java_version }} + + - name: Run apt-get update + run: sudo apt-get update # ICAT Ansible clone and install dependencies - name: Checkout icat-ansible @@ -64,10 +56,6 @@ jobs: sudo apt-get remove --purge "mysql*" sudo rm -rf /var/lib/mysql* /etc/mysql - # Needed for `maven_artifact` module on Ansible - lxml is in requirements.txt but doesn't seem to work on GitHub Actions - - name: Install lxml - run: sudo apt-get install python3-lxml - # Create local instance of ICAT - name: Run ICAT Ansible Playbook run: |