Class Identifiers


  • public class Identifiers
    extends Object
    Utilities for Identifiers, such as creating various URIs that can be fed to the Identifier class. the classic form is
         caput:/ranom_hex_string/timestamp_milliseconds
     

    Created by Jeff Gaynor
    on 4/10/12 at 11:56 AM

    • Constructor Detail

      • Identifiers

        public Identifiers()
    • Method Detail

      • getByteCount

        public static int getByteCount()
      • setByteCount

        public static void setByteCount​(int newByteCount)
      • getHexString

        public static String getHexString()
      • uniqueIdentifier

        public static URI uniqueIdentifier​(String caput,
                                           String tail)
        This creates an identifier of the form
             caput + / + hex_string + / + tail
         
        If tail has a trailing / it will be removed.
        Parameters:
        caput -
        tail -
        Returns:
      • uniqueIdentifier

        public static URI uniqueIdentifier​(String caput,
                                           String component,
                                           String version,
                                           long lifetime)
        Creates a new token of the form
             caput/id?param1=&param2=...
         
        E.g.
             https://foo.bar/oauth2/5c6c24e951a5a965f5303b7207b2a90b?type=accessToken&ts=1681817646409&version=v2.0&lifetime=1000000
         
        Parameters:
        caput -
        component -
        version -
        lifetime -
        Returns:
      • getParameters

        public static Map<String,​String> getParameters​(URI uri)
        Take a URI and turn the query string in to a set of parameters. These are returned as strings so they may need some further processing.
        Parameters:
        uri -
        Returns:
      • main

        public static void main​(String[] args)
        Just a demo of this class
        Parameters:
        args -