Class RandomAuthorizableNodeName

  • All Implemented Interfaces:
    AuthorizableNodeName

    public class RandomAuthorizableNodeName
    extends Object
    implements AuthorizableNodeName
    Implementation of the AuthorizableNodeName that generates a random node name that doesn't reveal the ID of the authorizable.
    • Field Detail

      • DEFAULT_LENGTH

        public static final int DEFAULT_LENGTH
        21 characters, each character with 6 bit of entropy (64 possible characters), results in 126 bits of entropy. With regards to probability of duplicates, this is even better than standard UUIDs, which have 122 bits of entropy and are 36 characters long.
        See Also:
        Constant Field Values
    • Constructor Detail

      • RandomAuthorizableNodeName

        public RandomAuthorizableNodeName()
    • Method Detail

      • generateNodeName

        @NotNull
        public @NotNull String generateNodeName​(@NotNull
                                                @NotNull String authorizableId)
        Description copied from interface: AuthorizableNodeName
        Generates a node name from the specified authorizableId.
        Specified by:
        generateNodeName in interface AuthorizableNodeName
        Parameters:
        authorizableId - The ID of the authorizable to be created.
        Returns:
        A valid node name.