1 23 24 package javax.security.jacc; 25 26 import java.security.*; 27 import java.io.IOException ; 28 import java.io.ObjectStreamField ; 29 30 52 53 public final class EJBRoleRefPermission extends Permission 54 implements java.io.Serializable 55 { 56 57 private final String actions; 58 59 private transient int hashCodeValue = 0; 60 61 private static final long serialVersionUID = 1L; 62 63 70 private static final ObjectStreamField [] serialPersistentFields = { 71 new ObjectStreamField ("actions", java.lang.String .class) 72 }; 73 74 85 86 public EJBRoleRefPermission(String name, String actions) 87 { 88 super(name); 89 this.actions = actions; 90 } 91 92 106 107 public boolean equals(Object o) 108 { 109 if (o == null || 110 ! (o instanceof EJBRoleRefPermission )) return false; 111 112 EJBRoleRefPermission that = (EJBRoleRefPermission ) o; 113 114 if (!this.getName().equals(that.getName())) return false; 115 116 return this.actions.equals(that.actions); 117 } 118 119 126 127 public String getActions() 128 { 129 return this.actions; 130 } 131 132 149 150 public int hashCode() 151 { 152 153 if (hashCodeValue == 0) { 154 155 String hashInput = new String (this.getName() + " " + this.actions); 156 157 hashCodeValue = hashInput.hashCode(); 158 } 159 160 return this.hashCodeValue; 161 } 162 163 180 181 public boolean implies(Permission permission) 182 { 183 return this.equals(permission); 184 } 185 186 188 195 private synchronized void readObject(java.io.ObjectInputStream s) 196 throws IOException ,ClassNotFoundException 197 { 198 s.defaultReadObject(); 199 } 200 201 209 private synchronized void writeObject(java.io.ObjectOutputStream s) 210 throws IOException 211 { 212 s.defaultWriteObject(); 213 } 214 215 } 216 217 218 219 220 221 222 223 | Popular Tags |