use of org.ovirt.engine.core.common.businessentities.AuditLog in project ovirt-engine by oVirt.
the class GlusterUtil method alertVolumeLimitReached.
private boolean alertVolumeLimitReached(final GlusterVolumeEntity volume, boolean checkHardLimit) {
AuditLogType logType = checkHardLimit ? AuditLogType.GLUSTER_VOLUME_SNAPSHOT_HARD_LIMIT_REACHED : AuditLogType.GLUSTER_VOLUME_SNAPSHOT_SOFT_LIMIT_REACHED;
List<AuditLog> limitAlerts = auditLogDao.getByVolumeIdAndType(volume.getId(), logType.getValue());
if (!limitAlerts.isEmpty()) {
for (AuditLog alert : limitAlerts) {
if (!alert.isDeleted()) {
return true;
}
}
}
// Alert
boolean limitReached = checkHardLimit ? glusterDBUtils.isVolumeSnapshotHardLimitReached(volume.getId()) : glusterDBUtils.isVolumeSnapshotSoftLimitReached(volume.getId());
if (limitReached) {
glusterAuditLogUtil.logAuditMessage(volume.getClusterId(), volume.getClusterName(), volume, null, logType, volumeAsMap(volume));
return true;
}
return false;
}
Aggregations