Skip to content
Snippets Groups Projects
README.md 3.17 KiB
Newer Older
## API Module

The API-module contains interfaces and domain model value classes that provide the basic functionality to build an
- **api.config** - sdk wide configuration and settings
- **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 
   }


        + validateMetadataSchema
        + validateIntegrity
  
   class EventLogService{
        + getEventLog
        + sendEvent
  }
  
   class SubmissionService{
        + announceSubmission
        + getSubmission
        + sendSubmission
        + pollAvailableSubmissions
        + uploadAttachment
        + getAttachment
  
   class SecurityEventService{
        + createAcceptSubmissionEvent
        + createRejectSubmissionEvent
  }
  
   class MessageDigestService{
    + createHash
    + verify
  }
  
  class DestinationService{
    + getEncryptionKey
    + getDestination
  }

  class SenderFacade {
    + validatePublicKey
    + encryptBytes
    + encryptObject
    + createHash
    + getEncryptionKeyForDestination
  }

   class SubscriberFacade {
    + decryptStringContent
    + pollAvailableSubmissions
    + getSubmission
    + validateEventLog
    + validateMetadata
    + confirmValidSubmission
  }
  
  class SubscriberClient{
       SubscriberFacade
  }
  
  class SenderClient{
        SenderFacade
  }
 
    class ClientFactory {
  }
 
ClientFactory  ..> SenderClient : Constructs
ClientFactory  ..> SubscriberClient : Constructs

SenderClient ..> SenderFacade : Uses
SubscriberClient ..> SubscriberFacade : Uses

SenderFacade ..> SubmissionService : Uses
SenderFacade ..> CryptoService : Uses
SenderFacade ..> ValidationService : Uses
SenderFacade ..> DestinationService : Uses
SenderFacade ..> EventLogService : Uses
SubscriberFacade ..> SubmissionService : Uses
SubscriberFacade ..> CryptoService : Uses
SubscriberFacade ..> ValidationService : Uses
SubscriberFacade ..> EventLogService : Uses
SubscriberFacade ..> SecurityEventService : Uses

DestinationService ..> OAuthService : Uses
SubmissionService ..> OAuthService : Uses
EventLogService ..> OAuthService : Uses

CryptoService ..> MessageDigestService : Uses
ValidationService ..> MessageDigestService : Uses