'Called by the stream when it has started.
This examines the default namespace of the incoming stream and whether
there is a requested hostname for the component. Then it generates a
stream identifier, sends a response header and adds an observer for
the first incoming element, triggering L{onElement}.'

def streamStarted(self, rootElement):

    xmlstream.ListenAuthenticator.streamStarted(self, rootElement)
    if (rootElement.defaultUri != self.namespace):
        exc = error.StreamError('invalid-namespace')
        self.xmlstream.sendStreamError(exc)
        return
    if (not self.xmlstream.thisEntity):
        exc = error.StreamError('improper-addressing')
        self.xmlstream.sendStreamError(exc)
        return
    self.xmlstream.sendHeader()
    self.xmlstream.addOnetimeObserver('/*', self.onElement)
