Package g4ds :: Module messagewrapper :: Class GenericWrapper
[show private | hide private]
[frames | no frames]

Class GenericWrapper

Known Subclasses:
ControlMessageWrapper, MessageWrapper, PolicyFileWrapper, RoutingTableWrapper

Wrapper for generic functionality.

Wrapping for things like an action and data.
Method Summary
  __init__(self)
Yet empty constructor.
String and String unwrapActionAndData(self, rootnode, message, decodeHex)
Unwraps a messge as assembled with wrapActionAndData before.
  unwrapArgsAndDatas(self, rootname, message)
Extracts actions and data.
  wrapActionAndData(self, rootnode, action, data, encodeHex)
Comparable with a function call.
  wrapArgsAndDatas(self, root, args, datas)
Wraps a message with one root element, several args and several cdatas.

Method Details

__init__(self)
(Constructor)

Yet empty constructor.

unwrapActionAndData(self, rootnode, message, decodeHex=0)

Unwraps a messge as assembled with wrapActionAndData before.
Parameters:
rootnode - Name of the rootnode inside the message
           (type=String)
message - XML message
           (type=String)
decodeHex - Was the message hex encoded when assembled? Decode it with this parameter
           (type=Boolean)
Returns:
The action and the data extracted from the XML fragment
           (type=String and String)

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.
Parameters:
rootnode - Name of the root node to create
           (type=String)
action - Name of the action in string representation
           (type=String)
data - Any data to be wrapped (may even be binary data)
           (type=String)
encodeHex - Shall the data be hex encoded before put into the CDATA section
           (type=Boolean)

wrapArgsAndDatas(self, root, args=None, datas=None)

Wraps a message with one root element, several args and several cdatas.

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