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

io.contek.invoker.commons.websocket.IWebSocketAuthenticator Maven / Gradle / Ivy

There is a newer version: 3.8.0
Show newest version
package io.contek.invoker.commons.websocket;

import javax.annotation.concurrent.Immutable;
import javax.annotation.concurrent.ThreadSafe;

@ThreadSafe
public interface IWebSocketAuthenticator extends IWebSocketListener {

  static NoOp noOp() {
    return NoOp.INSTANCE;
  }

  void handshake(WebSocketSession session);

  boolean isPending();

  boolean isCompleted();

  @Immutable
  final class NoOp implements IWebSocketAuthenticator {

    private static final NoOp INSTANCE = new NoOp();

    @Override
    public void handshake(WebSocketSession session) {}

    @Override
    public boolean isPending() {
      return false;
    }

    @Override
    public boolean isCompleted() {
      return true;
    }

    @Override
    public void onMessage(AnyWebSocketMessage message, WebSocketSession session) {}

    @Override
    public void afterDisconnect() {}

    private NoOp() {}
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy