Ejemplo n.º 1
0
  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);
    }
  }
Ejemplo n.º 2
0
  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);
    }
  }