1 26 27 package org.objectweb.jonas_web.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 31 32 36 public class SecurityConstraint extends AbsElement { 37 38 41 private JLinkedList webResourceCollectionList = null; 42 43 46 private AuthConstraint authConstraint = null; 47 48 51 private UserDataConstraint userDataConstraint = null; 52 53 54 57 public SecurityConstraint() { 58 super(); 59 webResourceCollectionList = new JLinkedList("web-resource-collection"); 60 } 61 62 63 65 69 public void setWebResourceCollectionList(JLinkedList webResourceCollectionList) { 70 this.webResourceCollectionList = webResourceCollectionList; 71 } 72 73 77 public void addWebResourceCollection(WebResourceCollection webResourceCollection) { 78 webResourceCollectionList.add(webResourceCollection); 79 } 80 81 85 public void setAuthConstraint(AuthConstraint authConstraint) { 86 this.authConstraint = authConstraint; 87 } 88 89 93 public void setUserDataConstraint(UserDataConstraint userDataConstraint) { 94 this.userDataConstraint = userDataConstraint; 95 } 96 97 98 99 100 102 106 public JLinkedList getWebResourceCollectionList() { 107 return webResourceCollectionList; 108 } 109 110 114 public AuthConstraint getAuthConstraint() { 115 return authConstraint; 116 } 117 118 122 public UserDataConstraint getUserDataConstraint() { 123 return userDataConstraint; 124 } 125 126 127 132 public String toXML(int indent) { 133 StringBuffer sb = new StringBuffer (); 134 sb.append(indent(indent)); 135 sb.append("<security-constraint>\n"); 136 137 indent += 2; 138 139 sb.append(webResourceCollectionList.toXML(indent)); 141 142 if (authConstraint != null) { 144 sb.append(authConstraint.toXML(indent)); 145 } 146 147 if (userDataConstraint != null) { 149 sb.append(userDataConstraint.toXML(indent)); 150 } 151 152 153 indent -= 2; 154 sb.append(indent(indent)); 155 sb.append("</security-constraint>\n"); 156 157 return sb.toString(); 158 } 159 160 } 161 | Popular Tags |