Package org.olat.commons.lifecycle

Examples of org.olat.commons.lifecycle.LifeCycleManager


    // this code must not have any error handling or retry, this will be done in super class
    if ( RepositoryManager.getInstance().lookupRepositoryEntry(repositoryEntry.getKey()) != null ) {
      RepositoryEntry reloadedRe = (RepositoryEntry) DBFactory.getInstance().loadObject(repositoryEntry, true);
      reloadedRe.incrementLaunchCounter();
      reloadedRe.setLastUsage(new Date());
      LifeCycleManager lcManager = LifeCycleManager.createInstanceFor(reloadedRe);
      if (lcManager.lookupLifeCycleEntry(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION) != null) {
        Tracing.logAudit("Repository-Deletion: Remove from delete-list repositoryEntry=" + reloadedRe, RepositoryManager.class);
        LifeCycleManager.createInstanceFor(reloadedRe).deleteTimestampFor(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION);
      }
      RepositoryManager.getInstance().updateRepositoryEntry(reloadedRe);
    } else {
View Full Code Here


    // this code must not have any error handling or retry, this will be done in super class
    if ( RepositoryManager.getInstance().lookupRepositoryEntry(repositoryEntry.getKey()) != null ) {
      RepositoryEntry reloadedRe = (RepositoryEntry) DBFactory.getInstance().loadObject(repositoryEntry, true);
      reloadedRe.incrementDownloadCounter();
      reloadedRe.setLastUsage(new Date());
      LifeCycleManager lcManager = LifeCycleManager.createInstanceFor(reloadedRe);
      if (lcManager.lookupLifeCycleEntry(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION) != null) {
        Tracing.logAudit("Repository-Deletion: Remove from delete-list repositoryEntry=" + reloadedRe, RepositoryManager.class);
        LifeCycleManager.createInstanceFor(reloadedRe).deleteTimestampFor(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION);
      }
      Codepoint.hierarchicalCodepoint(IncrementDownloadCounterBackgroundTask.class, "executeTask-before-update", 1);
      RepositoryManager.getInstance().updateRepositoryEntry(reloadedRe);
View Full Code Here

    // this code must not be synchronized because in case of exception we try it again
    // this code must not have any error handling or retry, this will be done in super class
    if ( RepositoryManager.getInstance().lookupRepositoryEntry(repositoryEntry.getKey()) != null ) {
      RepositoryEntry reloadedRe = (RepositoryEntry) DBFactory.getInstance().loadObject(repositoryEntry, true);
      reloadedRe.setLastUsage(new Date());
      LifeCycleManager lcManager = LifeCycleManager.createInstanceFor(reloadedRe);
      if (lcManager.lookupLifeCycleEntry(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION) != null) {
        Tracing.logAudit("Repository-Deletion: Remove from delete-list repositoryEntry=" + reloadedRe, RepositoryManager.class);
        lcManager.deleteTimestampFor(RepositoryDeletionManager.SEND_DELETE_EMAIL_ACTION);
      }
      RepositoryManager.getInstance().updateRepositoryEntry(reloadedRe);
    } else {
      log.info("Could not executeTask, because repositoryEntry does no longer exist");
    }
View Full Code Here

        public void execute() {
           //o_clusterOK by:fj : must be fast
          Identity identity = (Identity)DBFactory.getInstance().loadObject(anIdentity, true);
          if (Tracing.isDebugEnabled(this.getClass())) Tracing.logDebug("setIdentityAsActiv beginSingleTransaction identity=" + identity, this.getClass());
          identity.setLastLogin(new Date());
          LifeCycleManager lifeCycleManagerForIdenitiy = LifeCycleManager.createInstanceFor(identity);
          if (lifeCycleManagerForIdenitiy.lookupLifeCycleEntry(SEND_DELETE_EMAIL_ACTION) != null) {
            Tracing.logAudit("User-Deletion: Remove from delete-list identity=" + identity, this.getClass());
            lifeCycleManagerForIdenitiy.deleteTimestampFor(SEND_DELETE_EMAIL_ACTION);
          }
          if (Tracing.isDebugEnabled(this.getClass())) Tracing.logDebug("setIdentityAsActiv updateObject identity=" + identity, this.getClass());
          DBFactory.getInstance().updateObject(identity);
          if (Tracing.isDebugEnabled(this.getClass())) Tracing.logDebug("setIdentityAsActiv committed identity=" + identity, this.getClass());
        }
View Full Code Here

    log.debug("setValue index=" + index + " : " + value);
    customfields.put(CUSTOMFIELD_KEY + index, value);
  }

  public ProjectEvent getProjectEvent(Project.EventType eventType) {
    LifeCycleManager lifeCycleManager = LifeCycleManager.createInstanceFor(this);
    LifeCycleEntry startLifeCycleEntry = lifeCycleManager.lookupLifeCycleEntry(eventType.toString(), EVENT_START);
    LifeCycleEntry endLifeCycleEntry = lifeCycleManager.lookupLifeCycleEntry(eventType.toString(), EVENT_END);
    Date startDate = null;
    if (startLifeCycleEntry != null) {
      startDate = startLifeCycleEntry.getLcTimestamp();
    }
    Date endDate = null;
View Full Code Here

    log.debug("getProjectEvent projectEvent=" + projectEvent);
    return projectEvent;
  }

  public void setProjectEvent(ProjectEvent projectEvent ) {
    LifeCycleManager lifeCycleManager = LifeCycleManager.createInstanceFor(this);
    log.debug("setProjectEvent projectEvent=" + projectEvent);
    if (projectEvent.getStartDate() != null) {
      lifeCycleManager.markTimestampFor(projectEvent.getStartDate(), projectEvent.getEventType().toString(), EVENT_START);
    } else {
      lifeCycleManager.deleteTimestampFor(projectEvent.getEventType().toString(), EVENT_START);
      log.debug("delete timestamp for " + projectEvent.getEventType().toString(), EVENT_START);
    }
    if (projectEvent.getEndDate() != null) {
      lifeCycleManager.markTimestampFor(projectEvent.getEndDate(), projectEvent.getEventType().toString(), EVENT_END);
    } else {
      lifeCycleManager.deleteTimestampFor(projectEvent.getEventType().toString(), EVENT_END);
      log.debug("delete timestamp for " + projectEvent.getEventType().toString(), EVENT_END);
    }

  }
View Full Code Here


  public void setLastUsageNowFor(BusinessGroup group) {
    group = (BusinessGroup) DBFactory.getInstance().loadObject(group, true);
    group.setLastUsage(new Date());
    LifeCycleManager lcManager = LifeCycleManager.createInstanceFor(group);
    if (lcManager.lookupLifeCycleEntry(SEND_DELETE_EMAIL_ACTION) != null) {
      Tracing.logAudit("Group-Deletion: Remove from delete-list group=" + group, GroupDeletionManager.class);
      LifeCycleManager.createInstanceFor(group).deleteTimestampFor(SEND_DELETE_EMAIL_ACTION);
    }
    BusinessGroupManagerImpl.getInstance().updateBusinessGroup(group);   
  }
View Full Code Here

TOP

Related Classes of org.olat.commons.lifecycle.LifeCycleManager

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.