public abstract class SNIMatcher extends Object
SNIServerName实例上执行匹配操作的匹配器。
服务器可以使用服务器名称指示(SNI)信息来确定特定的SSLSocket或SSLEngine实例是否应该接受连接。 例如,当多个“虚拟”或“基于名称”的服务器托管在单个底层网络地址上时,服务器应用程序可以使用SNI信息来确定此服务器是否是客户端要访问的确切服务器。 服务器可以使用此类的实例来验证特定类型的可接受的服务器名称,例如主机名。
SNIMatcher对象是不可变的。 子类不能提供可以在创建实例后更改实例状态的方法。
SNIServerName , SNIHostName , SSLParameters.getSNIMatchers() , SSLParameters.setSNIMatchers(Collection)
| Modifier | Constructor and Description |
|---|---|
protected |
SNIMatcher(int type)
使用指定的服务器名称类型创建
SNIMatcher 。
|
| Modifier and Type | Method and Description |
|---|---|
int |
getType()
返回此
SNIMatcher对象的服务器名称类型。
|
abstract boolean |
matches(SNIServerName serverName)
尝试匹配给定的 SNIServerName 。
|
protected SNIMatcher(int type)
SNIMatcher 。
type - 该匹配器执行的服务器名称的类型
IllegalArgumentException - 如果
type不在0到255(含)范围内。
public final int getType()
SNIMatcher对象的服务器名称类型。
SNIMatcher对象的服务器名称类型。
SNIServerName
public abstract boolean matches(SNIServerName serverName)
SNIServerName 。
serverName - 该匹配器执行匹配操作的SNIServerName实例
true如果,并且只有匹配器匹配给定的
serverName
NullPointerException - 如果
serverName是
null
IllegalArgumentException - 如果
serverName不是此匹配器的给定服务器名称类型
SNIServerName
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.