--- /dev/null
+package de.juplo.kafka.outbox.polling;
+
+import org.springframework.context.ApplicationEvent;
+
+
+public class UserEvent extends ApplicationEvent
+{
+ public enum Type
+ {
+ CREATED(1),
+ LOGIN(2),
+ LOGOUT(3),
+ DELETED(4);
+
+ public final int num;
+
+
+ Type(int num)
+ {
+ this.num = num;
+ }
+
+
+ public static Type ofInt(int ordinal)
+ {
+ switch (ordinal)
+ {
+ case 1: return CREATED;
+ case 2: return LOGIN;
+ case 3: return LOGOUT;
+ case 4: return DELETED;
+ default:
+ throw new RuntimeException("Unknown ordinal: " + ordinal);
+ }
+ }
+
+ public static int toInt(Type type)
+ {
+ return type.toInt();
+ }
+
+ public int toInt()
+ {
+ return this.num;
+ }
+ }
+
+
+ final Type type;
+ final String user;
+
+
+ public UserEvent(Object source, Type type, String user)
+ {
+ super(source);
+ this.type = type;
+ this.user = user;
+ }
+}