예제 #1
0
  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);
    }
  }
예제 #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);
    }
  }