Node
Extends:
Node class: node is an item of a topology and manages a set of servers.
Constructor Summary
Public Constructor | ||
public |
constructor(arg_name: string, arg_settings: object, arg_log_context: string): nothing Create a Node instance. |
Member Summary
Public Members | ||
public |
$settings: * |
|
public |
features: *[] |
|
public |
Class type flag. |
|
public |
logs_bus: * |
|
public |
|
|
public |
metrics_bus: * |
|
public |
|
|
public |
|
|
public |
msg_bus: * |
|
public |
|
|
public |
remote_nodes: {} |
|
public |
|
Method Summary
Public Methods | ||
public |
Get metrics server instance. |
|
public |
TODO get_metrics_server_name |
|
public |
get_servers(): Collection Get Node instance servers collection. |
|
public |
get_topology_info(arg_deep: boolean, arg_visited: object): object Get topology item informations. |
|
public |
load(): nothing Load Node with starting settings. |
|
public |
load_features(): nothing Load Node features. |
|
public |
load_topology_settings(arg_settings: object): nothing Load settings on master node. |
|
public |
receive_master_msg(arg_sender: string, arg_payload: object): nothing Process received message on master node. |
|
public |
receive_msg(arg_msg: DistributedMessage): nothing Process received message. |
|
public |
receive_node_msg(arg_sender: string, arg_payload: object): nothing Process received message not on master node. |
|
public |
start(): nothing Starts node features. |
|
public |
stop(): nothing Stops node features. |
|
public |
|
|
public |
|
Inherited Summary
From class NodeMessaging | ||
public |
Is master flag. |
|
public |
Class type flag. |
|
public |
Master name. |
|
public |
state: * |
|
public |
find_master(): Node Find master node. |
|
public |
get_logs_bus(): BusClient | BusServer Get metrics bus client or server instance. |
|
public |
get_metrics_bus(): BusClient | BusServer Get metrics bus client or server instance. |
|
public |
get_msg_bus(): BusClient | BusServer Get metrics bus client or server instance. |
|
public |
Promote this node to master node. |
|
public |
register_to_master(): nothing Register this node to master node. |
|
public |
Revoke this node from master node. |
|
public |
send_msg_to_master(arg_payload: object): nothing Send a message to master node through a bus. |
|
public |
switch_state(arg_state: string): nothing Switch Node state. |
|
public |
unregister_to_master(): nothing Unegister this node from master node. |
Public Constructors
public constructor(arg_name: string, arg_settings: object, arg_log_context: string): nothing source
Create a Node instance.
Override:
NodeMessaging#constructorReturn:
nothing |
Public Members
public $settings: * source
public features: *[] source
public logs_bus: * source
public logs_bus_feature: * source
public metrics_bus: * source
public metrics_bus_feature: * source
public metrics_feature: * source
public msg_bus: * source
public msg_bus_feature: * source
public remote_nodes: {} source
public servers_feature: * source
Public Methods
public get_servers(): Collection source
Get Node instance servers collection.
Return:
Collection | Node servers. |
public get_topology_info(arg_deep: boolean, arg_visited: object): object source
Get topology item informations.
public load_topology_settings(arg_settings: object): nothing source
Load settings on master node.
Params:
Name | Type | Attribute | Description |
arg_settings | object | master node settings. |
Return:
nothing |
public receive_master_msg(arg_sender: string, arg_payload: object): nothing source
Process received message on master node.
Return:
nothing |
public receive_msg(arg_msg: DistributedMessage): nothing source
Process received message.
Params:
Name | Type | Attribute | Description |
arg_msg | DistributedMessage | message object. |
Return:
nothing |
public receive_node_msg(arg_sender: string, arg_payload: object): nothing source
Process received message not on master node.
Return:
nothing |