com.netflix.config.sources
Class URLConfigurationSource

java.lang.Object
  extended by com.netflix.config.sources.URLConfigurationSource
All Implemented Interfaces:
PolledConfigurationSource

public class URLConfigurationSource
extends java.lang.Object
implements PolledConfigurationSource

A polled configuration source based on a set of URLs. For each poll, it always returns the complete union of properties defined in all files. If one property is defined in more than one URL, the value in file later on the list will override the value in the previous one. The content of the URL should conform to the properties file format.


Field Summary
static java.lang.String CONFIG_URL
          System property name to define a set of URLs to be used by the default constructor.
static java.lang.String DEFAULT_CONFIG_FILE_FROM_CLASSPATH
           
static java.lang.String DEFAULT_CONFIG_FILE_NAME
          Default configuration file name to be used by default constructor.
 
Constructor Summary
URLConfigurationSource()
          Create the instance for the default list of URLs, which is composed by the following order A configuration file (default name to be config.properties, see DEFAULT_CONFIG_FILE_NAME) on the classpath A list of URLs defined by system property "archaius.configurationSource.additionalUrls" with values separated by comma ",".
URLConfigurationSource(java.lang.String... urls)
          Create an instance with a list URLs to be used.
URLConfigurationSource(java.net.URL... urls)
          Create an instance with a list URLs to be used.
 
Method Summary
 PollResult poll(boolean initial, java.lang.Object checkPoint)
          Retrieve the content of the property files.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG_URL

public static final java.lang.String CONFIG_URL
System property name to define a set of URLs to be used by the default constructor.

See Also:
Constant Field Values

DEFAULT_CONFIG_FILE_NAME

public static final java.lang.String DEFAULT_CONFIG_FILE_NAME
Default configuration file name to be used by default constructor. This file should be on the classpath. The file name can be overridden by the value of system property configurationSource.defaultFileName

See Also:
Constant Field Values

DEFAULT_CONFIG_FILE_FROM_CLASSPATH

public static final java.lang.String DEFAULT_CONFIG_FILE_FROM_CLASSPATH
Constructor Detail

URLConfigurationSource

public URLConfigurationSource(java.lang.String... urls)
Create an instance with a list URLs to be used.

Parameters:
urls - list of URLs to be used

URLConfigurationSource

public URLConfigurationSource(java.net.URL... urls)
Create an instance with a list URLs to be used.

Parameters:
urls - list of URLs to be used

URLConfigurationSource

public URLConfigurationSource()
Create the instance for the default list of URLs, which is composed by the following order

Method Detail

poll

public PollResult poll(boolean initial,
                       java.lang.Object checkPoint)
                throws java.io.IOException
Retrieve the content of the property files. For each poll, it always returns the complete union of properties defined in all URLs. If one property is defined in content of more than one URL, the value in file later on the list will override the value in the previous one.

Specified by:
poll in interface PolledConfigurationSource
Parameters:
initial - this parameter is ignored by the implementation
checkPoint - this parameter is ignored by the implementation
Returns:
The content of the configuration which may be full or incremental.
Throws:
java.io.IOException - IOException occurred in file operation

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object