raas-server
Version:
rhamt as a service server
62 lines • 2.39 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const raas_core_1 = require("raas-core");
// import { Protocol } from 'raas-core';
class DriverMessageDelage {
constructor(client) {
this.client = client;
}
handleMessage(data) {
const target = this;
if (typeof target[data.method] === 'function') {
console.log(`invoking client handler for ${data.method}`);
target[data.method](data.params);
}
else {
console.log(`method not found ${data.method}`);
}
}
/*
Server
*/
// private findServerInstallations(): void {
// }
// private getDiscoveryPaths(): void {
// }
// private addDiscoveryPath(): void {
// }
// private removeDiscoveryPath(): void {
// }
// private getServerHandles(): void {
// }
// private deleteServer(): void {
// }
// private createServer(): void {
// }
startServerAsync() {
(() => __awaiter(this, void 0, void 0, function* () {
// const config: Protocol.Server = new Protocol.Server();
// config.id = '1';
const installation = {
id: raas_core_1.RhamtModelService.generateUniqueId(),
duration: '',
installableServerId: '',
installationCompleteTimestamp: '',
installationStartedTimestamp: '',
location: ''
};
const status = yield this.client.addInstalledServer(installation);
console.log(`startServerAsync request sent. response status is: ${JSON.stringify(status)}`);
}))();
}
}
exports.DriverMessageDelage = DriverMessageDelage;
//# sourceMappingURL=driverMessageDelegate.js.map