Public Member Functions | Private Member Functions | Private Attributes
rtctree.tree.RTCTree Class Reference

Tree object. More...

List of all members.

Public Member Functions

def __del__
def __init__
def __str__
def add_name_server
def get_node
def give_away_orb
def has_path
def is_component
def is_directory
def is_manager
def is_nameserver
def is_unknown
def is_zombie
def iterate
def load_servers_from_env
def orb
def own_orb

Private Member Functions

def _create_orb
def _parse_name_server
def _parse_name_servers

Private Attributes

 _dynamic
 _orb
 _orb_is_mine
 _poa
 _root

Detailed Description

Tree object.

Represents a tree of name servers, directories, managers and components.

This stores the root node. All other nodes branch off from that.

When creating a tree, you may pass no arguments, or a list of name servers
to load, or a path or list of paths (as returned by
rtctree.path.parse_path). If no arguments are given, the tree will load
name servers from the environment variable specified in
NAMESERVERS_ENV_VAR. If a list of servers are given, only those servers
will be loaded.

If paths are given, and the path is just '/', behaviour is as if no path
argument were given. If a path starts with '/' and contains an element
after it, that element will be treated as a name server. Otherwise the path
is considered to be bad.

Definition at line 40 of file tree.py.


Constructor & Destructor Documentation

def rtctree.tree.RTCTree.__init__ (   self,
  servers = None,
  paths = None,
  orb = None,
  filter = [],
  dynamic = False,
  args,
  kwargs 
)
Constructor.

@param servers A list of servers to parse into the tree.
@param paths A list of paths from which to get servers to parse
     into the tree.
@param orb If not None, the specified ORB will be used. If None,
   the tree object will create its own ORB.
@param filter A list of paths (each a list of strings).
      If not empty, then only objects in the paths will
      be parsed, to increase speed. If the tail of a
      path is a directory, that entire directory will be
      parsed. Directories that are not the tail will
      only have the next entry in the path parsed.
@param dynamic Use observers to keep the tree up-to-date. For example,
       when a component changes state, an observer can notify
       RTCTree so that the corresponding object in the tree can
       be updated. Currently this only affects components.
@raises NonRootPathError

Definition at line 58 of file tree.py.

Definition at line 104 of file tree.py.


Member Function Documentation

Definition at line 110 of file tree.py.

def rtctree.tree.RTCTree._create_orb (   self,
  orb = None 
) [private]

Definition at line 250 of file tree.py.

def rtctree.tree.RTCTree._parse_name_server (   self,
  address,
  filter = [],
  dynamic = False 
) [private]

Definition at line 281 of file tree.py.

def rtctree.tree.RTCTree._parse_name_servers (   self,
  servers,
  filter = [],
  dynamic = False 
) [private]

Definition at line 267 of file tree.py.

def rtctree.tree.RTCTree.add_name_server (   self,
  server,
  filter = [],
  dynamic = None 
)
Parse a name server, adding its contents to the tree.

@param server The address of the name server, in standard
      address format. e.g. 'localhost',
      'localhost:2809', '59.7.0.1'.
@param filter Restrict the parsed objects to only those in this
      path. For example, setting filter to [['/',
      'localhost', 'host.cxt', 'comp1.rtc']] will
      prevent 'comp2.rtc' in the same naming context
      from being parsed.
@param dynamic Override the tree-wide dynamic setting. If not provided,
       the value given when the tree was created will be used.

Definition at line 114 of file tree.py.

def rtctree.tree.RTCTree.get_node (   self,
  path 
)
Get a node by path.

@param path A list of path elements pointing to a node in the tree.
    For example, ['/', 'localhost', 'dir.host']. The first
    element in this path should be the root node's name.

Definition at line 133 of file tree.py.

Releases ownership of an ORB created by the tree.

This will prevent the ORB being destroyed when the tree is.

Definition at line 229 of file tree.py.

def rtctree.tree.RTCTree.has_path (   self,
  path 
)
Check if the tree has a path.

@param path A list of path elements pointing to a node in the tree.
    For example, ['/', 'localhost', 'dir.host']. The first
    element in this path should be the root node's name.

Definition at line 143 of file tree.py.

def rtctree.tree.RTCTree.is_component (   self,
  path 
)
Is the node pointed to by @ref path a component?

Definition at line 153 of file tree.py.

def rtctree.tree.RTCTree.is_directory (   self,
  path 
)
Is the node pointed to by @ref path a directory (name servers and
naming contexts)?

Definition at line 158 of file tree.py.

def rtctree.tree.RTCTree.is_manager (   self,
  path 
)
Is the node pointed to by @ref path a manager?

Definition at line 166 of file tree.py.

def rtctree.tree.RTCTree.is_nameserver (   self,
  path 
)
Is the node pointed to by @ref path a name server (specialisation
of directory nodes)?

Definition at line 171 of file tree.py.

def rtctree.tree.RTCTree.is_unknown (   self,
  path 
)
Is the node pointed to by @ref path an unknown object?

Definition at line 179 of file tree.py.

def rtctree.tree.RTCTree.is_zombie (   self,
  path 
)
Is the node pointed to by @ref path a zombie object?

Definition at line 184 of file tree.py.

def rtctree.tree.RTCTree.iterate (   self,
  func,
  args = None,
  filter = [] 
)
Call a function on the root node, and recursively all its children.

This is a depth-first iteration.

@param func The function to call. Its declaration must be
    'def blag(node, args)', where 'node' is the current node
    in the iteration and args is the value of @ref args.
@param args Extra arguments to pass to the function at each iteration.
    Pass multiple arguments in as a tuple.
@param filter A list of filters to apply before calling func for each
      node in the iteration. If the filter is not True,
      @ref func will not be called for that node. Each filter
      entry should be a string, representing on of the is_*
      properties (is_component, etc), or a function object.
@return The results of the calls to @ref func in a list.

Definition at line 189 of file tree.py.

def rtctree.tree.RTCTree.load_servers_from_env (   self,
  filter = [],
  dynamic = None 
)
Load the name servers environment variable and parse each server in
the list.

@param filter Restrict the parsed objects to only those in this
      path. For example, setting filter to [['/',
      'localhost', 'host.cxt', 'comp1.rtc']] will
      prevent 'comp2.rtc' in the same naming context
      from being parsed.
@param dynamic Override the tree-wide dynamic setting. If not provided,
       the value given when the tree was created will be used.

Definition at line 209 of file tree.py.

def rtctree.tree.RTCTree.orb (   self)
The reference to the ORB held by this tree.

Definition at line 246 of file tree.py.

Claims ownership of an ORB created elsewhere.

This will cause the ORB to be destroyed when the tree is.

Definition at line 237 of file tree.py.


Member Data Documentation

Definition at line 77 of file tree.py.

Definition at line 250 of file tree.py.

Definition at line 233 of file tree.py.

Definition at line 250 of file tree.py.

Definition at line 77 of file tree.py.


The documentation for this class was generated from the following file:


rtctree
Author(s): Geoffrey Biggs
autogenerated on Wed Aug 26 2015 16:13:08