member_webapp/@overflow/discovery/store/discover/discover.action.ts

98 lines
2.7 KiB
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import { Action } from '@ngrx/store';
import {
Zone,
Host,
Port,
Service,
2018-04-27 16:29:54 +00:00
DiscoverZone as MDDiscoverZone,
DiscoverHost as MDDiscoverHost,
DiscoverPort as MDDiscoverPort,
DiscoverService as MDiscoverService,
2018-05-02 07:23:35 +00:00
} from '@overflow/commons-typescript/model/discovery';
2018-04-06 11:02:18 +00:00
export enum ActionType {
DiscoverZone = '[discovery.discovery] discoverZone',
DiscoverHost = '[discovery.discovery] discoverHost',
DiscoverPort = '[discovery.discovery] discoverPort',
DiscoverService = '[discovery.discovery] discoverService',
2018-04-19 15:15:20 +00:00
DiscoveryStart = '[discovery.discovery] DiscoveryService.discoveryStart',
DiscoveryStop = '[discovery.discovery] DiscoveryService.discoveryStop',
2018-04-06 11:02:18 +00:00
DiscoveredZone = '[discovery.discovery] DiscoveryService.discoveredZone',
DiscoveredHost = '[discovery.discovery] DiscoveryService.discoveredHost',
DiscoveredPort = '[discovery.discovery] DiscoveryService.discoveredPort',
DiscoveredService = '[discovery.discovery] DiscoveryService.discoveredService',
}
export class DiscoverZone implements Action {
readonly type = ActionType.DiscoverZone;
2018-04-27 16:29:54 +00:00
constructor(public payload: {probeID: string, discoverZone: MDDiscoverZone}) {}
2018-04-06 11:02:18 +00:00
}
export class DiscoverHost implements Action {
readonly type = ActionType.DiscoverHost;
2018-04-27 16:29:54 +00:00
constructor(public payload: {probeID: string, zone: Zone, discoverHost: MDDiscoverHost}) {}
2018-04-06 11:02:18 +00:00
}
export class DiscoverPort implements Action {
readonly type = ActionType.DiscoverPort;
2018-04-27 16:29:54 +00:00
constructor(public payload: {probeID: string, host: Host, discoverPort: MDDiscoverPort}) {}
2018-04-06 11:02:18 +00:00
}
export class DiscoverService implements Action {
readonly type = ActionType.DiscoverService;
2018-04-27 16:29:54 +00:00
constructor(public payload: {probeID: string, port: Port, discoverService: MDiscoverService}) {}
2018-04-06 11:02:18 +00:00
}
2018-04-19 15:15:20 +00:00
export class DiscoveryStart implements Action {
readonly type = ActionType.DiscoveryStart;
constructor(public payload: Date) {}
}
export class DiscoveryStop implements Action {
readonly type = ActionType.DiscoveryStop;
constructor(public payload: Date) {}
}
2018-04-06 11:02:18 +00:00
export class DiscoveredZone implements Action {
readonly type = ActionType.DiscoveredZone;
constructor(public payload: Zone) {}
}
export class DiscoveredHost implements Action {
readonly type = ActionType.DiscoveredHost;
constructor(public payload: Host) {}
}
export class DiscoveredPort implements Action {
readonly type = ActionType.DiscoveredPort;
constructor(public payload: Port) {}
}
export class DiscoveredService implements Action {
readonly type = ActionType.DiscoveredService;
constructor(public payload: Service) {}
}
export type Actions =
| DiscoverZone
| DiscoverHost
| DiscoverPort
| DiscoverService
2018-04-19 15:15:20 +00:00
| DiscoveryStart
| DiscoveryStop
2018-04-06 11:02:18 +00:00
| DiscoveredZone
| DiscoveredHost
| DiscoveredPort
| DiscoveredService
;