public final class RestClientBindings extends Object
Modifier and Type | Field and Description |
---|---|
static String |
E_INVALID_NAME |
Constructor and Description |
---|
RestClientBindings() |
Modifier and Type | Method and Description |
---|---|
static Properties |
bind(URI fsURI,
org.apache.hadoop.conf.Configuration conf)
Build a properties instance bound to the configuration file -using
the filesystem URI as the source of the information.
|
static String |
buildSwiftInstancePrefix(String service)
Public for testing : build the full prefix for use in resolving
configuration items
|
static void |
copy(org.apache.hadoop.conf.Configuration conf,
String confKey,
Properties props,
String propsKey,
boolean required)
Copy a (trimmed) property from the configuration file to the properties file.
|
static String |
extractContainerName(String hostname)
Get the container name from the hostname -the single element before the
first "." in the hostname
|
static String |
extractContainerName(URI uri) |
static String |
extractServiceName(String hostname)
Get the service name from a longer hostname string
|
static String |
extractServiceName(URI uri) |
public static final String E_INVALID_NAME
public static String buildSwiftInstancePrefix(String service)
service
- service to usepublic static String extractContainerName(String hostname) throws SwiftConfigurationException
hostname
- hostname to splitSwiftConfigurationException
public static String extractContainerName(URI uri) throws SwiftConfigurationException
SwiftConfigurationException
public static String extractServiceName(String hostname) throws SwiftConfigurationException
hostname
- hostnameSwiftConfigurationException
- if the hostname was invalidpublic static String extractServiceName(URI uri) throws SwiftConfigurationException
SwiftConfigurationException
public static Properties bind(URI fsURI, org.apache.hadoop.conf.Configuration conf) throws SwiftConfigurationException
fsURI
- filesystem URIconf
- configurationSwiftConfigurationException
- if the configuration is invalidpublic static void copy(org.apache.hadoop.conf.Configuration conf, String confKey, Properties props, String propsKey, boolean required) throws SwiftConfigurationException
conf
- source configurationconfKey
- key in the configuration fileprops
- destination property setpropsKey
- key in the property setrequired
- is the property requiredSwiftConfigurationException
- if the property is required but was
not found in the configuration instance.Copyright © 2015 Apache Software Foundation. All Rights Reserved.