use of org.bedework.inoutsched.processors.SchedProcessor.SchedProcResult in project bw-calendar-engine by Bedework.
the class InScheduler method processScheduleUpdateEvent.
private ProcessMessageResult processScheduleUpdateEvent(final ScheduleUpdateEvent msg) {
try (final CalSvcI svci = getSvci(msg.getOwnerHref())) {
if (debug) {
trace("ScheduleUpdateEvent for principal " + msg.getOwnerHref());
}
final EventInfo ei = svci.getEventsHandler().get(getParentPath(msg.getHref()), getName(msg.getHref()));
if (ei == null) {
// Event deleted?.
if (debug) {
trace("InSchedule event deleted?");
}
return ProcessMessageResult.NO_ACTION;
}
final BwEvent ev = ei.getEvent();
SchedProcessor proc = null;
switch(msg.getChange()) {
case attendeeChange:
{
proc = new SchedAttendeeUpdate(svci);
break;
}
default:
warn("InSchedule: unhandled change type for " + ev.getOwnerHref() + " " + msg.getChange());
}
if (proc == null) {
return ProcessMessageResult.PROCESSED;
}
final SchedProcResult pr = proc.process(ei);
if (debug) {
trace("InSchedule " + pr.sr);
}
return ProcessMessageResult.PROCESSED;
} catch (final CalFacadeStaleStateException csse) {
if (debug) {
trace("Stale state exception");
}
rollback(getSvc());
return ProcessMessageResult.STALE_STATE;
} catch (final Throwable t) {
rollback(getSvc());
error(t);
}
return ProcessMessageResult.FAILED;
}
Aggregations