Package g4ds :: Module maintainlib
[show private | hide private]
[frames | no frames]

Module g4ds.maintainlib

Functions to g4ds for maintainence.

Grid for Digital Security (G4DS)

This module provides the functionality. The access is provided by the module maintain.

Functions may call each other - proper output and appropriate indenting is maintained. This module is still shell interactive; hence, in the current stage it could not simply be used as a lib from another application or gui.

Author: Michael Pilgermann

Contact: mailto:mpilgerm@glam.ac.uk

License: GPL (General Public License)

Function Summary
  addEndpointsForMember(memberid, communityid, indent)
Installs enpoints for a member and a community.
  addKsdl(filename, indent)
  addMdl(filename, indent)
Applies a member description to the local managers from a file.
  addRoute(indent)
Add a route to the routing table manually.
  addTcdl(filename, indent)
Applies a community description to the local managers from a file.
  communityInfo(id)
Prints information about a certain community.
  createServiceKeys(indent)
  downloadAndInstallCommunityDescription(communityid, destinationmemberid, indent)
Downloads the community description from the given member.
  downloadAndInstallKsdl(serviceid, destinationmemberid, indent)
  dynamicRoutingUpdate(indent)
Polls routing information from connected gateways and applies infos to the local routing table.
  flushRoutingTable(indent)
Causes a flush of the entire routing table.
  getLocalMdl(filename, indent)
Generates the member description for the local node.
  nodeInfo(id)
Prints information about a remote node.
  printNodeDescription(dict, local)
Prints information about a certain node.
  printPermissionMatrix(indent)
  printRoutingTable(indent)
Print the routing table.
  printServiceInformation(serviceid, indent)
Prints information about one service.
  printServiceList(indent)
Prints list of known services with basic information.
  pushMemberDescription(memberid, communityid, destinationList, indent)
Uploads the local member description to certain nodes.
  readLog(n, indent)
Show log entries.
  recalculatePermissions(indent)
  recalculateRoutingTable(indent)
Recreates the routing table by the use of gateway information.
  sendTestMessage(indent)
Sends a test message to a member using a certain community.
  status()
Prints information about the local node.
  subscribeMemberToCommunity(memberid, communityid, destination, indent)
Performs the subscription of a member to a community.
  subscribeMemberToService(memberid, serviceid, indent)
  uploadKsdl(serviceid, indent)
  _addEndpointsAutomatically(memberid, communityid, indent)
Supporter function for endpoint installation (addEndpointsForMember ) - automatic mode.
  _connectForSubscription(communityid, memberid, destination, inbackground, status)
Supporter function for subsribing a member to a community.
  _doSubscribe(indent, communityid, newmemberid, destination)
Supporter function for member subscription process.
  _enterFunction(indent, text)
Should be called by a function at entry stage.
  _finishActionLine(sucess)
Finishes a line as prepared by _printAction.
  _leaveFunction(indent, text, sucess)
Shoudl be called by a function before leaving.
  _printAction(indent, text, linebreak, out)
Prints a line for an action and puts the cursor on a predefined column.
  _requestInput(indent, prompt, default)
Prompts the user for input.
  _subdownloadTcdl(communityid, memberid, inbackground, status)
Supporter function for downloading a tcdl from a remote host.

Variable Summary
int COLUMN_INPUT = 70                                                                    
int COLUMN_SUCESS = 80                                                                    
int LENGTH_LINE = 89                                                                    
String oneindent: The space to indent between functions within the hierarchy
String SUCESS_NEG: Default string for unsucessful action
String SUCESS_POS: Default string for sucessful action
str SUCESS_SKIP = '\x1b[33;01m SKIP \x1b[39;49;00m'
str SUCESS_WARN = '\x1b[33;01m  !!  \x1b[39;49;00m'

Function Details

addEndpointsForMember(memberid=None, communityid=None, indent=0)

Installs enpoints for a member and a community.

addMdl(filename=None, indent=0)

Applies a member description to the local managers from a file.

addRoute(indent=0)

Add a route to the routing table manually.

addTcdl(filename=None, indent=0)

Applies a community description to the local managers from a file.

communityInfo(id)

Prints information about a certain community.

downloadAndInstallCommunityDescription(communityid=None, destinationmemberid=None, indent=0)

Downloads the community description from the given member.

dynamicRoutingUpdate(indent=0)

Polls routing information from connected gateways and applies infos to the local routing table.

flushRoutingTable(indent=0)

Causes a flush of the entire routing table.

getLocalMdl(filename='./local.mdl', indent=0)

Generates the member description for the local node.

Uses information from the local managers and config file.

nodeInfo(id)

Prints information about a remote node.

printNodeDescription(dict, local=0)

Prints information about a certain node.

printRoutingTable(indent=0)

Print the routing table.

printServiceInformation(serviceid, indent=0)

Prints information about one service.

printServiceList(indent=0)

Prints list of known services with basic information.

pushMemberDescription(memberid=None, communityid=None, destinationList=[], indent=0)

Uploads the local member description to certain nodes.
Parameters:
memberid - ID of the member whose mdl shall be dealt with
           (type=String)
communityid - ID of the community - MDL will be uploaded to its authorities
           (type=String)
destinationList - List of members to send the mdl to
           (type=List of String)

readLog(n=10, indent=0)

Show log entries.

recalculateRoutingTable(indent=0)

Recreates the routing table by the use of gateway information.

sendTestMessage(indent=0)

Sends a test message to a member using a certain community.

status()

Prints information about the local node.

subscribeMemberToCommunity(memberid=None, communityid=None, destination=None, indent=0)

Performs the subscription of a member to a community.

If the community is not yet known on this system, it's attempted to be downloaded.
Parameters:
memberid - The id of the member to subscribe (if None, it will be requested from the stdin)
           (type=String)
communityid - The id of the community to subscribe to (if None, it will be requested from stdin)
           (type=String)

_addEndpointsAutomatically(memberid, communityid, indent=0)

Supporter function for endpoint installation (addEndpointsForMember ) - automatic mode.

_connectForSubscription(communityid, memberid, destination, inbackground=0, status=None)

Supporter function for subsribing a member to a community.

Supports job functionality.

_doSubscribe(indent, communityid, newmemberid, destination)

Supporter function for member subscription process.

Encapsulates the user input and the timer for waiting for replies.

_enterFunction(indent, text=None)

Should be called by a function at entry stage.

Calculates indent and puts some additional output.

_finishActionLine(sucess='\x1b[32;01m  OK  \x1b[39;49;00m')

Finishes a line as prepared by _printAction.

Puts the given sucess string in brackets.

_leaveFunction(indent, text='Finished here', sucess=None)

Shoudl be called by a function before leaving.

Puts some output and optionally information about sucess.

_printAction(indent, text, linebreak=0, out=<epydoc.imports._DevNull instance at 0xb7bbbc0c>)

Prints a line for an action and puts the cursor on a predefined column.

Usually, no line break is written, the line should be finished after performing an action using the function _finishActionLine.

_requestInput(indent, prompt, default=None)

Prompts the user for input.

_subdownloadTcdl(communityid, memberid, inbackground=0, status=None)

Supporter function for downloading a tcdl from a remote host.

Supports job functionality.

Variable Details

COLUMN_INPUT

Type:
int
Value:
70                                                                    

COLUMN_SUCESS

Type:
int
Value:
80                                                                    

LENGTH_LINE

Type:
int
Value:
89                                                                    

oneindent

The space to indent between functions within the hierarchy
Type:
String
Value:
'   '                                                                  

SUCESS_NEG

Default string for unsucessful action
Type:
String
Value:
'\x1b[31;01mFAILED\x1b[39;49;00m'                                      

SUCESS_POS

Default string for sucessful action
Type:
String
Value:
'\x1b[32;01m  OK  \x1b[39;49;00m'                                      

SUCESS_SKIP

Type:
str
Value:
'\x1b[33;01m SKIP \x1b[39;49;00m'                                      

SUCESS_WARN

Type:
str
Value:
'\x1b[33;01m  !!  \x1b[39;49;00m'                                      

Generated by Epydoc 2.0 on Sat Oct 22 22:52:46 2005 http://epydoc.sf.net