FileDocCategorySizeDatePackage
SecurityIdentityNode.javaAPI DocGlassfish v2 API5210Fri May 04 22:31:40 BST 2007com.sun.enterprise.deployment.node.ejb

SecurityIdentityNode

public class SecurityIdentityNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode
This node handles all information relative to security-indentity tag
author
Jerome Dochez
version

Fields Summary
Constructors Summary
public SecurityIdentityNode()
Creates new SecurityIdentityNode

        super();        
        registerElementHandler(new XMLElement(EjbTagNames.RUNAS_SPECIFIED_IDENTITY), RunAsNode.class);
    
Methods Summary
public java.lang.ObjectgetDescriptor()

return
the Descriptor subclass that was populated by reading the source XML file

        return null;
    
protected java.util.MapgetDispatchTable()
all sub-implementation of this class can use a dispatch table to map xml element to method name on the descriptor class for setting the element value.

return
the map with the element name as a key, the setter method as a value

        return  null;
    
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notiification of the value for a particular tag

param
element the xml element
param
value it's associated value

    
        if (EjbTagNames.DESCRIPTION.equals(element.getQName())) {
            ((EjbDescriptor) getParentNode().getDescriptor()).setSecurityIdentityDescription(value);
        } else {
            super.setElementValue(element, value);
        }
    
public voidstartElement(com.sun.enterprise.deployment.node.XMLElement element, org.xml.sax.Attributes attributes)

        if( EjbTagNames.USE_CALLER_IDENTITY.equals(element.getQName()) ) {
            ((EjbDescriptor) getParentNode().getDescriptor()).
                setUsesCallerIdentity(true);
        } else {
            super.startElement(element, attributes);
        }
        return;
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.EjbDescriptor descriptor)
write the descriptor class to a DOM tree and return it

param
parent node in the DOM tree
param
node name for the root element for this DOM tree fragment
param
the descriptor to write
return
the DOM tree top node

    
        Node subNode = appendChild(parent, nodeName);
        appendTextChild(subNode, EjbTagNames.DESCRIPTION, descriptor.getSecurityIdentityDescription());
        if (descriptor.getUsesCallerIdentity()) {
            Node useCaller = subNode.getOwnerDocument().createElement(EjbTagNames.USE_CALLER_IDENTITY);
            subNode.appendChild(useCaller);
        } else {
            RunAsNode runAs = new RunAsNode();
            runAs.writeDescriptor(subNode, EjbTagNames.RUNAS_SPECIFIED_IDENTITY, descriptor.getRunAsIdentity());
        }
    return subNode;