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

org.zalando.spring.boot.nakadi.config.PublisherConfig Maven / Gradle / Ivy

There is a newer version: 0.0.18
Show newest version
package org.zalando.spring.boot.nakadi.config;

import java.util.Optional;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = false)
public class PublisherConfig extends AbstractConfig {

    public PublisherConfig() {
        setId("default");
    }

    void mergeWithDefaultConfig(DefaultConsumerConfig defaultConsumerConfig) {
        this.setNakadiUrl(Optional.ofNullable(this.getNakadiUrl()).orElse(defaultConsumerConfig.getNakadiUrl()));
        this.setApplicationName(Optional.ofNullable(this.getApplicationName()).orElse(defaultConsumerConfig.getApplicationName()));

        // oauth
        if(defaultConsumerConfig.getOauth().getEnabled() && !this.getOauth().getEnabled()) {
            this.oauth.setEnabled(defaultConsumerConfig.getOauth().getEnabled());
            this.oauth.setAccessTokenIdIfNotConfigured(defaultConsumerConfig.getOauth().getAccessTokenId());
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy