use of org.apache.ranger.db.XXSecurityZoneRefResourceDao in project ranger by apache.
the class SecurityZoneRefUpdater method cleanupRefTables.
public Boolean cleanupRefTables(RangerSecurityZone rangerSecurityZone) {
final Long zoneId = rangerSecurityZone == null ? null : rangerSecurityZone.getId();
if (zoneId == null) {
return false;
}
XXSecurityZoneRefServiceDao xZoneServiceDao = daoMgr.getXXSecurityZoneRefService();
XXSecurityZoneRefTagServiceDao xZoneTagServiceDao = daoMgr.getXXSecurityZoneRefTagService();
XXSecurityZoneRefResourceDao xZoneResourceDao = daoMgr.getXXSecurityZoneRefResource();
XXSecurityZoneRefUserDao xZoneUserDao = daoMgr.getXXSecurityZoneRefUser();
XXSecurityZoneRefGroupDao xZoneGroupDao = daoMgr.getXXSecurityZoneRefGroup();
for (XXSecurityZoneRefService service : xZoneServiceDao.findByZoneId(zoneId)) {
xZoneServiceDao.remove(service);
}
for (XXSecurityZoneRefTagService service : xZoneTagServiceDao.findByZoneId(zoneId)) {
xZoneTagServiceDao.remove(service);
}
for (XXSecurityZoneRefResource resource : xZoneResourceDao.findByZoneId(zoneId)) {
xZoneResourceDao.remove(resource);
}
for (XXSecurityZoneRefUser user : xZoneUserDao.findByZoneId(zoneId)) {
xZoneUserDao.remove(user);
}
for (XXSecurityZoneRefGroup group : xZoneGroupDao.findByZoneId(zoneId)) {
xZoneGroupDao.remove(group);
}
return true;
}
Aggregations