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

org.jboss.resteasy.reactor.MonoRxInvokerImpl Maven / Gradle / Ivy

There is a newer version: 7.0.0.Alpha4
Show newest version
package org.jboss.resteasy.reactor;

import java.util.Objects;
import java.util.concurrent.CompletionStage;

import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.core.GenericType;
import jakarta.ws.rs.core.Response;

import org.jboss.resteasy.client.jaxrs.internal.ClientInvocationBuilder;
import org.jboss.resteasy.client.jaxrs.internal.PublisherRxInvokerImpl;
import org.reactivestreams.Publisher;

import reactor.core.publisher.Mono;

public class MonoRxInvokerImpl implements MonoRxInvoker {

    private final MonoPublisherInvoker monoInvoker;

    static class MonoPublisherInvoker extends PublisherRxInvokerImpl {
        MonoPublisherInvoker(final ClientInvocationBuilder builder) {
            super(builder);
        }

        @Override
        protected  Publisher toPublisher(CompletionStage completable) {
            return Mono.fromCompletionStage(completable);
        }
    }

    public MonoRxInvokerImpl(final ClientInvocationBuilder builder) {
        monoInvoker = new MonoPublisherInvoker(Objects.requireNonNull(builder));
    }

    @Override
    public Mono get() {
        return Mono.from(monoInvoker.get());
    }

    @Override
    public  Mono get(Class responseType) {
        return Mono.from(monoInvoker.get(responseType));
    }

    @Override
    public  Mono get(GenericType responseType) {
        return Mono.from(monoInvoker.get(responseType));
    }

    @Override
    public Mono put(Entity entity) {
        return Mono.from(monoInvoker.put(entity));
    }

    @Override
    public  Mono put(Entity entity, Class clazz) {
        return Mono.from(monoInvoker.put(entity, clazz));
    }

    @Override
    public  Mono put(Entity entity, GenericType type) {
        return Mono.from(monoInvoker.put(entity, type));
    }

    @Override
    public Mono post(Entity entity) {
        return Mono.from(monoInvoker.post(entity));
    }

    @Override
    public  Mono post(Entity entity, Class clazz) {
        return Mono.from(monoInvoker.post(entity, clazz));
    }

    @Override
    public  Mono post(Entity entity, GenericType type) {
        return Mono.from(monoInvoker.post(entity, type));
    }

    @Override
    public Mono delete() {
        return Mono.from(monoInvoker.delete());
    }

    @Override
    public  Mono delete(Class responseType) {
        return Mono.from(monoInvoker.delete(responseType));
    }

    @Override
    public  Mono delete(GenericType responseType) {
        return Mono.from(monoInvoker.delete(responseType));
    }

    @Override
    public Mono head() {
        return Mono.from(monoInvoker.head());
    }

    @Override
    public Mono options() {
        return Mono.from(monoInvoker.options());
    }

    @Override
    public  Mono options(Class responseType) {
        return Mono.from(monoInvoker.options(responseType));
    }

    @Override
    public  Mono options(GenericType responseType) {
        return Mono.from(monoInvoker.options(responseType));
    }

    @Override
    public Mono trace() {
        return Mono.from(monoInvoker.trace());
    }

    @Override
    public  Mono trace(Class responseType) {
        return Mono.from(monoInvoker.trace(responseType));
    }

    @Override
    public  Mono trace(GenericType responseType) {
        return Mono.from(monoInvoker.trace(responseType));
    }

    @Override
    public Mono method(String name) {
        return Mono.from(monoInvoker.method(name));
    }

    @Override
    public  Mono method(String name, Class responseType) {
        return Mono.from(monoInvoker.method(name, responseType));
    }

    @Override
    public  Mono method(String name, GenericType responseType) {
        return Mono.from(monoInvoker.method(name, responseType));
    }

    @Override
    public Mono method(String name, Entity entity) {
        return Mono.from(monoInvoker.method(name, entity));
    }

    @Override
    public  Mono method(String name, Entity entity, Class responseType) {
        return Mono.from(monoInvoker.method(name, entity, responseType));
    }

    @Override
    public  Mono method(String name, Entity entity, GenericType responseType) {
        return Mono.from(monoInvoker.method(name, entity, responseType));
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy