ATG: add support for idTag distribution algorithms
[e-mobility-charging-stations-simulator.git] / src / types / ConfigurationData.ts
CommitLineData
6c1761d4 1import type { ListenOptions } from 'net';
8114d10e 2
9efbac5b 3import type { WorkerChoiceStrategy } from 'poolifier';
8114d10e 4
6c1761d4 5import type { StorageType } from './Storage';
eb3abc4f 6import type { ApplicationProtocol, AuthenticationType } from './UIProtocol';
6c1761d4 7import type { WorkerProcessType } from './Worker';
a4624c96 8
eb3abc4f 9export type ServerOptions = ListenOptions;
66271092 10
2dcfe98e
JB
11export enum SupervisionUrlDistribution {
12 ROUND_ROBIN = 'round-robin',
13 RANDOM = 'random',
c72f6634 14 CHARGING_STATION_AFFINITY = 'charging-station-affinity',
2dcfe98e
JB
15}
16
83e00df1 17export type StationTemplateUrl = {
e118beaa
JB
18 file: string;
19 numberOfStations: number;
83e00df1 20};
e118beaa 21
83e00df1 22export type UIServerConfiguration = {
6a49ad23 23 enabled?: boolean;
1f7fa4de 24 type?: ApplicationProtocol;
66271092 25 options?: ServerOptions;
eb3abc4f
JB
26 authentication?: {
27 enabled: boolean;
28 type: AuthenticationType;
29 username?: string;
30 password?: string;
31 };
83e00df1 32};
6a49ad23 33
83e00df1 34export type StorageConfiguration = {
72f041bd
JB
35 enabled?: boolean;
36 type?: StorageType;
1f5df42a 37 uri?: string;
83e00df1 38};
72f041bd 39
83e00df1 40export type WorkerConfiguration = {
cf2a5d9b
JB
41 processType?: WorkerProcessType;
42 startDelay?: number;
43 elementsPerWorker?: number;
44 elementStartDelay?: number;
45 poolMinSize?: number;
46 poolMaxSize?: number;
47 poolStrategy?: WorkerChoiceStrategy;
83e00df1 48};
cf2a5d9b 49
83e00df1 50export type ConfigurationData = {
2dcfe98e
JB
51 supervisionUrls?: string | string[];
52 supervisionUrlDistribution?: SupervisionUrlDistribution;
1f5df42a 53 stationTemplateUrls: StationTemplateUrl[];
675fa8e3 54 uiServer?: UIServerConfiguration;
72f041bd 55 performanceStorage?: StorageConfiguration;
cf2a5d9b 56 worker?: WorkerConfiguration;
e118beaa 57 autoReconnectMaxRetries?: number;
cf2a5d9b 58 // deprecated
a4624c96 59 workerProcess?: WorkerProcessType;
cf2a5d9b 60 // deprecated
322c9192 61 workerStartDelay?: number;
cf2a5d9b 62 // deprecated
4bfd80fa 63 elementStartDelay?: number;
cf2a5d9b 64 // deprecated
a4624c96 65 workerPoolMinSize?: number;
cf2a5d9b 66 // deprecated
4fa59b8a 67 workerPoolMaxSize?: number;
cf2a5d9b 68 // deprecated
9efbac5b 69 workerPoolStrategy?: WorkerChoiceStrategy;
cf2a5d9b 70 // deprecated
5fdab605 71 chargingStationsPerWorker?: number;
72f041bd 72 logStatisticsInterval?: number;
e118beaa 73 logFormat?: string;
324fd4ee 74 logLevel?: string;
6bf6769e
JB
75 logRotate?: boolean;
76 logMaxFiles?: number;
e118beaa 77 logFile?: string;
7ec46a9a
JB
78 logErrorFile?: string;
79 logConsole?: boolean;
83e00df1 80};