org.springframework.security.acls.model.ChildrenExistException Java Examples

The following examples show how to use org.springframework.security.acls.model.ChildrenExistException. 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: AclService.java    From kylin-on-parquet-v2 with Apache License 2.0 6 votes vote down vote up
@Override
public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException {
    try (AutoLock l = lock.lockForWrite()) {
        List<ObjectIdentity> children = findChildren(objectIdentity);
        if (!deleteChildren && children.size() > 0) {
            Message msg = MsgPicker.getMsg();
            throw new BadRequestException(
                    String.format(Locale.ROOT, msg.getIDENTITY_EXIST_CHILDREN(), objectIdentity));
        }
        for (ObjectIdentity oid : children) {
            deleteAcl(oid, deleteChildren);
        }
        crud.delete(objID(objectIdentity));
        logger.debug("ACL of " + objectIdentity + " deleted successfully.");
    } catch (IOException e) {
        throw new InternalErrorException(e);
    }
}
 
Example #2
Source File: AclService.java    From kylin with Apache License 2.0 6 votes vote down vote up
@Override
public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException {
    try (AutoLock l = lock.lockForWrite()) {
        List<ObjectIdentity> children = findChildren(objectIdentity);
        if (!deleteChildren && children.size() > 0) {
            Message msg = MsgPicker.getMsg();
            throw new BadRequestException(
                    String.format(Locale.ROOT, msg.getIDENTITY_EXIST_CHILDREN(), objectIdentity));
        }
        for (ObjectIdentity oid : children) {
            deleteAcl(oid, deleteChildren);
        }
        crud.delete(objID(objectIdentity));
        logger.debug("ACL of " + objectIdentity + " deleted successfully.");
    } catch (IOException e) {
        throw new InternalErrorException(e);
    }
}
 
Example #3
Source File: AclService.java    From Kylin with Apache License 2.0 6 votes vote down vote up
@Override
public void deleteAcl(ObjectIdentity objectIdentity, boolean deleteChildren) throws ChildrenExistException {
    HTableInterface htable = null;
    try {
        htable = HBaseConnection.get(hbaseUrl).getTable(aclTableName);
        Delete delete = new Delete(Bytes.toBytes(String.valueOf(objectIdentity.getIdentifier())));

        List<ObjectIdentity> children = findChildren(objectIdentity);
        if (!deleteChildren && children.size() > 0) {
            throw new ChildrenExistException("Children exists for " + objectIdentity);
        }

        for (ObjectIdentity oid : children) {
            deleteAcl(oid, deleteChildren);
        }

        htable.delete(delete);
        htable.flushCommits();

        logger.debug("ACL of " + objectIdentity + " deleted successfully.");
    } catch (IOException e) {
        throw new RuntimeException(e.getMessage(), e);
    } finally {
        IOUtils.closeQuietly(htable);
    }
}