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

com.turbospaces.dispatch.NotifyQueuePostSpec Maven / Gradle / Ivy

There is a newer version: 2.0.33
Show newest version
package com.turbospaces.dispatch;

import java.io.IOException;
import java.io.OutputStream;
import java.net.URI;
import java.time.Duration;
import java.time.OffsetDateTime;
import java.util.Optional;
import java.util.Set;
import java.util.UUID;

import com.google.protobuf.Any;
import com.google.protobuf.ByteString;
import com.turbospaces.api.Topic;
import com.turbospaces.api.facade.NotificationWrapperFacade;

import io.cloudevents.CloudEventData;
import io.cloudevents.SpecVersion;
import io.netty.util.AsciiString;
import lombok.AccessLevel;
import lombok.RequiredArgsConstructor;

public interface NotifyQueuePostSpec extends QueuePostSpec, NotificationWrapperFacade {
    static NotificationBuilder newBuilder(NotificationWrapperFacade facade) {
        return new NotificationBuilder(facade);
    }

    @RequiredArgsConstructor(access = AccessLevel.PRIVATE)
    public static class NotificationBuilder extends Builder {
        private final NotificationWrapperFacade facade;

        @Override
        public NotifyQueuePostSpec build() {
            QueuePostSpec post = super.build();
            return new NotifyQueuePostSpec() {
                @Override
                public Topic topic() {
                    return post.topic();
                }
                @Override
                public Optional timeout() {
                    return post.timeout();
                }
                @Override
                public Optional routingKey() {
                    return post.routingKey();
                }
                @Override
                public Optional replyTo() {
                    return post.replyTo();
                }
                @Override
                public UUID messageId() {
                    return post.messageId();
                }
                @Override
                public ByteString toByteString() {
                    return facade.toByteString();
                }
                @Override
                public Any body() {
                    return facade.body();
                }
                @Override
                public void writeTo(OutputStream output) throws IOException {
                    facade.writeTo(output);
                }
                @Override
                public CloudEventData getData() {
                    return facade.getData();
                }
                @Override
                public SpecVersion getSpecVersion() {
                    return facade.getSpecVersion();
                }
                @Override
                public String getId() {
                    return facade.getId();
                }
                @Override
                public String getType() {
                    return facade.getType();
                }
                @Override
                public URI getSource() {
                    return facade.getSource();
                }
                @Override
                public String getDataContentType() {
                    return facade.getDataContentType();
                }
                @Override
                public URI getDataSchema() {
                    return facade.getDataSchema();
                }
                @Override
                public String getSubject() {
                    return facade.getSubject();
                }
                @Override
                public OffsetDateTime getTime() {
                    return facade.getTime();
                }
                @Override
                public Object getAttribute(String attributeName) throws IllegalArgumentException {
                    return facade.getAttribute(attributeName);
                }
                @Override
                public Object getExtension(String extensionName) {
                    return facade.getExtension(extensionName);
                }
                @Override
                public Set getExtensionNames() {
                    return facade.getExtensionNames();
                }
            };
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy