Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
FIT-Connect-SDK - Java
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
FIT-Connect-SDK - Java
Commits
1da071b3
Commit
1da071b3
authored
2 years ago
by
Martin Vogel
Browse files
Options
Downloads
Patches
Plain Diff
#414 Adjust to renamed model classes
parent
892d828d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!2
#414 Remaining changes from MR
,
!1
planning#414 Methoden Signaturen (Zwischenstand)
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/src/main/java/de/fitko/fitconnect/api/services/Sender.java
+22
-24
22 additions, 24 deletions
...rc/main/java/de/fitko/fitconnect/api/services/Sender.java
with
22 additions
and
24 deletions
api/src/main/java/de/fitko/fitconnect/api/services/Sender.java
+
22
−
24
View file @
1da071b3
...
...
@@ -5,20 +5,20 @@ import de.fitko.fitconnect.api.domain.auth.OAuthToken;
import
de.fitko.fitconnect.api.domain.model.metadata.Metadata
;
import
de.fitko.fitconnect.api.domain.model.metadata.attachment.Attachment
;
import
de.fitko.fitconnect.api.domain.model.metadata.data.Data
;
import
de.fitko.fitconnect.api.domain.model.submission.Submission
Request
;
import
de.fitko.fitconnect.api.domain.model.submission.
Created
Submission
;
import
de.fitko.fitconnect.api.domain.model.submission.Submission
ForPickup
;
import
de.fitko.fitconnect.api.domain.model.submission.Submission
Submit
;
import
de.fitko.fitconnect.api.domain.validation.ValidationResult
;
import
de.fitko.fitconnect.api.exceptions.*
;
import
java.io.File
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.UUID
;
/**
* A technical system that creates a submission via the FIT-Connect Submission API.
* <p>
* The Sender acts as a common interface wrapping all client functionality to authenticate <p>
* and create a valid {@link Submission
Reques
t} including encrypted {@link Data} and {@link Attachment}s
* and create a valid {@link Submission
Submi
t} including encrypted {@link Data} and {@link Attachment}s
*
* @see <a href="https://docs.fitko.de/fit-connect/docs/sending/overview">Sending Submissions</a>
*/
...
...
@@ -36,39 +36,39 @@ public interface Sender {
* Encrypts the submission data payload (json or xml) with JWE (JSON-Web-Encryption).
*
* @param publicKey the public encryption key the data is encrypted with
* @param data the {@link Data} payload that is encrypted
* @param data
the {@link Data} payload that is encrypted
* @return the JWE-encrypted {@link Data}, is empty if en error occurred
*/
Optional
<
Data
>
encryptSubmissionData
(
final
RSAKey
publicKey
,
final
Data
data
);
Data
encryptSubmissionData
(
final
RSAKey
publicKey
,
final
Data
data
)
throws
EncryptionException
;
/**
* Encrypts the submission attachment binary data with JWE (JSON-Web-Encryption).
*
* @param publicKey the public encryption key the attachment is encrypted with
* @param publicKey
the public encryption key the attachment is encrypted with
* @param attachment the {@link Attachment} that is encrypted
* @return the JWE-encrypted {@link Attachment}, is empty if en error occurred
*/
Optional
<
Attachment
>
encryptAttachment
(
final
RSAKey
publicKey
,
final
Attachment
attachment
);
Attachment
encryptAttachment
(
final
RSAKey
publicKey
,
final
Attachment
attachment
)
throws
EncryptionException
;
/**
* Authenticates the {@link Sender} against the FitConnect-Auth-API and retrieves an {@link OAuthToken}.
*
* @param clientId a unique client identifier
* @param clientId
a unique client identifier
* @param clientSecret the applications secret key
* @param scope 1 or more client scopes that determine if a submission is accepted by the client
* @param scope
1 or more client scopes that determine if a submission is accepted by the client
* @return {@link OAuthToken}, is empty if an error occurred
*/
Optional
<
OAuthToken
>
retrieveOAuthToken
(
final
String
clientId
,
final
String
clientSecret
,
final
String
...
scope
);
OAuthToken
retrieveOAuthToken
(
final
String
clientId
,
final
String
clientSecret
,
final
String
...
scope
)
throws
AuthenticationException
;
/**
* Creates and uploads a {@link Metadata} object that contains {@link Data}, {@link Attachment} and their hashes so a subscriber
* can verify the integrity.
*
* @param data {@link Data} object of the json or xml payload
* @param data
{@link Data} object of the json or xml payload
* @param attachments a list of binary {@link Attachment}s
* @return a valid {@link Metadata} object with hashed {@link Data} and {@link Attachment}s, is empty if an error occurred
*/
Optional
<
Metadata
>
createMetadata
(
final
Data
data
,
final
List
<
Attachment
>
attachments
);
Metadata
createMetadata
(
final
Data
data
,
final
List
<
Attachment
>
attachments
)
throws
MetadataNotCreatedException
;
/**
* Creates and uploads a {@link Metadata} object that contains {@link Data}, {@link Attachment} and their hashes so a subscriber
...
...
@@ -77,30 +77,28 @@ public interface Sender {
* @param attachments a list of binary {@link Attachment}s
* @return a valid {@link Metadata} object with hashed {@link Data} and {@link Attachment}s, is empty if an error occurred
*/
Optional
<
Metadata
>
createMetadata
(
final
List
<
Attachment
>
attachments
);
Metadata
createMetadata
(
final
List
<
Attachment
>
attachments
)
throws
MetadataNotCreatedException
;
/**
* Creates and announces a new {@link Submission
Reques
t}
* Creates and announces a new {@link Submission
Submi
t}
*
* @param submission with a destinationId, a list of attachmentIds and a serviceType
* @return the created submission
*/
Optional
<
Created
Submission
>
createSubmission
(
Submission
Reques
t
submission
);
Submission
ForPickup
createSubmission
(
Submission
Submi
t
submission
)
throws
SubmissionNotCreatedException
;
/**
* Posts the announced {@link Submission
Reques
t}
* Posts the announced {@link Submission
Submi
t}
*
* @param submissionId identifier of the announced submission
* @param submissionId
identifier of the announced submission
* @param encryptedMetadata the encrypted metadata
*
* @return the submission
*/
Optional
<
CreatedSubmission
>
sendSubmission
(
UUID
submissionId
,
Metadata
encryptedMetadata
);
SubmissionForPickup
sendSubmission
(
UUID
submissionId
,
Metadata
encryptedMetadata
)
throws
SubmissionNotSentException
;
void
uploadAttachments
(
UUID
submissionId
,
List
<
Attachment
>
encryptedAttachments
);
void
uploadAttachments
(
UUID
submissionId
,
List
<
Attachment
>
encryptedAttachments
)
throws
AttachmentUploadException
;
Optional
<
Attachment
>
createAttachment
(
File
file
);
Attachment
createAttachment
(
File
file
)
throws
AttachmentCreationException
;
RSAKey
getEncryptionKeyForDestination
(
UUID
destinationId
);
RSAKey
getEncryptionKeyForDestination
(
UUID
destinationId
)
throws
KeyNotRetrievedException
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment