Class RandomAuthorizableNodeName

  • All Implemented Interfaces:
    AuthorizableNodeName

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

      Fields 
      Modifier and Type Field Description
      static int DEFAULT_LENGTH
      21 characters, each character with 6 bit of entropy (64 possible characters), results in 126 bits of entropy.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @NotNull java.lang.String generateNodeName​(@NotNull java.lang.String authorizableId)
      Generates a node name from the specified authorizableId.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 java.lang.String generateNodeName​(@NotNull
                                                          @NotNull java.lang.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.