Class DefaultNodeIdentifierStrategy

  • All Implemented Interfaces:
    NodeIdentifierStrategy

    public final class DefaultNodeIdentifierStrategy
    extends Object
    implements NodeIdentifierStrategy
    Strategy that provides a random node identifier. A random node identifier is generated ONCE and always returned. It uses SecureRandom to generate a 'cryptographic quality random number'. The first generated number is returned for all calls. ### RFC-4122 - 4.1.6. Node 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. ### RFC-4122 - 4.5. Node IDs that Do Not Identify the Host This section describes how to generate a version 1 UUID if an IEEE 802 address is not available, or its use is not desired. A better solution is to obtain a 47-bit cryptographic quality random number and use it as the low 47 bits of the node ID, with the least significant bit of the first octet of the node ID set to one. This bit is the unicast/multicast bit, which will never be set in IEEE 802 addresses obtained from network cards. Hence, there can never be a conflict between UUIDs generated by machines with and without network cards. (Recall that the IEEE 802 spec talks about transmission order, which is the opposite of the in-memory representation that is discussed in this document.
    • Constructor Detail

      • DefaultNodeIdentifierStrategy

        public DefaultNodeIdentifierStrategy()
        This constructor sets a random node identifier to the new strategy.