}
// create session object if necessary, context etc and get it
if (this.getLogger().isDebugEnabled() == true) {
this.getLogger().debug("creating session");
}
SessionContext context = this.getSunRiseSessionContext(true);
if (this.getLogger().isDebugEnabled() == true) {
this.getLogger().debug("session created");
}
synchronized(context) {
// add special nodes to the authentication block:
// useragent, type and media
Element specialElement;
Text specialValue;
Element authNode;
authNode = (Element)authenticationFragment.getFirstChild();
specialElement = authenticationFragment.getOwnerDocument().createElementNS(null, "useragent");
specialValue = authenticationFragment.getOwnerDocument().createTextNode(request.getHeader("User-Agent"));
specialElement.appendChild(specialValue);
authNode.appendChild(specialElement);
specialElement = authenticationFragment.getOwnerDocument().createElementNS(null, "type");
specialValue = authenticationFragment.getOwnerDocument().createTextNode("sunrise");
specialElement.appendChild(specialValue);
authNode.appendChild(specialElement);
specialElement = authenticationFragment.getOwnerDocument().createElementNS(null, "media");
specialValue = authenticationFragment.getOwnerDocument().createTextNode(this.mediaType);
specialElement.appendChild(specialValue);
authNode.appendChild(specialElement);
// store the authentication data in the context
context.setXML("/" + myHandler.getName(), authenticationFragment);
// Now create the return value for this method:
// <code>null</code>
authenticationFragment = null;