Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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
70
71
72
73
74
75
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
## Client Module
### API Flow
The ClientFactory provides fluent API clients both for **Sender** and **Subscriber**.
As the flow chart below shows, the fluent client guides through all essential calls in order to hand in a correct
**Submission** as well as receive submissions on the subscriber side.
#### Api client flow for sending a submission
For the actual sender client those calls look like this:
<table>
<tr>
<th>Workflow</th>
<th>Java sample calls</th>
</tr>
<tr>
<td>
```mermaid
flowchart TD
A[Create Client] --> B(Provide DestinationID)
B -->|next| C[Add Attachments]
C -->|send| D[SubmissionForPickup]
C -->|next| E[Add Data]
E -->|send| D[SubmissionForPickup]
```
</td>
<td>
```java
List<File> attachments...
// Send without data
ClientFactory.senderClient()
.withDestination(UUID.randomUUID())
.withAttachments(attachments)
.submit();
// Send with data
ClientFactory.senderClient()
.withDestination(UUID.randomUUID())
.withAttachments(attachments)
.withData("some json or xml content")
.submit();
```
</td>
</tr>
</table>
#### Api client flow for subscribing to a submission
<table>
<tr>
<th>Workflow</th>
<th>Java sample calls</th>
</tr>
<tr>
<td>
```mermaid
flowchart TD
A[Create Client] --> B(Poll List ofAvailable Submissions)
A[Create Client] --> C(Request Submission by ID)
B -->|next| C[Request Submission by ID]
C -->|get| D[Attachments]
C -->|get| E[Metadata]
C -->|get| F[Data]
```
</td>
<td>
```java
var client = ClientFactory.subscriberClient();
var submissions = client.getAvailableSubmissions(destinationId);
// filter submission list for requested one ...
var submission = client.requestSubmission(submissionId)
submission.getAttachments();
submission.getMetadata();
submission.getData();
```
</td>
</tr>
</table>