Пример #1
0
  public static ProcessContext addMentioners(ExoSocialActivity activity, String[] mentioners) {
    //
    StreamProcessContext processCtx =
        StreamProcessContext.getIntance(
            StreamProcessContext.UPDATE_ACTIVITY_MENTIONER_PROCESS, ctx);
    processCtx.activity(activity).mentioners(mentioners);

    try {
      processCtx.getTraceElement().start();
      ctx.getServiceExecutor().async(StreamProcessorFactory.addMentioners(), processCtx);
      processCtx.getTraceElement().end();
    } finally {
      LOG.debug(processCtx.getTraceLog());
    }

    return processCtx;
  }
Пример #2
0
  // (parentActivity, mentioners, commenters);
  public static ProcessContext deleteComment(
      ExoSocialActivity activity, String[] mentioners, String[] commenters) {
    //
    SocialServiceContext ctx = SocialServiceContextImpl.getInstance();
    StreamProcessContext processCtx =
        StreamProcessContext.getIntance(StreamProcessContext.DELETE_COMMENT_PROCESS, ctx);
    processCtx.activity(activity).mentioners(mentioners).commenters(commenters);

    try {
      // beforeAsync(); //this point can make the problem with ADD_PROPERTY exception
      //
      ctx.getServiceExecutor().execute(StreamProcessorFactory.deleteCommentStream(), processCtx);
    } finally {
      LOG.debug(processCtx.getTraceLog());
    }

    return processCtx;
  }
Пример #3
0
  public static ProcessContext update(ExoSocialActivity activity, long oldUpdated) {
    //
    StreamProcessContext processCtx =
        StreamProcessContext.getIntance(StreamProcessContext.UPDATE_ACTIVITY_PROCESS, ctx);
    processCtx.activity(activity).oldLastUpdated(oldUpdated);

    try {
      if (ctx.isAsync()) {
        processCtx.getTraceElement().start();
        beforeAsync();
        ctx.getServiceExecutor().async(StreamProcessorFactory.updateStream(), processCtx);
        processCtx.getTraceElement().end();
      } else {
        ctx.getServiceExecutor().execute(StreamProcessorFactory.updateStream(), processCtx);
      }

    } finally {
      LOG.debug(processCtx.getTraceLog());
    }

    return processCtx;
  }
Пример #4
0
  public static ProcessContext updateHidable(
      Identity owner, ActivityEntity entity, ExoSocialActivity activity) {
    //
    StreamProcessContext processCtx =
        StreamProcessContext.getIntance(StreamProcessContext.UPDATE_ACTIVITY_REF, ctx);
    processCtx.activity(activity).mentioners(entity.getMentioners()).identity(owner);

    try {
      if (ctx.isAsync()) {
        beforeAsync();
        ctx.getServiceExecutor().async(StreamProcessorFactory.updateHidable(), processCtx);
      } else {
        ctx.getServiceExecutor().execute(StreamProcessorFactory.updateHidable(), processCtx);
      }

    } finally {
      if (ctx.isTraced()) {
        LOG.debug(processCtx.getTraceLog());
      }
    }

    return processCtx;
  }