C# Class Brunet.Node

Inheritance: IDataHandler, ISender, IActionQueue, ITAHandler
Show file Open project: pstjuste/brunet Class Usage Examples

Public Properties

Property Type Description
DemuxHandler DemuxHandler
EdgeVerifyMethod EdgeVerifier
MAX_AVG_QUEUE_LENGTH int
PACKET_QUEUE_RETAIN float
SimulatorRandom Random
_disconnect_on_overload bool

Protected Properties

Property Type Description
MAX_CONNECTION_TIMEOUT TimeSpan
MAX_QUEUE_LENGTH int
_LOG bool
_MAX_RECORDED_TAS int
_announce_thread Thread
_check_edges Util.FuzzyEvent
_co_list List
_codeinjection Brunet.Services.CodeInjection
_con_state ConnectionState
_connection_table ConnectionTable
_connection_timeout TimeSpan
_current_action IAction
_edge_factory EdgeFactory
_edgelistener_list ArrayList
_heart_period int
_heartbeat_handlers Brunet.Util.FuzzyEvent>.Dictionary
_local_add Address
_monitor_fe Util.FuzzyEvent
_mr_handler Brunet.Services.MapReduce.MapReduceHandler
_packet_queue Brunet.Concurrent.LFBlockingQueue
_packet_queue_exp_avg float
_realm string
_remote_ta ImmutableList
_rpc RpcManager
_rrm ReqrepManager
_running int
_send_pings int
_sync object
_ta_discovery ImmutableList
_task_queue NodeTaskQueue
_unconnected_timeout TimeSpan

Public Methods

Method Description
Abort ( ) : void
AddConnectionOverlord ( ConnectionOverlord co ) : void
AddEdgeListener ( EdgeListener el ) : void
AddTADiscovery ( Discovery disc ) : void

Add a TA discovery agent.

Clear ( ) : void

Deletes (and thus unsubscribes) all IDataHandlers for the table.

ClearTypeSource ( Object t ) : void

Deletes (and thus unsubscribes) all IDataHandlers for a given key.

Connect ( ) : void
ConnectionHandler ( object ct, EventArgs args ) : void
CreateLocalSender ( object n, string uri ) : Node
Disconnect ( ) : void
EnqueueAction ( IAction a ) : void
GetNodeInfo ( int max_local ) : NodeInfo
GetNodeInfo ( int max_local, TAAuthorizer ta_auth ) : NodeInfo
GetStatus ( string con_type_string, Brunet.Address addr ) : StatusMessage
GetTypeSource ( Object t ) : ISource

All packets that come to this are demultiplexed according to t. To subscribe or unsubscribe, get the ISource for the type you want and subscribe to it,

HandleData ( MemBlock data, ISender return_path, object state ) : void
Send ( ICopyable data ) : void
ToString ( ) : string
ToUri ( ) : string
UpdateRemoteTAs ( IList tas_to_add ) : void

Protected Methods

Method Description
Announce ( MemBlock b, ISender from ) : void
AnnounceThread ( ) : void
CheckEdgesCallback ( object node, EventArgs args ) : void
CheckForStateChange ( object ct, EventArgs ce_args ) : void
Close ( Edge e ) : void
ComputeDynamicTimeout ( ) : System.TimeSpan
EdgeHandler ( object edge, EventArgs args ) : void
HandleTADiscoveryState ( Node n, ConnectionState newstate ) : void

If the node is connecting, we need TAs, if its in any other state, we'll deal with what we have.

LogPacketQueue ( ) : void
MonitorLogOff ( ) : void
MonitorLogSwitch ( ) : void
Node ( Address addr ) : System
Node ( Address addr, string realm ) : System
SendStateChange ( ConnectionState new_state ) : void
SetConState ( ConnectionState new_cs, bool &success ) : ConnectionState
StartAllEdgeListeners ( ) : void
StartConnectionOverlords ( ) : void
StopAllEdgeListeners ( ) : void
StopConnectionOverlords ( ) : void

Private Methods

Method Description
Node ( ) : System

Method Details

