OwnerImplpublic class OwnerImpl extends Object implements java.security.acl.Owner, SerializableOwner of Access Control Lists (ACLs).
The initial owner Principal should be specified as an
argument to the constructor of the class AclImpl. |
Fields Summary |
---|
private Vector | ownerList |
Constructors Summary |
---|
public OwnerImpl()Constructs an empty list of owner.
ownerList = new Vector();
| public OwnerImpl(PrincipalImpl owner)Constructs a list of owner with the specified principal as first element.
ownerList = new Vector();
ownerList.addElement(owner);
|
Methods Summary |
---|
public boolean | addOwner(java.security.Principal caller, java.security.Principal owner)Adds an owner. Only owners can modify ACL contents. The caller principal
must be an owner of the ACL in order to invoke this method. That is, only
an owner can add another owner. The initial owner is configured at
ACL construction time.
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (ownerList.contains(owner)) {
return false;
} else {
ownerList.addElement(owner);
return true;
}
| public boolean | deleteOwner(java.security.Principal caller, java.security.Principal owner)Deletes an owner. If this is the last owner in the ACL, an exception is raised.
The caller principal must be an owner of the ACL in order to invoke this method.
if (!ownerList.contains(caller))
throw new NotOwnerException();
if (!ownerList.contains(owner)){
return false;
} else {
if (ownerList.size() == 1)
throw new LastOwnerException();
ownerList.removeElement(owner);
return true;
}
| public boolean | isOwner(java.security.Principal owner)Returns true if the given principal is an owner of the ACL.
return ownerList.contains(owner);
|
|