Commit | Line | Data |
---|---|---|
fe94fce0 JB |
1 | import { AbstractUIServer } from './AbstractUIServer'; |
2 | import { ApplicationProtocol } from '../../types/UIProtocol'; | |
3 | import Configuration from '../../utils/Configuration'; | |
4 | import { ServerOptions } from '../../types/ConfigurationData'; | |
5 | import UIWebSocketServer from './UIWebSocketServer'; | |
6 | ||
7 | export default class UIServerFactory { | |
8 | private constructor() { | |
9 | // This is intentional | |
10 | } | |
11 | ||
12 | public static getUIServerImplementation( | |
13 | applicationProtocol: ApplicationProtocol, | |
b153c0fd | 14 | options?: ServerOptions |
fe94fce0 JB |
15 | ): AbstractUIServer | null { |
16 | switch (applicationProtocol) { | |
17 | case ApplicationProtocol.WS: | |
b153c0fd | 18 | return new UIWebSocketServer(options ?? Configuration.getUIServer().options); |
fe94fce0 JB |
19 | default: |
20 | return null; | |
21 | } | |
22 | } | |
23 | } |