protected void notifyDelete(final boolean reallyDelete, final BwEvent val, final boolean shared) throws CalFacadeException { SysEvent.SysCode code; if (reallyDelete) { code = SysEvent.SysCode.ENTITY_DELETED; } else { code = SysEvent.SysCode.ENTITY_TOMBSTONED; } ; String note = getChanges(code, val); if (note == null) { return; } try { postNotification( SysEvent.makeEntityDeletedEvent( code, authenticatedPrincipal(), val.getOwnerHref(), val.getHref(), shared, val.getPublick(), true, // indexed, IcalDefs.fromEntityType(val.getEntityType()), val.getRecurrenceId(), note, null)); // XXX Emit multiple targted? } catch (NotificationException ne) { throw new CalFacadeException(ne); } }
protected void notify(final SysEvent.SysCode code, final BwEvent val, final boolean shared) throws CalFacadeException { try { final String note = getChanges(code, val); if (note == null) { return; } final boolean indexed = (getSyspars().getTestMode() /* && (val.getRecurrenceId() == null)*/); postNotification( SysEvent.makeEntityUpdateEvent( code, authenticatedPrincipal(), val.getOwnerHref(), val.getHref(), shared, indexed, val.getRecurrenceId(), note, null)); // XXX Emit multiple targeted? } catch (NotificationException ne) { throw new CalFacadeException(ne); } }
protected void notifyInstanceChange( final SysEvent.SysCode code, final BwEvent val, final boolean shared, final String recurrenceId) throws CalFacadeException { try { String note = getChanges(code, val); if (note == null) { return; } /* We flag these as indexed. They get handled by the update for the master */ if (code.equals(SysEvent.SysCode.ENTITY_DELETED) || code.equals(SysEvent.SysCode.ENTITY_TOMBSTONED)) { postNotification( SysEvent.makeEntityDeletedEvent( code, authenticatedPrincipal(), val.getOwnerHref(), val.getHref(), shared, val.getPublick(), true, // Indexed IcalDefs.fromEntityType(val.getEntityType()), recurrenceId, note, null)); // XXX Emit multiple targted? } else { postNotification( SysEvent.makeEntityUpdateEvent( code, authenticatedPrincipal(), val.getOwnerHref(), val.getHref(), shared, true, // Indexed val.getRecurrenceId(), note, // changes null)); // XXX Emit multiple targted? } } catch (NotificationException ne) { throw new CalFacadeException(ne); } }
protected void stat(final String name, final Long startTime) throws CalFacadeException { if (!collectTimeStats) { return; } try { postNotification(SysEvent.makeStatsEvent(name, System.currentTimeMillis() - startTime)); } catch (NotificationException ne) { throw new CalFacadeException(ne); } }
protected void notifyMove( final SysEvent.SysCode code, final String oldHref, final boolean oldShared, final BwEvent val, final boolean shared) throws CalFacadeException { try { postNotification( SysEvent.makeEntityMovedEvent( code, currentPrincipal(), val.getOwnerHref(), val.getHref(), shared, false, oldHref, oldShared)); } catch (NotificationException ne) { throw new CalFacadeException(ne); } }