Skip to content
Snippets Groups Projects
README.md 3.73 KiB
Newer Older
The API-module contains interfaces and domain model value classes that provide the basic functionality to build a sdk-client.
- **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 
}

class SchemaProvider{
    + isAllowedSetSchema
    + isAllowedMetadataSchema
    + loadLatestSetSchema
    + loadMetadataSchema
}

class EventLogService{
    + getEventLog
    + sendEvent
}

class EventLogVerificationService {
    + validateEventLogs
}
class SubmissionService{
    + announceSubmission
    + getSubmission
    + sendSubmission
    + pollAvailableSubmissions
    + uploadAttachment
    + getAttachment
}
class SecurityEventService{
    + createAcceptSubmissionEvent
    + createRejectSubmissionEvent
}
class MessageDigestService{
}

class KeyService{
    + getPublicEncryptionKey
    + getPublicSignatureKey
    + getPortalSignatureKey
    + getSubmissionServiceSignatureKey

class ValidationService{
    + validatePublicKey
    + validateMetadataSchema
    + validateIntegrity
}

class OAuthService{
class SenderFacade {
    + validateMetadata
    + encryptBytes
    + encryptObject
    + createHash
    + validateJsonFormat
    + validateXmlFormat
    + getEventLog
    + gelatestEvent
    + getEncryptionKeyForDestination
    + sendSubmission
}
class SubscriberFacade {
    + decryptStringContent
    + pollAvailableSubmissions
    + getSubmission
    + getEventLog
    + acceptSubmission
class SubscriberClient{
    SubscriberFacade
}
class SenderClient{
    SenderFacade
}


class ClientFactory {
    ApplicationConfig
}
 
ClientFactory  ..> SenderClient : Constructs
ClientFactory  ..> SubscriberClient : Constructs

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

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

SenderFacade ..> SubmissionService : Uses
SenderFacade ..> CryptoService : Uses
SenderFacade ..> KeyService : Uses
SenderFacade ..> EventLogService : Uses
SenderFacade ..> ValidationService : Uses

SubmissionService ..> OAuthService : Uses
EventLogService ..> OAuthService : Uses
EventLogService ..> EventLogVerificationService : Uses
EventLogVerificationService ..> KeyService : Uses
EventLogVerificationService ..> ValidationService : Uses

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

SecurityEventService ..> ValidationService : Uses
KeyService ..> ValidationService : Uses
KeyService ..> OAuthService : Uses
KeyService ..> SubmissionService : Uses