io.undertow.protocols.alpn

## Class JDK9AlpnProvider

- java.lang.Object
- - io.undertow.protocols.alpn.JDK9AlpnProvider

All Implemented Interfaces:
  ALPNProvider

    public class JDK9AlpnProvider
    extends Object
    implements ALPNProvider

Open listener adaptor for ALPN connections that use the JDK9 API

Not a proper open listener as such, but more a mechanism for selecting between them

Author:
  Stuart Douglas

### Nested Class Summary

Nested Classes
`static class` `JDK9AlpnProvider.JDK9ALPNMethods`

### Field Summary

Fields
`static JDK9AlpnProvider.JDK9ALPNMethods` `JDK_9_ALPN_METHODS`

### Constructor Summary

Constructors
Constructor and Description
`JDK9AlpnProvider()`

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `getPriority()`
`String` `getSelectedProtocol(SSLEngine engine)` Gets the selected ALPN protocol, of null if none was selected.
`boolean` `isEnabled(SSLEngine sslEngine)`
`SSLEngine` `setProtocols(SSLEngine engine, String[] protocols)` Sets the SSL protocols, and potentially wraps the SSLEngine
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### JDK_9_ALPN_METHODS

    public static final JDK9AlpnProvider.JDK9ALPNMethods JDK_9_ALPN_METHODS

### Constructor Detail

#### JDK9AlpnProvider

    public JDK9AlpnProvider()

### Method Detail

#### isEnabled

    public boolean isEnabled(SSLEngine sslEngine)

Specified by:
  `isEnabled` in interface `ALPNProvider`

#### setProtocols

    public SSLEngine setProtocols(SSLEngine engine,
                                  String[] protocols)

Description copied from interface: `ALPNProvider`
Sets the SSL protocols, and potentially wraps the SSLEngine

Specified by:
  `setProtocols` in interface `ALPNProvider`
Parameters:
  `engine` - The original engine
  `protocols` - The protocols
Returns:
  The new SSLEngine

#### getSelectedProtocol

    public String getSelectedProtocol(SSLEngine engine)

Description copied from interface: `ALPNProvider`
Gets the selected ALPN protocol, of null if none was selected.

Specified by:
  `getSelectedProtocol` in interface `ALPNProvider`
Parameters:
  `engine` - The SSL Engine
Returns:
  The selected protocol

#### getPriority

    public int getPriority()

Specified by:
  `getPriority` in interface `ALPNProvider`
Returns:
  The priority of this provider, higher priority providers will be tried first

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`