public class Configuration extends Object
| Constructor and Description |
|---|
Configuration(ConfigurationLoader configurationLoader,
Map<?,?> config) |
| Modifier and Type | Method and Description |
|---|---|
String |
get(String propertyKey,
String defaultValue) |
boolean |
getBoolean(String propertyKey,
boolean defaultValue) |
<T> Class<? extends T> |
getClass(String propertyKey) |
<T> Class<? extends T> |
getClass(String propertyKey,
Class<? extends T> defaultClass) |
org.json.JSONObject |
getConfigurationInfo() |
Integer |
getInt(String propertyKey) |
Integer |
getInt(String propertyKey,
Integer defaultValue) |
org.json.JSONObject |
getJsonProperties() |
Iterable<String> |
getKeys() |
Iterable<String> |
getKeys(String keyPrefix) |
static SortedMap<String,Map<String,String>> |
getMultiValue(Iterable<Map.Entry<String,String>> config,
String prefix)
Processing configuration items that looks like this:
|
Map<String,Map<String,String>> |
getMultiValue(String prefix)
Similar to
getMultiValue(java.lang.Iterable, java.lang.String) but uses the internal
configuration state. |
<T> Map<String,T> |
getMultiValueConfigurables(String prefix,
Class<T> configurableType)
Similar to
getMultiValue(java.lang.String), but returns a new instance of
a configurable type for each prefix. |
Map<String,String> |
getSubset(String keyPrefix) |
void |
set(String propertyKey,
Object value) |
static void |
setConfigurables(Object o,
Map<String,String> config) |
void |
setConfigurables(Object o,
String keyPrefix) |
org.json.JSONObject |
toJSON(Locale locale) |
org.json.JSONObject |
toJSON(ResourceBundle resourceBundle) |
Map |
toMap() |
String |
toString() |
public static final String BASE_URL
public static final String HDFS_LIB_SOURCE_DIRECTORY
public static final String HDFS_LIB_TEMP_DIRECTORY
public static final String HDFS_USER_NAME
public static final String HDFS_USER_NAME_DEFAULT
public static final String ZK_SERVERS
public static final String LOCK_REPOSITORY
public static final String TRACE_REPOSITORY
public static final String USER_REPOSITORY
public static final String SEARCH_REPOSITORY
public static final String WORKSPACE_REPOSITORY
public static final String GRAPH_AUTHORIZATION_REPOSITORY
public static final String ONTOLOGY_REPOSITORY
public static final String USER_SESSION_COUNTER_REPOSITORY
public static final String WORK_QUEUE_REPOSITORY
public static final String LONG_RUNNING_PROCESS_REPOSITORY
public static final String DIRECTORY_REPOSITORY
public static final String SIMPLE_ORM_SESSION
public static final String HTTP_REPOSITORY
public static final String GEOCODER_REPOSITORY
public static final String EMAIL_REPOSITORY
public static final String STATUS_REPOSITORY
public static final String ONTOLOGY_REPOSITORY_OWL
public static final String ACL_PROVIDER_REPOSITORY
public static final String FILE_SYSTEM_REPOSITORY
public static final String AUTHORIZATION_REPOSITORY
public static final String PRIVILEGE_REPOSITORY
public static final String GRAPH_PROVIDER
public static final String VISIBILITY_TRANSLATOR
public static final String WEB_CONFIGURATION_PREFIX
public static final String WEB_GEOCODER_ENABLED
public static final String MAPZEN_TILE_API_KEY
public static final String DEV_MODE
public static final boolean DEV_MODE_DEFAULT
public static final String PLUGIN_DEV_MODE
public static final boolean PLUGIN_DEV_MODE_DEFAULT
public static final String DEFAULT_SEARCH_RESULT_COUNT
public static final String LOCK_REPOSITORY_PATH_PREFIX
public static final String DEFAULT_LOCK_REPOSITORY_PATH_PREFIX
public static final String USER_SESSION_COUNTER_PATH_PREFIX
public static final String DEFAULT_TIME_ZONE
public static final String RABBITMQ_PREFETCH_COUNT
public static final String QUEUE_PREFIX
public static final String STATUS_ZK_PATH
public static final String DEFAULT_STATUS_ZK_PATH
public static final String STATUS_PORT_RANGE
public static final String DEFAULT_STATUS_PORT_RANGE
public static final String COMMENTS_AUTO_PUBLISH
public static final boolean DEFAULT_COMMENTS_AUTO_PUBLISH
public static final String STATUS_REFRESH_INTERVAL_SECONDS
public static final int STATUS_REFRESH_INTERVAL_SECONDS_DEFAULT
public static final String STATUS_ENABLED
public static final boolean STATUS_ENABLED_DEFAULT
public static final String SYSTEM_PROPERTY_PREFIX
public static final String HTTP_GZIP_ENABLED
public Configuration(ConfigurationLoader configurationLoader, Map<?,?> config)
public boolean getBoolean(String propertyKey, boolean defaultValue)
public <T> Class<? extends T> getClass(String propertyKey, Class<? extends T> defaultClass)
public Map toMap()
public org.json.JSONObject toJSON(Locale locale)
public org.json.JSONObject toJSON(ResourceBundle resourceBundle)
public org.json.JSONObject getJsonProperties()
public <T> Map<String,T> getMultiValueConfigurables(String prefix, Class<T> configurableType)
getMultiValue(java.lang.String), but returns a new instance of
a configurable type for each prefix.
Given the following configuration:
repository.ontology.owl.dev.iri=http://visallo.org/dev
repository.ontology.owl.dev.dir=examples/ontology-dev/
repository.ontology.owl.csv.iri=http://visallo.org/csv
repository.ontology.owl.csv.dir=storm/plugins/csv/ontology/
And the following class.
class OwlItem {
@Configurable
public String iri;
@Configurable
public String dir;
}
Would produce a map with two keys "dev" and "csv" mapped to an OwlItem object.prefix - The configuration key prefixconfigurableType - The type of each configurable object to create instances ofpublic Map<String,Map<String,String>> getMultiValue(String prefix)
getMultiValue(java.lang.Iterable, java.lang.String) but uses the internal
configuration state.public static SortedMap<String,Map<String,String>> getMultiValue(Iterable<Map.Entry<String,String>> config, String prefix)
repository.ontology.owl.dev.iri=http://visallo.org/dev
repository.ontology.owl.dev.dir=examples/ontology-dev/
repository.ontology.owl.csv.iri=http://visallo.org/csv
repository.ontology.owl.csv.dir=storm/plugins/csv/ontology/
Into a hash like this:
- dev
- iri: http://visallo.org/dev
- dir: examples/ontology-dev/
- csv
- iri: http://visallo.org/csv
- dir: storm/plugins/csv/ontology/public org.json.JSONObject getConfigurationInfo()
Copyright © 2013–2017 V5 Analytics. All rights reserved.