Skip to content
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

feat(extension): Add flattenEvent parsing to RestEventParser and convert Groovy to Java in echo-rest #708

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions echo-api/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# echo-api

A module for defining plugin extension interfaces.

WARNING: This is an Alpha module and is not stable. Consider this an experiment.

Currently there is one extension point `RestEventParser` which is limited to parsing events
in echo's `RestEventListener`. This is primarily for early iteration and testing purposes.

The more powerful extension point for Echo is likely to be `EchoEventListener` - this would enable a plugin
ecosystem for Echo and also allow us to break existing implementations of `EchoEventListener`
(echo-rest, echo-notifications, echo-telemetry, etc) up into discrete plugins.
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,20 @@
public interface RestEventParser extends ExtensionPoint {

/**
* Parse an Event prior to POST to the configured URL
* Parse an event prior to POST to the configured URL
*
* @param event {@link Event}
* @return Map, which conforms to the RestEventListener API
*/
Map parse(Event event);
Map<String, Object> parseEvent(Event event);

/**
* Flatten an event prior to POST to configured URL
*
* @param event
* @return FlatEvent, which conforms to the RestEventListener API for flattened events
*/
FlatEvent flattenEvent(Event event);

@Data
class Event {
Expand All @@ -58,4 +66,12 @@ class Metadata {
private Map<String, List> requestHeaders;
private Map<String, String> attributes;
}

@Data
@AllArgsConstructor
@NoArgsConstructor
class FlatEvent {
private String details;
private String content;
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Loading