java.security.acl.LastOwnerException Java Examples

The following examples show how to use java.security.acl.LastOwnerException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OwnerImpl.java    From jdk1.8-source-analysis with Apache License 2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #2
Source File: OwnerImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #3
Source File: OwnerImpl.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #4
Source File: OwnerImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #5
Source File: OwnerImpl.java    From JDKSourceCode1.8 with MIT License 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #6
Source File: OwnerImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #7
Source File: OwnerImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #8
Source File: OwnerImpl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #9
Source File: OwnerImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #10
Source File: OwnerImpl.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #11
Source File: OwnerImpl.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #12
Source File: OwnerImpl.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #13
Source File: OwnerImpl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}
 
Example #14
Source File: OwnerImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Deletes an owner. If this is the last owner in the ACL, an exception is raised.
 *<P>
 * The caller principal must be an owner of the ACL in order to invoke this method.
 *
 * @param caller the principal invoking this method. It must be an owner
 *   of the ACL.
 * @param owner the owner to be removed from the list of owners.
 * @return true if successful, false if owner is already an owner.
 * @exception NotOwnerException if the caller principal is not an owner
 *   of the ACL.
 * @exception LastOwnerException if there is only one owner left, so that
 *   deleteOwner would leave the ACL owner-less.
 */
public boolean deleteOwner(Principal caller, Principal owner)
              throws NotOwnerException,LastOwnerException {

      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;
      }
}