com.languagecomputer.api
Class ServiceConfig

java.lang.Object
  extended by com.languagecomputer.api.ServiceConfig

public class ServiceConfig
extends Object

Maintains the URLs to use for various services.

Since:
1.0
Author:
Kirk Roberts

Constructor Summary
ServiceConfig()
          Creates an empty ServiceConfig.
ServiceConfig(File serviceFile)
          Creates a new ServiceConfig with an existing properties file.
 
Method Summary
 Long getConnectTimeout(String serviceName)
          Returns the connection timeout to use for the given service.
 Long getReceiveTimeout(String serviceName)
          Returns the receive timeout to use for the given service.
 String getURL(String serviceName)
          Returns the URL to use for the given service.
 void setConnectTimeout(String serviceName, long connectTimeout)
          Sets the connection timeout to use for the given service.
 void setReceiveTimeout(String serviceName, long receiveTimeout)
          Sets the receive timeout to use for the given service.
 void setURL(String serviceName, String url)
          Sets the URL to use for the given service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceConfig

public ServiceConfig()
Creates an empty ServiceConfig.


ServiceConfig

public ServiceConfig(File serviceFile)
              throws IOException
Creates a new ServiceConfig with an existing properties file.

Throws:
IOException
Method Detail

getURL

public String getURL(String serviceName)
Returns the URL to use for the given service.


setURL

public void setURL(String serviceName,
                   String url)
Sets the URL to use for the given service.


getConnectTimeout

public Long getConnectTimeout(String serviceName)
Returns the connection timeout to use for the given service.

Returns:
The preferred connection timeout, or null if no connection timeout has been specified and a default should be used.

setConnectTimeout

public void setConnectTimeout(String serviceName,
                              long connectTimeout)
Sets the connection timeout to use for the given service.


getReceiveTimeout

public Long getReceiveTimeout(String serviceName)
Returns the receive timeout to use for the given service.

Returns:
The preferred receive timeout, or null if no connection timeout has been specified and a default should be used.

setReceiveTimeout

public void setReceiveTimeout(String serviceName,
                              long receiveTimeout)
Sets the receive timeout to use for the given service.



Copyright © 2009. All Rights Reserved.