java.lang.Object
jakarta.mail.internet.UniqueValue
This is a utility class that generates unique values. The generated
String contains only US-ASCII characters and hence is safe for use
in RFC822 headers.
This is a package private class.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static AtomicInteger
A global unique number, to ensure uniqueness of generated strings. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
id
A global unique number, to ensure uniqueness of generated strings.
-
-
Constructor Details
-
UniqueValue
UniqueValue()
-
-
Method Details
-
getUniqueBoundaryValue
Get a unique value for use in a multipart boundary string. This implementation generates it by concatenating a global part number, a newly created object'shashCode()
, and the current time (in milliseconds). -
getUniqueMessageIDValue
Get a unique value for use in a Message-ID. This implementation generates it by concatenating a newly created object'shashCode()
, a global ID (incremented on every use), the current time (in milliseconds), and the host name from this user's local address generated byInternetAddress.getLocalAddress()
. (The host name defaults to "localhost" ifgetLocalAddress()
returns null.)- Parameters:
ssn
- Session object used to get the local address- See Also:
-