Package g4ds :: Module communitymanager :: Class CommunityManager
[show private | hide private]
[frames | no frames]

Class CommunityManager


Responsible for maintaining information about Communities this node is member of

Connected to a database. All the data is loaded into the memory at startup time. Changes are written through directly.
Method Summary
  __init__(self, loadFromDatabase)
Initialises the Community Manager
  __str__(self)
Some basic information about the object
  addCommunity(self, community, persistent, storeMemberRelations)
Adds a community instance to the repository
Community getCommunity(self, communityId)
Getter
List of String getCommunityIds(self)
GETTER
  registerCommunityAlgorithmRelation(self, communityid, algorithmid)
Passes the request to the database backend.
  registerCommunityAuthorityRelation(self, communityid, memberid)
Passes the request to the database backend.
  registerCommunityMemberRelation(self, communityid, memberid)
Passes the request to the database backend.
  registerCommunityProtocolRelation(self, communityid, protocolid)
Passes the request to the database backend.
  updateCommunity(self, community, dropAuthorityRelations, dropGatewayRelations, dropMemberRelations, dropProtocols, dropAlgorithms)
Updates or inserts the description for one community.

Method Details

__init__(self, loadFromDatabase=0)
(Constructor)

Initialises the Community Manager

Instanstiates local variables. Loads all the stuff from the database.
Parameters:
loadFromDatabase - Indicates, whether the manager shall be initialised from the database backend
           (type=Boolean)

__str__(self)
(Informal representation operator)

Some basic information about the object

addCommunity(self, community, persistent=1, storeMemberRelations=0)

Adds a community instance to the repository
Parameters:
community - Community to be inserted
           (type=Community)
persistent - Indicates, whether the community shall be written through to the database
           (type=Boolean)
storeMemberRelations - When persistent is true, shall the relations be saved in the db too?
           (type=Boolean)

getCommunity(self, communityId)

Getter
Parameters:
communityId - ID of the community to return
           (type=String)
Returns:
The community with the given id from the community repository.
           (type=Community)

getCommunityIds(self)

GETTER
Returns:
The list of ids off all communitities
           (type=List of String)

registerCommunityAlgorithmRelation(self, communityid, algorithmid)

Passes the request to the database backend.
Parameters:
communityid - The id of the community the algorithm shall be added to
           (type=String)
algorithmid - The id of the algorithm, which shall be added to the community
           (type=String)

registerCommunityAuthorityRelation(self, communityid, memberid)

Passes the request to the database backend.
Parameters:
communityid - ID of the community to put into relation
           (type=String)
memberid - ID of the member to put into relation as a authority for the given community
           (type=String)

registerCommunityMemberRelation(self, communityid, memberid)

Passes the request to the database backend.
Parameters:
communityid - ID of the community to put into relation
           (type=String)
memberid - ID of the member to put into relation
           (type=String)

registerCommunityProtocolRelation(self, communityid, protocolid)

Passes the request to the database backend.
Parameters:
communityid - The id of the community the protocol shall be added to
           (type=String)
protocolid - The id of the protocol, which shall be added to the community
           (type=String)

updateCommunity(self, community, dropAuthorityRelations=1, dropGatewayRelations=1, dropMemberRelations=0, dropProtocols=1, dropAlgorithms=1)

Updates or inserts the description for one community.
Parameters:
community - Reference to the community instance to be updated
           (type=Community)
dropAuthorityRelations - Indicates, whether all relations for authorities shall be dropped
           (type=Boolean)
dropGatewayRelations - Indicates, whether all relations for gateways shall be dropped
           (type=Boolean)
dropMemberRelations - Indicates, whether all relations for members shall be dropped
           (type=Boolean)

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