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

io.quarkiverse.reactive.messaging.nats.jetstream.client.configuration.DefaultStreamConfiguration Maven / Gradle / Ivy

There is a newer version: 3.17.0
Show newest version
package io.quarkiverse.reactive.messaging.nats.jetstream.client.configuration;

import java.time.Duration;
import java.util.Optional;
import java.util.Set;

import io.nats.client.api.CompressionOption;
import io.nats.client.api.DiscardPolicy;
import io.nats.client.api.RetentionPolicy;
import io.nats.client.api.StorageType;
import lombok.AllArgsConstructor;
import lombok.Builder;

@Builder
@AllArgsConstructor
public class DefaultStreamConfiguration implements StreamConfiguration {
    private final String name;
    private final String description;
    private final Set subjects;
    private final Integer replicas;
    private final StorageType storageType;
    private final RetentionPolicy retentionPolicy;
    private final CompressionOption compressionOption;
    private final Long maximumConsumers;
    private final Long maximumMessages;
    private final Long maximumMessagesPerSubject;
    private final Long maximumBytes;
    private final Duration maximumAge;
    private final Integer maximumMessageSize;
    private final String templateOwner;
    private final DiscardPolicy discardPolicy;
    private final Duration duplicateWindow;
    private final Boolean sealed;
    private final Boolean allowRollup;
    private final Boolean allowDirect;
    private final Boolean mirrorDirect;
    private final Boolean denyDelete;
    private final Boolean denyPurge;
    private final Boolean discardNewPerSubject;
    private final Long firstSequence;

    @Override
    public String name() {
        return name;
    }

    @Override
    public Optional description() {
        return Optional.ofNullable(description);
    }

    @Override
    public Set subjects() {
        return subjects;
    }

    @Override
    public Integer replicas() {
        return replicas;
    }

    @Override
    public StorageType storageType() {
        return storageType;
    }

    @Override
    public RetentionPolicy retentionPolicy() {
        return retentionPolicy;
    }

    @Override
    public CompressionOption compressionOption() {
        return compressionOption;
    }

    @Override
    public Optional maximumConsumers() {
        return Optional.ofNullable(maximumConsumers);
    }

    @Override
    public Optional maximumMessages() {
        return Optional.ofNullable(maximumMessages);
    }

    @Override
    public Optional maximumMessagesPerSubject() {
        return Optional.ofNullable(maximumMessagesPerSubject);
    }

    @Override
    public Optional maximumBytes() {
        return Optional.ofNullable(maximumBytes);
    }

    @Override
    public Optional maximumAge() {
        return Optional.ofNullable(maximumAge);
    }

    @Override
    public Optional maximumMessageSize() {
        return Optional.ofNullable(maximumMessageSize);
    }

    @Override
    public Optional templateOwner() {
        return Optional.ofNullable(templateOwner);
    }

    @Override
    public Optional discardPolicy() {
        return Optional.ofNullable(discardPolicy);
    }

    @Override
    public Optional duplicateWindow() {
        return Optional.ofNullable(duplicateWindow);
    }

    @Override
    public Optional allowRollup() {
        return Optional.ofNullable(allowRollup);
    }

    @Override
    public Optional allowDirect() {
        return Optional.ofNullable(allowDirect);
    }

    @Override
    public Optional mirrorDirect() {
        return Optional.ofNullable(mirrorDirect);
    }

    @Override
    public Optional denyDelete() {
        return Optional.ofNullable(denyDelete);
    }

    @Override
    public Optional denyPurge() {
        return Optional.ofNullable(denyPurge);
    }

    @Override
    public Optional discardNewPerSubject() {
        return Optional.ofNullable(discardNewPerSubject);
    }

    @Override
    public Optional firstSequence() {
        return Optional.ofNullable(firstSequence);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy