Class FedLibSystemProperties

  • All Implemented Interfaces:
    ISystemProperties
    Direct Known Subclasses:
    FedSystemProperties

    public class FedLibSystemProperties
    extends Object
    implements ISystemProperties
    This is the adapter class for Federation Library to the shared library. Mainly to provide system configuration information.
    • Field Detail

      • systemConfigProps

        protected static Properties systemConfigProps
    • Constructor Detail

      • FedLibSystemProperties

        public FedLibSystemProperties()
        Creates a new instance of FedLibSystemProperties
    • Method Detail

      • get

        public String get​(String key)
        Returns system properties.
        Specified by:
        get in interface ISystemProperties
        Parameters:
        key - Key to the properties.
      • getOrDefault

        public String getOrDefault​(String key,
                                   String defaultValue)
        Description copied from interface: ISystemProperties
        Returns system property or the default value if not set.
        Specified by:
        getOrDefault in interface ISystemProperties
        Parameters:
        key - the system property to retrieve.
        defaultValue - the default value if the property is not set.
        Returns:
        the property value or the default.
      • initializeProperties

        public void initializeProperties​(Properties properties)
        Initializes the properties to be used by Open Federation Library. Ideally this must be called first before any other method is called within Open Federation Library. This method provides a programmatic way to set the properties, and will override similar properties if loaded for a properties file.
        Specified by:
        initializeProperties in interface ISystemProperties
        Parameters:
        properties - properties for Open Federation Library
      • getServiceURL

        public URL getServiceURL​(String serviceName,
                                 String protocol,
                                 String hostname,
                                 int port,
                                 String uri)
                          throws Exception
        Returns the URL of the specified service on the specified host.
        Specified by:
        getServiceURL in interface ISystemProperties
        Parameters:
        serviceName - The name of the service.
        protocol - The service protocol.
        hostname - The service host name.
        port - The service listening port.
        uri - The service URI.
        Returns:
        The URL of the specified service on the specified host.
        Throws:
        Exception - if the URL could not be found.
      • initializeProperties

        public void initializeProperties​(String propertyName,
                                         String propertyValue)
        Initializes the properties map.
        Specified by:
        initializeProperties in interface ISystemProperties
        Parameters:
        propertyName - Name of properties.
        propertyValue - Value of properties.