-
Notifications
You must be signed in to change notification settings - Fork 5
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
[DSM] PEPPER-1402 PEPPER-1397 refactoring DSM event transmission into DSS and retrying failed events #2874
Merged
Merged
[DSM] PEPPER-1402 PEPPER-1397 refactoring DSM event transmission into DSS and retrying failed events #2874
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
b75f783
PEPPER-1402 WIP some refactoring and test working now
pegahtah 8f7ce29
Merge remote-tracking branch 'origin/develop' into PEPPER-1402_PEPPER…
pegahtah 864f014
Merge branch 'develop' into PEPPER-1402_PEPPER-1397_trigger_ddp
pegahtah 4e39668
PEPPER-1402 PEPPER-1397
pegahtah 962e9f6
PEPPER-1402 PEPPER-1397
pegahtah d0d09f8
PEPPER-1402 PEPPER-1397
pegahtah ef86513
PEPPER-1402 PEPPER-1397
pegahtah 5aca459
PEPPER-1402 PEPPER-1397
pegahtah b9aba34
PEPPER-1402 merged develop in and added changes
pegahtah a91eb51
PEPPER-1402 checkstyle fix
pegahtah 2011496
Merge branch 'develop' into PEPPER-1402_PEPPER-1397_trigger_ddp
pegahtah c392262
PEPPER-1402 more refactoring, changed EventUtil to EventService
pegahtah 73192f6
PEPPER-1402 PEPPER-1397 added tests for all scenarios, changed the cl…
pegahtah 5c40fa7
PEPPER-1402 PEPPER-1397 checkstyle fix
pegahtah b483a7f
Merge remote-tracking branch 'origin/develop' into PEPPER-1402_PEPPER…
pegahtah 2d31cc2
PEPPER-1402 PEPPER-1397 deleting unused classes
pegahtah 4114d03
PEPPER-1402 PEPPER-1397 deleting unused classes
pegahtah 71acc96
PEPPER-1402 PEPPER-1397 small clean ups
pegahtah a68831a
PEPPER-1402 PEPPER-1397 fixed a bug in TestHelper and moved dto and d…
pegahtah 9a33f71
PEPPER-1402 PEPPER-1397 fixed java doc comment
pegahtah 90db874
PEPPER-1402 PEPPER-1397 small letters
pegahtah f41e052
PEPPER-1402 PEPPER-1397 small letters
pegahtah 991aad6
PEPPER-1402 changes to add jitters using IntervalFunction and Retry, …
pegahtah b060d15
PEPPER-1402 Adding logging
pegahtah 0389076
PEPPER-1402 Moved DsmNotificationEventType.java and DsmNotificationPa…
pegahtah 4a64816
Merge remote-tracking branch 'origin/develop' into PEPPER-1402_PEPPER…
pegahtah 3b72df0
PEPPER-1402 based on PR comments I increased the initial wait time fo…
pegahtah 4c27130
Merge remote-tracking branch 'origin/develop' into PEPPER-1402_PEPPER…
pegahtah 5158814
PEPPER-1402 cleaned up code
pegahtah 81336d8
PEPPER-1402 cleaned up code
pegahtah 66308da
PEPPER-1402 cleaned up code
pegahtah f5834d3
PEPPER-1402 made BaseKitTestUtil an abstract class
pegahtah d8dd384
PEPPER-1402 changed BaseKitTestUtil into KitTestUtil and removed Pepp…
pegahtah c3dbf1c
Merge branch 'develop' into PEPPER-1402_PEPPER-1397_trigger_ddp
pegahtah 66ddffb
Merge remote-tracking branch 'origin/develop' into PEPPER-1402_PEPPER…
pegahtah dad9982
PEPPER-1402 resolving conflicts
pegahtah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...p/model/dsm/DsmNotificationEventType.java → ...cationevent/DsmNotificationEventType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...nstitute/ddp/model/dsm/KitReasonType.java → ...e/ddp/notficationevent/KitReasonType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,7 +154,7 @@ public DDPInstance(int ddpInstanceId, String name) { | |
public static DDPInstance getDDPInstance(@NonNull String realm) { | ||
SimpleResult results = inTransaction((conn) -> { | ||
SimpleResult dbVals = new SimpleResult(); | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_ALL_ACTIVE_REALMS + QueryExtension.BY_INSTANCE_NAME)) { | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_ALL_ACTIVE_REALMS.concat(QueryExtension.BY_INSTANCE_NAME))) { | ||
stmt.setString(1, realm); | ||
try (ResultSet rs = stmt.executeQuery()) { | ||
if (rs.next()) { | ||
|
@@ -178,7 +178,7 @@ public static DDPInstance getDDPInstance(@NonNull String realm) { | |
public static DDPInstance getDDPInstanceByGuid(@NonNull String studyGuid) { | ||
SimpleResult results = inTransaction(conn -> { | ||
SimpleResult dbVals = new SimpleResult(); | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_ALL_ACTIVE_REALMS + QueryExtension.BY_STUDY_GUID)) { | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_ALL_ACTIVE_REALMS.concat(QueryExtension.BY_STUDY_GUID))) { | ||
stmt.setString(1, studyGuid); | ||
try (ResultSet rs = stmt.executeQuery()) { | ||
if (rs.next()) { | ||
|
@@ -200,7 +200,7 @@ public static DDPInstance getDDPInstanceByGuid(@NonNull String studyGuid) { | |
public static DDPInstance getDDPInstanceById(@NonNull Integer ddpInstanceId) { | ||
SimpleResult results = inTransaction((conn) -> { | ||
SimpleResult dbVals = new SimpleResult(); | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_ALL_ACTIVE_REALMS + QueryExtension.BY_INSTANCE_ID)) { | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_ALL_ACTIVE_REALMS.concat(QueryExtension.BY_INSTANCE_ID))) { | ||
stmt.setInt(1, ddpInstanceId); | ||
try (ResultSet rs = stmt.executeQuery()) { | ||
if (rs.next()) { | ||
|
@@ -258,7 +258,7 @@ public static DDPInstance getDDPInstanceWithRole(@NonNull String realm, @NonNull | |
// and by Covid19OrderRegistrar | ||
public static DDPInstance getDDPInstanceWithRole(@NonNull String realm, @NonNull String role, Connection conn) { | ||
SimpleResult dbVals = new SimpleResult(); | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_INSTANCE_WITH_ROLE + QueryExtension.BY_INSTANCE_NAME)) { | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_INSTANCE_WITH_ROLE.concat(QueryExtension.BY_INSTANCE_NAME))) { | ||
stmt.setString(1, role); | ||
stmt.setString(2, realm); | ||
try (ResultSet rs = stmt.executeQuery()) { | ||
|
@@ -276,7 +276,7 @@ public static DDPInstance getDDPInstanceWithRole(@NonNull String realm, @NonNull | |
public static DDPInstance getDDPInstanceWithRoleByStudyGuid(@NonNull String studyGuid, @NonNull String role) { | ||
SimpleResult results = inTransaction((conn) -> { | ||
SimpleResult dbVals = new SimpleResult(); | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_INSTANCE_WITH_ROLE + QueryExtension.BY_STUDY_GUID)) { | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_INSTANCE_WITH_ROLE.concat(QueryExtension.BY_STUDY_GUID))) { | ||
stmt.setString(1, role); | ||
stmt.setString(2, studyGuid); | ||
try (ResultSet rs = stmt.executeQuery()) { | ||
|
@@ -404,31 +404,6 @@ public static DDPInstance getDDPInstanceWithRoleByParticipant(@NonNull String pa | |
return (DDPInstance) results.resultValue; | ||
} | ||
|
||
public static boolean getRole(@NonNull String realm, @NonNull String role) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was not used |
||
SimpleResult results = inTransaction((conn) -> { | ||
SimpleResult dbVals = new SimpleResult(); | ||
try (PreparedStatement stmt = conn.prepareStatement(SQL_SELECT_INSTANCE_WITH_ROLE + QueryExtension.BY_INSTANCE_NAME)) { | ||
stmt.setString(1, role); | ||
stmt.setString(2, realm); | ||
try (ResultSet rs = stmt.executeQuery()) { | ||
if (rs.next()) { | ||
dbVals.resultValue = rs.getBoolean(DBConstants.HAS_ROLE); | ||
} | ||
} catch (SQLException e) { | ||
throw new RuntimeException("Error getting role of realm " + realm, e); | ||
} | ||
} catch (SQLException ex) { | ||
dbVals.resultException = ex; | ||
} | ||
return dbVals; | ||
}); | ||
|
||
if (results.resultException != null) { | ||
throw new RuntimeException("Couldn't get role of realm " + realm, results.resultException); | ||
} | ||
return (boolean) results.resultValue; | ||
} | ||
|
||
public static DDPInstance getDDPInstanceWithRoleFormResultSet(@NonNull ResultSet rs) throws SQLException { | ||
String notificationRecipient = rs.getString(DBConstants.NOTIFICATION_RECIPIENT); | ||
List<String> recipients = null; | ||
|
@@ -536,8 +511,9 @@ public static DDPInstance from(DDPInstanceDto ddpInstanceDto) { | |
.withCollaboratorIdPrefix(ddpInstanceDto.getCollaboratorIdPrefix()) | ||
.withDaysMrAttentionNeeded(ddpInstanceDto.getMrAttentionFlagD()) | ||
.withDaysTissueAttentionNeeded(ddpInstanceDto.getTissueAttentionFlagD()) | ||
.withHasAuth0Token(ddpInstanceDto.getAuth0Token() != null) | ||
.withNotificationRecipient(ddpInstanceDto.getNotificationRecipients()) | ||
.withHasAuth0Token(ddpInstanceDto.getAuth0Token() != null && ddpInstanceDto.getAuth0Token()) | ||
.withNotificationRecipient(ddpInstanceDto.getNotificationRecipients().isEmpty() | ||
? null : ddpInstanceDto.getNotificationRecipients()) | ||
.withBillingReference(ddpInstanceDto.getBillingReference()) | ||
.withParticipantIndexES(ddpInstanceDto.getEsParticipantIndex()) | ||
.withActivityDefinitionIndexES(ddpInstanceDto.getEsActivityDefinitionIndex()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
concat
changes are a fix for sonar marking these as "blocker" issues