Class ComponentService
java.lang.Object
fr.paris.lutece.plugins.releaser.service.ComponentService
- All Implemented Interfaces:
IComponentService
ComponentService
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeNextReleaseVersion(Component component) Change the next release versiongetComponentBranchList(Component component, RepositoryType repositoryType, ReleaserUser user) Set list of all component branchesgetComponentTagList(Component component, RepositoryType repositoryType, ReleaserUser user) Clone the component repo (if needed) and populatecomponent.setTags(...)with the pre-release tags (beta and RC) of this artifactId, used by the "release from tag" workflow.getLastBranchVersion(Component component, String branchName, ReleaserUser user) getLastReleaseNextSnapshotVersion(String strArtifactId) Returns the LastAvailableVersiongetLastReleaseVersion(String strArtifactId) Returns the LastAvailableVersionfr.paris.lutece.portal.web.util.LocalizedPaginator<Component>getSearchComponent(String strSearch, javax.servlet.http.HttpServletRequest request, Locale locale, String strPaginateUrl, String strCurrentPageIndex) Gets the search component.static IComponentServicegetVersionDivergenceMessage(Component component) Readable description of the Git/Nexus version divergence, for user-facing messages.voidinit()Inits the.booleanisErrorSnapshotComponentInformations(Component component, String strComponentPomPath) Checks if is error snapshot component informations.booleanisGitComponent(Component component) Checks if is git component.booleanisReleaseBlockedByDivergence(Component component) Divergence on a merge-back branch (seeGitUtils.isMergeBackBranch(String)) : the branch follows a master* counterpart, so the release is blocked outright, without confirmation.booleanDivergence on a branch that has no master* counterpart, on an otherwise releasable component : the release is allowed after an explicit user confirmation.static booleanIsSearchComponentAuthorized(fr.paris.lutece.portal.business.user.AdminUser adminUser) booleanisVersionDivergence(Component component) Whether the branch POM version and the last Nexus snapshot are both valid snapshots but differ.loadComponent(Component component, boolean bUpdateComponent, String strPom, String strUser, String strPassword) Load component.intrelease(Component component, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request) Release.intrelease(Component component, Locale locale, fr.paris.lutece.portal.business.user.AdminUser user, javax.servlet.http.HttpServletRequest request, boolean forceRelease) Release.voidsetLastReleaseNextSnapshotVersion(String strArtifactId, String strVersion) set the LastAvailableVersion set The LastAvailableVersionvoidsetLastReleaseVersion(String strArtifactId, String strVersion) set the LastAvailableVersion set The LastAvailableVersionvoidsetRemoteInformations(Component component, boolean bCache) Sets the remote informations.updateComponentForReleaseBranchFrom(Component component, String strPom) Update the remote informations when changing branch to release from.voidupdateRemoteInformations(Component component) Update remote informations.
-
Constructor Details
-
ComponentService
public ComponentService()
-
-
Method Details
-
getService
- Returns:
- get service
-
setRemoteInformations
public void setRemoteInformations(Component component, boolean bCache) throws fr.paris.lutece.util.httpaccess.HttpAccessException, IOException Description copied from interface:IComponentServiceSets the remote informations.- Specified by:
setRemoteInformationsin interfaceIComponentService- Parameters:
component- the componentbCache- the b cache- Throws:
fr.paris.lutece.util.httpaccess.HttpAccessException- the http access exceptionIOException- Signals that an I/O exception has occurred.
-
getLastReleaseVersion
Returns the LastAvailableVersion- Specified by:
getLastReleaseVersionin interfaceIComponentService- Parameters:
strArtifactId- the str artifact id- Returns:
- The LastAvailableVersion
-
setLastReleaseVersion
set the LastAvailableVersion set The LastAvailableVersion- Specified by:
setLastReleaseVersionin interfaceIComponentService- Parameters:
strArtifactId- the str artifact idstrVersion- the str version
-
getLastReleaseNextSnapshotVersion
Returns the LastAvailableVersion- Specified by:
getLastReleaseNextSnapshotVersionin interfaceIComponentService- Parameters:
strArtifactId- the str artifact id- Returns:
- The LastAvailableVersion
-
setLastReleaseNextSnapshotVersion
set the LastAvailableVersion set The LastAvailableVersion- Specified by:
setLastReleaseNextSnapshotVersionin interfaceIComponentService- Parameters:
strArtifactId- the str artifact idstrVersion- 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:IComponentServiceRelease.- Specified by:
releasein interfaceIComponentService- Parameters:
component- the componentlocale- the localeuser- the userrequest- the requestforceRelease- 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:IComponentServiceRelease.- Specified by:
releasein interfaceIComponentService- Parameters:
component- the componentlocale- the localeuser- the userrequest- the request- Returns:
- context id
-
isGitComponent
Description copied from interface:IComponentServiceChecks if is git component.- Specified by:
isGitComponentin interfaceIComponentService- Parameters:
component- the component- Returns:
- boolean
-
init
public void init()Description copied from interface:IComponentServiceInits the.- Specified by:
initin interfaceIComponentService
-
updateRemoteInformations
Description copied from interface:IComponentServiceUpdate remote informations.- Specified by:
updateRemoteInformationsin interfaceIComponentService- Parameters:
component- the component
-
updateComponentForReleaseBranchFrom
Description copied from interface:IComponentServiceUpdate the remote informations when changing branch to release from.- Specified by:
updateComponentForReleaseBranchFromin interfaceIComponentService- Parameters:
component- the componentstrPom- 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:IComponentServiceGets the search component.- Specified by:
getSearchComponentin interfaceIComponentService- Parameters:
strSearch- the str searchrequest- the requestlocale- the localestrPaginateUrl- the str paginate urlstrCurrentPageIndex- 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:IComponentServiceLoad component.- Specified by:
loadComponentin interfaceIComponentService- Parameters:
component- the componentbUpdateComponent- Update component when change branch to release fromstrPom- the pomstrPassword- the password- Returns:
- component
-
isVersionDivergence
Whether the branch POM version and the last Nexus snapshot are both valid snapshots but differ.- Specified by:
isVersionDivergencein interfaceIComponentService- Parameters:
component- the component- Returns:
- true if a real Git/Nexus snapshot version divergence is detected
-
isReleaseBlockedByDivergence
Divergence on a merge-back branch (seeGitUtils.isMergeBackBranch(String)) : the branch follows a master* counterpart, so the release is blocked outright, without confirmation.- Specified by:
isReleaseBlockedByDivergencein interfaceIComponentService- Parameters:
component- the component- Returns:
- true if the divergence must block the release systematically
-
isReleaseConfirmationRequiredByDivergence
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:
isReleaseConfirmationRequiredByDivergencein interfaceIComponentService- Parameters:
component- the component- Returns:
- true if the divergence requires a confirmation before releasing
-
getVersionDivergenceMessage
Readable description of the Git/Nexus version divergence, for user-facing messages.- Specified by:
getVersionDivergenceMessagein interfaceIComponentService- Parameters:
component- the component- Returns:
- the divergence description
-
isErrorSnapshotComponentInformations
public boolean isErrorSnapshotComponentInformations(Component component, String strComponentPomPath) Description copied from interface:IComponentServiceChecks if is error snapshot component informations.- Specified by:
isErrorSnapshotComponentInformationsin interfaceIComponentService- Parameters:
component- the componentstrComponentPomPath- the str component pom path- Returns:
- boolean
-
changeNextReleaseVersion
Change the next release version- Specified by:
changeNextReleaseVersionin interfaceIComponentService- 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:IComponentServiceSet list of all component branches- Specified by:
getComponentBranchListin interfaceIComponentServiceuser- The user- Returns:
-
getComponentTagList
public Component getComponentTagList(Component component, RepositoryType repositoryType, ReleaserUser user) Clone the component repo (if needed) and populatecomponent.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:
getComponentTagListin interfaceIComponentService- Parameters:
component- the componentrepositoryType- the repository typeuser- the releaser user- Returns:
- the component (mutated)
-
getLastBranchVersion
- Specified by:
getLastBranchVersionin interfaceIComponentService
-