Class IdentifierProvider<V extends Identifier>

  • All Implemented Interfaces:
    javax.inject.Provider<V>
    Direct Known Subclasses:
    IP2

    public abstract class IdentifierProvider<V extends Identifier>
    extends Object
    implements javax.inject.Provider<V>
    Creates Identifiers for use by Identifiable objects. Override for specific semantics. These are created for the various token types when the system is loaded.

    Created by Jeff Gaynor
    on 4/3/12 at 1:54 PM

    • Field Detail

      • SCHEME

        public static String SCHEME
      • SCHEME_SPECIFIC_PART

        public static String SCHEME_SPECIFIC_PART
      • VERSION_2_0

        public static String VERSION_2_0
      • uriScheme

        protected String uriScheme
      • schemeSpecificPart

        protected String schemeSpecificPart
      • useTimestamps

        protected boolean useTimestamps
      • component

        protected String component
    • Constructor Detail

      • IdentifierProvider

        protected IdentifierProvider​(URI uri,
                                     String component,
                                     boolean useTimestamps)
      • IdentifierProvider

        protected IdentifierProvider​(URI uri,
                                     String component,
                                     String versionString,
                                     boolean useTimestamps)
      • IdentifierProvider

        protected IdentifierProvider​(String component)
      • IdentifierProvider

        protected IdentifierProvider​(String component,
                                     boolean useTimestamps)
      • IdentifierProvider

        protected IdentifierProvider​(String scheme,
                                     String schemeSpecificPart,
                                     String component,
                                     boolean useTimestamps)
        The main constructor. The component is appended after the caput. If time stamps are enabled, then the last component will be a the current time in milliseconds.
        Parameters:
        scheme -
        schemeSpecificPart -
        component -
        useTimestamps -
    • Method Detail

      • setScheme

        public static void setScheme​(String SCHEME)
      • setSchemeSpecificPart

        public static void setSchemeSpecificPart​(String SCHEME_SPECIFIC_PART)
      • getCaput

        protected String getCaput()
        Creates the caput (="head") from the uri scheme and scheme specific part. This will be of the form



        scheme : scheme specific part :

        Note that this will not add the final ":" if the SSP ends with a colon or slash. E.g. if
        • scheme = myproxy
        • SPP = oa4mp,2012
        then the caput is myproxy:oa4mp,2012:

        Note that this does allow for empty scheme specific parts vs. null ones. In the former, it is assumed the user is actively suppressing this component, where as in the null case the default is used.

        Returns:
      • uniqueIdentifier

        protected URI uniqueIdentifier()
        Creates identifiers of the form

        caput + head + hexString + t

        with forward slashes added between components as needed.

        E.g. if the caput = myproxy:oa4mp,2012:

        and the head is "client" and the tail is null, then one result might be

        myproxy:oa4mp,2012:/client/1d1158e470589f64a816b040b669ba07

        Note that if timestamps are enabled, then a last component consisting of a time stamp will be added.

        Returns:
      • get

        public V get()
        Specified by:
        get in interface javax.inject.Provider<V extends Identifier>