Interface ALPN.ClientProvider

  • All Superinterfaces:
    ALPN.Provider
    Enclosing class:
    ALPN

    public static interface ALPN.ClientProvider
    extends ALPN.Provider
    The client-side provider interface that applications must implement to interact with the negotiation of the protocol.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<java.lang.String> protocols()
      Callback invoked to let the implementation know the list of protocols that should be added to the ALPN extension in a ClientHello TLS message.
      void selected​(java.lang.String protocol)
      Callback invoked to let the client application know the protocol chosen by the server.
      boolean supports()
      Callback invoked to let the implementation know whether an ALPN extension should be added to a ClientHello TLS message.
      void unsupported()
      Callback invoked to let the client application know that the server does not support ALPN.
    • Method Detail

      • supports

        boolean supports()
        Callback invoked to let the implementation know whether an ALPN extension should be added to a ClientHello TLS message.
        Returns:
        true to add the ALPN extension, false otherwise
      • protocols

        java.util.List<java.lang.String> protocols()
        Callback invoked to let the implementation know the list of protocols that should be added to the ALPN extension in a ClientHello TLS message.

        This callback is invoked only if the supports() returned true.

        Returns:
        the list of protocols supported by the client; if null or empty, the ALPN extension is not sent
      • unsupported

        void unsupported()
        Callback invoked to let the client application know that the server does not support ALPN.
      • selected

        void selected​(java.lang.String protocol)
        Callback invoked to let the client application know the protocol chosen by the server.
        Parameters:
        protocol - the protocol selected by the server