Package org.olat.core.util.coordinate

Examples of org.olat.core.util.coordinate.SyncerExecutor


   * @param toUpdate
   */
  public void updatePropertiesFor(final Identity identity, final ImPreferences toUpdate) {
    //o_clusterOK by guido
    CoordinatorManager.getCoordinator().getSyncer().doInSync(
        OresHelper.createOLATResourceableInstanceWithoutCheck(LOCK_KEY, identity.getKey()), new SyncerExecutor(){

          public void execute() {
            PropertyManager pm = PropertyManager.getInstance();
            // generate x-stream serialization of this object
            String props = XStreamHelper.toXML(toUpdate);
View Full Code Here


   * @return The feed cache
   */
  protected CacheWrapper initFeedCache() {
    if (feedCache == null) {
      OLATResourceable ores = OresHelper.createOLATResourceableType(this.getClass());
      CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor() {
        public void execute() {
          if (feedCache == null) {
            feedCache = CoordinatorManager.getCoordinator().getCacher().getOrCreateCache(this.getClass(), "feed");
          }
        }
View Full Code Here

   * @param feed
   */
  void syncedFeedCacheUpdate(final Feed feed, boolean inSync) {
    initFeedCache();
    if(inSync) {
      CoordinatorManager.getCoordinator().getSyncer().doInSync(feed, new SyncerExecutor() {
        public void execute() {
          // update and put behaves the same way
          feedCache.update(feed.getResourceableId().toString(), feed);
        }
      });
View Full Code Here

    // the AssessmentEditController - which as the 2nd last method calls into saveScoreEvaluation
    // - which in turn does update the EfficiencyStatement - at which point we're happy and everything works fine.
    // But it seems like this mechanism is a bit unobvious and might well be worth some refactoring...
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property attemptsProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, ATTEMPTS);
        if (attemptsProperty == null) {
          attemptsProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, ATTEMPTS,
              null, new Long(attempts.intValue()), null, null);
View Full Code Here

   *      java.lang.String)
   */
  public void saveNodeComment(final CourseNode courseNode, final Identity identity, final Identity assessedIdentity, final String comment) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property commentProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, COMMENT);
        if (commentProperty == null) {
          commentProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, COMMENT, null, null, null, comment);
          cpm.saveProperty(commentProperty);
View Full Code Here

   *      org.olat.core.id.Identity, java.lang.String)
   */
  public void saveNodeCoachComment(final CourseNode courseNode, final Identity assessedIdentity, final String comment) {
    ICourse course = CourseFactory.loadCourse(ores);
    final CoursePropertyManager cpm = course.getCourseEnvironment().getCoursePropertyManager();
    CoordinatorManager.getCoordinator().getSyncer().doInSync(createOLATResourceableForLocking(assessedIdentity), new SyncerExecutor(){
      public void execute() {
        Property commentProperty = cpm.findCourseNodeProperty(courseNode, assessedIdentity, null, COACH_COMMENT);
        if (commentProperty == null) {
          commentProperty = cpm.createCourseNodePropertyInstance(courseNode, assessedIdentity, null, COACH_COMMENT, null, null, null, comment);
          cpm.saveProperty(commentProperty);
View Full Code Here

      Iterator<Identity> iter = identities.iterator();     
      while (iter.hasNext()) {
        final Identity identity = iter.next();         
        //o_clusterOK: by ld
        OLATResourceable efficiencyStatementResourceable = am.createOLATResourceableForLocking(identity);
        CoordinatorManager.getCoordinator().getSyncer().doInSync(efficiencyStatementResourceable, new SyncerExecutor() {
          public void execute() {         
            // create temporary user course env
            UserCourseEnvironment uce = AssessmentHelper.createAndInitUserCourseEnvironment(identity, course);
            updateUserEfficiencyStatement(uce, re.getKey(), course, checkForExistingProperty);
            }
View Full Code Here

   * Update checklist.
   * @param checklist
   */
  public void updateChecklist(final Checklist cl) {
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(Checklist.class, cl.getKey());
    CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor() {
      public void execute() {
        cl.setLastModified(new Date());
        DBFactory.getInstance().updateObject(cl);
      }
    });
View Full Code Here

   * @param checklist
   */
  public void deleteChecklist(final Checklist cl) {
    final DB db = DBFactory.getInstance();
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(Checklist.class, cl.getKey());
    CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor() {
        public void execute() {
          Checklist checklist = (Checklist) db.loadObject(cl);
          db.deleteObject(checklist);
        }
    });
View Full Code Here

   * Update checkpoint
   * @param checkpoint
   */
  public void updateCheckpoint(final Checkpoint cp) {
    OLATResourceable ores = OresHelper.createOLATResourceableInstance(Checkpoint.class, cp.getKey());
    CoordinatorManager.getCoordinator().getSyncer().doInSync(ores, new SyncerExecutor() {
      public void execute() {
        cp.setLastModified(new Date());
        DBFactory.getInstance().updateObject(cp);
      }
    });
View Full Code Here

TOP

Related Classes of org.olat.core.util.coordinate.SyncerExecutor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.