-
-
Notifications
You must be signed in to change notification settings - Fork 998
SAK-51956 notifications Add broadcast type notification #14312
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
Draft
adrianfish
wants to merge
13
commits into
sakaiproject:master
Choose a base branch
from
adrianfish:SAK-51956
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+646
−328
Draft
Changes from 6 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
5cd321d
SAK-51956 motifications Add broadcast type notification
adrianfish a1f835a
Move the event matching into a reusable Predicate.
adrianfish c561570
Removed typo quote and unused import
adrianfish dd84943
Paged getUsers call
adrianfish 7ce88e1
Removed redundant setters
adrianfish 545cb65
Fixed predicate for announcment event cleanups
adrianfish 07b5d1d
Added scheduleAtFixedRate to SchedulingService
adrianfish 18a1c20
Added null check for site member
adrianfish f42c1ce
Upped pageSize for user messaging to 100
adrianfish 9034cdd
Use List.forEach
adrianfish 91252e6
pagination fix
adrianfish 5f4e264
Added log for 429 rate limit error
adrianfish f3a880b
Removed TransactionTemplate wrapper
adrianfish 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
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
245 changes: 132 additions & 113 deletions
245
.../api/src/java/org/sakaiproject/announcement/api/AnnouncementsUserNotificationHandler.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
60 changes: 60 additions & 0 deletions
60
kernel/api/src/main/java/org/sakaiproject/messaging/api/UserNotificationTransferBean.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| /** | ||
| * Copyright (c) 2003-2019 The Apereo Foundation | ||
| * | ||
| * Licensed under the Educational Community License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://opensource.org/licenses/ecl2 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.sakaiproject.messaging.api; | ||
|
|
||
| import org.sakaiproject.messaging.api.model.UserNotification; | ||
|
|
||
| import java.time.Instant; | ||
|
|
||
| import lombok.AllArgsConstructor; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.Data; | ||
|
|
||
| public class UserNotificationTransferBean { | ||
|
|
||
| public String from; | ||
| public String to; | ||
| public String event; | ||
| public String ref; | ||
| public String title; | ||
| public String siteId; | ||
| public String url; | ||
| public Instant eventDate; | ||
| public boolean viewed; | ||
| public String tool; | ||
| public boolean broadcast; | ||
|
|
||
| public String fromDisplayName; | ||
| public String siteTitle; | ||
| public String formattedEventDate; | ||
|
|
||
| public static UserNotificationTransferBean of(UserNotification un) { | ||
|
|
||
| UserNotificationTransferBean bean = new UserNotificationTransferBean(); | ||
| bean.from = un.getFromUser(); | ||
| bean.to = un.getToUser(); | ||
| bean.event = un.getEvent(); | ||
| bean.ref = un.getRef(); | ||
| bean.title = un.getTitle(); | ||
| bean.siteId = un.getSiteId(); | ||
| bean.url = un.getUrl(); | ||
| bean.eventDate = un.getEventDate(); | ||
| bean.viewed = un.getViewed(); | ||
| bean.tool = un.getTool(); | ||
| bean.broadcast = un.getBroadcast(); | ||
| return bean; | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
51 changes: 51 additions & 0 deletions
51
kernel/api/src/main/java/org/sakaiproject/scheduling/api/SchedulingService.java
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| /** | ||
| * Copyright (c) 2003-2017 The Apereo Foundation | ||
| * | ||
| * Licensed under the Educational Community License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://opensource.org/licenses/ecl2 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
| package org.sakaiproject.scheduling.api; | ||
|
|
||
| import java.util.concurrent.ScheduledFuture; | ||
| import java.util.concurrent.TimeUnit; | ||
|
|
||
| /** | ||
| * A facade for Java's ScheduledExecutorService. The number of threads in the pool can be configured | ||
| * using the property <code>schedulingservice.poolsize</code> | ||
| */ | ||
| public interface SchedulingService { | ||
|
|
||
| /** | ||
| * Schedule the Runnable to be executed after delay units, that is delay number of time units. | ||
| * | ||
| * @param command The command to run | ||
| * @param delay The time, in units, to wait until execution of command | ||
| * @param unit The type of time unit to use. | ||
| */ | ||
| ScheduledFuture<?> schedule(Runnable command, long delay, TimeUnit unit); | ||
|
|
||
| /** | ||
| * Schedule the Runnable to be executed after initialDelay units and then every delay units | ||
| * thereafter. | ||
| * | ||
| * @param command The command to run | ||
| * @param initialDelay The time, in units, to wait until execution of command | ||
| * @param delay The time, in units, to wait between each further execution of command | ||
| * @param unit The type of time unit to use. | ||
| */ | ||
| ScheduledFuture<?> scheduleWithFixedDelay(Runnable command, | ||
| long initialDelay, | ||
| long delay, | ||
| TimeUnit unit); | ||
| } | ||
adrianfish marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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.
Uh oh!
There was an error while loading. Please reload this page.