Exemplo n.º 1
0
  public static ProcessContext createMyActivitiesActivityRef(
      Identity owner, List<ExoSocialActivity> list) {
    //
    SocialServiceContext ctx = SocialServiceContextImpl.getInstance();
    StreamProcessContext processCtx =
        StreamProcessContext.getIntance(StreamProcessContext.LAZY_UPGRADE_STREAM_PROCESS, ctx);
    processCtx.identity(owner).activities(list);

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

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

    return processCtx;
  }
Exemplo n.º 2
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;
  }
Exemplo n.º 3
0
  public static ProcessContext loadFeed(Identity owner) {
    //
    SocialServiceContext ctx = SocialServiceContextImpl.getInstance();
    StreamProcessContext processCtx =
        StreamProcessContext.getIntance(StreamProcessContext.LOAD_ACTIVITIES_STREAM_PROCESS, ctx);
    processCtx.identity(owner);

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

    return processCtx;
  }
Exemplo n.º 4
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;
  }