Class Options
- java.lang.Object
-
- com.sodius.oslc.server.Options
-
public class Options extends Object
Defines options that can adapt the capabilities provided by thecom.sodius.oslc.server
plug-in. Options can be set as Java System properties or as servlet context parameters.- Since:
- 1.5.0
-
-
Field Summary
Fields Modifier and Type Field 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_ENABLE_PROXY_REDIRECT
Use JAX-RS redirect (HTTP 307), instead of servlet dispatch, when a Proxy service receives a request to a local resource.static String
OPTION_FORCE_XML_ABBREVIATED
When set totrue
, this option forces replyingapplication/xml
ifapplication/rdf+xml
is requested for Service Provider Catalog and Service Provider resources.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
enableBasicUnsecure(boolean enable)
Set the property to enable or not the basic authorization when doing HTTP.static void
enableProxyRedirect(boolean enable)
Sets the property to enable JAX-RS redirect (HTTP 307), instead of servlet dispatch, when a Proxy service receives a request to a local resource.static void
setAccessLogHeaders(String... headers)
Adds the headers given to system property.static void
setEnabledLocales(Locale... locales)
Adds the given locales to system property.
-
-
-
Field Detail
-
OAUTH_TOKEN_CACHE_DURATION
public static final String OAUTH_TOKEN_CACHE_DURATION
The duration in minutes for which an OAuth token can be cached before it expires and becomes rejected.Default value: 120
- Since:
- 1.8.0
- See Also:
- Constant Field Values
-
OPTION_FORCE_XML_ABBREVIATED
public static final String OPTION_FORCE_XML_ABBREVIATED
When set totrue
, this option forces replyingapplication/xml
ifapplication/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 ifapplication/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.
- See Also:
- Constant Field Values
-
ENABLED_LOCALES
public static final String ENABLED_LOCALES
Determines the set of locales that are enabled on server side.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.
- Since:
- 1.13.0
- See Also:
OslcRequests.getLocales()
,setEnabledLocales(Locale...)
, Constant Field Values
-
OPTION_ACCESS_LOG_HEADERS
public static final String OPTION_ACCESS_LOG_HEADERS
Allows to indicate the headers to log from request and response.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.
- Since:
- 1.14.0
- See Also:
AccessLogFilter
, Constant Field Values
-
OPTION_ENABLE_BASIC_UNSECURE
public static final String OPTION_ENABLE_BASIC_UNSECURE
Allows to authorize basic authentication with an HTTP protocol.The value must be true if needed.
False by default.
- Since:
- 2.1.0
- See Also:
OAuthFilter
, Constant Field Values
-
OPTION_ENABLE_PROXY_REDIRECT
public static final String OPTION_ENABLE_PROXY_REDIRECT
Use JAX-RS redirect (HTTP 307), instead of servlet dispatch, when a Proxy service receives a request to a local resource.- Since:
- 3.3.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
setEnabledLocales
public static final void setEnabledLocales(Locale... locales)
Adds the given locales to system property.- Parameters:
locales
- The collection of locales to enable.- Since:
- 1.14.0
- See Also:
ENABLED_LOCALES
-
setAccessLogHeaders
public static void setAccessLogHeaders(String... headers)
Adds the headers given to system property.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.
- Parameters:
headers
- The collection of headers to log when debugging.- Since:
- 1.14.0
-
enableBasicUnsecure
public static void enableBasicUnsecure(boolean enable)
Set the property to enable or not the basic authorization when doing HTTP.- Parameters:
enable
- true to enable BASIC authorizaton with HTTP protocol, false otherwise.- Since:
- 2.1.0
-
enableProxyRedirect
public static void enableProxyRedirect(boolean enable)
Sets the property to enable JAX-RS redirect (HTTP 307), instead of servlet dispatch, when a Proxy service receives a request to a local resource.- Parameters:
enable
- true to enable JAX-RS redirect, false to keep servlet dispatch.- Since:
- 3.3.0
-
-