Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade to spring 6 #18314

Merged
merged 138 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from 130 commits
Commits
Show all changes
138 commits
Select commit Hold shift + click to select a range
ddd2212
chore: upgrade spring 6
vietnguyen Aug 8, 2024
06ae723
replace httpclient with httpclient5
vietnguyen Aug 8, 2024
d26ca83
fix: setReadTimeOut is removed
vietnguyen Aug 8, 2024
6f82f4b
fix use jakarta adapter for ActiveMQ lib
vietnguyen Aug 9, 2024
4fc1622
fix HttpStatusCode
vietnguyen Aug 9, 2024
a3347ce
upgrade spring-security to 6.3.1
vietnguyen Aug 9, 2024
32c3511
upgrade jakarta-persistence-api 3.2.0
vietnguyen Aug 11, 2024
a4ee47a
replace hibernate-types with hypersistence-utils
vietnguyen Aug 11, 2024
d12f9ec
Fix CommonsMultipartFile
vietnguyen Aug 11, 2024
bb9b437
fix micrometer-hibernate
vietnguyen Aug 14, 2024
6c8b9e7
exclude hibernate-core dependency
vietnguyen Aug 14, 2024
c161d97
fix jasperreport jakarta
vietnguyen Aug 14, 2024
68a43d3
upgrade tomcat-embed-core to 10.1.28
vietnguyen Aug 14, 2024
62f54b8
upgrade jetty to 12.0.12
vietnguyen Aug 14, 2024
d2ed972
minor fix
vietnguyen Aug 14, 2024
f0b1f3c
Add DhisPersistenceUnitManager and DhisPersistenceUnitInfo
vietnguyen Aug 15, 2024
6db1a6d
fix programruleaction.notificationtemplateid type in database
vietnguyen Aug 15, 2024
df14a7c
fix spring security conflicts
vietnguyen Aug 15, 2024
192aba4
fix prometheus conflicts
vietnguyen Aug 15, 2024
6b758f5
remove redundant class
vietnguyen Aug 15, 2024
66e47f2
merge from master
vietnguyen Aug 15, 2024
94c21c2
merge from master
vietnguyen Aug 15, 2024
b9600cd
merge from master
vietnguyen Aug 15, 2024
78fd272
Merge branch 'master' into viet-spring-6
vietnguyen Aug 15, 2024
7452f48
remove redundant hibernate config
vietnguyen Aug 15, 2024
829dac8
fix HttpUtils
vietnguyen Aug 15, 2024
d11489c
fix maven dependency issues
vietnguyen Aug 16, 2024
793d472
fix maven dependency issues
vietnguyen Aug 16, 2024
77b6fd3
fix BulkSmsGatewayTest
vietnguyen Aug 20, 2024
4e5fb2c
merge from master
vietnguyen Aug 20, 2024
8f8f936
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Aug 20, 2024
cd9fe59
fix TrackedEntityAttributeStoreTest
vietnguyen Aug 21, 2024
0171d58
revert javax package fix
vietnguyen Aug 21, 2024
458c92a
fix cors config for spring security 6
vietnguyen Aug 22, 2024
98936eb
merge from master
vietnguyen Aug 22, 2024
2fa27d9
merge from master
vietnguyen Aug 22, 2024
5d02c82
clear cache
vietnguyen Aug 22, 2024
4dc6f6d
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Aug 22, 2024
bcad1ef
fix setUseTrailingSlashMatch issue
vietnguyen Aug 23, 2024
b5d2b77
merge from master
vietnguyen Aug 23, 2024
aac4163
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Aug 23, 2024
4c16f7a
fix CustomRequestMappingHandlerMapping
vietnguyen Aug 23, 2024
cba4b37
fix ContentNegotiationManager in test
vietnguyen Aug 23, 2024
165107e
fix: hibernate configs
vietnguyen Aug 24, 2024
6c19034
fix messageSender test
vietnguyen Aug 26, 2024
db575bc
merge from masterwq
vietnguyen Aug 26, 2024
649c7b9
merge from master
vietnguyen Aug 26, 2024
cc4401c
fix HibernateApiTrackedEntityAuditStorewq
vietnguyen Aug 26, 2024
50fd97f
fix messageSender in test config
vietnguyen Aug 29, 2024
6b63a29
merge from master
vietnguyen Aug 29, 2024
c62b7a3
merge from master
vietnguyen Aug 29, 2024
3029402
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Aug 29, 2024
11b3a5a
fix dataSource bean config
vietnguyen Aug 29, 2024
e1b452c
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Aug 29, 2024
c118366
replace @EnableMethodSecurity
vietnguyen Aug 29, 2024
5e52317
fix messageSender bean wiring
vietnguyen Aug 29, 2024
879bcce
fix flyway migration
vietnguyen Aug 29, 2024
553e59d
fix emailMessageSender wiring
vietnguyen Aug 29, 2024
c80874f
fix emailMessageSender in test
vietnguyen Aug 29, 2024
b8a37e4
fix DataApprovalControllerTest
vietnguyen Aug 29, 2024
859553c
fix MessageSender bean autowire issue
vietnguyen Sep 9, 2024
bbce4af
Merge branch 'master' into viet-spring-6
vietnguyen Sep 10, 2024
ac55820
fix merge conflicts
vietnguyen Sep 10, 2024
9fc4224
fix code formats
vietnguyen Sep 10, 2024
7822293
fix maven dependency issue
vietnguyen Sep 10, 2024
dc48a60
fix merge conflicts
vietnguyen Sep 10, 2024
847bf43
fix maven dependency
vietnguyen Sep 10, 2024
56ff8a2
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Sep 10, 2024
e0e6c6a
fix tracker tests
vietnguyen Sep 10, 2024
1449452
fix NodeService bean injection
vietnguyen Sep 10, 2024
2f2930f
code format
vietnguyen Sep 10, 2024
df8b01f
code format
vietnguyen Sep 10, 2024
53e0528
Disable test testDeleteWithException
vietnguyen Sep 12, 2024
169a3fb
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Sep 12, 2024
483b3ad
fix test
vietnguyen Sep 18, 2024
b1807ee
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Sep 18, 2024
f44a7cf
revert debug log
vietnguyen Sep 18, 2024
aa828a9
Merge branch 'master' of github.com:dhis2/dhis2-core into viet-spring-6
netroms Sep 18, 2024
fbfa326
fix: fix ecache issue with DataDimensionTypeUserType
netroms Sep 18, 2024
3077573
Merge remote-tracking branch 'origin/viet-spring-6' into viet-spring-6
netroms Sep 18, 2024
6e847a9
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Sep 19, 2024
0c5a5aa
fix jakarta in TrailingSlashInterceptor
vietnguyen Sep 19, 2024
ca15ac2
Merge remote-tracking branch 'origin/viet-spring-6' into viet-spring-6
vietnguyen Sep 19, 2024
71da0db
fix: remove usage of requires_new
netroms Sep 19, 2024
93b67fe
Change tomcat version
enricocolasante Sep 19, 2024
fd25d8a
fix test
vietnguyen Sep 19, 2024
883f56c
Merge remote-tracking branch 'origin/viet-spring-6' into viet-spring-6
vietnguyen Sep 19, 2024
3b5dd64
fix: revert remove usage of requires_new, except for jobs
netroms Sep 19, 2024
847ce1f
fix HttpStatusCode
vietnguyen Sep 19, 2024
e8b3eb2
Merge remote-tracking branch 'origin/viet-spring-6' into viet-spring-6
vietnguyen Sep 19, 2024
e88c4d6
fix deps
vietnguyen Sep 19, 2024
3469eab
fix job update status
vietnguyen Sep 20, 2024
f49a7a1
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Sep 20, 2024
a56ed5b
code format
vietnguyen Sep 20, 2024
0af49c1
fix systemSettings api content-type
vietnguyen Sep 20, 2024
aa91b1b
code format
vietnguyen Sep 20, 2024
ae43ff3
code format
vietnguyen Sep 20, 2024
98deb11
code format
vietnguyen Sep 20, 2024
a60cb39
chore: Fix file resource multipart upload test
david-mackessy Sep 24, 2024
3ae5768
merge master
david-mackessy Sep 24, 2024
5f5fc5a
chore: fix formatting
david-mackessy Sep 24, 2024
4606f5a
fix: wrong charset in content-type headers
netroms Sep 26, 2024
3f7cdb6
Merge branch 'master' of github.com:dhis2/dhis2-core into viet-spring-6
netroms Sep 26, 2024
88a8a87
fix: remove merge artifacts
netroms Sep 26, 2024
4005df1
fix: merge artifacts
netroms Sep 26, 2024
2999325
Merge branch 'master' of github.com:dhis2/dhis2-core into viet-spring-6
netroms Sep 26, 2024
710be95
fix: fake message sender refactorings
netroms Sep 26, 2024
28ddc8c
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Sep 26, 2024
2c00821
code format
vietnguyen Sep 26, 2024
fb2466c
fix sonarcloud issue
vietnguyen Sep 26, 2024
46d8446
fix sonarcloud issue
vietnguyen Sep 26, 2024
b08423f
Merge branch 'master' of github.com:dhis2/dhis2-core into viet-spring-6
netroms Sep 28, 2024
4cee535
Merge branch 'master' of github.com:dhis2/dhis2-core into viet-spring-6
netroms Sep 28, 2024
a007887
chore: adjust sms related
netroms Sep 29, 2024
538b096
fix: adjust sms test
netroms Sep 29, 2024
f6a9c62
Merge branch 'master' into viet-spring-6
vietnguyen Sep 29, 2024
89ece4f
Merge branch 'master' of github.com:dhis2/dhis2-core into viet-spring-6
netroms Oct 1, 2024
8206f41
fix: adjust sms test
netroms Oct 1, 2024
1e0b0f0
add jobSchedulerService.createThenExecute method
vietnguyen Oct 1, 2024
5b7feb8
code format
vietnguyen Oct 1, 2024
5ae71b2
remove entityManager.getReference in HibernateIdentifiableObjectStore
vietnguyen Oct 1, 2024
8f83b18
fix sonar issues
vietnguyen Oct 1, 2024
9aae708
Merge remote-tracking branch 'origin/master' into viet-spring-6
vietnguyen Oct 1, 2024
9ea41a9
fix merge conflicts
vietnguyen Oct 1, 2024
48b95a0
code format
vietnguyen Oct 1, 2024
ffd5229
fix DhisCorsFilter
vietnguyen Oct 1, 2024
0006a14
remove interface FakeMessageSender
vietnguyen Oct 1, 2024
d8d95ae
fix DhisCorsProcessor
vietnguyen Oct 1, 2024
78767b6
revert build.sh
vietnguyen Oct 1, 2024
db26043
Merge branch 'master' into viet-spring-6
jbee Oct 2, 2024
046c728
temp amend jenkins dev file for pipeline test
david-mackessy Oct 2, 2024
f6573ef
update docker build image to use tomcat 10 to test pipeline
david-mackessy Oct 2, 2024
07e3edf
Merge branch 'master' into viet-spring-6
david-mackessy Oct 2, 2024
c7c4718
update root pom to tomcat 10 to test pipeline
david-mackessy Oct 2, 2024
c2dae53
update jenkins dev to tomcat 10 to test pipeline
david-mackessy Oct 2, 2024
0e32bd9
uncomment code in jenkins dev file after testing
david-mackessy Oct 2, 2024
cc6ca79
merge master
david-mackessy Oct 3, 2024
675a262
format
david-mackessy Oct 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Empty file modified dhis-2/build.sh
100755 → 100644
Empty file.
18 changes: 9 additions & 9 deletions dhis-2/dhis-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
Expand Down Expand Up @@ -117,18 +121,14 @@
<groupId>org.geotools</groupId>
<artifactId>gt-geojson</artifactId>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<artifactId>hibernate-core-jakarta</artifactId>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
Expand All @@ -139,8 +139,8 @@
<artifactId>gt-opengis</artifactId>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>

