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

Class Community


All information about one community
Method Summary
  __init__(self, id, name, description, tcdl, tcdlversion, tcdldate)
Initialises a Community instance
  __str__(self)
Some basic information about the object
  addAlgorithm(self, algorithmid, loading)
Adds a algorithm to the community.
  addAuthority(self, authority_memberId, loading, registerInMember)
Adds the authority role for the given member to this community.
  addGateway(self, gateway)
Add a community gateway to this community.
  addMember(self, memberId, isAuthority, registerInMember, loading)
Add a member to this community.
  addProtocol(self, protocolid, loading)
Adds a protocol to the community.
List of String getAlgorithms(self)
Returns the list of algorithms for this community.
List of String getAuthorities(self)
GETTER
  getDescription(self)
GETTER
CommunityGateway getDestinationGateways(self)
GETTER
  getId(self)
GETTER
List of String getMembers(self)
GETTER
  getName(self)
GETTER
List of String getProtocols(self)
Returns the list of protocols for this community.
CommunityGateway getSourceGateways(self)
GETTER
  getTcdl(self)
GETTER
  getTcdlDate(self)
GETTER
  getTcdlVersion(self)
GETTER
Boolean hasMember(self, memberid)
Checks, whether the community has a member with the given id subscribed to it.

Method Details

__init__(self, id=None, name=None, description=None, tcdl=None, tcdlversion=None, tcdldate=None)
(Constructor)

Initialises a Community instance

Assigns the parameters to the instance variables. If no id is given (or is None), one will be calculated.
Parameters:
id - Unique ID for the Community
           (type=String)
name - Name of the Community
           (type=String)
description - Community Description
           (type=String)
tcdl - Community Description in XML format
           (type=String)
tcdlversion - Version of the current XML Community Description
           (type=String)
tcdldate - Date of the current version of the XML Community Description
           (type=String)

__str__(self)
(Informal representation operator)

Some basic information about the object

addAlgorithm(self, algorithmid, loading=0)

Adds a algorithm to the community.
Parameters:
algorithmid - ID of the algorithm to add to the community
           (type=String)
loading - Indicates, whether this function is called during initialisation process. No changes must be written to the db then.
           (type=Boolean)

addAuthority(self, authority_memberId, loading=0, registerInMember=0)

Adds the authority role for the given member to this community.
Parameters:
authority_memberId - Member id of the member which is a authority for this community
           (type=String)
loading - Indicates, whether this function is called during initialisation process. No changes must be written to the db then.
           (type=Boolean)
registerInMember - Indicates, whether the function Member.addCommunity() shall be invoked.
           (type=Boolean)

addGateway(self, gateway)

Add a community gateway to this community.

It will determine itself, whether it is the source or the destination for the gateway.
Parameters:
gateway - Community gateway to be added
           (type=CommunityGateway)

addMember(self, memberId, isAuthority=0, registerInMember=0, loading=0)

Add a member to this community.

This function invokes a function in the db backend process for updating the table for the relation between members and communities.
Parameters:
memberId - ID of the member to be added
           (type=String)
isAuthority - Indicates, whether the given member is Community Authority for this community
           (type=Boolean)
registerInMember - Indicates, whether the function Member.addCommunity() shall be invoked.
           (type=Boolean)
loading - Indicates, whether this function is called during initialisation process. No changes must be written to the db then.
           (type=Boolean)

Note: If your system is db backend connected, you must first add community to the community manager and the member to the member manager! Then you may add relations between them.

addProtocol(self, protocolid, loading=0)

Adds a protocol to the community.
Parameters:
protocolid - ID of the protocol to add to the community
           (type=String)
loading - Indicates, whether this function is called during initialisation process. No changes must be written to the db then.
           (type=Boolean)

getAlgorithms(self)

Returns the list of algorithms for this community.
Returns:
The list of IDs for the algorithms
           (type=List of String)

getAuthorities(self)

GETTER

Provides the list of community authorities for this community.
Returns:
List of IDs for the members, which are authorities for this community
           (type=List of String)

getDescription(self)

GETTER
Returns:
The description (comment) as saved in the instance variable rtype: String

getDestinationGateways(self)

GETTER

Provides all the gateways, this community may receive through.
Returns:
References to the gateways instances.
           (type=CommunityGateway)

getId(self)

GETTER
Returns:
The id as saved in the instance variable rtype: String

getMembers(self)

GETTER

Provides the list of members of this community.
Returns:
List of IDs for the members
           (type=List of String)

getName(self)

GETTER
Returns:
The name as saved in the instance variable rtype: String

getProtocols(self)

Returns the list of protocols for this community.
Returns:
The list of IDs for the protocols
           (type=List of String)

getSourceGateways(self)

GETTER

Provides all the gateways, this community may send through.
Returns:
References to the gateways instances.
           (type=CommunityGateway)

getTcdl(self)

GETTER
Returns:
The XML community descriptoin as saved in the instance variable rtype: String

getTcdlDate(self)

GETTER
Returns:
The date of the version of the TCDL as saved in the instance variable rtype: String

getTcdlVersion(self)

GETTER
Returns:
The version of the tcdl as saved in the instance variable rtype: String

hasMember(self, memberid)

Checks, whether the community has a member with the given id subscribed to it.
Parameters:
memberid - ID of the potential member of the community
           (type=String)
Returns:
Indicates, whether the member is member of the community
           (type=Boolean)

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