41 lines
1.3 KiB
TypeScript
41 lines
1.3 KiB
TypeScript
import { Injectable } from '@angular/core';
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { RPCService } from '@loafer/ng-rpc';
|
|
import {
|
|
DiscoverZone as MDDiscoverZone,
|
|
DiscoverHost as MDDiscoverHost,
|
|
DiscoverPort as MDDiscoverPort,
|
|
DiscoverService as MDDiscoverService,
|
|
Zone,
|
|
Host,
|
|
Port,
|
|
Service,
|
|
} from '@overflow/commons-typescript/model/discovery';
|
|
|
|
@Injectable()
|
|
export class DiscoveryService {
|
|
|
|
public constructor(
|
|
private rpcService: RPCService,
|
|
) {
|
|
|
|
}
|
|
|
|
public discoverZone(probeID: string, discoverZone: MDDiscoverZone): void {
|
|
this.rpcService.send('DiscoveryService.discoverZone', probeID, discoverZone);
|
|
}
|
|
public discoverHost(probeID: string, zone: Zone, discoverHost: MDDiscoverHost): void {
|
|
this.rpcService.send('DiscoveryService.discoverHost', probeID, zone, discoverHost);
|
|
}
|
|
public discoverPort(probeID: string, host: Host, discoverPort: MDDiscoverPort): void {
|
|
this.rpcService.send('DiscoveryService.discoverPort', probeID, host, discoverPort);
|
|
}
|
|
public discoverService(probeID: string, port: Port, discoverService: MDDiscoverService): void {
|
|
this.rpcService.send('DiscoveryService.discoverService', probeID, port, discoverService);
|
|
}
|
|
public stopDiscovery(probeID: string): void {
|
|
this.rpcService.send('DiscoveryService.stopDiscovery', probeID);
|
|
}
|
|
}
|