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

io.vertx.ext.web.impl.ServerWebSocketWrapper Maven / Gradle / Ivy

There is a newer version: 5.0.0.CR1
Show newest version
package io.vertx.ext.web.impl;

import io.vertx.codegen.annotations.Nullable;
import io.vertx.core.AsyncResult;
import io.vertx.core.Future;
import io.vertx.core.Handler;
import io.vertx.core.MultiMap;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.http.ServerWebSocket;
import io.vertx.core.http.WebSocketBase;
import io.vertx.core.http.WebSocketFrame;
import io.vertx.core.net.HostAndPort;
import io.vertx.core.net.SocketAddress;

import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.security.cert.X509Certificate;
import java.security.cert.Certificate;
import java.util.List;

public class ServerWebSocketWrapper implements ServerWebSocket {
  private final ServerWebSocket delegate;
  private final String host;
  private final HostAndPort authority;
  private final String scheme;
  private final boolean isSsl;
  private final SocketAddress remoteAddress;

  public ServerWebSocketWrapper(ServerWebSocket delegate,
                                String host,
                                HostAndPort authority,
                                String scheme,
                                boolean isSsl,
                                SocketAddress remoteAddress) {
    this.delegate = delegate;
    this.host = host;
    this.authority = authority;
    this.scheme = scheme;
    this.isSsl = isSsl;
    this.remoteAddress = remoteAddress;
  }

  @Override
  public ServerWebSocket exceptionHandler(Handler handler) {
    delegate.exceptionHandler(handler);
    return this;
  }

  @Override
  public Future write(Buffer data) {
    return delegate.write(data);
  }

  @Override
  public void write(Buffer data, Handler> handler) {
    delegate.write(data, handler);
  }

  @Override
  public ServerWebSocket handler(Handler handler) {
    delegate.handler(handler);
    return this;
  }

  @Override
  public ServerWebSocket pause() {
    delegate.pause();
    return this;
  }

  @Override
  public ServerWebSocket resume() {
    delegate.resume();
    return this;
  }

  @Override
  public ServerWebSocket fetch(long amount) {
    delegate.fetch(amount);
    return this;
  }

  @Override
  public ServerWebSocket endHandler(Handler endHandler) {
    delegate.endHandler(endHandler);
    return this;
  }

  @Override
  public ServerWebSocket setWriteQueueMaxSize(int maxSize) {
    delegate.setWriteQueueMaxSize(maxSize);
    return this;
  }

  @Override
  public boolean writeQueueFull() {
    return delegate.writeQueueFull();
  }

  @Override
  public ServerWebSocket drainHandler(Handler handler) {
    delegate.drainHandler(handler);
    return this;
  }

  @Override
  public String binaryHandlerID() {
    return delegate.binaryHandlerID();
  }

  @Override
  public String textHandlerID() {
    return delegate.textHandlerID();
  }

  @Override
  public String subProtocol() {
    return delegate.subProtocol();
  }

  @Override
  public Short closeStatusCode() {
    return delegate.closeStatusCode();
  }

  @Override
  public String closeReason() {
    return delegate.closeReason();
  }

  @Override
  public MultiMap headers() {
    return delegate.headers();
  }

  @Override
  public Future writeFrame(WebSocketFrame frame) {
    return delegate.writeFrame(frame);
  }

  @Override
  public ServerWebSocket writeFrame(WebSocketFrame frame, Handler> handler) {
    delegate.writeFrame(frame, handler);
    return this;
  }

  @Override
  public Future writeFinalTextFrame(String text) {
    return delegate.writeFinalTextFrame(text);
  }

  @Override
  public ServerWebSocket writeFinalTextFrame(String text, Handler> handler) {
    delegate.writeFinalTextFrame(text, handler);
    return this;
  }

  @Override
  public Future writeFinalBinaryFrame(Buffer data) {
    return delegate.writeFinalBinaryFrame(data);
  }

  @Override
  public ServerWebSocket writeFinalBinaryFrame(Buffer data, Handler> handler) {
    delegate.writeFinalBinaryFrame(data, handler);
    return this;
  }

