Methods Summary |
---|
public boolean | equals(java.lang.Object obj)Checks two DelegationPermission objects for equality.
if (obj == this)
return true;
if (! (obj instanceof DelegationPermission))
return false;
DelegationPermission that = (DelegationPermission) obj;
return implies(that);
|
public int | hashCode()Returns the hash code value for this object.
return getName().hashCode();
|
public boolean | implies(java.security.Permission p)Checks if this Kerberos delegation permission object "implies" the
specified permission.
If none of the above are true, implies returns false.
if (!(p instanceof DelegationPermission))
return false;
DelegationPermission that = (DelegationPermission) p;
if (this.subordinate.equals(that.subordinate) &&
this.service.equals(that.service))
return true;
return false;
|
private void | init(java.lang.String target)Initialize the DelegationPermission object.
StringTokenizer t = null;
if (!target.startsWith("\"")) {
throw new IllegalArgumentException
("service principal [" + target +
"] syntax invalid: " +
"improperly quoted");
} else {
t = new StringTokenizer(target, "\"", false);
subordinate = t.nextToken();
if (t.countTokens() == 2) {
t.nextToken(); // bypass whitespace
service = t.nextToken();
} else if (t.countTokens() > 0) {
throw new IllegalArgumentException
("service principal [" + t.nextToken() +
"] syntax invalid: " +
"improperly quoted");
}
}
|
public java.security.PermissionCollection | newPermissionCollection()Returns a PermissionCollection object for storing
DelegationPermission objects.
DelegationPermission objects must be stored in a manner that
allows them to be inserted into the collection in any order, but
that also enables the PermissionCollection implies method to
be implemented in an efficient (and consistent) manner.
return new KrbDelegationPermissionCollection();
|
private synchronized void | readObject(java.io.ObjectInputStream s)readObject is called to restore the state of the
DelegationPermission from a stream.
// Read in the action, then initialize the rest
s.defaultReadObject();
init(getName());
|
private synchronized void | writeObject(java.io.ObjectOutputStream s)WriteObject is called to save the state of the DelegationPermission
to a stream. The actions are serialized, and the superclass
takes care of the name.
s.defaultWriteObject();
|