1 22 23 29 30 package org.jboss.test.security.interfaces; 31 32 import java.io.Serializable ; 33 import java.security.Principal ; 34 import java.util.HashSet ; 35 import java.util.Set ; 36 37 43 public class CallerInfo implements Serializable 44 { 45 private static final long serialVersionUID = 1; 46 47 48 private Principal callerIdentity; 49 50 private Principal runAsIdentity; 51 52 private HashSet expectedCallerRoles = new HashSet (); 53 54 private HashSet expectedRunAsRoles = new HashSet (); 55 56 public CallerInfo() 57 { 58 59 } 60 public CallerInfo(Principal callerIdentity, Principal runAsIdentity, 61 Set expectedCallerRoles, Set expectedRunAsRoles) 62 { 63 this.callerIdentity = callerIdentity; 64 this.runAsIdentity = runAsIdentity; 65 this.expectedCallerRoles.addAll(expectedCallerRoles); 66 this.expectedRunAsRoles.addAll(expectedRunAsRoles); 67 } 68 69 public Principal getCallerIdentity() 70 { 71 return callerIdentity; 72 } 73 74 public void setCallerIdentity(Principal callerIdentity) 75 { 76 this.callerIdentity = callerIdentity; 77 } 78 79 public Principal getRunAsIdentity() 80 { 81 return runAsIdentity; 82 } 83 84 public void setRunAsIdentity(Principal runAsIdentity) 85 { 86 this.runAsIdentity = runAsIdentity; 87 } 88 89 public Set getExpectedCallerRoles() 90 { 91 return expectedCallerRoles; 92 } 93 94 public void setExpectedCallerRoles(Set expectedCallerRoles) 95 { 96 this.expectedCallerRoles.clear(); 97 this.expectedCallerRoles.addAll(expectedCallerRoles); 98 } 99 100 public Set getExpectedRunAsRoles() 101 { 102 return expectedRunAsRoles; 103 } 104 105 public void setExpectedRunAsRoles(Set expectedRunAsRoles) 106 { 107 this.expectedRunAsRoles.clear(); 108 this.expectedRunAsRoles.addAll(expectedRunAsRoles); 109 } 110 } 111 | Popular Tags |