Skip to content
Snippets Groups Projects

API Module

The API-module contains interfaces and domain model value classes that provide the basic functionality to build an sdk-client.

Structure

  • 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.

classDiagram

  class CryptoService{
    + decryptString
    + decryptBytes 
    + encryptString
    + encryptBytes 
   }


   class ValidationService{
        + validatePublicKey
        + 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 OAuthService{
   + getCurrentToken
  }

  class SenderFacade {
    + validatePublicKey
    + encryptBytes
    + encryptObject
    + createHash
    + createSubmission
    + uploadAttachment
    + sendSubmission
    + getDestination
    + getEncryptionKeyForDestination
  }

   class SubscriberFacade {
    + decryptStringContent
    + pollAvailableSubmissions
    + getSubmission
    + fetchAttachment
    + validateEventLog
    + validateMetadata
    + validateHashIntegrity
    + confirmValidSubmission
    + rejectSubmission
  }
  
  class SubscriberClient{
       SubscriberFacade
  }
  
  class SenderClient{
        SenderFacade
  }
 
    class ClientFactory {
        ApplicationConfig
  }
 
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