use of org.bedework.sysevents.events.EntityFetchEvent in project bw-calendar-engine by Bedework.
the class Events method get.
@Override
public EventInfo get(final String colPath, final String name, final String recurrenceId) throws CalFacadeException {
final EventInfo res = postProcess(getCal().getEvent(colPath, name, RecurringRetrievalMode.overrides));
int num = 0;
if (res != null) {
num = 1;
}
getSvc().postNotification(new EntityFetchEvent(SysCode.ENTITY_FETCHED, num));
if (res == null) {
return null;
}
if (recurrenceId == null) {
return res;
}
return makeInstance(res, recurrenceId);
}
use of org.bedework.sysevents.events.EntityFetchEvent in project bw-calendar-engine by Bedework.
the class Events method getEvents.
@Override
public Collection<EventInfo> getEvents(final BwCalendar cal, final FilterBase filter, final BwDateTime startDate, final BwDateTime endDate, final List<BwIcalPropertyInfoEntry> retrieveList, final DeletedState delState, final RecurringRetrievalMode recurRetrieval) throws CalFacadeException {
Collection<BwCalendar> cals = null;
if (cal != null) {
cals = new ArrayList<BwCalendar>();
cals.add(cal);
}
Collection<EventInfo> res = getMatching(cals, filter, startDate, endDate, retrieveList, delState, recurRetrieval, false);
int num = 0;
if (res != null) {
num = res.size();
}
getSvc().postNotification(new EntityFetchEvent(SysCode.ENTITY_FETCHED, num));
return res;
}
use of org.bedework.sysevents.events.EntityFetchEvent in project bw-calendar-engine by Bedework.
the class Events method getByUid.
@Override
public Collection<EventInfo> getByUid(final String colPath, final String guid, final String recurrenceId, final RecurringRetrievalMode recurRetrieval) throws CalFacadeException {
Collection<EventInfo> res = postProcess(getCal().getEvent(colPath, guid));
int num = 0;
if (res != null) {
num = res.size();
}
if (num == 0) {
return res;
}
getSvc().postNotification(new EntityFetchEvent(SysCode.ENTITY_FETCHED, num));
if ((recurrenceId == null) && ((recurRetrieval == null) || (recurRetrieval.mode != Rmode.expanded))) {
return res;
}
/* For an expansion replace the result with a set of expansions
*/
if (recurrenceId == null) {
return processExpanded(res, recurRetrieval);
}
if (num > 1) {
throw new CalFacadeException("cannot return rid for multiple events");
}
final Collection<EventInfo> eis = new ArrayList<>();
final EventInfo ei = makeInstance(res.iterator().next(), recurrenceId);
if (ei != null) {
eis.add(ei);
}
return eis;
}
Aggregations