Skip to content
This repository has been archived by the owner on Jun 2, 2019. It is now read-only.

Commit

Permalink
Remove class from event
Browse files Browse the repository at this point in the history
  • Loading branch information
dethi committed Dec 9, 2017
1 parent 98a6dbf commit e8563f6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/main/java/com/epita/guereza/EventStoreApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ private void extractThen(final EventBusClient.Message msg, final Consumer<Object
@Override
public void run() {
eventBus.subscribe("/request/crawler/url", msg -> extractThen(msg, o -> {
Event<String> ev = new Event<>("CRAWLER_REQUEST_URL", String.class, (String) o);
Event<String> ev = new Event<>("CRAWLER_REQUEST_URL", (String) o);
eventStore.dispatch(ev);
}));
eventBus.subscribe("/request/indexer/url", msg -> extractThen(msg, o -> {
Event<String> ev = new Event<>("INDEXER_REQUEST_URL", String.class, (String) o);
Event<String> ev = new Event<>("INDEXER_REQUEST_URL", (String) o);
eventStore.dispatch(ev);
}));
eventBus.subscribe("/store/crawler", msg -> extractThen(msg, o -> {
Event<String[]> ev = new Event<>("ADD_URLS", String[].class, (String[]) o);
Event<String[]> ev = new Event<>("ADD_URLS", (String[]) o);
eventStore.dispatch(ev);
}));
eventBus.subscribe("/store/indexer", msg -> extractThen(msg, o -> {
Event<Document> ev = new Event<>("ADD_DOCUMENT", Document.class, (Document) o);
Event<Document> ev = new Event<>("ADD_DOCUMENT", (Document) o);
eventStore.dispatch(ev);
}));
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/com/epita/guereza/eventsourcing/Event.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,10 @@
@SuppressWarnings("WeakerAccess")
public class Event<BEAN_TYPE> {
public final String type;
public final Class<BEAN_TYPE> klass;
public final BEAN_TYPE obj;

public Event(final String type, final Class<BEAN_TYPE> klass, final BEAN_TYPE obj) {
public Event(final String type, final BEAN_TYPE obj) {
this.type = type;
this.klass = klass;
this.obj = obj;
}
}

0 comments on commit e8563f6

Please sign in to comment.