= Configuration [[config]]
== Upgrading to 6.0
Both busdox locator and bdxl locator are now configurable via oxalis.conf i.e following properties added:
----
lookup.locator.busdox.maxRetries=1
lookup.locator.busdox.timeout=30  # in seconds
lookup.locator.bdxl.maxRetries=1
lookup.locator.bdxl.timeout=30 # in seconds
----

== Upgrading to 5.0
Oxalis already supporting default CNAME lookup, so configuration 'lookup.locator.class' is Not required in ```oxalis.conf```.
If it exist then either remove it or comment it out:
#lookup.locator.class=network.oxalis.vefa.peppol.lookup.locator.BusdoxLocator

HTTP Client parameters (validate_after_inactivity & time_to_live) made configurable
----
oxalis.http.pool.validate_after_inactivity = 1000
oxalis.http.pool.time_to_live = 30
----

== Upgrading to 4.0 [[config-upgrade-4]]

This is an overview of keys used for configuration when converting from Oxalis version 2.x/3.x to Oxalis version 4.x.

As of version 4.0 is the configuration file named ```oxalis.conf```.

[cols="3*",options="header"]
|===
| oxalis-globals.properties (pre 4.0)
| oxalis.conf (4.0+)
| Default value (4.0+)

3+h| _Database_

| oxalis.datasource.jndi.name
| oxalis.database.jndi.resource
| jdbc/oxalis

| oxalis.jdbc.driver.class
| oxalis.database.driver.class
| org.h2.Driver

| oxalis.jdbc.class.path
| oxalis.database.driver.path
| _null_

| oxalis.jdbc.connection.uri
| oxalis.database.jdbc.connection
| jdbc:h2:file:data/oxalis

| oxalis.jdbc.dialect
2+^| _Removed_

| oxalis.jdbc.user
| oxalis.database.jdbc.username
| sa

| oxalis.jdbc.password
| oxalis.database.jdbc.password
| _blank_

| oxalis.jdbc.validation.query
| oxalis.database.dbcp.validation
| select 1

3+h| _HTTP_

| oxalis.connection.timeout
| oxalis.http.timeout.connect
| 0

| oxalis.read.timeout
| oxalis.http.timeout.read
| 0

3+h| _Keystore_

| oxalis.keystore
| oxalis.keystore.path
| oxalis-keystore.jks

| oxalis.keystore.password
| oxalis.keystore.password
| changeit

^| _New_
| oxalis.keystore.key.alias
| ap

^| _New_
| oxalis.keystore.key.password
| changeit

3+h| _Logging_

| oxalis.app.log.config
2+^| _Removed_

| oxalis.inbound.log.config
| oxalis.logging.config
| logback.xml

3+h| _Lookup_

| oxalis.sml.hostname
2+^| _Removed - Depending on mode_

3+h| _Mode_

| oxalis.operation.mode
2+^| _Removed - Detected using certificate_

3+h| _Proxy_

| oxalis.httpProxyHost
2.4+^.^| _See link:#_proxy[Proxy]._

| oxalis.httpProxyPort

| oxalis.proxyUser


| oxalis.proxyPassword


3+h| _Storage_

| oxalis.inbound.message.store
| oxalis.path.inbound
| inbound

1.2+<.^| oxalis.persistence.class.path
| oxalis.persister.payload.service
| default

| oxalis.persister.receipt.service
| default

3+h| _Truststore_

| oxalis.truststore.password
2+^| _Removed_

|===

== Database [[config-database]]

=== Data Source [[config-database-datasource]]

Oxalis supports two different datasources out of the box;

* ```dbcp``` - link:https://commons.apache.org/proper/commons-dbcp/[DBCP]
* ```jndi``` - JNDI

[source,conf]
.Default configuration
----
oxalis.database.datasource = dbcp
----

=== Driver [[config-database-driver]]

_This is used when setting Data Source to ```dbcp```._

[source,conf]
.Default configuration
----
oxalis.database.driver.class = org.h2.Driver
# oxalis.database.driver.path = (not set)
----

