Package beepy :: Package profiles :: Module mgmtcreator :: Class Creator
[show private | hide private]
[frames | no frames]

Class Creator


A Creator object is used to create management messages. This provides a convenience API for the creation of all the management messages used by the BEEP Management profile.
Method Summary
  __init__(self)
A newly created creator is basically empty.
  __del__(self)
We have to specifically unlink() the doc DOM else Python may not garbage collect it due to circular references.
  createCloseMessage(self, number, code, text, xmlLang)
Creates a <close> message.
  createErrorMessage(self, code, text, xmlLang)
Creates an <error> message populated with the supplied parameters.
  createGreetingMessage(self, profileURIList, features, localize)
Create a <greeting/> message object with any parameters it might need.
  createOKMessage(self)
Creates an <ok> message, used for positive replies.
  createStartMessage(self, number, profileList, serverName)
createStartMessage takes a profileList, different from createGreetingMessage.
  createStartReplyMessage(self, profileURI)
Creates a positive reply message to a start message, which will be a <profile> message.
  messageToString(self, DOMdocument)
A convenience method to print messages without leading <?xml version="1.0" ?> type strings in them

Method Details

__init__(self)
(Constructor)

A newly created creator is basically empty.

__del__(self)
(Destructor)

We have to specifically unlink() the doc DOM else Python may not garbage collect it due to circular references.

createCloseMessage(self, number, code, text=None, xmlLang=None)

Creates a <close> message.
Parameters:
number - the number of the channel to close
           (type=int or string)
code - The reason the channel is being closed
           (type=string)
text - A human language description of the close reason.
           (type=string)
xmlLang - The language used by the optional text part of the message.
           (type=string)

createErrorMessage(self, code, text=None, xmlLang=None)

Creates an <error> message populated with the supplied parameters.
Parameters:
code - the error code
           (type=string)
text - A human language description of the error
           (type=string)
xmlLang - The language used by the optional text part of the message.
           (type=string)

createGreetingMessage(self, profileURIList=None, features=None, localize=None)

Create a <greeting/> message object with any parameters it might need.
Parameters:
profileURIList - a list of profiles to include in the greeting.
           (type=a list of strings)
features - any special features we want to advertise
           (type=string)
localize - a localization definition, for language support
           (type=string)

createOKMessage(self)

Creates an <ok> message, used for positive replies.

createStartMessage(self, number, profileList, serverName=None)

createStartMessage takes a profileList, different from createGreetingMessage. It is a list of profile descriptions. A profile description consists of a list thus:

['profileURI', 'encoding', chardata]

profileURI is a string of the URI for this profile. eg: http://iana.org/beep/SASL/OTP

encoding is an optional encoding type specifying if the chardata within the profile element is a base64-encoded string

chardata is up to 4k octets of initialization message given to the channel.
Parameters:
number - The number of the channel to start
           (type=int or string)
profileList - a list of profiles, explained above
serverName - a name used to refer to the server. Defined in RFC3080, but I'll have to look it up and update this bit of the doco.
           (type=string)

createStartReplyMessage(self, profileURI)

Creates a positive reply message to a start message, which will be a <profile> message.
Parameters:
profileURI - the URI used to create the channel
           (type=string)

messageToString(self, DOMdocument)

A convenience method to print messages without leading <?xml version="1.0" ?> type strings in them

Generated by Epydoc 2.0 on Thu Sep 30 14:39:25 2004 http://epydoc.sf.net