All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.synapse.subscription.events.SubscriptionCreated Maven / Gradle / Ivy

Go to download

A library used at otto.de to implement Spring Boot based event-sourcing microservices.

The newest version!
package de.otto.synapse.subscription.events;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;

public class SubscriptionCreated extends SubscriptionEvent {
    private final String subscribedChannel;
    private final String responseChannel;

    @JsonCreator
    public SubscriptionCreated(final @JsonProperty("id") String id,
                               final @JsonProperty("subscribedChannel") String subscribedChannel,
                               final @JsonProperty("responseChannel") String responseChannel) {
        super(id, Type.CREATED);
        this.subscribedChannel = subscribedChannel;
        this.responseChannel = responseChannel;
    }

    @Override
    public SubscriptionCreated asSubscriptionCreated() {
        return this;
    }

    @Override
    public SubscriptionUpdated asSubscriptionUpdated() {
        throw new ClassCastException("not a SubscriptionUpdated event");
    }

    public String getSubscribedChannel() {
        return subscribedChannel;
    }

    public String getResponseChannel() {
        return responseChannel;
    }

    @Override
    public String toString() {
        return "SubscriptionCreated{" +
                "subscribedChannel='" + subscribedChannel + '\'' +
                ", responseChannel='" + responseChannel + '\'' +
                '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy