Class MacNodeIdentifierStrategy

  • All Implemented Interfaces:
    NodeIdentifierStrategy

    public final class MacNodeIdentifierStrategy
    extends Object
    implements NodeIdentifierStrategy
    Strategy that provides the current machine address (MAC), if available. If no MAC is found, a random node identifier is returned. It looks for the first MAC that can be found. First it tries to find the MAC that is associated with the host name. Otherwise, it tries to find the first MAC that is up and running. This second try may be very expensive on Windows, because it iterates over a lot of virtual network interfaces created by the operating system. ### RFC-4122 - 4.1.6. Node For UUID version 1, the node field consists of an IEEE 802 MAC address, usually the host address. For systems with multiple IEEE 802 addresses, any available one can be used. The lowest addressed octet (octet number 10) contains the global/local bit and the unicast/multicast bit, and is the first octet of the address transmitted on an 802.3 LAN. For systems with no IEEE address, a randomly or pseudo-randomly generated value may be used; see Section 4.5. The multicast bit must be set in such addresses, in order that they will never conflict with addresses obtained from network cards.
    • Constructor Detail

      • MacNodeIdentifierStrategy

        public MacNodeIdentifierStrategy()
        This constructor works in three steps: 1. Find the MAC associated with the host name; 2. If not found, find the first MAC that is up and running; 3. If not found, generate a random node identifier.