View Javadoc
1   package de.dlr.shepard.common.subscription.io;
2   
3   import de.dlr.shepard.common.neo4j.io.HasIdIO;
4   import de.dlr.shepard.common.util.RequestMethod;
5   import lombok.Data;
6   import org.eclipse.microprofile.openapi.annotations.media.Schema;
7   
8   @Data
9   @Schema(name = "Event")
10  public class EventIO {
11  
12    private SubscriptionIO subscription;
13  
14    @Schema(nullable = true)
15    private HasIdIO subscribedObject;
16  
17    private String url;
18  
19    private RequestMethod requestMethod;
20  
21    public EventIO(String url, RequestMethod requestMethod) {
22      this.url = url;
23      this.requestMethod = requestMethod;
24    }
25  
26    /**
27     * Copy constructor
28     *
29     * @param event The event to be copied
30     */
31    public EventIO(EventIO event) {
32      this.subscription = event.getSubscription();
33      this.url = event.getUrl();
34      this.requestMethod = event.getRequestMethod();
35      this.subscribedObject = event.getSubscribedObject();
36    }
37  
38    /**
39     * For testing purposes only
40     *
41     * @param url the url that triggered the event
42     */
43    public EventIO(String url) {
44      this.url = url;
45    }
46  }