C# Class Brunet.Applications.BasicNode

BasicNode provides the core Brunet features in a deployable model the inputs are a xml config file called NodeConfig, which specifies which if any services to deploy. Other projects should inherit this as their base class rather than implementing their own interfaces to Brunet.
Mostrar archivo Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
XmppService XmppService

Protected Properties

Property Type Description
_app_node ApplicationNode
_fe_stop_pem FuzzyEvent
_node_config NodeConfig
_node_config_path string
_path String
_rand System.Random
_running bool
_shutdown Brunet.Applications.Shutdown
_type_to_pem PathELManager>.Dictionary
_xrm Brunet.Services.XmlRpc.XmlRpcManagerServer

Public Methods

Method Description
BasicNode ( NodeConfig node_config ) : System

Prepares a BasicNode.

CreateNode ( NodeConfig node_config ) : ApplicationNode

Creates an ApplicationNode and prepares it for connection to the overlay. For historical reasons it is linked to _node, _dht, _rpc_dht, and _bso.

OnExit ( ) : void

This method is registered as a delegate to Shutdown.OnExit and will be called when ctrl-c is pressed by the user. This stops services, prevents the node from reincarnating, and then disconnects the node.

Run ( ) : void

This should be called by the Main after all the setup is done this passes control to the _node and won't return until the program is exiting. (It is synchronous.)

Protected Methods

Method Description
CreateBaseEdgeListener ( NodeConfig el_info, ApplicationNode node, IEnumerable addresses ) : EdgeListener

Given a EdgeListener info and a list of addresses to advertise, returns an EdgeListener.

CreateEdgeListener ( NodeConfig el_info, ApplicationNode node, IEnumerable addresses ) : EdgeListener

Given an EdgeListener info, attempts to find a PathEL, if one is not found, creates a base EL and wraps it with a PathEL.

CreatePrivateNode ( ApplicationNode shared, NodeConfig node_config ) : void

Create a PrivateNode given a shared node and a node_config.

GetXmlRpcUri ( ApplicationNode appnode ) : string
StopPem ( System.DateTime now ) : void

All nodes are disconnected? Stop the PathEL.

Method Details

BasicNode() public method

Prepares a BasicNode.
public BasicNode ( NodeConfig node_config ) : System
node_config NodeConfig A node config object.
return System

CreateBaseEdgeListener() protected method

Given a EdgeListener info and a list of addresses to advertise, returns an EdgeListener.
protected CreateBaseEdgeListener ( NodeConfig el_info, ApplicationNode node, IEnumerable addresses ) : EdgeListener
el_info NodeConfig
node ApplicationNode
addresses IEnumerable
return EdgeListener

CreateEdgeListener() protected method

Given an EdgeListener info, attempts to find a PathEL, if one is not found, creates a base EL and wraps it with a PathEL.
protected CreateEdgeListener ( NodeConfig el_info, ApplicationNode node, IEnumerable addresses ) : EdgeListener
el_info NodeConfig
node ApplicationNode
addresses IEnumerable
return EdgeListener

CreateNode() public method

Creates an ApplicationNode and prepares it for connection to the overlay. For historical reasons it is linked to _node, _dht, _rpc_dht, and _bso.
public CreateNode ( NodeConfig node_config ) : ApplicationNode
node_config NodeConfig
return ApplicationNode

CreatePrivateNode() protected method

Create a PrivateNode given a shared node and a node_config.
protected CreatePrivateNode ( ApplicationNode shared, NodeConfig node_config ) : void
shared ApplicationNode
node_config NodeConfig
return void

GetXmlRpcUri() protected method

protected GetXmlRpcUri ( ApplicationNode appnode ) : string
appnode ApplicationNode
return string

OnExit() public method

This method is registered as a delegate to Shutdown.OnExit and will be called when ctrl-c is pressed by the user. This stops services, prevents the node from reincarnating, and then disconnects the node.
public OnExit ( ) : void
return void

Run() public method

This should be called by the Main after all the setup is done this passes control to the _node and won't return until the program is exiting. (It is synchronous.)
public Run ( ) : void
return void

StopPem() protected method

All nodes are disconnected? Stop the PathEL.
protected StopPem ( System.DateTime now ) : void
now System.DateTime
return void

Property Details

XmppService public_oe property

public XmppService XmppService
return XmppService

_app_node protected_oe property

Contains the StructuredNode and other Brunet features.
protected ApplicationNode,Brunet.Applications _app_node
return ApplicationNode

_fe_stop_pem protected_oe property

protected FuzzyEvent _fe_stop_pem
return FuzzyEvent

_node_config protected_oe property

The NodeConfig that defines the Brunet.Node.
protected NodeConfig,Brunet.Applications _node_config
return NodeConfig

_node_config_path protected_oe property

Path to the node config (for updating it).
protected string _node_config_path
return string

_path protected_oe property

The path to the NodeConfig.
protected String _path
return String

_rand protected_oe property

protected Random,System _rand
return System.Random

_running protected_oe property

True if the node should reincarnate itself if Node.Connect exits or throws an exception
protected bool _running
return bool

_shutdown protected_oe property

protected Shutdown,Brunet.Applications _shutdown
return Brunet.Applications.Shutdown

_type_to_pem protected_oe property

protected Dictionary _type_to_pem
return PathELManager>.Dictionary

_xrm protected_oe property

The XmlRpc service provider.
protected XmlRpcManagerServer,Brunet.Services.XmlRpc _xrm
return Brunet.Services.XmlRpc.XmlRpcManagerServer