Class Options
com.sodius.oslc.server plug-in.
Options can be set as Java System properties or as servlet context parameters.- Since:
- 1.5.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDetermines the set of locales that are enabled on server side.static final StringThe duration in minutes for which an OAuth token can be cached before it expires and becomes rejected.static final StringAllows to indicate the headers to log from request and response.static final StringAllows to indicate the sensitive headers to mask their value while logging from request and response.static final StringAllows to authorize basic authentication with an HTTP protocol.static final StringUse JAX-RS redirect (HTTP 307), instead of servlet dispatch, when a Proxy service receives a request to a local resource.static final StringWhen set totrue, this option forces replyingapplication/xmlifapplication/rdf+xmlis requested for Service Provider Catalog and Service Provider resources. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidenableBasicUnsecure(boolean enable) Set the property to enable or not the basic authorization when doing HTTP.static voidenableProxyRedirect(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 voidsetAccessLogHeaders(String... headers) Adds the given headers to theOPTION_ACCESS_LOG_HEADERSsystem property.static voidsetAccessLogMaskedHeaders(String... headers) Adds the given headers to theOPTION_ACCESS_LOG_MASKED_HEADERSsystem property.static final voidsetEnabledLocales(Locale... locales) Adds the given locales to system property.
-
Field Details
-
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:
-
OPTION_FORCE_XML_ABBREVIATED
When set totrue, this option forces replyingapplication/xmlifapplication/rdf+xmlis 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+xmlcontent but only correctly process the response ifapplication/xmlis 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:
-
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:
-
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 taken into account.
- Since:
- 1.14.0
- See Also:
-
OPTION_ACCESS_LOG_MASKED_HEADERS
Allows to indicate the sensitive headers to mask their value while logging from request and response.The value must be a comma separated list of headers, e.g.
Authorization,X-Sensitive-Header.No header is considered sensitive by default.
Important note: This option can only be set at initialization time, changing it after initialization will not be taken into account.
- Since:
- 4.0.0
- See Also:
-
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:
-
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:
-
-
Method Details
-
setEnabledLocales
Adds the given locales to system property.- Parameters:
locales- The collection of locales to enable.- Since:
- 1.14.0
- See Also:
-
setAccessLogHeaders
Adds the given headers to theOPTION_ACCESS_LOG_HEADERSsystem 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
-
setAccessLogMaskedHeaders
Adds the given headers to theOPTION_ACCESS_LOG_MASKED_HEADERSsystem 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 mask when logging.- Since:
- 4.0.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
-