Add helper in LRU cache to get cache key
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIServerFactory.ts
CommitLineData
fe94fce0
JB
1import { AbstractUIServer } from './AbstractUIServer';
2import { ApplicationProtocol } from '../../types/UIProtocol';
3import Configuration from '../../utils/Configuration';
4import { ServerOptions } from '../../types/ConfigurationData';
5import UIWebSocketServer from './UIWebSocketServer';
6
7export 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}