Class UserAliasesSource<C>

  • Type Parameters:
    C - Command type

    public class UserAliasesSource<C>
    extends java.lang.Object
    Represents the source of user defined aliases
    • Constructor Summary

      Constructors 
      Constructor Description
      UserAliasesSource​(java.lang.String filename, java.lang.String prefix, java.lang.String... searchLocations)  
      UserAliasesSource​(java.lang.String filename, java.lang.String prefix, java.util.List<ResourceLocator> locators, java.util.List<java.lang.String> searchLocations)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFilename()
      Gets the filename of the configuration file that will be scanned for alias definitions
      java.util.List<ResourceLocator> getLocators()
      Gets the locators that are used to resolve search locations to actual usable locations
      java.lang.String getPrefix()
      Gets the prefix that is used to distinguish alias definitions from other property definitions in the configuration file
      java.util.List<java.lang.String> getSearchLocations()
      Gets the search locations where the configuration file may be located in order of preference
      java.util.List<AliasMetadata> load()
      Loads the alias metadata based on the configured sources
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_LOCATORS

        public static final ResourceLocator[] DEFAULT_LOCATORS
        Default user alias source locators
      • searchLocations

        private final java.util.List<java.lang.String> searchLocations
      • filename

        private final java.lang.String filename
      • prefix

        private final java.lang.String prefix
    • Constructor Detail

      • UserAliasesSource

        public UserAliasesSource​(java.lang.String filename,
                                 java.lang.String prefix,
                                 java.lang.String... searchLocations)
      • UserAliasesSource

        public UserAliasesSource​(java.lang.String filename,
                                 java.lang.String prefix,
                                 java.util.List<ResourceLocator> locators,
                                 java.util.List<java.lang.String> searchLocations)
    • Method Detail

      • getFilename

        public java.lang.String getFilename()
        Gets the filename of the configuration file that will be scanned for alias definitions
        Returns:
        Configuration file name
      • getSearchLocations

        public java.util.List<java.lang.String> getSearchLocations()
        Gets the search locations where the configuration file may be located in order of preference
        Returns:
        Search locations in order of preference
      • getPrefix

        public java.lang.String getPrefix()
        Gets the prefix that is used to distinguish alias definitions from other property definitions in the configuration file

        If this is null/empty/blank then no prefix is in effect

        Returns:
        Prefix
      • getLocators

        public java.util.List<ResourceLocator> getLocators()
        Gets the locators that are used to resolve search locations to actual usable locations
        Returns:
        User alias locators
      • load

        public java.util.List<AliasMetadata> load()
                                           throws java.io.FileNotFoundException,
                                                  java.io.IOException
        Loads the alias metadata based on the configured sources
        Returns:
        Alias metadata
        Throws:
        java.io.FileNotFoundException - Thrown if unable to find a properties file
        java.io.IOException - Thrown if unable to read a properties file