Newer
Older
## API Module
The API-module contains interfaces and domain model value classes that provide the basic functionality to build an
sdk-client.
### Structure
- **api.domain** - contains all model classes and domain related pojos
- **api.exceptions** - all use case specific the services throw
- **api.services** - all services to authenticate, encrypt, validate and perform REST-requests
There are two service facade interfaces that provide a client centric wrapper around the underlying services,
- **Sender** - create a submission, announce attachments, encrypt and send the submission including metadata
- **Subscriber** - poll, receive and decrypt submissions and confirm their valid transmission
### Service Architecture
Apart from the ClientFactory the overall service architecture focuses on composition and has no inherited dependencies.
```mermaid
classDiagram
class CryptoService{
+ decryptString
+ decryptBytes
+ encryptString
+ encryptBytes
}
class CertificateValidator{
+ validatePublicKey
}
class MetadataValidator{
+ validateMetadataSchema
+ validateMetadataHashValues
}
class MetadataService{
+ createMetadata
}
class OAuthService{
+ authenticate
}
+ retrieveOAuthToken
+ validatePublicKey
+ encryptSubmissionData
+ encryptAttachment
+ createMetadata
+ createSubmission
+ sendSubmission
+ uploadAttachments
+ createAttachment
+ getEncryptionKeyForDestination
+ retrieveOAuthToken
+ decryptStringContent
+ pollAvailableSubmissions
+ getSubmission
+ fetchAttachments
+ validateEventLog
+ validateMetadata
+ validateData
+ validateAttachments
+ confirmValidSubmission
class SubscriberClient{
class SenderClient{
ClientFactory ..> SenderClient : Constructs
ClientFactory ..> SubscriberClient : Constructs
SenderClient ..> SenderFacade : Uses
SubscriberClient ..> SubscriberFacade : Uses
SenderFacade ..> MetadataService : Uses
SenderFacade ..> OAuthService : Uses
SenderFacade ..> CryptoService : Uses
SubscriberFacade ..> OAuthService : Uses
SubscriberFacade ..> CryptoService : Uses
SubscriberFacade ..> MetadataValidator : Uses