1 26 package org.objectweb.jonas_ear.deployment.xml; 27 28 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 29 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 30 31 36 37 public class SecurityRoleMapping extends AbsElement { 38 39 42 private String roleName = null; 43 44 47 private JLinkedList principalNamesList = null; 48 49 52 public SecurityRoleMapping() { 53 super(); 54 principalNamesList = new JLinkedList("principal-name"); 55 } 56 57 61 public JLinkedList getPrincipalNamesList() { 62 return principalNamesList; 63 } 64 65 69 public void setRoleName(String roleName) { 70 this.roleName = roleName; 71 } 72 73 76 public String getRoleName() { 77 return roleName; 78 } 79 80 84 public void addPrincipalName(String principalName) { 85 principalNamesList.add(principalName); 86 } 87 88 93 public String toXML(int indent) { 94 StringBuffer sb = new StringBuffer (); 95 sb.append(indent(indent)); 96 sb.append("<security-role-mapping>\n"); 97 98 indent += 2; 99 100 sb.append(xmlElement(roleName, "role-name", indent)); 102 103 sb.append(principalNamesList.toXML(indent)); 105 106 indent -= 2; 107 sb.append(indent(indent)); 108 sb.append("</security-role-mapping>\n"); 109 110 return sb.toString(); 111 } 112 } | Popular Tags |