Class ComponentService

java.lang.Object
fr.paris.lutece.plugins.releaser.service.ComponentService
All Implemented Interfaces:
IComponentService

public class ComponentService extends Object implements IComponentService
ComponentService
  • Constructor Details

    • ComponentService

      public ComponentService()
  • Method Details

    • getService

      public static IComponentService getService()
      Returns:
      get service
    • setRemoteInformations

      public void setRemoteInformations(Component component, boolean bCache) throws fr.paris.lutece.util.httpaccess.HttpAccessException, IOException
      Description copied from interface: IComponentService
      Sets the remote informations.
      Specified by:
      setRemoteInformations in interface IComponentService
      Parameters:
      component - the component
      bCache - the b cache
      Throws:
      fr.paris.lutece.util.httpaccess.HttpAccessException - the http access exception
      IOException - Signals that an I/O exception has occurred.
    • getLastReleaseVersion

      public String getLastReleaseVersion(String strArtifactId)
      Returns the LastAvailableVersion
      Specified by:
      getLastReleaseVersion in interface IComponentService
      Parameters:
      strArtifactId - the str artifact id
      Returns:
      The LastAvailableVersion
    • setLastReleaseVersion

      public void setLastReleaseVersion(String strArtifactId, String strVersion)
      set the LastAvailableVersion set The LastAvailableVersion
      Specified by:
      setLastReleaseVersion in interface IComponentService
      Parameters:
      strArtifactId - the str artifact id
      strVersion - the str version
    • getLastReleaseNextSnapshotVersion

      public String getLastReleaseNextSnapshotVersion(String strArtifactId)
      Returns the LastAvailableVersion
      Specified by:
      getLastReleaseNextSnapshotVersion in interface IComponentService
      Parameters:
      strArtifactId - the str artifact id
      Returns:
      The LastAvailableVersion
    • setLastReleaseNextSnapshotVersion

      public void setLastReleaseNextSnapshotVersion(String strArtifactId, String strVersion)
      set the LastAvailableVersion set The LastAvailableVersion
      Specified by:
      setLastReleaseNextSnapshotVersion in interface IComponentService
      Parameters:
      strArtifactId - the str artifact id
      strVersion - the str version
    • release

      public int release(Component component, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request, boolean forceRelease)
      Description copied from interface: IComponentService
      Release.
      Specified by:
      release in interface IComponentService
      Parameters:
      component - the component
      locale - the locale
      user - the user
      request - the request
      forceRelease - the force release
      Returns:
      context id
    • release

      public int release(Component component, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request)
      Description copied from interface: IComponentService
      Release.
      Specified by:
      release in interface IComponentService
      Parameters:
      component - the component
      locale - the locale
      user - the user
      request - the request
      Returns:
      context id
    • isGitComponent

      public boolean isGitComponent(Component component)
      Description copied from interface: IComponentService
      Checks if is git component.
      Specified by:
      isGitComponent in interface IComponentService
      Parameters:
      component - the component
      Returns:
      boolean
    • init

      public void init()
      Description copied from interface: IComponentService
      Inits the.
      Specified by:
      init in interface IComponentService
    • updateRemoteInformations

      public void updateRemoteInformations(Component component)
      Description copied from interface: IComponentService
      Update remote informations.
      Specified by:
      updateRemoteInformations in interface IComponentService
      Parameters:
      component - the component
    • updateComponentForReleaseBranchFrom

      public Component updateComponentForReleaseBranchFrom(Component component, String strPom)
      Description copied from interface: IComponentService
      Update the remote informations when changing branch to release from.
      Specified by:
      updateComponentForReleaseBranchFrom in interface IComponentService
      Parameters:
      component - the component
      strPom - the component Pom
    • getSearchComponent

      public fr.paris.lutece.portal.web.util.LocalizedPaginator<Component> getSearchComponent(String strSearch, javax.servlet.http.HttpServletRequest request, Locale locale, String strPaginateUrl, String strCurrentPageIndex)
      Description copied from interface: IComponentService
      Gets the search component.
      Specified by:
      getSearchComponent in interface IComponentService
      Parameters:
      strSearch - the str search
      request - the request
      locale - the locale
      strPaginateUrl - the str paginate url
      strCurrentPageIndex - the str current page index
      Returns:
      local paginator
    • loadComponent

      public Component loadComponent(Component component, boolean bUpdateComponent, String strPom, String strUser, String strPassword)
      Description copied from interface: IComponentService
      Load component.
      Specified by:
      loadComponent in interface IComponentService
      Parameters:
      component - the component
      bUpdateComponent - Update component when change branch to release from
      strPom - the pom
      strPassword - the password
      Returns:
      component
    • isVersionDivergence

      public boolean isVersionDivergence(Component component)
      Whether the branch POM version and the last Nexus snapshot are both valid snapshots but differ.
      Specified by:
      isVersionDivergence in interface IComponentService
      Parameters:
      component - the component
      Returns:
      true if a real Git/Nexus snapshot version divergence is detected
    • isReleaseBlockedByDivergence

      public boolean isReleaseBlockedByDivergence(Component component)
      Divergence on a merge-back branch (see GitUtils.isMergeBackBranch(String)) : the branch follows a master* counterpart, so the release is blocked outright, without confirmation.
      Specified by:
      isReleaseBlockedByDivergence in interface IComponentService
      Parameters:
      component - the component
      Returns:
      true if the divergence must block the release systematically
    • isReleaseConfirmationRequiredByDivergence

      public boolean isReleaseConfirmationRequiredByDivergence(Component component)
      Divergence on a branch that has no master* counterpart, on an otherwise releasable component : the release is allowed after an explicit user confirmation.
      Specified by:
      isReleaseConfirmationRequiredByDivergence in interface IComponentService
      Parameters:
      component - the component
      Returns:
      true if the divergence requires a confirmation before releasing
    • getVersionDivergenceMessage

      public String getVersionDivergenceMessage(Component component)
      Readable description of the Git/Nexus version divergence, for user-facing messages.
      Specified by:
      getVersionDivergenceMessage in interface IComponentService
      Parameters:
      component - the component
      Returns:
      the divergence description
    • isErrorSnapshotComponentInformations

      public boolean isErrorSnapshotComponentInformations(Component component, String strComponentPomPath)
      Description copied from interface: IComponentService
      Checks if is error snapshot component informations.
      Specified by:
      isErrorSnapshotComponentInformations in interface IComponentService
      Parameters:
      component - the component
      strComponentPomPath - the str component pom path
      Returns:
      boolean
    • changeNextReleaseVersion

      public void changeNextReleaseVersion(Component component)
      Change the next release version
      Specified by:
      changeNextReleaseVersion in interface IComponentService
      Parameters:
      component - The component
    • IsSearchComponentAuthorized

      public static boolean IsSearchComponentAuthorized(fr.paris.lutece.portal.business.user.AdminUser adminUser)
    • getComponentBranchList

      public Component getComponentBranchList(Component component, RepositoryType repositoryType, ReleaserUser user)
      Description copied from interface: IComponentService
      Set list of all component branches
      Specified by:
      getComponentBranchList in interface IComponentService
      user - The user
      Returns:
    • getComponentTagList

      public Component getComponentTagList(Component component, RepositoryType repositoryType, ReleaserUser user)
      Clone the component repo (if needed) and populate component.setTags(...) with the pre-release tags (beta and RC) of this artifactId, used by the "release from tag" workflow. Lists tags whose name matches "<artifactId>-X.Y.Z-(beta|RC)-NN" so the "release from tag" dropdown only proposes pre-release tags eligible for stabilization.
      Specified by:
      getComponentTagList in interface IComponentService
      Parameters:
      component - the component
      repositoryType - the repository type
      user - the releaser user
      Returns:
      the component (mutated)
    • getLastBranchVersion

      public Component getLastBranchVersion(Component component, String branchName, ReleaserUser user)
      Specified by:
      getLastBranchVersion in interface IComponentService