FileDocCategorySizeDatePackage
PrincipalNode.javaAPI DocGlassfish v2 API4311Fri May 04 22:31:48 BST 2007com.sun.enterprise.deployment.node.runtime.connector

PrincipalNode

public class PrincipalNode extends com.sun.enterprise.deployment.node.runtime.RuntimeDescriptorNode
This node handles the principal runtime deployment descriptors
author
Jerome Dochez
version

Fields Summary
Constructors Summary
Methods Summary
public voidsetElementValue(com.sun.enterprise.deployment.node.XMLElement element, java.lang.String value)
receives notification of the value for a particular tag

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

    
	RuntimeDescriptor descriptor = (RuntimeDescriptor) getDescriptor();
	if (descriptor==null) {
	    throw new RuntimeException("Trying to set values on a null descriptor");
	}
	if (element.getQName().equals(RuntimeTagNames.USER_NAME)) {
	    descriptor.setAttributeValue(Principal.USER_NAME, value);
	} else
	if (element.getQName().equals(RuntimeTagNames.PASSWORD)) {
	    descriptor.setAttributeValue(Principal.PASSWORD, value);
	} else
	if (element.getQName().equals(RuntimeTagNames.CREDENTIAL)) {
	    descriptor.setAttributeValue(Principal.CREDENTIAL, value);
	} else
	super.setElementValue(element, value);
    
public org.w3c.dom.NodewriteDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.runtime.connector.Principal descriptor)
write the descriptor class to a DOM tree and return it

param
parent node for the DOM tree
param
node name for the descriptor
param
the descriptor to write
return
the DOM tree top node

	Element principalNode = (Element) super.writeDescriptor(parent, nodeName, descriptor);
	appendTextChild(principalNode, RuntimeTagNames.DESCRIPTION, descriptor.getDescription());
	setAttribute(principalNode, RuntimeTagNames.USER_NAME, (String) descriptor.getValue(Principal.USER_NAME));
	setAttribute(principalNode, RuntimeTagNames.PASSWORD, (String) descriptor.getValue(Principal.PASSWORD));
	setAttribute(principalNode, RuntimeTagNames.CREDENTIAL, (String) descriptor.getValue(Principal.CREDENTIAL));
	return principalNode;