1 /* 2 * Copyright (c) 2002-2021, City of Paris 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice 10 * and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice 13 * and the following disclaimer in the documentation and/or other materials 14 * provided with the distribution. 15 * 16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its 17 * contributors may be used to endorse or promote products derived from 18 * this software without specific prior written permission. 19 * 20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE 24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30 * POSSIBILITY OF SUCH DAMAGE. 31 * 32 * License 1.0 33 */ 34 package fr.paris.lutece.plugins.releaser.service; 35 36 import java.io.IOException; 37 import java.util.Locale; 38 39 import javax.servlet.http.HttpServletRequest; 40 41 import fr.paris.lutece.plugins.releaser.business.Component; 42 import fr.paris.lutece.plugins.releaser.business.ReleaserUser; 43 import fr.paris.lutece.plugins.releaser.business.RepositoryType; 44 import fr.paris.lutece.plugins.releaser.business.Site; 45 import fr.paris.lutece.portal.business.user.AdminUser; 46 import fr.paris.lutece.portal.web.util.LocalizedPaginator; 47 import fr.paris.lutece.util.httpaccess.HttpAccessException; 48 // TODO: Auto-generated Javadoc 49 50 /** 51 * IComponentService . 52 */ 53 public interface IComponentService 54 { 55 56 /** 57 * Sets the remote informations. 58 * 59 * @param component 60 * the component 61 * @param bCache 62 * the b cache 63 * @throws HttpAccessException 64 * the http access exception 65 * @throws IOException 66 * Signals that an I/O exception has occurred. 67 */ 68 void setRemoteInformations( Component component, boolean bCache ) throws HttpAccessException, IOException; 69 70 /** 71 * Update remote informations. 72 * 73 * @param component 74 * the component 75 */ 76 void updateRemoteInformations( Component component ); 77 78 /** 79 * Release. 80 * 81 * @param component 82 * the component 83 * @param locale 84 * the locale 85 * @param user 86 * the user 87 * @param request 88 * the request 89 * @param forceRelease 90 * the force release 91 * @return context id 92 */ 93 int release( Component component, Locale locale, AdminUser user, HttpServletRequest request, boolean forceRelease ); 94 95 /** 96 * Release. 97 * 98 * @param component 99 * the component 100 * @param locale 101 * the locale 102 * @param user 103 * the user 104 * @param request 105 * the request 106 * @return context id 107 */ 108 int release( Component component, Locale locale, AdminUser user, HttpServletRequest request ); 109 110 /** 111 * Checks if is git component. 112 * 113 * @param component 114 * the component 115 * @return boolean 116 */ 117 boolean isGitComponent( Component component ); 118 119 /** 120 * Returns the LastAvailableVersion. 121 * 122 * @param strArtifactId 123 * the str artifact id 124 * @return The LastAvailableVersion 125 */ 126 127 String getLastReleaseVersion( String strArtifactId ); 128 129 /** 130 * set the LastAvailableVersion 131 * 132 * set The LastAvailableVersion. 133 * 134 * @param strArtifactId 135 * the str artifact id 136 * @param strVersion 137 * the str version 138 */ 139 140 void setLastReleaseVersion( String strArtifactId, String strVersion ); 141 142 /** 143 * Returns the LastAvailableVersion. 144 * 145 * @param strArtifactId 146 * the str artifact id 147 * @return The LastAvailableVersion 148 */ 149 String getLastReleaseNextSnapshotVersion( String strArtifactId ); 150 151 /** 152 * setLastReleaseNextSnapshotVersion. 153 * 154 * @param strArtifactId 155 * the str artifact id 156 * @param strVersion 157 * the str version 158 */ 159 void setLastReleaseNextSnapshotVersion( String strArtifactId, String strVersion ); 160 161 /** 162 * Gets the search component. 163 * 164 * @param strSearch 165 * the str search 166 * @param request 167 * the request 168 * @param locale 169 * the locale 170 * @param strPaginateUrl 171 * the str paginate url 172 * @param strCurrentPageIndex 173 * the str current page index 174 * @return local paginator 175 */ 176 LocalizedPaginator<Component> getSearchComponent( String strSearch, HttpServletRequest request, Locale locale, String strPaginateUrl, 177 String strCurrentPageIndex ); 178 179 /** 180 * Load component. 181 * 182 * @param component 183 * the component 184 * @param strPom 185 * the str pom 186 * @param stUser 187 * the st user 188 * @param strPassword 189 * the str password 190 * @return component 191 */ 192 Component/../../../fr/paris/lutece/plugins/releaser/business/Component.html#Component">Component loadComponent( Component component, String strPom, String stUser, String strPassword ); 193 194 /** 195 * Change next release version. 196 * 197 * @param component 198 * component 199 */ 200 void changeNextReleaseVersion( Component component ); 201 202 /** 203 * Checks if is error snapshot component informations. 204 * 205 * @param component 206 * the component 207 * @param strComponentPomPath 208 * the str component pom path 209 * @return boolean 210 */ 211 boolean isErrorSnapshotComponentInformations( Component component, String strComponentPomPath ); 212 213 /** 214 * Inits the. 215 */ 216 void init( ); 217 218 /** 219 * Set list of all component branches 220 * 221 * @param site 222 * The site 223 * @param artifactId 224 * The component artifactId 225 * @param user 226 * The user 227 * @return 228 */ 229 Component/fr/paris/lutece/plugins/releaser/business/Component.html#Component">Component getComponentBranchList( Component component, RepositoryType repositoryType, ReleaserUser user ); 230 231 Component../fr/paris/lutece/plugins/releaser/business/Component.html#Component">Component getLastBranchVersion( Component component, String branchName, ReleaserUser user ); 232 }