1 27 package org.objectweb.jonas_ejb.deployment.xml; 28 29 import org.objectweb.jonas_lib.deployment.xml.AbsElement; 30 import org.objectweb.jonas_lib.deployment.xml.JLinkedList; 31 32 37 38 public class JonasRunAsMapping extends AbsElement { 39 40 43 private String principalName = null; 44 45 48 private JLinkedList roleNamesList = null; 49 50 53 public JonasRunAsMapping() { 54 super(); 55 roleNamesList = new JLinkedList("role-name"); 56 } 57 58 62 public JLinkedList getRoleNamesList() { 63 return roleNamesList; 64 } 65 66 70 public void addRoleName(String roleName) { 71 roleNamesList.add(roleName); 72 } 73 74 77 public String getPrincipalName() { 78 return principalName; 79 } 80 81 85 public void setPrincipalName(String principalName) { 86 this.principalName = principalName; 87 } 88 89 94 public String toXML(int indent) { 95 StringBuffer sb = new StringBuffer (); 96 sb.append(indent(indent)); 97 sb.append("<jonas-run-as-mapping>\n"); 98 99 indent += 2; 100 101 sb.append(xmlElement(principalName, "principal-name", indent)); 103 104 sb.append(roleNamesList.toXML(indent)); 106 107 indent -= 2; 108 sb.append(indent(indent)); 109 sb.append("</jonas-run-as-mapping>\n"); 110 111 return sb.toString(); 112 } 113 } | Popular Tags |