1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package io.netty.handler.ssl;
17
18 import static io.netty.handler.ssl.ApplicationProtocolUtil.toList;
19 import static io.netty.util.internal.ObjectUtil.checkNotNull;
20
21 import java.util.List;
22
23
24
25
26
27
28 @Deprecated
29 public final class OpenSslNpnApplicationProtocolNegotiator implements OpenSslApplicationProtocolNegotiator {
30 private final List<String> protocols;
31
32 public OpenSslNpnApplicationProtocolNegotiator(Iterable<String> protocols) {
33 this.protocols = checkNotNull(toList(protocols), "protocols");
34 }
35
36 public OpenSslNpnApplicationProtocolNegotiator(String... protocols) {
37 this.protocols = checkNotNull(toList(protocols), "protocols");
38 }
39
40 @Override
41 public ApplicationProtocolConfig.Protocol protocol() {
42 return ApplicationProtocolConfig.Protocol.NPN;
43 }
44
45 @Override
46 public List<String> protocols() {
47 return protocols;
48 }
49
50 @Override
51 public ApplicationProtocolConfig.SelectorFailureBehavior selectorFailureBehavior() {
52 return ApplicationProtocolConfig.SelectorFailureBehavior.CHOOSE_MY_LAST_PROTOCOL;
53 }
54
55 @Override
56 public ApplicationProtocolConfig.SelectedListenerFailureBehavior selectedListenerFailureBehavior() {
57 return ApplicationProtocolConfig.SelectedListenerFailureBehavior.ACCEPT;
58 }
59 }