|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectinfo.sswap.api.model.Config
public class Config
Configuration properties for SSWAP Services. These properties may be set in a Java properties file and loaded at startup by entering a path to the file in web.xml as in this snippet:
<servlet>
<servlet-name>MyServlet</servlet-name>
<servlet-class>org.mySite.sswap.MyServlet</servlet-class>
<!-- if not defined, defaults to values in info.sswap.api.model.Config <url-pattern>
<init-param>
<param-name>ConfigPath</param-name>
<param-value>/pathTo/config.properties</param-value>
</init-param>
-->
</servlet>
Sample sswap.properties file:
info.sswap.impl.empire.io.CACHE_DIR = /opt/tomcat/cache
info.sswap.impl.empire.model.RIG_INVOCATION_TIMEOUT = 120000
The keys in the property file (e.g. 'info.sswap.impl.empire.io.CACHE_DIR')
are the values of their respective _KEY fields in this class (e.g. CACHE_DIR_KEY)
as listed in Constant Field Values link for each field.
Field Summary | |
---|---|
static java.lang.String |
CACHE_DIR_DEFAULT
The default cache directory. |
static java.lang.String |
CACHE_DIR_KEY
Key for the cache directory which contains the index and cached files. |
static java.lang.String |
CACHE_ENABLED_DEFAULT
The default value for enabling (or disabling) caching (value is 'true' or 'false'). |
static java.lang.String |
CACHE_ENABLED_KEY
Key for enabling any caching (disk or memory) |
static java.lang.String |
CACHE_INDEX_FILE_DEFAULT
The default name of the cache index file. |
static java.lang.String |
CACHE_INDEX_FILE_KEY
Key for the name of the index file for the cache that maps URIs to local file paths. |
static java.lang.String |
CLOSURE_BYTES_LIMIT_DEFAULT
The default byte limit for closure computation in bytes, if not otherwise specified. |
static java.lang.String |
CLOSURE_BYTES_LIMIT_KEY
Key for the property that defines a closure-wide bytes limit (i.e., if that many bytes are transmitted during a single closure computation, no further HTTP connections will be initiated, and existing connections will be terminated as soon as possible). |
static java.lang.String |
CLOSURE_CONNECT_TIMEOUT_DEFAULT
The default connect timeout for closure computation (in milliseconds), if not otherwise specified. |
static java.lang.String |
CLOSURE_CONNECT_TIMEOUT_KEY
Key for the property that defines the connect timeout for a single HTTP connection during closure computation (i.e., if an HTTP connection cannot be established in that many milliseconds, it will be interrupted, and a retrieval failure will be declared for that term.) |
static java.lang.String |
CLOSURE_READ_TIMEOUT_DEFAULT
The default read timeout for closure computation (in milliseconds), if not otherwise specified. |
static java.lang.String |
CLOSURE_READ_TIMEOUT_KEY
Key for the property that defines the read timeout for a single HTTP connection during closure computation (i.e., if data transmission for an HTTP connection should stall past that many milliseconds, it will be interrupted, and a retrieval failure will be declared for that term). |
static java.lang.String |
CLOSURE_THREADS_DEFAULT
The default number of threads for closure retrieval, if not otherwise specified. |
static java.lang.String |
CLOSURE_THREADS_KEY
Key for the property that defines how many threads/concurrent connections should be used in a single closure computation. |
static java.lang.String |
CLOSURE_TIME_LIMIT_DEFAULT
The default time limit for closure computation in milliseconds, if not otherwise specified. |
static java.lang.String |
CLOSURE_TIME_LIMIT_KEY
Key for the property that defines a closure-wide time limit (i.e., if an attempt to retrieve a closure should exceed that many milliseconds, no further HTTP connections will be initiated, and existing connections will be terminated as soon as possible). |
static java.lang.String |
CONTENT_EHCACHE_CACHE_NAME_DEFAULT
Default value of the EHCache cache that stores content/output data (produced by the SSWAP service) |
static java.lang.String |
CONTENT_EHCACHE_CACHE_NAME_KEY
Property name for the name of the EHCache cache for storing content/output of the service (produced by the SSWAP service) |
static java.lang.String |
CONTENT_EHCACHE_FILE_KEY
Property name for the path to EHCache configuration file for storing content/output of the service (e.g., referenced in an RRG). |
static java.lang.String |
DISABLE_UNA_WHEN_CLOSING_WORLD
We are not disabling UNA by default when closing the world during service invocations. |
static java.lang.String |
DISABLE_UNA_WHEN_CLOSING_WORLD_KEY
Property name for controlling Unique Name Assumption (UNA) when closing the world during service invocations. |
static java.lang.String |
DISCOVERY_SERVER_URI_DEFAULT
The default URI of the discovery server, if not otherwise specified. |
static java.lang.String |
DISCOVERY_SERVER_URI_KEY
The URI of the discovery server (used to answer RQGs) |
static java.lang.String |
DISK_CACHE_ENABLED_DEFAULT
The default value for enabling (or disabling) the disk cache (value is 'true' or 'false'). |
static java.lang.String |
DISK_CACHE_ENABLED_KEY
Key for enabling the disk cache (vs. |
static java.lang.String |
HTTP_API_URI_DEFAULT
The default URI for HTTP API, if not otherwise specified. |
static java.lang.String |
HTTP_API_URI_KEY
The URI of the publicly accessible instance of HTTP/JSON API (used by classes in info.sswap.api.http). |
private static Config |
instance
A singleton instance of the config. |
static java.lang.String |
MAX_CLOSURE_DEGREE_DEFAULT
The default closure degree if not otherwise specified (must be a parseable integer) |
static java.lang.String |
MAX_CLOSURE_DEGREE_KEY
Key for the property that defines how many closure degrees will be performed during closure computation. |
static java.lang.String |
MAX_HIERARCHY_CLOSURE_DEGREE_DEFAULT
The default hierarchy retrieving closure degree if not otherwise specified (must be a parseable integer) |
static java.lang.String |
MAX_HIERARCHY_CLOSURE_DEGREE_KEY
Key for the property that defines how many additional "hierarchy retrieving" closure degrees will be performed (in addition to the closure degrees defined by MAX_CLOSURE_DEGREE_KEY) during closure computation. |
static java.lang.String |
MODEL_CACHE_ENTRY_TTL_DEFAULT
The default TTL for a model cache entry, if not otherwise specified. |
static java.lang.String |
MODEL_CACHE_ENTRY_TTL_KEY
Key for the property that defines how long an entry cached in model cache should be stored (time-to-live; TTL). |
static java.lang.String |
MODEL_CACHE_NEGATIVE_ENTRY_TTL_DEFAULT
|
static java.lang.String |
MODEL_CACHE_NEGATIVE_ENTRY_TTL_KEY
|
static java.lang.String |
MODULE_EXTRACTION_ENABLED_DEFAULT
The default URI for the module extraction service |
static java.lang.String |
MODULE_EXTRACTION_ENABLED_KEY
The key for the URI of the module extraction service |
static java.lang.String |
MODULE_EXTRACTION_URI_DEFAULT
The default URI for the module extraction service |
static java.lang.String |
MODULE_EXTRACTION_URI_KEY
The key for the URI of the module extraction service |
private java.util.Properties |
properties
Actual property values. |
static java.lang.String |
RIG_INVOCATION_TIMEOUT_DEFAULT
The default connect timeout (in milliseconds) during RIG invocation. |
static java.lang.String |
RIG_INVOCATION_TIMEOUT_KEY
Property name for setting the connect timeout (in milliseconds) during RIG invocation. |
static java.lang.String |
RRG_EHCACHE_CACHE_NAME_DEFAULT
Default value of the EHCache cache that stores RRGs (produced by the SSWAP service and available for asynchronous retrieval) |
static java.lang.String |
RRG_EHCACHE_CACHE_NAME_KEY
Property name for the name of the EHCache cache for storing RRGs (produced by the SSWAP service and available for asynchronous retrieval) |
static java.lang.String |
RRG_EHCACHE_FILE_KEY
Property name for the path to EHCache configuration file for storing RRGs. |
Constructor Summary | |
---|---|
private |
Config()
Initializes the default values of all known properties. |
Method Summary | |
---|---|
static Config |
get()
Getter for the singleton instance of the config. |
java.lang.String |
getProperty(java.lang.String key)
Gets the value of the specified property. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Gets the value of the specified property or the specified default value, if the default value is not defined. |
void |
load(java.io.InputStream is)
Loads the values from the specified input stream (which is expected to contain standard Java properties file). |
void |
load(java.io.Reader reader)
Loads the values from the specified reader (which is expected to contain standard Java properties file). |
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets the value of the specified property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String MAX_CLOSURE_DEGREE_KEY
public static final java.lang.String MAX_CLOSURE_DEGREE_DEFAULT
public static java.lang.String MAX_HIERARCHY_CLOSURE_DEGREE_KEY
public static final java.lang.String MAX_HIERARCHY_CLOSURE_DEGREE_DEFAULT
public static java.lang.String CLOSURE_CONNECT_TIMEOUT_KEY
public static final java.lang.String CLOSURE_CONNECT_TIMEOUT_DEFAULT
public static java.lang.String CLOSURE_READ_TIMEOUT_KEY
public static final java.lang.String CLOSURE_READ_TIMEOUT_DEFAULT
public static java.lang.String CLOSURE_BYTES_LIMIT_KEY
public static final java.lang.String CLOSURE_BYTES_LIMIT_DEFAULT
public static java.lang.String CLOSURE_TIME_LIMIT_KEY
public static final java.lang.String CLOSURE_TIME_LIMIT_DEFAULT
public static java.lang.String CLOSURE_THREADS_KEY
public static final java.lang.String CLOSURE_THREADS_DEFAULT
public static java.lang.String MODEL_CACHE_ENTRY_TTL_KEY
public static final java.lang.String MODEL_CACHE_ENTRY_TTL_DEFAULT
public static java.lang.String MODEL_CACHE_NEGATIVE_ENTRY_TTL_KEY
public static final java.lang.String MODEL_CACHE_NEGATIVE_ENTRY_TTL_DEFAULT
public static java.lang.String HTTP_API_URI_KEY
public static final java.lang.String HTTP_API_URI_DEFAULT
public static java.lang.String DISCOVERY_SERVER_URI_KEY
public static final java.lang.String DISCOVERY_SERVER_URI_DEFAULT
public static final java.lang.String RIG_INVOCATION_TIMEOUT_KEY
public static final java.lang.String RIG_INVOCATION_TIMEOUT_DEFAULT
public static final java.lang.String CACHE_DIR_KEY
public static final java.lang.String CACHE_DIR_DEFAULT
public static final java.lang.String CACHE_INDEX_FILE_KEY
public static final java.lang.String CACHE_INDEX_FILE_DEFAULT
public static final java.lang.String DISK_CACHE_ENABLED_KEY
public static final java.lang.String DISK_CACHE_ENABLED_DEFAULT
public static final java.lang.String CACHE_ENABLED_KEY
public static final java.lang.String CACHE_ENABLED_DEFAULT
public static final java.lang.String DISABLE_UNA_WHEN_CLOSING_WORLD_KEY
public static final java.lang.String DISABLE_UNA_WHEN_CLOSING_WORLD
public static final java.lang.String RRG_EHCACHE_FILE_KEY
public static final java.lang.String RRG_EHCACHE_CACHE_NAME_KEY
public static final java.lang.String RRG_EHCACHE_CACHE_NAME_DEFAULT
public static final java.lang.String CONTENT_EHCACHE_FILE_KEY
public static final java.lang.String CONTENT_EHCACHE_CACHE_NAME_KEY
public static final java.lang.String CONTENT_EHCACHE_CACHE_NAME_DEFAULT
public static final java.lang.String MODULE_EXTRACTION_URI_KEY
public static final java.lang.String MODULE_EXTRACTION_URI_DEFAULT
public static final java.lang.String MODULE_EXTRACTION_ENABLED_KEY
public static final java.lang.String MODULE_EXTRACTION_ENABLED_DEFAULT
private static Config instance
private java.util.Properties properties
Constructor Detail |
---|
private Config()
Method Detail |
---|
public static Config get()
public java.lang.String getProperty(java.lang.String key)
key
- the key identifying the property
public java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
key
- the key identifying the propertydefaultValue
- the default value to be returned, if there is no property with the specified key
public void setProperty(java.lang.String key, java.lang.String value)
key
- the key identifying the propertyvalue
- the new value for the propertypublic void load(java.io.InputStream is) throws java.io.IOException
is
- the input stream
java.io.IOException
- if an I/O error should occurpublic void load(java.io.Reader reader) throws java.io.IOException
reader
- the reader
java.io.IOException
- if an I/O error should occur
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |