Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "Config/config.global"

Index

Variables

Functions

Object literals

Variables

argParser

argParser: any = require('./../Util/commandline.parser')

This module is available throughout xyz using xyz.CONFIG. It sores important information about the node and the system. Most of the properties are read-only and should be updated ONLY using defined methods.

module

Configuration

selfConf

selfConf: ISelfConfValue

systemConf

systemConf: ISystemConfValue

Functions

MergeRecursive

  • MergeRecursive(obj1: any, obj2: any): any

Object literals

CONFIG

CONFIG: object

addServer

  • should be called to update the values of selfConf.transport when a new server is added. Should be called from Transport layer, not directly.

    Parameters

    Returns boolean

ensureNode

  • ensureNode(aNode: string): 1 | -1
  • Similar to joinNode(). The only difference is that it will not log a warning if a node already exists. Note that a middleware or bootstrap function should call a method with the same name in serviceRepository layer. This method should not be called directly.

    Parameters

    • aNode: string

      netId of a node

    Returns 1 | -1

    1 if ok, -1 if fail.

ensureNodes

  • ensureNodes(someNodes: Array<string>): void
  • a Duplicate function to joinNode. The only difference is logging and the fact that this one takes an array of nodes

    Parameters

    • someNodes: Array<string>

      a list of nodes

    Returns void

forget

  • forget(): void
  • Will cause the system to forget all of the nodes. Should not be used only in test environemts

    Returns void

getSelfConf

getSystemConf

joinNode

  • joinNode(aNode: string): 1 | -1
  • should be called to inform that a new node has joined the system. This will log the results automatically. Note that a middleware or bootstrap function should call a method with the same name in serviceRepository layer. This method should not be called directly.

    Parameters

    • aNode: string

      netId of a node

    Returns 1 | -1

    1 if ok, -1 if fail.

kickNode

  • kickNode(aNode: string): 1 | -1
  • should be called to inform that a node has left the system. This will log the results automatically. Note that a middleware or bootstrap function should call a method with the same name in serviceRepository layer. This method should not be called directly.

    Parameters

    • aNode: string

      netId of a node

    Returns 1 | -1

    1 if ok, -1 if fail.

removeServer

  • removeServer(aPort: number): boolean
  • Will remove a server from the confg object

    Parameters

    • aPort: number

      port of the server

    Returns boolean

    Status of the operation

setSelfConf

  • setSelfConf(aConf: object, cmdLineArgs: string): void
  • will override the configurations passed to XYZ constructor inside internal variable. Note that the xyz.js constructor should call this and there is no other use case for it.

    Parameters

    • aConf: object

      Object with the same format of xyz's constructor selfConf

    • cmdLineArgs: string

      Manual command line arguments. When this has a value, it will be used insteat of process.argv[1]

    Returns void

setSystemConf

  • setSystemConf(aConf: object): void
  • Overrides the configuration's systemConf inside internal variables

    Parameters

    • aConf: object

      systemConf with the same format like xyz's constructor

    Returns void

Generated using TypeDoc