Restructure UI server code to prepare it for issue #238
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
index 10f2565a81f52a5b874c3331771cdd110c83a7f9..cf534c39bfe6d8e6ef71359a7268d2442e82c69a 100644 (file)
@@ -3,12 +3,18 @@ import { StorageType } from './Storage';
 import type { WorkerChoiceStrategy } from 'poolifier';
 import { WorkerProcessType } from './Worker';
 
+export enum SupervisionUrlDistribution {
+  ROUND_ROBIN = 'round-robin',
+  RANDOM = 'random',
+  SEQUENTIAL = 'sequential',
+}
+
 export interface StationTemplateUrl {
   file: string;
   numberOfStations: number;
 }
 
-export interface UIWebSocketServerConfiguration {
+export interface UIServerConfiguration {
   enabled?: boolean;
   options?: ServerOptions;
 }
@@ -20,14 +26,15 @@ export interface StorageConfiguration {
 }
 
 export default interface ConfigurationData {
-  supervisionUrls?: string[];
+  supervisionUrls?: string | string[];
+  supervisionUrlDistribution?: SupervisionUrlDistribution;
   stationTemplateUrls: StationTemplateUrl[];
-  uiWebSocketServer?: UIWebSocketServerConfiguration;
+  uiServer?: UIServerConfiguration;
   performanceStorage?: StorageConfiguration;
   autoReconnectMaxRetries?: number;
-  distributeStationsToTenantsEqually?: boolean;
   workerProcess?: WorkerProcessType;
   workerStartDelay?: number;
+  elementStartDelay?: number;
   workerPoolMinSize?: number;
   workerPoolMaxSize?: number;
   workerPoolStrategy?: WorkerChoiceStrategy;