The machine's identity which is typically the hostname.
the machine's identity.
The process identifier which is typically the OS PID.
the process identifier.
The user's identity which is typically the OS login username.
the user's identity.
Compares this leaseholder to another leaseholder to determine if they are equal. Two leaseholders are equal if their username, hostname, and process id are the same.
the other leaseholder to compare.
true if the leaseholders are equal; false otherwise.
Determines if the process associated with this leaseholder is still alive. This method will return false if the process is not alive or an error occurs while checking the process status.
true if the process is alive; false otherwise.
Compares this leaseholder to another leaseholder to determine if they are the same machine. Two leaseholders are the same machine if their username and hostname are the same.
the other leaseholder to compare.
true if the leaseholders are the same machine; false otherwise.
Serializes this leaseholder to a JSON string representation.
a JSON string representation of this leaseholder.
Returns a plain object representation of this leaseholder. This object may be serialized to JSON.
a plain object representation of this leaseholder.
Static
defaultCreates a new leaseholder by retrieving the current user's identity, the current machine's hostname, and the current process's PID.
a new leaseholder instance.
Static
fromDeserializes a JSON string representation of a leaseholder into a new leaseholder instance.
the JSON string representation of a leaseholder.
a new leaseholder instance.
Static
ofCreates a new leaseholder with the given username. The hostname is set to the current machine's hostname and the process id is set to the current process's PID.
the user's identity.
a new leaseholder instance.
A representation of a leaseholder who is identified by a username, hostname, and process id (PID). This implementation is serializable to/from a JSON object and is comparable to other leaseholders.