Package com.sun.identity.configuration
Class FedLibSystemProperties
- java.lang.Object
-
- com.sun.identity.configuration.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 Summary
Fields Modifier and Type Field Description protected static Properties
systemConfigProps
-
Constructor Summary
Constructors Constructor Description FedLibSystemProperties()
Creates a new instance ofFedLibSystemProperties
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
get(String key)
Returns system properties.String
getOrDefault(String key, String defaultValue)
Returns system property or the default value if not set.Collection
getServerList()
Returns server list.Collection
getServiceAllURLs(String serviceName)
Returns service all url list.URL
getServiceURL(String serviceName, String protocol, String hostname, int port, String uri)
Returns the URL of the specified service on the specified host.void
initializeProperties(String propertyName, String propertyValue)
Initializes the properties map.void
initializeProperties(Properties properties)
Initializes the properties to be used by Open Federation Library.
-
-
-
Field Detail
-
systemConfigProps
protected static Properties systemConfigProps
-
-
Method Detail
-
get
public String get(String key)
Returns system properties.- Specified by:
get
in interfaceISystemProperties
- 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 interfaceISystemProperties
- 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 interfaceISystemProperties
- Parameters:
properties
- properties for Open Federation Library
-
getServerList
public Collection getServerList() throws Exception
Returns server list.- Specified by:
getServerList
in interfaceISystemProperties
- Returns:
- Server List.
- Throws:
Exception
- if server list cannot be returned.
-
getServiceAllURLs
public Collection getServiceAllURLs(String serviceName) throws Exception
Returns service all url list.- Specified by:
getServiceAllURLs
in interfaceISystemProperties
- Returns:
- Server List.
- Throws:
Exception
- if server list cannot be returned.
-
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 interfaceISystemProperties
- 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 interfaceISystemProperties
- Parameters:
propertyName
- Name of properties.propertyValue
- Value of properties.
-
-