Home | Trees | Index | Help |
|
---|
Package g4ds :: Module messagewrapper :: Class GenericWrapper |
|
ControlMessageWrapper
,
MessageWrapper
,
PolicyFileWrapper
,
RoutingTableWrapper
Wrapper for generic functionality.
Wrapping for things like an action and data.Method Summary | |
---|---|
Yet empty constructor. | |
String and String
|
Unwraps a messge as assembled with wrapActionAndData before. |
Extracts actions and data. | |
Comparable with a function call. | |
Wraps a message with one root element, several args and several cdatas. | |
String
|
Inverse function for _encodeHex . |
String
|
Replaces the function _replaceCdata , which was not really a nice
and sober solution for the nested CData sections problem. |
String
|
Replaces CData section keywords by pre-defined substitutes. |
String
|
Inverse function of _replaceCdata |
Method Details |
---|
__init__(self)
Yet empty constructor.
|
unwrapActionAndData(self, rootnode, message, decodeHex=0)Unwraps a messge as assembled withwrapActionAndData before.
|
unwrapArgsAndDatas(self, rootname, message)Extracts actions and data. |
wrapActionAndData(self, rootnode, action, data, encodeHex=0)Comparable with a function call. Action is wrapped as a text node, data in a CDATA section.
|
wrapArgsAndDatas(self, root, args=None, datas=None)Wraps a message with one root element, several args and several cdatas. |
_decodeHex(self, message, decompress=1)Inverse function for Converts a hex code string back into its original real data. Two characters of hex code will represented one character in the output; hence, the given message must have a lenght of an even number. Due to size constraint with the multiple wrappings compression was put into place. Check the explanaitions in_encodeHex for further details. Control
decompression with the parameter decompress . By default, decompression is
switched on.
|
_encodeHex(self, message, compress=1)Replaces the function CData sections in XML documents must not be nested. Before any new CData section is created, this function should be invoked for "encoding" the data to put into the CData section. The encoded version of the message will be a string of hex values, each character in the source string is prepresented by two characters in the return string. A problem arised when using this approach due to the multiple wrappings for single messages. The messages have significantly blown up in size and could not be transmitted properly. To overcome these problems, compressing has been put in place. This way, before the data is hex encoded it will be compressed using the zlib python libraries. The oposite procedure was put in place for_decodeHex - this way, it's totally
transparent to the calling application. Control the use of compression
with the parameter compress ; by default compression is
enabled now.
|
_replaceCdata(self, message)Replaces CData section keywords by pre-defined substitutes. CData sections in XML documents must not be nested. Before any new CData section is created, this function should be invoked for "encoding" inner CData section and substituting the indicator beginning and end strings. It can now also handle nested, nested, ... CData sections.
|
_unReplaceCdata(self, message)Inverse function of
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.0 on Sat Oct 22 22:52:46 2005 | http://epydoc.sf.net |