Skip to content
Snippets Groups Projects
README.md 2.38 KiB
Newer Older
Martin Vogel's avatar
Martin Vogel committed
The API-module contains interfaces and domain model value classes that provide the basic functionality to build an
sdk-client.
Martin Vogel's avatar
Martin Vogel committed
### 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,
Martin Vogel's avatar
Martin Vogel committed
- **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
Martin Vogel's avatar
Martin Vogel committed
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
  }

Martin Vogel's avatar
Martin Vogel committed
  class SenderFacade {
    + retrieveOAuthToken
    + validatePublicKey
    + encryptSubmissionData
    + encryptAttachment
    + createMetadata
Martin Vogel's avatar
Martin Vogel committed
    + createSubmission
    + sendSubmission
    + uploadAttachments
    + createAttachment
    + getEncryptionKeyForDestination
Martin Vogel's avatar
Martin Vogel committed
   class SubscriberFacade {
Martin Vogel's avatar
Martin Vogel committed
    + decryptStringContent
    + pollAvailableSubmissions
    + getSubmission
    + fetchAttachments
    + validateEventLog
    + validateMetadata
    + validateData
    + validateAttachments
    + confirmValidSubmission
Martin Vogel's avatar
Martin Vogel committed
  
Martin Vogel's avatar
Martin Vogel committed
       SubscriberFacade
Martin Vogel's avatar
Martin Vogel committed
  }
  
Martin Vogel's avatar
Martin Vogel committed
        SenderFacade
Martin Vogel's avatar
Martin Vogel committed
 
    class ClientFactory {
        AppplicationConfig
Martin Vogel's avatar
Martin Vogel committed
  }
Martin Vogel's avatar
Martin Vogel committed
 
ClientFactory  ..> SenderClient : Constructs
ClientFactory  ..> SubscriberClient : Constructs
Martin Vogel's avatar
Martin Vogel committed

Martin Vogel's avatar
Martin Vogel committed
SenderClient ..> SenderFacade : Uses
SubscriberClient ..> SubscriberFacade : Uses
Martin Vogel's avatar
Martin Vogel committed
SenderFacade ..> CertificateValidator : Uses
Martin Vogel's avatar
Martin Vogel committed
SenderFacade ..> MetadataService : Uses
SenderFacade ..> OAuthService : Uses
SenderFacade ..> CryptoService : Uses
Martin Vogel's avatar
Martin Vogel committed
SubscriberFacade ..> OAuthService : Uses
SubscriberFacade ..> CryptoService : Uses
SubscriberFacade ..> MetadataValidator : Uses