com.telapi.api.configuration
Class PropertiesFileTelapiConfiguration

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<Object,Object>
          extended by java.util.Properties
              extended by com.telapi.api.configuration.PropertiesFileTelapiConfiguration
All Implemented Interfaces:
TelapiConfiguration, Serializable, Cloneable, Map<Object,Object>

public class PropertiesFileTelapiConfiguration
extends Properties
implements TelapiConfiguration

A TelapiConfiguration implementation which loads the configuration from a file.

See Also:
TelapiConfiguration, Serialized Form

Field Summary
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PropertiesFileTelapiConfiguration()
          Creates a TelapiConfiguration from a file called "telapi.properties" which must be on the classpath.
PropertiesFileTelapiConfiguration(FileInputStream is)
          Creates a TelapiConfiguration by loading properties from the provided FileInputStream.
PropertiesFileTelapiConfiguration(String propFileName)
          Creates a TelapiConfiguration from a file which must be on the classpath.
 
Method Summary
 String getAuthToken()
           
 String getBaseUrl()
           
 String getProxyHost()
           
 String getProxyPort()
           
 String getProxyProtocol()
           
 String getSid()
           
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PropertiesFileTelapiConfiguration

public PropertiesFileTelapiConfiguration()
Creates a TelapiConfiguration from a file called "telapi.properties" which must be on the classpath.


PropertiesFileTelapiConfiguration

public PropertiesFileTelapiConfiguration(String propFileName)
Creates a TelapiConfiguration from a file which must be on the classpath.

Parameters:
propFileName - The fileName of the properties file.

PropertiesFileTelapiConfiguration

public PropertiesFileTelapiConfiguration(FileInputStream is)
Creates a TelapiConfiguration by loading properties from the provided FileInputStream.

Parameters:
is - The FileInputStream from which to load the configuration.
Method Detail

getSid

public String getSid()
Specified by:
getSid in interface TelapiConfiguration
Returns:
The account Sid.

getAuthToken

public String getAuthToken()
Specified by:
getAuthToken in interface TelapiConfiguration
Returns:
The authorization token.

getBaseUrl

public String getBaseUrl()
Specified by:
getBaseUrl in interface TelapiConfiguration
Returns:
The base URL. This should be "https://api.telapi.com/" by default.

getProxyHost

public String getProxyHost()
Specified by:
getProxyHost in interface TelapiConfiguration
Returns:
The proxy host (e.g. "192.168.0.1"). Leave null or empty if no proxy is to be used.

getProxyPort

public String getProxyPort()
Specified by:
getProxyPort in interface TelapiConfiguration
Returns:
The proxy port (e.g. 8080). Ignored if no proxy host is set.

getProxyProtocol

public String getProxyProtocol()
Specified by:
getProxyProtocol in interface TelapiConfiguration
Returns:
The proxy protocol (e.g. "http"). Ignored if no proxy host is set.


Copyright © 2012. All Rights Reserved.