=== JDBC [[config-database-jdbc]]

_This is used when setting Data Source to ```dbcp```._

[source,conf]
.Default configuration
----
oxalis.database.jdbc.connection = "jdbc:h2:file:./data/oxalis"
oxalis.database.jdbc.username = sa
oxalis.database.jdbc.password = "" # (blank)
----

=== DBCP [[config-database-dbcp]]

_This is used when setting Data Source to ```dbcp```._

[source,conf]
.Default configuration
----
oxalis.database.dbcp.max.idle = 30
oxalis.database.dbcp.max.total = 100
oxalis.database.dbcp.validation = select 1
----

=== JNDI [[config-database-jndi]]

_This is used when setting Data Source to ```jndi```._

[source,conf]
.Default configuration
----
oxalis.database.jndi.resource = jdbc/oxalis
----

== File system [[config-filesystem]]

=== Home folder [[config-filesystem-home]]

Home folder is set as the first occurance in this list:

. Path specified in JDNI context with key ```java:comp/env/OXALIS_HOME```.
. Path specified as a Java property with key ```OXALIS_HOME```.
. Path specified as an environment variable with key ```OXALIS_HOME```.
. Path ```.oxalis``` in home folder.

=== Other folders [[config-filesystem-others]]

[source,conf]
.Default configuration
----
oxalis.path.conf = "" # Blank
oxalis.path.inbound = inbound
# oxalis.path.plugin = (not set)
----

== HTTP outbound [[config-http]]

Outbound HTTP connections use link:https://hc.apache.org/[Apache HttpComponents].


=== Connection pool [[config-http-pool]]

Oxalis uses a shared connection pool of keep-alive connections to speed up transmission.

[source,conf]
.Default configuration
----
oxalis.http.pool.max_route = 2
oxalis.http.pool.total = 20
oxalis.http.pool.validate_after_inactivity = 1000
oxalis.http.pool.time_to_live = 30
----

=== Proxy [[config-http-proxy]]

Proxy is configured using link:#config-java[Java properties] as described in the link:https://docs.oracle.com/javase/8/docs/api/java/net/doc-files/net-properties.html[Java 8 documentation].

.Some relevant properties
* java.net.useSystemProxies
* http.proxyHost
* http.proxyPort
* http.nonProxyHosts
* https.proxyHost
* https.proxyPort
* http.proxyUser
* http.proxyPassword

=== Timeouts [[config-http-timeout]]

[source,conf]
.Default configuration
----
oxalis.http.timeout.connect = 0
oxalis.http.timeout.read = 0
----

== Java properties [[config-java]]

It is recommended to set Java properties as part of running Oxalis - not having Oxalis set Java properties.

[source,concole]
.The recommended way of setting properties on command line.
----
java -Dhttp.proxyHost=10.0.0.50 -Dhttp.proxyPort=8080 ...
----

In some situations may it be needed to put Java properties in the configuration file. Java propterties in the configuration file will be set just after configuration is loaded.

Properties are added by simple prefixing them with ```oxalis.java```.

[source,conf]
.Example Java properties in Oxalis configuration file.
----
oxalis.java.http.proxyHost = 10.0.0.50
oxalis.java.http.proxyPort = 80
----


== Key store [[config-keystore]]

keystore.path::
Path to file containing key store. JKS is the historical format used, however PKCS#12 has shown to be possible to use as a replacement without changes to the code.
keystore.password::
Password used to unlock the provided key store.
keystore.key.alias::
Alias identifying the private key inside the key store to be used.
keystore.key.password::
Password used to unlock the private key to be used.

NOTE: All configuration of key store and key is case sensitive.

[source,conf]
.Default configuration (review carefully)
----
oxalis.keystore.path = oxalis-keystore.jks
oxalis.keystore.password = changeit
oxalis.keystore.key.alias = ap
oxalis.keystore.key.password = changeit
----


== Logging [[config-logging]]
