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

io.inverno.mod.web.compiler.spi.WebSocketBoundPublisherInfo Maven / Gradle / Ivy

Go to download

Inverno web compiler module providing an Inverno compiler plugin to aggregate module's web routes and web router configurers into a single web router configurer

There is a newer version: 1.11.0
Show newest version
/*
 * Copyright 2022 Jeremy KUHN
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.inverno.mod.web.compiler.spi;

import io.netty.buffer.ByteBuf;
import javax.lang.model.type.TypeMirror;
import org.reactivestreams.Publisher;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

/**
 * 

* Describes a general WebSocket bound publisher (inbound or outbound) *

* * @author Jeremy Kuhn * @since 1.5 */ public interface WebSocketBoundPublisherInfo { /** *

* Indicates the kind of a bound. *

* * @author Jeremy Kuhn * @since 1.5 */ enum BoundKind { /** * The actual bound type is {@link ByteBuf} and corresponds to a single WebSocket message after reduction of non-final frames. */ RAW_REDUCED, /** * The actual bound type is {@link Mono Mono<ByteBuf>} and corresponds to a single WebSocket message after reduction of non-final frames. */ RAW_REDUCED_ONE, /** * The actual bound type is {@link Publisher Publisher<ByteBuf>} and corresponds to a single WebSocket message without reduction of non-final frames. */ RAW_PUBLISHER, /** * The actual bound type is {@link Flux Flux<ByteBuf>} and corresponds to a single WebSocket message without reduction of non-final frames. */ RAW_MANY, /** * The actual bound type extends {@link CharSequence} and corresponds to a single WebSocket message after reduction of non-final frames. */ CHARSEQUENCE_REDUCED, /** * The actual bound type extends {@link Mono Mono<CharSequence>} and corresponds to a single WebSocket message after reduction of non-final frames. */ CHARSEQUENCE_REDUCED_ONE, /** * The actual bound type extends {@link Publisher Publisher<CharSequence>} and corresponds to a single WebSocket message without reduction of non-final frames. */ CHARSEQUENCE_PUBLISHER, /** * The actual bound type extends {@link Flux Flux<CharSequence>} and corresponds to a single WebSocket message without reduction of non-final frames. */ CHARSEQUENCE_MANY, /** * The actual response body type is {@link Void}. */ EMPTY, /** * The actual response body type is none of the above. */ ENCODED; } /** *

* Indicates the reactive kind of a bound. *

* * @author Jeremy Kuhn * @since 1.0 */ enum BoundReactiveKind { /** * The body is of type {@link Publisher Publisher<T>} where {@code T} represents the actual response body type. */ PUBLISHER, /** * The body is of type {@link Mono Mono<T>} where {@code T} represents the actual response body type. */ ONE, /** * The body is of type {@link Flux Flux<T>} where {@code T} represents the actual response body type. */ MANY; } /** *

* Returns the actual type of the bound. *

* *

* When the bound is reactive, this corresponds to the type argument of the reactive type. *

* * @return the actual body type */ BoundKind getBoundKind(); /** *

* Returns the bound reactive kind. *

* * @return the bound reactive kind */ BoundReactiveKind getBoundReactiveKind(); /** *

* Returns the actual type of WebSocket bound messages. *

* *

* When the bound is reactive, this corresponds to the type argument of the reactive type. *

* * @return the actual message type */ TypeMirror getType(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy