 // @formatter:off
 // @startuml

// enum DiffusionGatewayFramework {
//  +{static} GatewayFramework initialize(GatewayApplication application)
// }
// note left of DiffusionGatewayFramework
// Main entry point with static initializer
// One framework and one application per JVM.
// Also provides static factory methods
// end note
//
// interface GatewayFramework {
//   +CompletableFuture<?> connect()
//   +String getConfiguration()
// }
//
// interface GatewayApplication {
//    +ApplicationDetails getApplicationDetails()
//    +void initialize(ApplicationDefinition)
//    +CompletableFuture<?> start()
//    +StreamingSourceHandler addStreamingSource(String name, ServiceDefinition, Publisher, StateHandler)
//    +PollingSourceHandler addPollingSource(String name, ServiceDefinition, Publisher, StateHandler)
//    +SinkHandler addSink(String name, ServiceDefinition, StateHandler)
//    +CompletableFuture<?> stop()
// }
//
// interface ApplicationDetails {
//    +String getApplicationType()
//    +String getGlobalSchema()
//    +List<ServiceType> getServiceTypes()
//    +List<SharedConfigTypes> getSharedConfigTypes()
// }
//
// interface ServiceType {
//    +String getName()
//    +ServiceMode getMode()
//    +String getSchema()
// }
//
// interface SharedConfigType {
//  +String getName()
//  +String getSchema()
//}
//
// enum ServiceMode {
//    STREAMING_SOURCE
//    POLLING_SOURCE
//    SINK
// }
//
// interface SharedConfig {
//  +String getName()
//  +String getType()
//  +Map<String, Object> getParameters()
// }
//
// interface ApplicationDefinition {
//  +String getId()
//  +Map<String, Object> getParameters()
// }
//
// interface ServiceDefinition {
//  +ServiceType getServiceType()
//  +SharedConfig getSharedConfig()
//  +Map<String, Object> getParameters()
// }
// note top of ServiceDefinition
// Passed by framework when creating handlers
// end note
//
// interface ServiceHandler {
//    +void start()
//    +void pause(PauseReason)
//    +void resume(ResumeReason)
//    +void stop()
// }
// note left of ServiceHandler
// One per Gateway service
// defined by the configuration
// end note
//
// interface SourceHandler extends ServiceHandler
//
// interface StreamingSourceHandler extends SourceHandler
//
// interface PollingSourceHandler extends SourceHandler {
//    +CompletableFuture<?> poll()
// }
//
// interface SinkHandler extends ServiceHandler {
//    +CompletableFuture<?> update(String path, Object value)
// }
//
// interface Publisher {
//    +CompletableFuture<?> publish(String path, Object value)
//    +CompletableFuture<?> applyJSONPatch(String path, String patch)
// }
//
// interface PayloadConverter<V, D> {
//    +D toDiffusionType(V value)
//    +V Object fromDiffusionType(D value)
// }
//
// interface StateHandler {
//    +ServiceState reportStatus(Level, String title, String description)
//    +ServiceState getState()
// }
//
// DiffusionGatewayFramework "1" -- "1" GatewayFramework : > initializes
// GatewayFramework -- "1" GatewayApplication : > manages
// GatewayFramework -- "1-n" ServiceHandler : > controls
// GatewayFramework -- "0-n" SharedConfig : > provides
// GatewayFramework -- "0-n" PayloadConverter : > uses
// ServiceType "1" -- "0-n" ServiceHandler : < implements
// ServiceType -- ServiceMode : > operates as
// ServiceHandler -- ServiceDefinition : > is defined by
// ServiceHandler "1" -- "1" StateHandler : > reports via
// GatewayApplication -- "0-n" ServiceHandler : > creates
// GatewayApplication -- "1-1" ApplicationDetails : > provides
// ApplicationDetails -- "1-n" ServiceType : > defines
// ApplicationDetails -- "0-n" SharedConfigType : > defines
// SourceHandler "1" -- "1" Publisher : > publishes using
// ServiceDefinition "1-n" -- "0-1" SharedConfig : > uses
// SharedConfig -- SharedConfigType : > is a
//
 // @enduml
 //
 // See also https://manuscript.pushtechnology.com/f/page?W1085
 //
 // @formatter:on