public final class AlertMessage extends Object implements DTLSMessage, Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
AlertMessage.AlertDescription
See Alert
Messages for the listing.
|
static class |
AlertMessage.AlertLevel
See Alert
Messages for the listing.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AlertMessage() |
|
AlertMessage(AlertMessage.AlertLevel level,
AlertMessage.AlertDescription description,
InetSocketAddress peerAddress)
Create new instance of alert message.
|
|
AlertMessage(AlertMessage.AlertLevel level,
AlertMessage.AlertDescription description,
ProtocolVersion protocolVersion,
InetSocketAddress peerAddress)
Create new instance of alert message.
|
| Modifier and Type | Method and Description |
|---|---|
static AlertMessage |
fromByteArray(byte[] byteArray,
InetSocketAddress peerAddress) |
ContentType |
getContentType()
Gets the message's content type.
|
AlertMessage.AlertDescription |
getDescription() |
AlertMessage.AlertLevel |
getLevel() |
InetSocketAddress |
getPeer()
Gets the IP address and port of the peer this message
has been received from or is to be sent to.
|
ProtocolVersion |
getProtocolVersion()
Get protocol version to use for the record on sending.
|
boolean |
isFatal() |
int |
size()
Gets the number of bytes representing this message as defined
by TLS 1.2, Appendix A.
|
byte[] |
toByteArray()
Gets the byte array representation of this message as defined
by TLS 1.2, Appendix A.
|
String |
toString() |
protected AlertMessage()
public AlertMessage(AlertMessage.AlertLevel level, AlertMessage.AlertDescription description, InetSocketAddress peerAddress)
level - the alert leveldescription - the alert descriptionpeerAddress - the IP address and port of the peer this message has
been received from or is to be sent toNullPointerException - if one of the provided parameter is
nullpublic AlertMessage(AlertMessage.AlertLevel level, AlertMessage.AlertDescription description, ProtocolVersion protocolVersion, InetSocketAddress peerAddress)
level - the alert leveldescription - the alert descriptionprotocolVersion - protocol version of record to send. Only possible
for AlertMessage.AlertDescription.PROTOCOL_VERSION alerts!peerAddress - the IP address and port of the peer this message has
been received from or is to be sent toNullPointerException - if one of the provided parameter is
nullIllegalArgumentException - if a protocol version is provided, but
the description is not
AlertMessage.AlertDescription.PROTOCOL_VERSIONpublic final InetSocketAddress getPeer()
DTLSMessagegetPeer in interface DTLSMessagepublic ContentType getContentType()
DTLSMessagegetContentType in interface DTLSMessagepublic int size()
DTLSMessagesize in interface DTLSMessagepublic byte[] toByteArray()
toByteArray in interface DTLSMessagepublic static AlertMessage fromByteArray(byte[] byteArray, InetSocketAddress peerAddress) throws HandshakeException
HandshakeExceptionpublic ProtocolVersion getProtocolVersion()
null, for fixed or negotiated
version.public AlertMessage.AlertLevel getLevel()
public AlertMessage.AlertDescription getDescription()
public boolean isFatal()
Copyright © 2023 Eclipse Foundation. All rights reserved.