Skip to content

Commit be42147

Browse files
committed
GlobalRegistryConnector updated
1 parent 2fa5a7c commit be42147

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

src/main/MsgNode.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ class MsgNode {
8888
this.app.get('/live', (req, res) => {
8989
res.send({
9090
status:'up',
91-
domain : this.config.url,
91+
domain: this.config.url,
9292
domainRegistry: this.config.domainRegistryUrl,
93+
globalRegistry: this.config.globalRegistryUrl,
9394
time: (new Date()).toISOString(),
9495
connected: Object.keys(this.io.sockets.sockets).length
9596
});
@@ -121,7 +122,7 @@ class MsgNode {
121122
this.registry.registerComponent(olm);
122123
let syncm = new SubscriptionManager('domain://msg-node.' + this.registry.getDomain() + '/sm', this.registry);
123124
this.registry.registerComponent(syncm);
124-
let rm = new RegistryManager('domain://registry.' + this.registry.getDomain() + '/', this.registry);
125+
let rm = new DomainRegistryManager('domain://registry.' + this.registry.getDomain() + '/', this.registry);
125126
this.registry.registerComponent(rm);
126127
let glbm = new GlobalRegistryManager(this.registry.getDomain().globalRegistryUrl, this.registry);
127128
this.registry.registerComponent(glbm);

src/main/components/rethink/GlobalRegistryManager.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,34 @@ let JSRequest = require('./../../../modules/JSRequest');
2929
class GlobalRegistryManager {
3030

3131
constructor(registryURL, registry) {
32-
this.name = name;
3332
this.request = new JSRequest();
3433
this.registry = registry;
3534
this.registryURL = this.registry.getConfig().globalRegistryUrl;
3635
this.logger = this.registry.getLogger();
3736
}
3837

38+
getName() {
39+
return this.name;
40+
}
41+
3942
processMessage(msg, callback) {
4043
// let msg = clientMessage.getMessage();
4144
let body = msg.getBody();
4245
this.logger.error(msg);
43-
switch(msg.getType().toLowerCase()) {
44-
try {
45-
case 'create':
46-
case 'update':
46+
switch (msg.getType().toLowerCase()) {
47+
case 'create':
48+
case 'update':
49+
try {
4750
if(typeof body.value !== 'undefined' && 'hypertyURL' in body.value) {
48-
this.logger.info('[Gloabl-Registry-Manager] Add hyperty with :' body.value);
51+
this.logger.info('[Gloabl-Registry-Manager] Add hyperty with :', body.value);
4952
this.addHyperty(body.value.user, body.value.hypertyURL, body.value.hypertyDescriptorURL, body.value.expires, callback);
5053
} else {
5154
this.logger.info('[Global-Registry-Manager] Add data Object :' + body.value.name);
5255
this.addDataObject(body.value.name, body.value.schema, body.value.expires, body.value.url, body.value.reporter, callback);
5356
}
54-
57+
} catch (e) {
58+
this.logger.error('[global-Registry-Manager] [', this.getName(), ']: Error while processing message:\n', e);
59+
}
5560
break;
5661

5762
case 'delete':
@@ -75,13 +80,10 @@ class GlobalRegistryManager {
7580
}
7681

7782
break;
78-
} catch (e) {
79-
this.logger.error('[global-Registry-Manager] [', this.getName(), ']: Error while processing message:\n', e);
80-
}
8183

82-
break;
83-
default:
84-
clientMessage.replyError(this.getName(), 'Unrecognized type :"' + msg.getType() + '"');
84+
break;
85+
default:
86+
clientMessage.replyError(this.getName(), 'Unrecognized type :"' + msg.getType() + '"');
8587
}
8688
}
8789

0 commit comments

Comments
 (0)