public class Options extends Object
com.sodius.oslc.server
plug-in.
Options can be set as Java System properties or as servlet context parameters.Modifier and Type | Field and Description |
---|---|
static String |
ENABLED_LOCALES
Determines the set of locales that are enabled on server side.
|
static String |
OAUTH_TOKEN_CACHE_DURATION
The duration in minutes for which an OAuth token can be cached before it expires and becomes rejected.
|
static String |
OPTION_ACCESS_LOG_HEADERS
Allows to indicate the headers to log from request and response.
|
static String |
OPTION_ENABLE_BASIC_UNSECURE
Allows to authorize basic authentication with an HTTP protocol.
|
static String |
OPTION_FORCE_XML_ABBREVIATED
When set to
true , this option forces replying application/xml
if application/rdf+xml is requested for Service Provider Catalog and Service Provider resources. |
Modifier and Type | Method and Description |
---|---|
static void |
enableBasicUnsecure(boolean enable)
Set the property to enable or not the basic authorization when doing HTTP.
|
static void |
setAccessLogHeaders(String... headers)
Adds the headers given to system property.
|
static void |
setEnabledLocales(Locale... locales)
Adds the given locales to system property.
|
public static final String OAUTH_TOKEN_CACHE_DURATION
Default value: 120
public static final String OPTION_FORCE_XML_ABBREVIATED
true
, this option forces replying application/xml
if application/rdf+xml
is requested for Service Provider Catalog and Service Provider resources.
It is to use for both DOORS Family and DOORS Next Generation that request application/rdf+xml
content
but only correctly process the response if application/xml
is actually returned.
Default value is false
.
Important note: This option can only be set as a Java System property. It cannot be set as a servlet context parameter.
public static final String ENABLED_LOCALES
Some translations are provided for messages defined in the framework. When a product does not fully support languages handled in the framework, it is recommended to set this property to narrow down the list of enabled languages, so there's not a mix of languages in the user interfaces.
The value must be a comma separated list of locales, e.g. "FR,EN"
.
The order in the property value is not important, as this list is just to filter the values in the Accept-Language header sent by client,
where the order for preferred locales is defined.
A product can use following code to force using English, at initialization phase:
System.setProperty(Options.ENABLED_LOCALES, Locale.ENGLISH.toString());
Default value is null
, which means no filtering is made on locales requested by client.
Important note: This option can only be set as a Java System property. It cannot be set as a servlet context parameter.
OslcRequests.getLocales()
,
setEnabledLocales(Locale...)
,
Constant Field Valuespublic static final String OPTION_ACCESS_LOG_HEADERS
The value must be a comma separated list of headers, e.g. Accept,Content-Type
.
No headers are logged by default.
Important note: This option can only be set at initialization time, changing it after initialization will not be taking into account.
AccessLogFilter
,
Constant Field Valuespublic static final String OPTION_ENABLE_BASIC_UNSECURE
The value must be true if needed.
False by default.
OAuthFilter
,
Constant Field Valuespublic static final void setEnabledLocales(Locale... locales)
locales
- The collection of locales to enable.ENABLED_LOCALES
public static void setAccessLogHeaders(String... headers)
Important note: This option can only be set at initialization time, changing it after initialization will not be taking into account. This method will not have any effect if context parameters are used, as system properties won't override context parameters.
headers
- The collection of headers to log when debugging.public static void enableBasicUnsecure(boolean enable)
enable
- true to enable BASIC authorizaton with HTTP protocol, false otherwise.