00001
00027 package org.objectweb.jonas_web.deployment.xml;
00028
00029 import org.objectweb.jonas_lib.deployment.xml.AbsElement;
00030 import org.objectweb.jonas_lib.deployment.xml.JLinkedList;
00031
00036 public class SecurityConstraint extends AbsElement {
00037
00041 private JLinkedList webResourceCollectionList = null;
00042
00046 private AuthConstraint authConstraint = null;
00047
00051 private UserDataConstraint userDataConstraint = null;
00052
00053
00057 public SecurityConstraint() {
00058 super();
00059 webResourceCollectionList = new JLinkedList("web-resource-collection");
00060 }
00061
00062
00063
00064
00069 public void setWebResourceCollectionList(JLinkedList webResourceCollectionList) {
00070 this.webResourceCollectionList = webResourceCollectionList;
00071 }
00072
00077 public void addWebResourceCollection(WebResourceCollection webResourceCollection) {
00078 webResourceCollectionList.add(webResourceCollection);
00079 }
00080
00085 public void setAuthConstraint(AuthConstraint authConstraint) {
00086 this.authConstraint = authConstraint;
00087 }
00088
00093 public void setUserDataConstraint(UserDataConstraint userDataConstraint) {
00094 this.userDataConstraint = userDataConstraint;
00095 }
00096
00097
00098
00099
00100
00101
00106 public JLinkedList getWebResourceCollectionList() {
00107 return webResourceCollectionList;
00108 }
00109
00114 public AuthConstraint getAuthConstraint() {
00115 return authConstraint;
00116 }
00117
00122 public UserDataConstraint getUserDataConstraint() {
00123 return userDataConstraint;
00124 }
00125
00126
00132 public String toXML(int indent) {
00133 StringBuffer sb = new StringBuffer();
00134 sb.append(indent(indent));
00135 sb.append("<security-constraint>\n");
00136
00137 indent += 2;
00138
00139
00140 sb.append(webResourceCollectionList.toXML(indent));
00141
00142
00143 if (authConstraint != null) {
00144 sb.append(authConstraint.toXML(indent));
00145 }
00146
00147
00148 if (userDataConstraint != null) {
00149 sb.append(userDataConstraint.toXML(indent));
00150 }
00151
00152
00153 indent -= 2;
00154 sb.append(indent(indent));
00155 sb.append("</security-constraint>\n");
00156
00157 return sb.toString();
00158 }
00159
00160 }