diff options
author | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2011-12-08 21:15:59 -0500 |
commit | 171aaece4f23709d33d180cf36eb3af5e454b0c9 (patch) | |
tree | 1485f9f0a7bd10de4ff25030db575dbb8dafae74 /pki/base/util/src/netscape/security/acl/OwnerImpl.java | |
parent | adad2fcee8a29fdb82376fbce07dedb11fccc182 (diff) | |
download | pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.gz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.tar.xz pki-171aaece4f23709d33d180cf36eb3af5e454b0c9.zip |
Revert "Formatting"
This reverts commit 32150d3ee32f8ac27118af7c792794b538c78a2f.
Diffstat (limited to 'pki/base/util/src/netscape/security/acl/OwnerImpl.java')
-rw-r--r-- | pki/base/util/src/netscape/security/acl/OwnerImpl.java | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/pki/base/util/src/netscape/security/acl/OwnerImpl.java b/pki/base/util/src/netscape/security/acl/OwnerImpl.java index 2cd2e5ea0..7ced59efd 100644 --- a/pki/base/util/src/netscape/security/acl/OwnerImpl.java +++ b/pki/base/util/src/netscape/security/acl/OwnerImpl.java @@ -25,79 +25,79 @@ import java.security.acl.Owner; import java.util.Enumeration; /** - * Class implementing the Owner interface. The initial owner principal is - * configured as part of the constructor. - * - * @author Satish Dharmaraj + * Class implementing the Owner interface. The + * initial owner principal is configured as + * part of the constructor. + * @author Satish Dharmaraj */ public class OwnerImpl implements Owner { private Group ownerGroup; public OwnerImpl(Principal owner) { - ownerGroup = new GroupImpl("AclOwners"); - ownerGroup.addMember(owner); + ownerGroup = new GroupImpl("AclOwners"); + ownerGroup.addMember(owner); } /** - * Adds an owner. Owners can modify ACL contents and can disassociate ACLs - * from the objects they protect in the AclConfig interface. The caller - * principal must be a part of the owners list of the ACL in order to invoke - * this method. The initial owner is configured at ACL construction time. - * - * @param caller the principal who is invoking this method. + * Adds an owner. Owners can modify ACL contents and can disassociate + * ACLs from the objects they protect in the AclConfig interface. + * The caller principal must be a part of the owners list of the ACL in + * order to invoke this method. The initial owner is configured + * at ACL construction time. + * @param caller the principal who is invoking this method. * @param owner The owner that should be added to the owners list. * @return true if success, false if already an owner. - * @exception NotOwnerException if the caller principal is not on the owners - * list of the Acl. + * @exception NotOwnerException if the caller principal is not on + * the owners list of the Acl. */ public synchronized boolean addOwner(Principal caller, Principal owner) - throws NotOwnerException { - if (!isOwner(caller)) - throw new NotOwnerException(); + throws NotOwnerException + { + if (!isOwner(caller)) + throw new NotOwnerException(); - ownerGroup.addMember(owner); - return false; + ownerGroup.addMember(owner); + return false; } - /** - * Delete owner. If this is the last owner in the ACL, an exception is - * raised. The caller principal must be a part of the owners list of the ACL - * in order to invoke this method. - * - * @param caller the principal who is invoking this method. + /** + * Delete owner. If this is the last owner in the ACL, an exception is + * raised. + * The caller principal must be a part of the owners list of the ACL in + * order to invoke this method. + * @param caller the principal who is invoking this method. * @param owner The owner to be removed from the owners list. - * @return true if the owner is removed, false if the owner is not part of - * the owners list. - * @exception NotOwnerException if the caller principal is not on the owners - * list of the Acl. - * @exception LastOwnerException if there is only one owner left in the - * group, then deleteOwner would leave the ACL owner-less. - * This exception is raised in such a case. + * @return true if the owner is removed, false if the owner is not part + * of the owners list. + * @exception NotOwnerException if the caller principal is not on + * the owners list of the Acl. + * @exception LastOwnerException if there is only one owner left in the group, then + * deleteOwner would leave the ACL owner-less. This exception is raised in such a case. */ - public synchronized boolean deleteOwner(Principal caller, Principal owner) - throws NotOwnerException, LastOwnerException { - if (!isOwner(caller)) - throw new NotOwnerException(); - - Enumeration e = ownerGroup.members(); - // - // check if there is atleast 2 members left. - // - Object o = e.nextElement(); - if (e.hasMoreElements()) - return ownerGroup.removeMember(owner); - else - throw new LastOwnerException(); - - } + public synchronized boolean deleteOwner(Principal caller, Principal owner) + throws NotOwnerException, LastOwnerException + { + if (!isOwner(caller)) + throw new NotOwnerException(); + + Enumeration e = ownerGroup.members(); + // + // check if there is atleast 2 members left. + // + Object o = e.nextElement(); + if (e.hasMoreElements()) + return ownerGroup.removeMember(owner); + else + throw new LastOwnerException(); + + } /** * returns if the given principal belongs to the owner list. - * * @param owner The owner to check if part of the owners list * @return true if the passed principal is in the owner list, false if not. */ public synchronized boolean isOwner(Principal owner) { - return ownerGroup.isMember(owner); + return ownerGroup.isMember(owner); } } |