FileDocCategorySizeDatePackage
OwnerImpl.javaAPI DocAndroid 1.5 API2458Wed May 06 22:41:06 BST 2009org.apache.harmony.security.tests.support.acl

OwnerImpl

public class OwnerImpl extends Object implements Owner
Additional class for verification Owner interface

Fields Summary
private Group
ownerGroup
Constructors Summary
public OwnerImpl(Principal principal)

        ownerGroup = new GroupImpl("AclOwners");
        ownerGroup.addMember(principal);
    
Methods Summary
public synchronized booleanaddOwner(java.security.Principal principal, java.security.Principal principal1)

        
        if(!isOwner(principal))
        {
            throw new NotOwnerException();
        } else {
            if (ownerGroup.isMember(principal1)) return false;
            if (!ownerGroup.isMember(principal1)) {
                ownerGroup.addMember(principal1);
                return true;
            }
        }
        return false;
    
public synchronized booleandeleteOwner(java.security.Principal principal, java.security.Principal principal1)

        
        if(!isOwner(principal)) throw new NotOwnerException();
        Enumeration enumeration = ownerGroup.members();
        Object obj = enumeration.nextElement();
        if(enumeration.hasMoreElements()) {
            return ownerGroup.removeMember(principal1);
        } else {
            throw new LastOwnerException();
        }
    
public synchronized booleanisOwner(java.security.Principal principal)

        return ownerGroup.isMember(principal);