SecurityConstraintNodepublic class SecurityConstraintNode extends com.sun.enterprise.deployment.node.DeploymentDescriptorNode This node handles the security-contraint xml tag |
Constructors Summary |
---|
public SecurityConstraintNode()
super();
registerElementHandler(new XMLElement(WebTagNames.USERDATA_CONSTRAINT),
UserDataConstraintNode.class, "setUserDataConstraint");
registerElementHandler(new XMLElement(WebTagNames.AUTH_CONSTRAINT),
AuthConstraintNode.class, "setAuthorizationConstraint");
registerElementHandler(new XMLElement(WebTagNames.WEB_RESOURCE_COLLECTION),
WebResourceCollectionNode.class, "addWebResourceCollection");
|
Methods Summary |
---|
protected java.util.Map | getDispatchTable()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.
Map table = super.getDispatchTable();
table.put(WebTagNames.NAME, "setName");
return table;
| public org.w3c.dom.Node | writeDescriptor(org.w3c.dom.Node parent, java.lang.String nodeName, com.sun.enterprise.deployment.SecurityConstraintImpl descriptor)write the descriptor class to a DOM tree and return it
Node myNode = appendChild(parent, nodeName);
appendTextChild(myNode, WebTagNames.NAME, descriptor.getName());
// web-resource-collection+
WebResourceCollectionNode wrcNode = new WebResourceCollectionNode();
for (Enumeration webResources = descriptor.getWebResourceCollections();
webResources.hasMoreElements();) {
wrcNode.writeDescriptor(myNode, WebTagNames.WEB_RESOURCE_COLLECTION,
(WebResourceCollectionImpl) webResources.nextElement());
}
// auth-constaint?
AuthorizationConstraintImpl aci = (AuthorizationConstraintImpl) descriptor.getAuthorizationConstraint();
if (aci!=null) {
AuthConstraintNode acNode = new AuthConstraintNode();
acNode.writeDescriptor(myNode, WebTagNames.AUTH_CONSTRAINT, aci);
}
// user-data-constraint?
UserDataConstraintImpl udci = (UserDataConstraintImpl) descriptor.getUserDataConstraint();
if (udci!=null) {
UserDataConstraintNode udcn = new UserDataConstraintNode();
udcn.writeDescriptor(myNode, WebTagNames.USERDATA_CONSTRAINT, udci);
}
return myNode;
|
|