  @Override
  public Future writeBinaryMessage(Buffer data) {
    return delegate.writeBinaryMessage(data);
  }

  @Override
  public ServerWebSocket writeBinaryMessage(Buffer data, Handler> handler) {
    delegate.writeBinaryMessage(data, handler);
    return this;
  }

  @Override
  public Future writeTextMessage(String text) {
    return delegate.writeTextMessage(text);
  }

  @Override
  public ServerWebSocket writeTextMessage(String text, Handler> handler) {
    delegate.writeTextMessage(text, handler);
    return this;
  }

  @Override
  public ServerWebSocket writePing(Buffer data, Handler> handler) {
    delegate.writePing(data, handler);
    return this;
  }

  @Override
  public Future writePing(Buffer data) {
    return delegate.writePing(data);
  }

  @Override
  public ServerWebSocket writePong(Buffer data, Handler> handler) {
    delegate.writePong(data, handler);
    return this;
  }

  @Override
  public Future writePong(Buffer data) {
    return delegate.writePong(data);
  }

  @Override
  public ServerWebSocket closeHandler(Handler handler) {
    delegate.closeHandler(handler);
    return this;
  }

  @Override
  public ServerWebSocket frameHandler(Handler handler) {
    delegate.frameHandler(handler);
    return this;
  }

  @Override
  public WebSocketBase textMessageHandler(@Nullable Handler handler) {
    delegate.textMessageHandler(handler);
    return this;
  }

  @Override
  public WebSocketBase binaryMessageHandler(@Nullable Handler handler) {
    delegate.binaryMessageHandler(handler);
    return this;
  }

  @Override
  public WebSocketBase pongHandler(@Nullable Handler handler) {
    delegate.pongHandler(handler);
    return this;
  }

  @Override
  public Future end() {
    return delegate.end();
  }

  @Override
  public void end(Handler> handler) {
    delegate.end(handler);
  }

  @Override
  public @Nullable String scheme() {
    return scheme;
  }

  @Override
  public @Nullable String host() {
    return host;
  }

  @Override
  public @Nullable HostAndPort authority() {
    return authority;
  }

  @Override
  public String uri() {
    return delegate.uri();
  }

  @Override
  public String path() {
    return delegate.path();
  }

  @Override
  public @Nullable String query() {
    return delegate.query();
  }

  @Override
  public void accept() {
    delegate.accept();
  }

  @Override
  public void reject() {
    delegate.reject();
  }

  @Override
  public void reject(int status) {
    delegate.reject(status);
  }

  @Override
  public void setHandshake(Future future, Handler> handler) {
    delegate.setHandshake(future, handler);
  }

  @Override
  public Future setHandshake(Future future) {
    return delegate.setHandshake(future);
  }

  @Override
  public Future close() {
    return delegate.close();
  }

  @Override
  public void close(Handler> handler) {
    delegate.close(handler);
  }

  @Override
  public Future close(short statusCode) {
    return delegate.close(statusCode);
  }

  @Override
  public void close(short statusCode, Handler> handler) {
    delegate.close(statusCode, handler);
  }

  @Override
  public Future close(short statusCode, @Nullable String reason) {
    return delegate.close(statusCode, reason);
  }

  @Override
  public void close(short statusCode, @Nullable String reason, Handler> handler) {
    delegate.close(statusCode, reason, handler);
  }

  @Override
  public SocketAddress remoteAddress() {
    return remoteAddress;
  }

  @Override
  public SocketAddress localAddress() {
    return delegate.localAddress();
  }

  @Override
  public boolean isSsl() {
    return isSsl;
  }

  @Override
  public boolean isClosed() {
    return delegate.isClosed();
  }

  @Override
  public SSLSession sslSession() {
    return delegate.sslSession();
  }

  @Override
  @Deprecated
  public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException {
    return delegate.peerCertificateChain();
  }

  @Override
  public List peerCertificates() throws SSLPeerUnverifiedException {
    return delegate.peerCertificates();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy