aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/service')
-rw-r--r--juick-server/src/main/java/com/juick/service/activities/ActivityListener.java10
-rw-r--r--juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java27
2 files changed, 37 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/activities/ActivityListener.java b/juick-server/src/main/java/com/juick/service/activities/ActivityListener.java
new file mode 100644
index 00000000..f89b401d
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/service/activities/ActivityListener.java
@@ -0,0 +1,10 @@
+package com.juick.service.activities;
+
+import org.springframework.context.event.EventListener;
+
+public interface ActivityListener {
+ @EventListener
+ void processFollowEvent(FollowEvent event);
+ @EventListener
+ void undoFollowEvent(UndoFollowEvent event);
+}
diff --git a/juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java b/juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java
new file mode 100644
index 00000000..fa162b2e
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/service/activities/UndoFollowEvent.java
@@ -0,0 +1,27 @@
+package com.juick.service.activities;
+
+import com.juick.server.api.activity.model.activities.Follow;
+import org.springframework.context.ApplicationEvent;
+
+public class UndoFollowEvent extends ApplicationEvent {
+ private String actor;
+ private Follow followRequest;
+ /**
+ * Create a new ApplicationEvent.
+ *
+ * @param source the object on which the event initially occurred (never {@code null})
+ */
+ public UndoFollowEvent(Object source, String actor, Follow object) {
+ super(source);
+ this.actor = actor;
+ this.followRequest = object;
+ }
+
+ public String getActor() {
+ return actor;
+ }
+
+ public Follow getFollowRequest() {
+ return followRequest;
+ }
+}