Abort() public abstract method

public abstract Abort ( ) : void
return void

AddConnectionOverlord() public method

public AddConnectionOverlord ( ConnectionOverlord co ) : void
co ConnectionOverlord
return void

AddEdgeListener() public method

public AddEdgeListener ( EdgeListener el ) : void
el EdgeListener
return void

AddTADiscovery() public method

Add a TA discovery agent.
public AddTADiscovery ( Discovery disc ) : void
disc Brunet.Transport.Discovery
return void

Announce() protected method

protected Announce ( MemBlock b, ISender from ) : void
b MemBlock
from ISender
return void

AnnounceThread() protected method

protected AnnounceThread ( ) : void
return void

CheckEdgesCallback() protected method

protected CheckEdgesCallback ( object node, EventArgs args ) : void
node object
args System.EventArgs
return void

CheckForStateChange() protected method

protected CheckForStateChange ( object ct, EventArgs ce_args ) : void
ct object
ce_args System.EventArgs
return void

Clear() public method

Deletes (and thus unsubscribes) all IDataHandlers for the table.
public Clear ( ) : void
return void

ClearTypeSource() public method

Deletes (and thus unsubscribes) all IDataHandlers for a given key.
public ClearTypeSource ( Object t ) : void
t Object The key for the MultiSource.
return void

Close() protected method

protected Close ( Edge e ) : void
e Edge
return void

ComputeDynamicTimeout() protected method

protected ComputeDynamicTimeout ( ) : System.TimeSpan
return System.TimeSpan

Connect() public method

public Connect ( ) : void
return void

ConnectionHandler() public method

public ConnectionHandler ( object ct, EventArgs args ) : void
ct object
args System.EventArgs
return void

CreateLocalSender() public static method

public static CreateLocalSender ( object n, string uri ) : Node
n object
uri string
return Node

Disconnect() public method

public Disconnect ( ) : void
return void

EdgeHandler() protected method

protected EdgeHandler ( object edge, EventArgs args ) : void
edge object
args System.EventArgs
return void

EnqueueAction() public method

public EnqueueAction ( IAction a ) : void
a IAction
return void

GetNodeInfo() public method

public GetNodeInfo ( int max_local ) : NodeInfo
max_local int
return NodeInfo

GetNodeInfo() public method

public GetNodeInfo ( int max_local, TAAuthorizer ta_auth ) : NodeInfo
max_local int
ta_auth TAAuthorizer
return NodeInfo

GetStatus() public method

public GetStatus ( string con_type_string, Brunet.Address addr ) : StatusMessage
con_type_string string
addr Brunet.Address
return Brunet.Connections.StatusMessage

GetTypeSource() public method

All packets that come to this are demultiplexed according to t. To subscribe or unsubscribe, get the ISource for the type you want and subscribe to it,
public GetTypeSource ( Object t ) : ISource
t Object The key for the MultiSource.
return ISource

HandleData() public method

public HandleData ( MemBlock data, ISender return_path, object state ) : void
data MemBlock
return_path ISender
state object
return void

HandleTADiscoveryState() protected method

If the node is connecting, we need TAs, if its in any other state, we'll deal with what we have.
protected HandleTADiscoveryState ( Node n, ConnectionState newstate ) : void
n Node
newstate Brunet.Connections.ConnectionState
return void

LogPacketQueue() protected method

protected LogPacketQueue ( ) : void
return void

MonitorLogOff() protected method

protected MonitorLogOff ( ) : void
return void

MonitorLogSwitch() protected method

protected MonitorLogSwitch ( ) : void
return void

Node() protected method

protected Node ( Address addr ) : System
addr Address
return System

Node() protected method

protected Node ( Address addr, string realm ) : System
addr Address
realm string
return System

Send() public method

public Send ( ICopyable data ) : void
data ICopyable
return void

SendStateChange() protected method

protected SendStateChange ( ConnectionState new_state ) : void
new_state ConnectionState
return void

SetConState() protected method

protected SetConState ( ConnectionState new_cs, bool &success ) : ConnectionState
new_cs ConnectionState
success bool
return ConnectionState

