public class ServerName extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ServerName.NameType
The enumeration of name types defined for the Server Name Indication extension.
|
| Modifier and Type | Field and Description |
|---|---|
static Charset |
CHARSET
The character set to use for encoding host names.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj)
Checks whether this instance is the same as another object.
|
static ServerName |
from(ServerName.NameType type,
byte[] name)
Creates a new instance for a type and name.
|
static ServerName |
fromHostName(String hostName)
Creates a new instance for a host name.
|
byte[] |
getName()
Gets the name.
|
String |
getNameAsString()
Gets the name as a string using ASCII encoding.
|
ServerName.NameType |
getType()
Gets this name's type.
|
int |
hashCode() |
public static final Charset CHARSET
public static ServerName from(ServerName.NameType type, byte[] name)
If the name is a host name then this method delegates
to fromHostName(String).
type - The type of name.name - The name's byte encoding.NullPointerException - if any of the parameters is null.public static ServerName fromHostName(String hostName)
hostName - The host name. All non-ASCII characters will be replaced
with the JRE's default replacement character. The name
will be converted to lower case.NullPointerException - if the host name is null.IllegalArgumentException - if the given name is not a valid host name
as per RFC 1123.public byte[] getName()
public String getNameAsString()
public ServerName.NameType getType()
Copyright © 2023 Eclipse Foundation. All rights reserved.