member_webapp/src/packages/discovery/store/discover/discover.action.ts

83 lines
2.2 KiB
TypeScript
Raw Normal View History

2018-04-06 11:02:18 +00:00
import { Action } from '@ngrx/store';
import {
Zone,
Host,
Port,
Service,
DiscoveryZone,
DiscoveryHost,
DiscoveryPort,
DiscoveryService as MDiscoveryService,
} from '../../model';
export enum ActionType {
DiscoverZone = '[discovery.discovery] discoverZone',
DiscoverHost = '[discovery.discovery] discoverHost',
DiscoverPort = '[discovery.discovery] discoverPort',
DiscoverService = '[discovery.discovery] discoverService',
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;
constructor(public payload: {probeID: string, discoveryZone: DiscoveryZone}) {}
}
export class DiscoverHost implements Action {
readonly type = ActionType.DiscoverHost;
constructor(public payload: {probeID: string, zone: Zone, discoveryHost: DiscoveryHost}) {}
}
export class DiscoverPort implements Action {
readonly type = ActionType.DiscoverPort;
constructor(public payload: {probeID: string, host: Host, discoveryPort: DiscoveryPort}) {}
}
export class DiscoverService implements Action {
readonly type = ActionType.DiscoverService;
constructor(public payload: {probeID: string, port: Port, discoveryService: MDiscoveryService}) {}
}
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
| DiscoveredZone
| DiscoveredHost
| DiscoveredPort
| DiscoveredService
;