use of org.bedework.caldav.util.notifications.NotificationType.NotificationInfo in project bw-calendar-engine by Bedework.
the class Notifications method getMatching.
@Override
public List<NotificationType> getMatching(final QName type) throws CalFacadeException {
final List<NotificationType> res = new ArrayList<>();
final BwCalendar ncol = getCols().getSpecial(BwCalendar.calTypeNotifications, true);
if (ncol == null) {
return res;
}
final Collection<BwResource> rsrc = getSvc().getResourcesHandler().getAll(ncol.getPath());
if (Util.isEmpty(rsrc)) {
return res;
}
if (rsrc.size() > 100) {
warn("Large resource collection for " + ncol.getPath());
}
for (final BwResource r : rsrc) {
if (type != null) {
final NotificationInfo ni = NotificationType.fromContentType(r.getContentType());
if ((ni == null) || !type.equals(ni.type)) {
continue;
}
}
final NotificationType nt = makeNotification(r);
if (nt != null) {
res.add(nt);
}
}
return res;
}
Aggregations