Class TrackerConfiguration.TrackerConfigurationBuilder
- Enclosing class:
- TrackerConfiguration
-
Method Summary
Modifier and TypeMethodDescriptionapiEndpoint
(URI apiEndpoint) The Matomo Tracking HTTP API endpoint, for example https://your-matomo-domain.example/matomo.phpbuild()
connectTimeout
(Duration connectTimeout) The timeout until a connection is established.defaultAuthToken
(String defaultAuthToken) The authorization token (parameter token_auth) to use if not specified explicitly.defaultSiteId
(Integer defaultSiteId) The default ID of the website that will be used if not specified explicitly.disableSslCertValidation
(boolean disableSslCertValidation) Disables SSL certificate validation.disableSslHostVerification
(boolean disableSslHostVerification) Disables SSL host verification.enabled
(boolean enabled) Allows to stop the tracker to send requests to the Matomo endpoint.logFailedTracking
(boolean logFailedTracking) Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code.The hostname or IP address of an optional HTTP proxy.proxyPassword
(String proxyPassword) The corresponding password for the basic auth proxy user.proxyPort
(int proxyPort) The port of an HTTP proxy.proxyUsername
(String proxyUsername) If the HTTP proxy requires a username for basic authentication, it can be configured here.socketTimeout
(Duration socketTimeout) The socket timeout (SO_TIMEOUT
), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.threadPoolSize
(int threadPoolSize) The thread pool size for the async sender.toString()
A custom user agent to be set.
-
Method Details
-
apiEndpoint
The Matomo Tracking HTTP API endpoint, for example https://your-matomo-domain.example/matomo.php- Returns:
this
.
-
defaultSiteId
The default ID of the website that will be used if not specified explicitly.- Returns:
this
.
-
defaultAuthToken
The authorization token (parameter token_auth) to use if not specified explicitly.- Returns:
this
.
-
enabled
Allows to stop the tracker to send requests to the Matomo endpoint.- Returns:
this
.
-
connectTimeout
The timeout until a connection is established.A timeout value of zero is interpreted as an infinite timeout. A `null` value is interpreted as undefined (system default if applicable).
Default: 5 seconds
- Returns:
this
.
-
socketTimeout
The socket timeout (SO_TIMEOUT
), which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets.A timeout value of zero is interpreted as an infinite timeout. A `null value is interpreted as undefined (system default if applicable).
Default: 5 seconds
- Returns:
this
.
-
proxyHost
The hostname or IP address of an optional HTTP proxy.proxyPort
must be configured as well- Returns:
this
.
-
proxyPort
The port of an HTTP proxy.proxyHost
must be configured as well.- Returns:
this
.
-
proxyUsername
public TrackerConfiguration.TrackerConfigurationBuilder proxyUsername(@Nullable String proxyUsername) If the HTTP proxy requires a username for basic authentication, it can be configured here. Proxy host, port and password must also be set.- Returns:
this
.
-
proxyPassword
public TrackerConfiguration.TrackerConfigurationBuilder proxyPassword(@Nullable String proxyPassword) The corresponding password for the basic auth proxy user. The proxy host, port and username must be set as well.- Returns:
this
.
-
userAgent
A custom user agent to be set. Defaults to "MatomoJavaClient"- Returns:
this
.
-
logFailedTracking
public TrackerConfiguration.TrackerConfigurationBuilder logFailedTracking(boolean logFailedTracking) Logs if the Matomo Tracking API endpoint responds with an erroneous HTTP code. Defaults to false.- Returns:
this
.
-
disableSslCertValidation
public TrackerConfiguration.TrackerConfigurationBuilder disableSslCertValidation(boolean disableSslCertValidation) Disables SSL certificate validation. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.Attention: This slows down performance
- Returns:
this
.- See Also:
-
disableSslHostVerification
-
disableSslHostVerification
public TrackerConfiguration.TrackerConfigurationBuilder disableSslHostVerification(boolean disableSslHostVerification) Disables SSL host verification. This is useful for testing with self-signed certificates. Do not use in production environments. Defaults to false.If you use the Java 11 of the Matomo Java Tracker, this setting is ignored. Instead, you have to set the system property
jdk.internal.httpclient.disableHostnameVerification
as described in the Module java.net.http.- Returns:
this
.- See Also:
-
disableSslCertValidation
-
threadPoolSize
The thread pool size for the async sender. Defaults to 2.Attention: If you use this library in a web application, make sure that this thread pool does not exceed the thread pool of the web application. Otherwise, you might run into problems.
- Returns:
this
.
-
build
-
toString
-