1 23 package com.sun.enterprise.deployment; 24 25 import com.sun.enterprise.deployment.Role; 26 import com.sun.enterprise.deployment.web.SecurityRoleReference; 27 import com.sun.enterprise.deployment.web.SecurityRole; 28 29 37 38 public class RoleReference extends EnvironmentProperty implements 39 SecurityRoleReference 40 { 41 44 public RoleReference() { 45 } 46 47 50 public RoleReference(String name, String description) { 51 super(name, "", description); 52 } 53 54 59 public RoleReference(EnvironmentProperty environmentProperty) { 60 super(environmentProperty.getName(), 61 environmentProperty.getDescription(), ""); 62 this.setValue(environmentProperty.getValue()); 63 } 64 65 69 void setRole(Role role) { 70 super.setValue(role.getName()); 71 } 72 73 77 public Role getRole() { 78 return new Role(super.getValue()); 79 } 80 81 85 public SecurityRole getSecurityRoleLink() { 86 return new SecurityRoleDescriptor(super.getValue(), ""); 87 } 88 89 93 public void setSecurityRoleLink(SecurityRole securityRole) { 94 super.setValue(securityRole.getName()); 95 } 96 97 101 public String getRolename() { 102 return this.getName(); 103 } 104 105 109 public void setRolename(String rolename) { 110 this.setName(rolename); 111 } 112 113 116 public void print(StringBuffer toStringBuffer) { 117 toStringBuffer.append("Role-Ref-Env-Prop: ").append(super.getName()).append("@").append( 118 this.getRole()).append("@").append(super.getDescription()); 119 } 120 121 } 122 123 | Popular Tags |