<!-- SMPP -->
Expand Down Expand Up @@ -186,8 +186,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@
* @author Lars Helge Overland
*/
public class ObjectDeletionRequestedEvent extends ApplicationEvent {

/** Should rollback the transaction if DeleteNotAllowedException is thrown */
private boolean shouldRollBack = true;
private boolean rollback = true;

// -------------------------------------------------------------------------
// Constructors
Expand All @@ -44,15 +45,16 @@ public ObjectDeletionRequestedEvent(Object source) {
super(source);
}

public ObjectDeletionRequestedEvent(Object source, boolean rollback) {
super(source);
this.rollback = rollback;
}

// -------------------------------------------------------------------------
// Getter && Setter
// -------------------------------------------------------------------------

public boolean isShouldRollBack() {
return shouldRollBack;
}

public void setShouldRollBack(boolean shouldRollBack) {
this.shouldRollBack = shouldRollBack;
public boolean isRollback() {
return rollback;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import com.google.common.base.MoreObjects;
import com.google.common.base.Objects;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import jakarta.persistence.UniqueConstraint;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;
import org.apache.commons.lang3.StringUtils;
import org.hisp.dhis.common.DxfNamespaces;
import org.hisp.dhis.common.IdentifiableObject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
package org.hisp.dhis.fileresource;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.xml.bind.annotation.XmlRootElement;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
import javax.xml.bind.annotation.XmlRootElement;

/** This is simple class to represent the list of possible static image resources. */
@XmlRootElement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

import java.util.Objects;
import org.hibernate.Hibernate;
import org.hibernate.proxy.HibernateProxy;
import org.hibernate.proxy.HibernateProxyHelper;

/**
Expand All @@ -55,15 +54,4 @@ public static Class getRealClass(Object object) {
public static <T> T unproxy(T proxy) {
return (T) Hibernate.unproxy(proxy);
}

public static <T> void initializeAndUnproxy(T entity) {
if (entity == null) {
return;
}

Hibernate.initialize(entity);
if (entity instanceof HibernateProxy) {
((HibernateProxy) entity).getHibernateLazyInitializer().getImplementation();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@
*/
package org.hisp.dhis.message;

import java.util.List;
import java.util.Set;
import java.util.concurrent.Future;
import org.hisp.dhis.outboundmessage.OutboundMessage;
import org.hisp.dhis.outboundmessage.OutboundMessageBatch;
import org.hisp.dhis.outboundmessage.OutboundMessageResponse;
import org.hisp.dhis.outboundmessage.OutboundMessageResponseSummary;
Expand All @@ -39,6 +41,7 @@
* @author Lars Helge Overland
*/
public interface MessageSender {

/**
* Sends a message. The given message will be sent to the given set of users.
*
Expand Down Expand Up @@ -71,4 +74,14 @@ ListenableFuture<OutboundMessageResponseSummary> sendMessageBatchAsync(

/** To check if given service is configured and ready to use. */
boolean isConfigured();

default List<OutboundMessage> getMessagesByEmail(String recipient) {
return List.of();
}

default void clearMessages() {}

default List<OutboundMessage> getAllMessages() {
return List.of();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wondering what these new default methods are for? are they used anywhere?
should a MessageSender just send messages, or get messages as well? :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i've seen it used in the FakeMessageSender while looking through the rest of the PR. This seems like a code smell if it's only used for tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently a workaround for fixing the issue of overriding a bean in test environment. As @Qualifer doesn't work for that purpose. I can give an explanation in next week meeting.
Basically in test we have FakeMessageSender SmsMessageSender and EmailMessageSender.
We want the FakeMessageSender to override both SmsMessageSender and EmailMessageSender.
But FakeMessageSender has specific methods getAllMessages(), which then can't be casted back to the others messageSenders.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Spring 5 you can override a bean by declaring same bean name.
But in spring 6, it doesn't work anymore. Need to implement same interface.

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Map;
import javax.annotation.Nonnull;
import org.hisp.dhis.feedback.ConflictException;
import org.hisp.dhis.feedback.NotFoundException;
import org.hisp.dhis.schema.Property;
import org.hisp.dhis.user.UserDetails;
import org.springframework.util.MimeType;
Expand Down Expand Up @@ -61,6 +62,13 @@ String create(JobConfiguration config, MimeType contentType, InputStream content

void createDefaultJob(JobType type, UserDetails actingUser);

String createInTransaction(
JobConfiguration jobConfiguration, MimeType contentType, InputStream content)
throws ConflictException, NotFoundException;

String createInTransaction(JobConfiguration jobConfiguration)
throws ConflictException, NotFoundException;

/**
* Updates all {@link JobConfiguration}s that are not {@link JobConfiguration#isEnabled()} to
* state {@link JobStatus#DISABLED} in case they are in state {@link JobStatus#SCHEDULED}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ public interface JobConfigurationStore extends GenericDimensionalObjectStore<Job
*/
boolean tryRevertNow(@Nonnull String jobId);

boolean executeNow(@Nonnull String jobId);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not exist as there is already a method with that exact task (we look at that later)


/**
* A successful update means the DB state flipped from {@link JobStatus#SCHEDULED} to {@link
* JobStatus#RUNNING}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,18 @@
*/
package org.hisp.dhis.scheduling;

import java.io.InputStream;
import java.util.List;
import java.util.Set;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import org.hisp.dhis.common.NonTransactional;
import org.hisp.dhis.common.UID;
import org.hisp.dhis.feedback.ConflictException;
import org.hisp.dhis.feedback.ForbiddenException;
import org.hisp.dhis.feedback.NotFoundException;
import org.hisp.dhis.scheduling.JobProgress.Progress;
import org.springframework.util.MimeType;

/**
* This is the external API (called by users via controller API) for the scheduling.
Expand All @@ -60,6 +63,22 @@ public interface JobSchedulerService {
*/
void executeNow(@Nonnull String jobId) throws ConflictException, NotFoundException;

/**
* Executes a job configuration in a separate transaction.
*
* @param jobId the job id to execute
* @throws NotFoundException
* @throws ConflictException
*/
void runInTransaction(String jobId) throws NotFoundException, ConflictException;

@NonTransactional
void createThenExecute(JobConfiguration config, MimeType contentType, InputStream content)
throws ConflictException, NotFoundException;

@NonTransactional
void createThenExecute(JobConfiguration config) throws ConflictException, NotFoundException;

/**
* Reverts the {@link JobStatus} of the job from {@link JobStatus#RUNNING} to the appropriate
* status after a failed execution. For an ad-hoc job this is {@link JobStatus#DISABLED}, for a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
package org.hisp.dhis.security;

import javax.xml.bind.DatatypeConverter;
import jakarta.xml.bind.DatatypeConverter;
import org.apache.commons.lang3.SerializationUtils;
import org.springframework.security.core.Authentication;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
package org.hisp.dhis.sms.config;

import com.fasterxml.jackson.annotation.JsonProperty;
import jakarta.xml.bind.annotation.XmlRootElement;
import java.io.Serial;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlRootElement;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
*/
package org.hisp.dhis.user;

import jakarta.servlet.http.HttpServletRequest;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import org.hisp.dhis.common.auth.RegistrationParams;
import org.hisp.dhis.common.auth.UserInviteParams;
import org.hisp.dhis.common.auth.UserRegistrationParams;
Expand Down
4 changes: 2 additions & 2 deletions dhis-2/dhis-services/dhis-service-administration/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.persistence</groupId>
<artifactId>javax.persistence-api</artifactId>
<groupId>jakarta.persistence</groupId>
<artifactId>jakarta.persistence-api</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@

import static java.util.stream.Collectors.toUnmodifiableList;

import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import java.util.Date;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import lombok.RequiredArgsConstructor;
import org.hisp.dhis.dataintegrity.DataIntegrityCheck;
import org.hisp.dhis.dataintegrity.DataIntegrityDetails;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
package org.hisp.dhis.merge.dataelement;

import com.google.common.collect.ImmutableList;
import jakarta.persistence.EntityManager;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.annotation.Nonnull;
import javax.annotation.PostConstruct;
import javax.persistence.EntityManager;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hisp.dhis.common.UID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
package org.hisp.dhis.merge.dataelement.handler;

import jakarta.persistence.EntityManager;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
Expand All @@ -35,7 +36,6 @@
import java.util.function.BiPredicate;
import java.util.stream.Collectors;
import javax.annotation.Nonnull;
import javax.persistence.EntityManager;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.hisp.dhis.dataelement.DataElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import static org.hisp.dhis.common.IdentifiableObjectUtils.getIdentifiers;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;
import lombok.RequiredArgsConstructor;
import org.hisp.dhis.common.IdentifiableObjectUtils;
import org.hisp.dhis.dataapproval.DataApprovalAuditService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
package org.hisp.dhis.merge.orgunit.handler;

import javax.persistence.EntityManager;
import jakarta.persistence.EntityManager;
import lombok.RequiredArgsConstructor;
import org.hisp.dhis.common.IdentifiableObjectUtils;
import org.hisp.dhis.merge.orgunit.OrgUnitMergeRequest;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,14 @@
import org.hisp.dhis.sms.outbound.OutboundSms;
import org.hisp.dhis.sms.outbound.OutboundSmsService;
import org.hisp.dhis.sms.outbound.OutboundSmsStatus;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@RequiredArgsConstructor
@Component("sendScheduledMessageJob")
public class SendScheduledMessageJob implements Job {
private final OutboundSmsService outboundSmsService;

@Qualifier("smsMessageSender")
private final MessageSender smsSender;
private final MessageSender smsMessageSender;

// -------------------------------------------------------------------------
// Implementation
Expand All @@ -65,7 +63,7 @@ public JobType getJobType() {
public void execute(JobConfiguration config, JobProgress progress) {
progress.startingProcess("Starting to send outbound messages");
progress.startingStage("Validating environment setup");
if (!smsSender.isConfigured()) {
if (!smsMessageSender.isConfigured()) {
progress.failedStage("SMS gateway configuration does not exist, job aborted");
return;
}
Expand Down Expand Up @@ -94,7 +92,8 @@ private void sendMessages(JobProgress progress) {
outboundSms -> {
outboundSms.setDate(new Date());
outboundSms.setStatus(OutboundSmsStatus.SENT);
smsSender.sendMessage(null, outboundSms.getMessage(), outboundSms.getRecipients());
smsMessageSender.sendMessage(
null, outboundSms.getMessage(), outboundSms.getRecipients());
});
}
}
Expand Down
Loading
Loading