Class PhaseService

java.lang.Object
com.xebialabs.xlrelease.service.PhaseService

@Service public class PhaseService extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PhaseService(com.xebialabs.xlrelease.service.CiIdService ciIdService, com.xebialabs.xlrelease.repository.ReleaseRepository releaseRepository, com.xebialabs.xlrelease.repository.PhaseRepository phaseRepository, XLReleaseEventBus eventBus, com.xebialabs.xlrelease.service.PhaseRestart phaseRestart, com.xebialabs.xlrelease.api.internal.InternalMetadataDecoratorService decoratorService, com.xebialabs.xlrelease.actors.ReleaseActorService releaseActorService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.xebialabs.xlrelease.domain.Phase
    build(com.xebialabs.xlrelease.domain.Release release, com.xebialabs.xlrelease.domain.Phase phaseTemplate, Integer position)
     
    com.xebialabs.xlrelease.domain.Phase
    copyPhase(com.xebialabs.xlrelease.domain.Release release, String originPhaseId, int targetPosition)
     
    com.xebialabs.xlrelease.domain.Phase
    create(String parentId)
     
    com.xebialabs.xlrelease.domain.Phase
    create(String parentId, com.xebialabs.xlrelease.domain.Phase phaseTemplate, Integer position)
     
    void
    delete(String phaseId)
     
    com.xebialabs.xlrelease.domain.Phase
    duplicatePhase(String originPhaseId)
     
    com.xebialabs.xlrelease.domain.Phase
    findById(String phaseId)
     
    com.xebialabs.xlrelease.domain.Phase
     
     
    com.xebialabs.xlrelease.domain.Phase
    movePhase(com.xebialabs.xlrelease.domain.Release release, MovementIndexes movementIndexes)
     
    com.xebialabs.xlrelease.domain.Release
    restartPhase(String releaseId, String phaseId, String taskId, com.xebialabs.xlrelease.repository.PhaseVersion phaseVersion)
     
    com.xebialabs.xlrelease.domain.Release
    restartPhase(String releaseId, String phaseId, String taskId, com.xebialabs.xlrelease.repository.PhaseVersion phaseVersion, boolean resumeRelease)
    Should only be called not from Actor thread This method calls Actor to modify release (add copy of restarted phase), and then searches for dependencies (gate tasks) and updates them.
    com.xebialabs.xlrelease.service.PhaseRestart.RestartPhaseResult
    restartPhases(String releaseId, String phaseId, String taskId, com.xebialabs.xlrelease.repository.PhaseVersion phaseVersion, boolean resumeRelease, com.xebialabs.xlrelease.domain.Release release)
     
    com.xebialabs.xlrelease.domain.Phase
    update(String phaseId, com.xebialabs.xlrelease.domain.Phase toUpdate)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • PhaseService

      @Autowired public PhaseService(com.xebialabs.xlrelease.service.CiIdService ciIdService, com.xebialabs.xlrelease.repository.ReleaseRepository releaseRepository, com.xebialabs.xlrelease.repository.PhaseRepository phaseRepository, XLReleaseEventBus eventBus, com.xebialabs.xlrelease.service.PhaseRestart phaseRestart, com.xebialabs.xlrelease.api.internal.InternalMetadataDecoratorService decoratorService, com.xebialabs.xlrelease.actors.ReleaseActorService releaseActorService)
  • Method Details

    • create

      @Timed public com.xebialabs.xlrelease.domain.Phase create(String parentId)
    • create

      @Timed public com.xebialabs.xlrelease.domain.Phase create(String parentId, com.xebialabs.xlrelease.domain.Phase phaseTemplate, Integer position)
    • build

      public com.xebialabs.xlrelease.domain.Phase build(com.xebialabs.xlrelease.domain.Release release, com.xebialabs.xlrelease.domain.Phase phaseTemplate, Integer position)
    • findById

      @Timed public com.xebialabs.xlrelease.domain.Phase findById(String phaseId)
    • findByIdWithoutDecorators

      public com.xebialabs.xlrelease.domain.Phase findByIdWithoutDecorators(String phaseId)
    • delete

      @Timed public void delete(String phaseId)
    • update

      @Timed public com.xebialabs.xlrelease.domain.Phase update(String phaseId, com.xebialabs.xlrelease.domain.Phase toUpdate)
    • copyPhase

      @Timed public com.xebialabs.xlrelease.domain.Phase copyPhase(com.xebialabs.xlrelease.domain.Release release, String originPhaseId, int targetPosition)
    • duplicatePhase

      @Timed public com.xebialabs.xlrelease.domain.Phase duplicatePhase(String originPhaseId)
    • movePhase

      @Timed public com.xebialabs.xlrelease.domain.Phase movePhase(com.xebialabs.xlrelease.domain.Release release, MovementIndexes movementIndexes)
    • restartPhases

      @Timed public com.xebialabs.xlrelease.service.PhaseRestart.RestartPhaseResult restartPhases(String releaseId, String phaseId, String taskId, com.xebialabs.xlrelease.repository.PhaseVersion phaseVersion, boolean resumeRelease, com.xebialabs.xlrelease.domain.Release release)
    • restartPhase

      @Timed public com.xebialabs.xlrelease.domain.Release restartPhase(String releaseId, String phaseId, String taskId, com.xebialabs.xlrelease.repository.PhaseVersion phaseVersion)
    • restartPhase

      @Timed public com.xebialabs.xlrelease.domain.Release restartPhase(String releaseId, String phaseId, String taskId, com.xebialabs.xlrelease.repository.PhaseVersion phaseVersion, boolean resumeRelease)
      Should only be called not from Actor thread This method calls Actor to modify release (add copy of restarted phase), and then searches for dependencies (gate tasks) and updates them. To me there seem to be a race condition, because when release is started after phase restart, then release execution races against dependency update which may cause release tasks from restarted phase to be completed earlier than dependencies will be discovered and updated One of the solutions would be to not restart release until all dependencies will be discovered and updated. TODO FI-526 check consistency of this approach and fix
    • getTitle

      @Timed public String getTitle(String id)