}
}
@Override
public SeverityFilter getParentFilter(int teamId, int appId) {
SeverityFilter returnFilter = new SeverityFilter();
// if teamId == -1 and appId == -1 then we're finding the parent of global, which is just the default SeverityFilter
if (teamId != -1 && appId == -1) {
// if we're finding the parent of a team filter, let's use global settings if present
SeverityFilter globalFilter = loadFilter(-1, -1);
if (globalFilter != null && globalFilter.getEnabled()) {
returnFilter = globalFilter;
}
} else if (teamId != -1) {
SeverityFilter targetFilter = loadFilter(teamId, -1);
if (targetFilter != null && targetFilter.getEnabled()) {
// this is an app level filter and there are team settings, so let's use those
returnFilter = targetFilter;
} else {
// there are no team settings, so let's look at global
targetFilter = loadFilter(-1, -1);
if (targetFilter == null || !targetFilter.getEnabled()) {
// this is a team level filter and there are team level settings, so let's use those
returnFilter = targetFilter;
}
}
}