Official Java SDK Documentation
Please find project tutorials and detailed usage information on FIT-Connect Java-SDK
FIT-Connect User Guide
The Java SDK for FIT-Connect enables to build clients for senders and subscribers without directly interacting with any REST-Endpoints. It provides a simple fluent API that guides through the creation and sending of a submission, as well as receiving submissions as a subscriber.
For further information, check out the official docs: FIT-Connect Documentation as well as the:
Installation and Getting Started
To add a dependency on FIT-Connect using Maven, use the following snippet:
<dependency>
<groupId>dev.fitko.fitconnect.sdk</groupId>
<artifactId>client</artifactId>
<version>[Latest Version]</version>
</dependency>
With [Latest Version]
of the last stable build or snapshot.
If you use a snapshot version, please add the maven snapshot repo to your pom.
<repositories>
<repository>
<id>maven-snapshots</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>
The reference documentation includes detailed docs on the sdk-setup, as well as guides for sending and receiving submissions.
Here is a quick teaser of the usage of a SenderClient
:
import dev.fitko.fitconnect.api.*;
import dev.fitko.fitconnect.client.SenderClient;
import dev.fitko.fitconnect.client.bootstrap.ApplicationConfigLoader;
import dev.fitko.fitconnect.client.bootstrap.ClientFactory;
public class Example {
private static final Logger LOGGER = LoggerFactory.getLogger(Example.class);
public static void main(String[] args) {
final SendableSubmission submission = SendableSubmission.Builder()
.setDestination(UUID.fromString("YOUR_DESTINATION_ID"))
.setServiceType("urn:de:fim:leika:leistung:99400048079000", "Test-Service")
.setJsonData(getDataAsString("/data.json"), URI.create("https://schema.fitko.de/fim/sample.schema.json"))
.addAttachment(Attachment.fromPath(Path.of("path/to/sample.pdf"), MimeType.APPLICATION_PDF.value()))
.build();
final ApplicationConfig config = ApplicationConfigLoader.loadConfigFromPath(Path.of("config.yml"));
final SenderClient senderClient = ClientFactory.createSenderClient(config);
final SentSubmission sentSubmission = senderClient.send(submission);
final Status status = senderClient.getSubmissionStatus(sentSubmission);
LOGGER.info("Current status for submission {}: {}", status.getSubmissionId(), status.getState());
}
}
Building from source
As an alternative to the pre-compiled maven artifact, the source code of the Java-SDK can be used to create a custom local build. The SDK requires a JDK >= 11 to be built, check your current setup in your commandline
java --version
Then, clone the repo with git clone
:
git clone https://git.fitko.de/fit-connect/sdk-java.git
Fetch the gitlab submodules after cloning:
git submodule update --init --recursive
Build via Maven-Wrapper:
./mvnw clean package -DskipTests
The client artifact is available in {projekt.dir}/client/target
after a successful build.
Build Dependencies
This section lists major frameworks/libraries used in the SDK.
- JDK 11
- Maven 3.x
- Junit 5
FIT-Connect dependencies:
Further 3rd party dependencies:
Coming up features
- Improved Certificate Handling & Key Generation
See the open issues for a full list of proposed features (and known issues).
Contact
FIT-Connect Contact Page for further information
License
Source code is licensed under the EUPL.
Rechtlicher Hinweis: Dieses Software Development Kit (SDK) ist dazu bestimmt, die Anbindung einer Software an die FIT-Connect-Infrastruktur zu ermöglichen. Hierfür kann das SDK in die anzubindende Software integriert werden. Erfolgt die Integration des SDK in unveränderter Form, liegt keine Bearbeitung im Sinne der EUPL bzw. des deutschen Urheberrechts vor. Die Art und Weise der Verlinkung des SDK führt insbesondere nicht zur Schaffung eines abgeleiteten Werkes. Die unveränderte Übernahme des SDK in eine anzubindende Software führt damit nicht dazu, dass die anzubindende Software unter den Bedingungen der EUPL zu lizenzieren ist. Für die Weitergabe des SDK selbst - in unveränderter oder bearbeiteter Form, als Quellcode oder ausführbares Programm - gelten die Lizenzbedingungen der EUPL in unveränderter Weise.