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 public final class WebRoleRefPermission extends Permission 53 implements java.io.Serializable 54 { 55 56 private final String actions; 57 58 private transient int hashCodeValue = 0; 59 60 private static final long serialVersionUID = 1L; 61 62 69 private static final ObjectStreamField [] serialPersistentFields = { 70 new ObjectStreamField ("actions", java.lang.String .class) 71 }; 72 73 85 86 public WebRoleRefPermission(String name, String actions) 87 { 88 super(name); 89 this.actions = actions; 90 } 91 92 107 108 public boolean equals(Object o) 109 { 110 if (o == null || 111 ! (o instanceof WebRoleRefPermission )) return false; 112 113 WebRoleRefPermission that = (WebRoleRefPermission ) o; 114 115 if (!this.getName().equals(that.getName())) return false; 116 117 return this.actions.equals(that.actions); 118 } 119 120 127 128 public String getActions() 129 { 130 return this.actions; 131 } 132 133 150 public int hashCode() 151 { 152 153 if (this.hashCodeValue == 0) { 154 155 String hashInput = new String (this.getName() + " " + this.actions); 156 157 this.hashCodeValue = hashInput.hashCode(); 158 } 159 160 return this.hashCodeValue; 161 } 162 163 181 182 public boolean implies(Permission permission) 183 { 184 return this.equals(permission); 185 } 186 187 189 196 private synchronized void readObject(java.io.ObjectInputStream s) 197 throws IOException ,ClassNotFoundException 198 { 199 s.defaultReadObject(); 200 } 201 202 210 private synchronized void writeObject(java.io.ObjectOutputStream s) 211 throws IOException 212 { 213 s.defaultWriteObject(); 214 } 215 216 } 217 218 219 220 221 222 223 | Popular Tags |