StartAllEdgeListeners() protected method

protected StartAllEdgeListeners ( ) : void
return void

StartConnectionOverlords() protected method

protected StartConnectionOverlords ( ) : void
return void

StopAllEdgeListeners() protected method

protected StopAllEdgeListeners ( ) : void
return void

StopConnectionOverlords() protected method

protected StopConnectionOverlords ( ) : void
return void

ToString() public method

public ToString ( ) : string
return string

ToUri() public method

public ToUri ( ) : string
return string

UpdateRemoteTAs() public method

public UpdateRemoteTAs ( IList tas_to_add ) : void
tas_to_add IList
return void

Property Details

DemuxHandler public property

Handles subscriptions for the different types of packets that come to this node.
public DemuxHandler DemuxHandler
return DemuxHandler

EdgeVerifyMethod public property

public EdgeVerifier EdgeVerifyMethod
return EdgeVerifier

MAX_AVG_QUEUE_LENGTH public static property

public static int MAX_AVG_QUEUE_LENGTH
return int

MAX_CONNECTION_TIMEOUT protected static property

protected static TimeSpan MAX_CONNECTION_TIMEOUT
return TimeSpan

MAX_QUEUE_LENGTH protected static property

protected static int MAX_QUEUE_LENGTH
return int

PACKET_QUEUE_RETAIN public static property

public static float PACKET_QUEUE_RETAIN
return float

SimulatorRandom public static property

public static Random SimulatorRandom
return Random

_LOG protected property

protected bool _LOG
return bool

_MAX_RECORDED_TAS static protected property

static protected int _MAX_RECORDED_TAS
return int

_announce_thread protected property

protected Thread _announce_thread
return Thread

_check_edges protected property

protected Util.FuzzyEvent _check_edges
return Util.FuzzyEvent

_co_list protected property

protected List _co_list
return List

_codeinjection protected property

protected Brunet.Services.CodeInjection _codeinjection
return Brunet.Services.CodeInjection

_con_state protected property

protected ConnectionState _con_state
return ConnectionState

_connection_table protected property

protected ConnectionTable _connection_table
return ConnectionTable

_connection_timeout protected property

protected TimeSpan _connection_timeout
return TimeSpan

_current_action protected property

protected IAction _current_action
return IAction

_disconnect_on_overload public property

public bool _disconnect_on_overload
return bool

_edge_factory protected property

protected EdgeFactory _edge_factory
return EdgeFactory

_edgelistener_list protected property

protected ArrayList _edgelistener_list
return ArrayList

_heart_period protected property

protected int _heart_period
return int

_heartbeat_handlers protected property

protected Dictionary _heartbeat_handlers
return Brunet.Util.FuzzyEvent>.Dictionary

_local_add protected property

protected Address _local_add
return Address

_monitor_fe protected property

protected Util.FuzzyEvent _monitor_fe
return Util.FuzzyEvent

_mr_handler protected property

protected MapReduceHandler,Brunet.Services.MapReduce _mr_handler
return Brunet.Services.MapReduce.MapReduceHandler

_packet_queue protected property

protected LFBlockingQueue,Brunet.Concurrent _packet_queue
return Brunet.Concurrent.LFBlockingQueue

_packet_queue_exp_avg protected property

protected float _packet_queue_exp_avg
return float

_realm protected property

protected string _realm
return string

_remote_ta protected property

protected ImmutableList _remote_ta
return ImmutableList

_rpc protected property

protected RpcManager _rpc
return RpcManager

_rrm protected property

protected ReqrepManager _rrm
return ReqrepManager

_running protected property

protected int _running
return int

_send_pings protected property

protected int _send_pings
return int

_sync protected property

protected object _sync
return object

_ta_discovery protected property

protected ImmutableList _ta_discovery
return ImmutableList

_task_queue protected property

protected NodeTaskQueue _task_queue
return NodeTaskQueue

_unconnected_timeout protected static property

protected static TimeSpan _unconnected_timeout
return TimeSpan