public static class ClientConfiguration.Builder extends Object
| Modifier and Type | Method and Description |
|---|---|
ClientConfiguration.Builder |
addDocumentBundleProcessor(DocumentBundleProcessor processor)
Add a
DocumentBundleProcessor which will be passed the generated zipped document bundle
together with the job it was created for. |
ClientConfiguration |
build() |
ClientConfiguration.Builder |
connectTimeoutMillis(int millis)
Override the
default connect timeout value. |
ClientConfiguration.Builder |
customizeJaxRs(Consumer<? super javax.ws.rs.core.Configurable<? extends javax.ws.rs.core.Configuration>> customizer)
This methods allows for custom configuration of JAX-RS (i.e.
|
ClientConfiguration.Builder |
enableDocumentBundleDiskDump(Path directory)
Have the library dump the generated document bundle zip files to disk before they are
sent to the service to create signature jobs.
|
ClientConfiguration.Builder |
enableRequestAndResponseLogging()
Makes the client log the sent requests and received responses to the logger named
ClientConfiguration.HTTP_REQUEST_RESPONSE_LOGGER_NAME. |
ClientConfiguration.Builder |
globalSender(Sender sender)
Set the sender used globally for every signature job.
|
ClientConfiguration.Builder |
includeInUserAgent(String userAgentCustomPart)
Customize the
User-Agent header value to include the
given string. |
ClientConfiguration.Builder |
serviceUri(ServiceUri environment)
Set the service URI to one of the predefined environments.
|
ClientConfiguration.Builder |
serviceUri(URI uri)
Override the service endpoint URI to a custom environment.
|
ClientConfiguration.Builder |
socketTimeoutMillis(int millis)
Override the
default socket timeout value. |
ClientConfiguration.Builder |
trustStore(Certificates certificates) |
ClientConfiguration.Builder |
trustStore(Iterable<String> certificatePaths)
Override the trust store configuration to load DER-encoded certificates from the given folder(s).
|
ClientConfiguration.Builder |
trustStore(String... certificatePaths)
Override the trust store configuration to load DER-encoded certificates from the given folder(s).
|
ClientConfiguration.Builder |
usingClock(Clock clock)
Allows for overriding which
Clock is used to convert between Java and XML,
may be useful for e.g. |
public ClientConfiguration.Builder serviceUri(ServiceUri environment)
public ClientConfiguration.Builder serviceUri(URI uri)
public ClientConfiguration.Builder socketTimeoutMillis(int millis)
default socket timeout value.public ClientConfiguration.Builder connectTimeoutMillis(int millis)
default connect timeout value.public ClientConfiguration.Builder trustStore(Certificates certificates)
public ClientConfiguration.Builder trustStore(String... certificatePaths)
public ClientConfiguration.Builder trustStore(Iterable<String> certificatePaths)
public ClientConfiguration.Builder globalSender(Sender sender)
Use PortalJob.Builder.withSender(Sender) or DirectJob.Builder.withSender(Sender)
if you need to specify different senders per signature job (typically when acting as a broker on
behalf of multiple other organizations)
public ClientConfiguration.Builder includeInUserAgent(String userAgentCustomPart)
User-Agent header value to include the
given string.userAgentCustomPart - The custom part to include in the User-Agent HTTP header.public ClientConfiguration.Builder enableRequestAndResponseLogging()
ClientConfiguration.HTTP_REQUEST_RESPONSE_LOGGER_NAME.public ClientConfiguration.Builder enableDocumentBundleDiskDump(Path directory)
The files will be given names on the format
timestamp-[reference_from_job-]asice.zip
The timestamp part may use a clock of your choosing, make sure to override the system clock with
usingClock(Clock) before calling this method if that is desired.
The reference_from_job part is only included if the job is given such a reference using
DirectJob.Builder.withReference(..) or PortalJob.Builder.withReference(..).
directory - the directory to dump to. This directory must already exist, or
creating new signature jobs will fail. Miserably.public ClientConfiguration.Builder addDocumentBundleProcessor(DocumentBundleProcessor processor)
DocumentBundleProcessor which will be passed the generated zipped document bundle
together with the job it was created for. The processor is not responsible for closing
the stream, as this is handled by the library itself.
processor - the DocumentBundleProcessor which will be passed the generated zipped document bundle
together with the job it was created for.public ClientConfiguration.Builder customizeJaxRs(Consumer<? super javax.ws.rs.core.Configurable<? extends javax.ws.rs.core.Configuration>> customizer)
ClientConfiguration.Builder.
This method should not be used to configure anything that is already directly supported by the
ClientConfiguration.Builder API.
If you still need to use this method, consider requesting first-class support for your requirement on the library's web site on GitHub.
customizer - The operations to do on the JAX-RS Configurable, e.g.
registering components.public ClientConfiguration.Builder usingClock(Clock clock)
Clock is used to convert between Java and XML,
may be useful for e.g. automated tests.
Uses the best available system clock if not specified.
public ClientConfiguration build()
Copyright © 2019 Digipost. All rights reserved.