-
Notifications
You must be signed in to change notification settings - Fork 251
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(Event Framework): add intermediate superclass for Asset Events #1815
feat(Event Framework): add intermediate superclass for Asset Events #1815
Conversation
spi/core-spi/src/main/java/org/eclipse/dataspaceconnector/spi/event/asset/AssetCreated.java
Fixed
Show fixed
Hide fixed
spi/core-spi/src/main/java/org/eclipse/dataspaceconnector/spi/event/asset/AssetDeleted.java
Fixed
Show fixed
Hide fixed
Codecov Report
@@ Coverage Diff @@
## main #1815 +/- ##
============================================
- Coverage 62.54% 62.53% -0.01%
- Complexity 0 3182 +3182
============================================
Files 781 782 +1
Lines 16592 16592
Branches 1079 1079
============================================
- Hits 10377 10376 -1
- Misses 5767 5768 +1
Partials 448 448
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
|
||
import java.util.Objects; | ||
|
||
/** | ||
* Describe an Asset deletion, after this has emitted, the Asset represented by the id won't be available anymore. | ||
*/ | ||
public class AssetDeleted extends Event<AssetDeleted.Payload> { | ||
public class AssetDeleted extends AssetEvent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public class AssetDeleted extends AssetEvent { | |
public class AssetDeleted extends Event<AssetDeleted.Payload> { |
I think the AssetDeleted should be related to its own payload, currently it's the same for both the events, but this could change in any moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i change it like the way you suggest their is no superclass again.
But you are right i messed up the Relation. I want sth. like EventPayload <- AssetPayload <- AssetCreatedPayload/AssetDeleted Payload. I need to change it this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking it from another perspective seems like the hierarchy is more related to the payload than to the event class itself...
Maybe the only class we need to introduce is a AssetEventPayload
that contains the assetId
and that it could be used to filter out events.
|
||
private AssetDeleted() { | ||
} | ||
|
||
public static class Builder extends Event.Builder<AssetDeleted, Payload, Builder> { | ||
public static class Builder extends Event.Builder<AssetDeleted, AssetEvent.Payload, Builder> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, and at a this point I would move the builder logic that permits to add an assetId
on the AssetEvent
superclass
20fe780
to
8800ccb
Compare
8800ccb
to
b4f6055
Compare
The hierarchy is now binded on the Payload classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said in the last comment, the setAssetId
method shouldn't exist
...core-spi/src/main/java/org/eclipse/dataspaceconnector/spi/event/asset/AssetEventPayload.java
Outdated
Show resolved
Hide resolved
Test, who fails has no connection to Eventsystem and touched Files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a flaky test
What this PR changes/adds
Add a 'intermediate' superclass for the Event Classes
AssetCreated
andAssetDeleted
.Why it does that
Improve the work with the Event Framework and give the possibility to filter Events on a bigger group of events
Linked Issue(s)
Closes #1813
Checklist
no-changelog
)