Newer
Older
<br />
<div align="center"><img src="https://www.fitko.de/fileadmin/_processed_/b/9/csm_FIT-Connect_3e8e926015.jpg" alt="Logo" width="50%" height="50%"> </div>
## About the FIT-Connect Java SDK
The Java SDk for FIT-Connect enables to build clients for senders and subscribers of the platform 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 of subscribing to handed in submissions as a subscriber.
For further information check out the official API docs: [FIT-Connect Documentation](https://docs.fitko.de/fit-connect/docs/) as well as the:
* Self-Service-Portal under https://portal.auth-dev.fit-connect.fitko.dev/
* Official Fit-Connect Project Page https://www.fitko.de/projektmanagement/fit-connect
### Build Dependencies
This section lists major frameworks/libraries used in the SDK.
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
* Java 11 (LTS)
* Maven 3.x
* Junit 5
Further 3rd party dependencies:
* Nimbus-Jose JWT
* Spring Web/HTTP
* Jackson FasterXMl
* JCommander
* Typesafe Config
## Getting Started
How to set up the SDK project locally.
### Prerequisites
* Java Runtime >= 11, check your current setup in your commandline
```sh
java --version
```
<p align="right">(<a href="#top">back to top</a>)</p>
### Modules
See the projects' module documentation for more specific information:
* [API Module ](api/README.md)
* [Core Module ](core/README.md)
* [Client Module ](client/README.md)
* [Open-API Module ](open-api/README.md)
### Setup
_The following steps show how to get the SDK running_
1. Create and [account](https://docs.fitko.de/fit-connect/docs/getting-started/account) on the self service portal
2. Get your sender/subscriber API-key credentials
3. Clone the sdk repo
```sh
git clone https://git.fitko.de/fit-connect/sdk-java
```
4. Build the project
```sh
mvn clean install
```
5. Enter your API keys and references to your private decryption key in `sdk.conf`
<p align="right">(<a href="#top">back to top</a>)</p>
Configuration properties e.g. for REST-API urls and proxy settings can be found in the [HOCON](https://github.com/lightbend/config/blob/main/HOCON.md)
config ``sdk.conf`` within the root folder of the project.
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
In order to run the SDK client a configuration needs to be provided as file in the same path as the jar (e.g. when the commandline client is used) or via reference using the environment variable ``CONFIG_LOCATION`` (e.g. when the SDK i used programmatically).
<p align="right">(<a href="#top">back to top</a>)</p>
## Usage
#### Sending
```java
List<File> attachments = ... // Load e.g from local file system
ClientFactory.senderClient()
.withDestination(UUID.randomUUID())
.withServiceType("ServiceName", "leika:key:service")
.withAttachments(attachments)
.withJsonData("{ caseSpecific: 'Data' }")
.submit();
```
#### Subscribing
```java
var client = ClientFactory.subscriberClient();
var submissions = client.getAvailableSubmissions(destinationId);
var submissionId = ... // filter submission list for requested one ...
var submission = client.requestSubmission(submissionId)
submission.getAttachments();
submission.getMetadata();
submission.getData();
```
<p align="right">(<a href="#top">back to top</a>)</p>
## Roadmap
- [ ] Add Routing features
- [ ] Add Callback handling
See the [open issues](https://git.fitko.de/fit-connect/planning/-/boards?search=SDK) for a full list of proposed features (and known issues).
<p align="right">(<a href="#top">back to top</a>)</p>
<!-- CONTACT -->
## Contact
[FIT-Connect Contact Page](https://docs.fitko.de/fit-connect/contact/) for further information
<p align="right">(<a href="#top">back to top</a>)</p>